542348cd1d19604bbce5e4035adca9dce5a0f952
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-01-28  Devin Rousso  <drousso@apple.com>
2
3         Web Inspector: provide a way to edit page WebRTC settings on a remote target
4         https://bugs.webkit.org/show_bug.cgi?id=193863
5         <rdar://problem/47572764>
6
7         Reviewed by Joseph Pecoraro.
8
9         Test: inspector/page/overrideSetting-ICECandidateFilteringEnabled.html
10               inspector/page/overrideSetting-MockCaptureDevicesEnabled.html
11
12         * inspector/agents/InspectorPageAgent.cpp:
13
14         * page/Settings.yaml:
15         * page/SettingsBase.h:
16         * page/SettingsBase.cpp:
17         (SettingsBase::iceCandidateFilteringEnabledChanged): Added.
18         (SettingsBase::mockCaptureDevicesEnabledChanged): Added.
19         * Scripts/GenerateSettings.rb:
20         * Scripts/SettingsTemplates/Settings.cpp.erb:
21         Add page-level settings for WebRTC preferences.
22
23         * Modules/mediastream/UserMediaController.cpp:
24         (WebCore::UserMediaController::canCallGetUserMedia):
25
26         * testing/InternalSettings.cpp:
27         (WebCore::InternalSettings::setMediaCaptureRequiresSecureConnection):
28
29         * testing/Internals.h:
30         * testing/Internals.cpp:
31         (WebCore::Internals::Internals):
32         (WebCore::Internals::setMockMediaCaptureDevicesEnabled):
33         (WebCore::Internals::setMediaCaptureRequiresSecureConnection): Added.
34
35         * page/DeprecatedGlobalSettings.h:
36         * page/DeprecatedGlobalSettings.cpp:
37         (WebCore::DeprecatedGlobalSettings::mockCaptureDevicesEnabled): Deleted.
38         (WebCore::DeprecatedGlobalSettings::setMockCaptureDevicesEnabled): Deleted.
39         (WebCore::DeprecatedGlobalSettings::mediaCaptureRequiresSecureConnection): Deleted.
40         (WebCore::DeprecatedGlobalSettings::setMediaCaptureRequiresSecureConnection): Deleted.
41
42 2019-01-28  Jer Noble  <jer.noble@apple.com>
43
44         webkitcurrentplaybacktargetiswirelesschanged and webkitCurrentPlaybackIsWireless are non-deterministic.
45         https://bugs.webkit.org/show_bug.cgi?id=193923
46         <rdar://problem/45956595>
47
48         Reviewed by Eric Carlson.
49
50         The value of webkitCurrentPlaybackTargetIsWireless can change in between when the event is scheduled
51         and when it's actually dispatched. To make this more deterministic, use a GenericTaskQueue to enqueue
52         setting m_isPlayingToWirelessTarget and dispatch the changed event in the same run-loop.
53
54         * html/HTMLMediaElement.cpp:
55         (WebCore::HTMLMediaElement::clearMediaPlayer):
56         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
57         (WebCore::HTMLMediaElement::setIsPlayingToWirelessTarget):
58         (WebCore::HTMLMediaElement::dispatchEvent):
59         * html/HTMLMediaElement.h:
60
61 2019-01-28  Ross Kirsling  <ross.kirsling@sony.com>
62
63         Remove unnecessary `using namespace WTF`s (or at least restrict their scope).
64         https://bugs.webkit.org/show_bug.cgi?id=193941
65
66         Reviewed by Alex Christensen.
67
68         * css/CSSBasicShapes.cpp:
69         * css/CSSPrimitiveValue.cpp:
70         * css/parser/CSSParser.cpp:
71         * css/parser/CSSParserSelector.cpp:
72         * css/parser/CSSPropertyParser.cpp:
73         * dom/Document.cpp:
74         * dom/EventListenerMap.cpp:
75         * dom/EventTarget.cpp:
76         * editing/Editor.cpp:
77         * html/HTMLElement.cpp:
78         * html/HTMLFontElement.cpp:
79         * html/parser/HTMLTokenizer.cpp:
80         * html/track/TrackBase.cpp:
81         * loader/FTPDirectoryParser.cpp:
82         * loader/TextResourceDecoder.cpp:
83         * loader/cache/CachedResource.cpp:
84         * page/ContextMenuController.cpp:
85         * page/Navigator.cpp:
86         * platform/Length.cpp:
87         * platform/cocoa/KeyEventCocoa.mm:
88         * platform/graphics/FontCascade.cpp:
89         * platform/graphics/WidthIterator.cpp:
90         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
91         * platform/ios/KeyEventIOS.mm:
92         * platform/mac/KeyEventMac.mm:
93         * platform/network/HTTPParsers.cpp:
94         * platform/text/TextCodecUTF8.cpp:
95         * platform/text/TextEncodingRegistry.cpp:
96         * platform/win/KeyEventWin.cpp:
97         * rendering/BidiRun.cpp:
98         * rendering/FloatingObjects.cpp:
99         * rendering/RenderBlock.cpp:
100         * rendering/RenderListMarker.cpp:
101         * rendering/RenderText.cpp:
102
103 2019-01-28  Fujii Hironori  <Hironori.Fujii@sony.com>
104
105         [Win] WebCore/platform/Process.h is conflicting with process.h
106         https://bugs.webkit.org/show_bug.cgi?id=193944
107
108         Reviewed by Ross Kirsling.
109
110         Windows has process.h. Rename Process.h to ProcessIdentifier.h.
111
112         No new tests because there is no behavior change.
113
114         * Sources.txt:
115         * UnifiedSources-input.xcfilelist:
116         * WebCore.xcodeproj/project.pbxproj:
117         * dom/MessagePortIdentifier.h:
118         * dom/messageports/MessagePortChannel.h:
119         * dom/messageports/MessagePortChannelProvider.h:
120         * dom/messageports/MessagePortChannelRegistry.h:
121         * history/BackForwardItemIdentifier.h:
122         * page/GlobalWindowIdentifier.h:
123         * platform/ProcessIdentifier.cpp: Renamed from Source/WebCore/platform/Process.cpp.
124         (WebCore::Process::setIdentifier):
125         (WebCore::Process::identifier):
126         * platform/ProcessIdentifier.h: Renamed from Source/WebCore/platform/Process.h.
127
128 2019-01-28  Antoine Quint  <graouts@apple.com>
129
130         Implement capture for Pointer Events on iOS
131         https://bugs.webkit.org/show_bug.cgi?id=193917
132         <rdar://problem/47605689>
133
134         Reviewed by Dean Jackson.
135
136         We add a new PointerCaptureController object which gets notified upon dispatch of pointer events
137         to implement implicit pointer capture, dispatch the gotpointercapture and lostpointercaptiure events,
138         and implement the Element APIs for pointer capture: hasPointerCapture(), setPointerCapture() and
139         releasePointerCapture().
140
141         Tests: pointerevents/ios/pointer-events-implicit-capture-has-pointer-capture-in-pointer-down.html
142                pointerevents/ios/pointer-events-implicit-capture-release-exception.html
143                pointerevents/ios/pointer-events-implicit-capture-release.html
144                pointerevents/ios/pointer-events-implicit-capture.html
145                pointerevents/ios/pointer-events-set-pointer-capture-exceptions.html
146
147         * Sources.txt:
148         * WebCore.xcodeproj/project.pbxproj:
149         * dom/Element.cpp:
150         (WebCore::Element::setPointerCapture):
151         (WebCore::Element::releasePointerCapture):
152         (WebCore::Element::hasPointerCapture):
153         * dom/Element.h:
154         * dom/Element.idl:
155         * dom/EventNames.h:
156         * dom/PointerEvent.h:
157         * page/Page.cpp:
158         (WebCore::Page::Page):
159         * page/Page.h:
160         (WebCore::Page::pointerCaptureController const):
161         * page/PointerCaptureController.cpp: Added.
162         (WebCore::PointerCaptureController::PointerCaptureController):
163         (WebCore::PointerCaptureController::setPointerCapture):
164         (WebCore::PointerCaptureController::releasePointerCapture):
165         (WebCore::PointerCaptureController::hasPointerCapture):
166         (WebCore::PointerCaptureController::pointerLockWasApplied):
167         (WebCore::PointerCaptureController::touchEndedOrWasCancelledForIdentifier):
168         (WebCore::PointerCaptureController::pointerEventWillBeDispatched):
169         (WebCore::PointerCaptureController::pointerEventWasDispatched):
170         (WebCore::PointerCaptureController::processPendingPointerCapture):
171         * page/PointerCaptureController.h: Added.
172         * page/PointerLockController.cpp:
173         (WebCore::PointerLockController::requestPointerLock):
174         * page/PointerLockController.h:
175
176 2019-01-28  Andy Estes  <aestes@apple.com>
177
178         [watchOS] Enable Parental Controls content filtering
179         https://bugs.webkit.org/show_bug.cgi?id=193939
180         <rdar://problem/46641912>
181
182         Reviewed by Ryosuke Niwa.
183
184         * Configurations/FeatureDefines.xcconfig:
185
186 2019-01-28  Dean Jackson  <dino@apple.com>
187
188         Produce "pen" Pointer Events if using a stylus (e.g. Apple Pencil)
189         https://bugs.webkit.org/show_bug.cgi?id=193945
190         <rdar://problem/47618922>
191
192         Reviewed by Antoine Quint.
193
194         Calculate the pressure, tiltX and tiltY values for incoming
195         Pointer Events, which have values when the PlatformTouchEvent
196         originated from a stylus.
197
198         Test: pointerevents/ios/pointer-events-dispatch-on-stylus.html
199
200         * dom/PointerEvent.h: Default to "mouse".
201         * dom/ios/PointerEventIOS.cpp: Calculate the values.
202
203 2019-01-28  Timothy Hatcher  <timothy@apple.com>
204
205         Make it easier for non-Apple ports to enable dark mode CSS support.
206         https://bugs.webkit.org/show_bug.cgi?id=193882
207
208         Reviewed by Megan Gardner.
209
210         * page/FrameView.cpp:
211         (WebCore::FrameView::updateBackgroundRecursively): Limit use of system
212         background color to the Mac platform.
213         * rendering/RenderTheme.cpp:
214         (WebCore::RenderTheme::purgeCaches): Purge m_darkColorCache.
215         (WebCore::RenderTheme::platformColorsDidChange): Reset m_darkColorCache.
216         (WebCore::RenderTheme::colorCache const): Added m_darkColorCache.
217         * rendering/RenderTheme.h:
218         (WebCore::RenderTheme::colorCache const): Deleted.
219         * rendering/RenderThemeMac.h:
220         * rendering/RenderThemeMac.mm:
221         (WebCore::RenderThemeMac::purgeCaches): Removed m_darkColorCache.
222         (WebCore::RenderThemeMac::platformColorsDidChange): Deleted.
223         (WebCore::RenderThemeMac::colorCache const): Deleted.
224
225 2019-01-28  Simon Fraser  <simon.fraser@apple.com>
226
227         svg/text/select-text-inside-non-static-position.html crashes under ScrollingStateTree::unparentChildrenAndDestroyNode()
228         https://bugs.webkit.org/show_bug.cgi?id=193930
229
230         Reviewed by Tim Horton.
231
232         ScrollingStateTree::unparentChildrenAndDestroyNode() should make a copy of the 'children' vector
233         before iterating, since iteration mutates the array.
234
235         Tested by ASan tests.
236
237         * page/scrolling/ScrollingStateNode.h:
238         (WebCore::ScrollingStateNode::takeChildren):
239         * page/scrolling/ScrollingStateTree.cpp:
240         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
241
242 2019-01-28  Simon Fraser  <simon.fraser@apple.com>
243
244         css3/filters/blur-filter-page-scroll-self.html crashes under WebCore::ScrollingStateNode::ScrollingStateNode
245         https://bugs.webkit.org/show_bug.cgi?id=193925
246
247         Reviewed by Tim Horton.
248
249         Some css3/filters/ tests disable accelerated compositing (which is crazy). Make these
250         tests not crash by ensuring that unparentNode() and unparentChildrenAndDestroyNode() clears the root
251         node if it's the node being unparented or destroyed.
252
253         Tested by existing tests.
254
255         * page/scrolling/ScrollingStateTree.cpp:
256         (WebCore::ScrollingStateTree::unparentNode):
257         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
258
259 2019-01-28  Daniel Bates  <dabates@apple.com>
260
261         [iOS] Make Window virtual key code computation match Mac
262         https://bugs.webkit.org/show_bug.cgi?id=193452
263
264         Reviewed by Ryosuke Niwa.
265
266         Use the same approach for computing the Windows virtual key code on iOS as we do on Mac for
267         web compatibility. On Mac, we prefer to compute the  Windows virtual key code from the input
268         strings of the key event and use the key event's keycode as a last resort.
269
270         Test: fast/events/ios/key-events-meta-alt-combinations.html
271
272         * platform/ios/PlatformEventFactoryIOS.h:
273         * platform/ios/PlatformEventFactoryIOS.mm:
274         (WebCore::isKeypadEvent): Added.
275         (WebCore::windowsKeyCodeForKeyEvent): Added.
276         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): Modified to call
277         WebCore::windowsKeyCodeForKeyEvent() to compute the Windows virtual key code.
278
279 2019-01-28  Antoine Quint  <graouts@apple.com>
280
281         Limit user-agent interactions based on the touch-action property on iOS
282         https://bugs.webkit.org/show_bug.cgi?id=193447
283
284         Unreviewed build fix.
285
286         * dom/Element.cpp:
287         (WebCore::parentCrossingFrameBoundaries):
288
289 2019-01-28  Eric Carlson  <eric.carlson@apple.com>
290
291         AVStreamSession isn't always available, make a HAVE compile flag for it
292         https://bugs.webkit.org/show_bug.cgi?id=193889
293         <rdar://problem/47452863>
294
295         Reviewed by Jer Noble.
296
297         No new tests, no functional change.
298
299         * page/Settings.yaml:
300         * page/SettingsBase.cpp:
301         (WebCore::SettingsBase::platformDefaultMediaSourceEnabled):
302         * page/SettingsBase.h:
303         * page/cocoa/SettingsBaseCocoa.mm:
304         (WebCore::SettingsBase::platformDefaultMediaSourceEnabled):
305         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
306         (WebCore::CDMPrivateMediaSourceAVFObjC::createSession):
307         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
308         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
309
310         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
311         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
312         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::durationChanged): Fix logging.
313         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
314
315         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
316         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
317         
318         Use a HashMap to associate CMSampleBuffer with SourceBufferPrivateAVFObjC.
319
320         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): isEqualTo
321         -> isEqualToString.
322         (WebCore::sourceBufferMap):
323         (WebCore::nextMapID):
324         (WebCore::bufferWasConsumedCallback):
325         (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
326         (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
327         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
328         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
329         (WebCore::SourceBufferPrivateAVFObjC::append):
330         (WebCore::SourceBufferPrivateAVFObjC::destroyParser):
331         (WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
332         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
333         (WebCore::SourceBufferPrivateAVFObjC::bufferWasConsumed):
334         (-[WebBufferConsumedContext initWithParent:]): Deleted.
335         (-[WebBufferConsumedContext parent]): Deleted.
336
337 2019-01-28  Rob Buis  <rbuis@igalia.com>
338
339         Update MIME type parser
340         https://bugs.webkit.org/show_bug.cgi?id=180526
341
342         Reviewed by Frédéric Wang.
343
344         I overlooked step 11.9.3 [1], for Mimesniff we should not
345         bail out on missing subtype, but keep trying. Note
346         that Rfc2045 does require bailing out, as before.
347
348         Test: ParsedContentType unittest
349
350         [1] https://mimesniff.spec.whatwg.org/#parse-a-mime-type
351
352         * platform/network/ParsedContentType.cpp:
353         (WebCore::parseToken):
354         (WebCore::parseContentType):
355
356 2019-01-28  Michael Catanzaro  <mcatanzaro@igalia.com>
357
358         Unreviewed follow-up to r240557, restore a call to makeString
359         https://bugs.webkit.org/show_bug.cgi?id=192742
360         <rdar://problem/46757369>
361
362         It works if we add this #include that was missing. I got confused by the error messages and
363         missed that there were two similarly-named headers.
364
365         * rendering/RenderLayerCompositor.cpp:
366         (WebCore::RenderLayerCompositor::logLayerInfo):
367
368 2019-01-28  Oriol Brufau  <obrufau@igalia.com>
369
370         [css-logical] Reject unitless length quirk in 'inset' shorthand
371         https://bugs.webkit.org/show_bug.cgi?id=193773
372
373         Reviewed by Manuel Rego Casasnovas.
374
375         Even though its longhands ('top', 'right', 'bottom', 'left') accept the
376         unitless length quirk, the 'inset' shorthand is a new CSS property and
377         should reject it. This was resolved by the CSS WG in
378         https://github.com/w3c/csswg-drafts/issues/3525#issuecomment-456902648
379
380         Tests: imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-001.html
381                imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-002.html
382                imported/w3c/web-platform-tests/quirks/unitless-length/excluded-properties-003.html
383                imported/w3c/web-platform-tests/quirks/unitless-length/limited-quirks.html
384                imported/w3c/web-platform-tests/quirks/unitless-length/no-quirks.html
385                imported/w3c/web-platform-tests/quirks/unitless-length/quirks.html
386
387         * css/parser/CSSPropertyParser.cpp:
388         (WebCore::CSSPropertyParser::parseSingleValue):
389
390 2019-01-28  Zalan Bujtas  <zalan@apple.com>
391
392         [LFC][MarginCollapsing][Quirks] Quirk margin values get propagated through margin collapsing
393         https://bugs.webkit.org/show_bug.cgi?id=193896
394
395         Reviewed by Antti Koivisto.
396
397         This patch implements quirk margin value collapsing. There are a few "quirk" rules when it comes to margin collapsing.
398
399         1. Collapsed quirk margin values are ignored on quirk containers
400
401             <body>
402               <p> p elements have 1em vertical (top/bottom) quirk margin
403             </body>
404
405             In quirk mode, <p> and <body> (quirk container) collapses their vertical margins but <p>'s quirk values(1qem -> 16px) are ignored.
406             Used vertical margin values on the <body> are top: 8px bottom: 8px.
407
408         2. Quirk margin values are turned into non-quirk values when collapsed with non-zero, non-quirk margins.
409
410             <body>
411               <div style="margin-top: 1px">
412                 <p> p elements have 1em vertical (top/bottom) quirk margin
413               </div>
414             </body>
415
416             When <p>'s vertical margin collapses with the parent <div>,
417             - the collapsed before value becomes 16px (max(1qem, 1px)) and this collapsed value is now considered as a non-quirk value
418             - the collapsed after value stays 1qem quirk value.
419
420             When <div> collapses with <body>
421             - the collapsed before value becomes 16px (max(16px, 8px))
422             - the <div>'s quirk after value gets ignored and the collapsed after value stays 8px.
423             Used vertical margin values on the <body> are top: 16px (1em) bottom: 8px.
424
425         * layout/MarginTypes.h:
426         (WebCore::Layout::PositiveAndNegativeVerticalMargin::Values::isNonZero const):
427         * layout/blockformatting/BlockFormattingContext.h:
428         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
429         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreCollapsedQuirkMargin):
430         (WebCore::Layout::hasMarginBeforeQuirkValue): Deleted.
431         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore): Deleted.
432         (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginAfter): Deleted.
433         * layout/blockformatting/BlockMarginCollapse.cpp:
434         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
435         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
436         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
437         (WebCore::Layout::computedPositiveAndNegativeMargin):
438         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
439         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
440
441 2019-01-28  Zalan Bujtas  <zalan@apple.com>
442
443         [LFC][BFC] Remove redundant vertical positioning in BlockFormattingContext::computeFloatingPosition
444         https://bugs.webkit.org/show_bug.cgi?id=193872
445
446         Reviewed by Antti Koivisto.
447
448         This is taken care of by verticalPositionWithMargin() in BlockFormattingContext::computeHeightAndMargin(). 
449
450         * layout/blockformatting/BlockFormattingContext.cpp:
451         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
452
453 2019-01-28  cathie chen  <cathiechen@igalia.com>
454
455         Add missing #include in ScrollingTreeFrameScrollingNode.cpp
456         https://bugs.webkit.org/show_bug.cgi?id=193905
457
458         Reviewed by Frédéric Wang.
459
460         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp: Add
461         #include "ScrollingStateFrameScrollingNode.h"
462
463 2019-01-28  Zalan Bujtas  <zalan@apple.com>
464
465         [LFC][BFC][Quirk] Ignore collapsed(through) margin after when stretching body height.
466         https://bugs.webkit.org/show_bug.cgi?id=193894
467
468         Reviewed by Antti Koivisto.
469
470         * layout/blockformatting/BlockFormattingContextQuirks.cpp:
471         (WebCore::Layout::BlockFormattingContext::Quirks::stretchedInFlowHeight):
472
473 2019-01-28  Antoine Quint  <graouts@apple.com>
474
475         Limit user-agent interactions based on the touch-action property on iOS
476         https://bugs.webkit.org/show_bug.cgi?id=193447
477         <rdar://problem/47283874>
478
479         Reviewed by Antti Koivisto and Simon Fraser.
480
481         We now compile a list of elements with a non-auto touch-action property that is updated whenever an element has its style changed
482         or is removed from its document. When the content of that list changes, we inform the scrolling coordinator such that it can compile
483         a list of TouchActionData structures which hold the touch-action value, the ID of the nearest scroll node and the Region containing
484         the bounds of each of those elements to send it up to the UI process along with touch regions. Computing the list of allowed touch
485         actions for a given element accounts for not only the value specified directly on that element's style, but also in its hierarchy,
486         crossing any frame boundary towards the top-level document's root node.
487
488         Tests: pointerevents/ios/touch-action-none-in-overflow-scrolling-touch.html
489                pointerevents/ios/touch-action-none-on-iframe.html
490                pointerevents/ios/touch-action-none-on-parent.html
491                pointerevents/ios/touch-action-none.html
492                pointerevents/ios/touch-action-pan-x-pan-y.html
493                pointerevents/ios/touch-action-pan-x.html
494                pointerevents/ios/touch-action-pan-y.html
495                pointerevents/ios/touch-action-pinch-zoom-allows-zooming.html
496                pointerevents/ios/touch-action-pinch-zoom-prevents-scrolling.html
497
498         * WebCore.xcodeproj/project.pbxproj: Update how certain headers are exposed such that they can be used from WebKit.
499         * dom/Document.cpp:
500         (WebCore::Document::invalidateRenderingDependentRegions):
501         (WebCore::Document::nodeWillBeRemoved): Ensure a node that is being removed from this document is no longer listed in its
502         list of elements with a non-auto touch-action property.
503         (WebCore::Document::absoluteEventRegionForNode):
504         (WebCore::Document::absoluteRegionForEventTargets):
505         (WebCore::Document::updateTouchActionElements): Create a list of elements with a non-auto touch-action property if one doesn't
506         exist yet and update it to add the given element if it contains a non-auto touch-action, or remove it if it doesn't. If the contents
507         of that list changed as a result, the scrolling coordinator is informed.
508         * dom/Document.h:
509         (WebCore::Document:: const):
510         * dom/Element.cpp:
511         (WebCore::parentCrossingFrameBoundaries):
512         (WebCore::Element::computedTouchActions const): Provide the list of allowed touch actions accounting for the "touch-action" property
513         specified on this element and all of its hierarchy, crossing frame boundary.
514         (WebCore::Element::nearestScrollingNodeIDUsingTouchOverflowScrolling const): Provide the ScrollingNodeID, if any, for the nearest scrolling node
515         for that element. This will allow the UI process to identify which scroll view's behavior to customize to reflect the element's allowed
516         touch actions.
517         * dom/Element.h:
518         * page/scrolling/ScrollingCoordinator.cpp:
519         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const): Compute the region for all elements with a non-auto touch-action property
520         throughout the provided frame and all of its subframes.
521         * page/scrolling/ScrollingCoordinator.h:
522         (WebCore::ScrollableAreaParameters::operator== const): Deleted.
523         * page/scrolling/ScrollingCoordinatorTypes.h: Added.
524         (WebCore::ScrollableAreaParameters::operator== const):
525         * page/scrolling/ScrollingTree.cpp:
526         (WebCore::ScrollingTree::touchActionDataAtPoint const): Query the list of TouchActionData objects for a match based on the provided point. Right
527         now the logic is pretty crude, stopping at the first TouchActionData for which the region contains the provided point, but future patches will
528         account for overlap and nesting.
529         * page/scrolling/ScrollingTree.h:
530         * page/scrolling/ScrollingTreeNode.h:
531         * platform/EventTrackingRegions.cpp:
532         (WebCore::operator==):
533         * platform/EventTrackingRegions.h:
534         (WebCore::operator!=):
535         * style/StyleTreeResolver.cpp:
536         (WebCore::Style::TreeResolver::resolveElement): Update the list of elements with a non-auto touch-action property when an element's style changes.
537
538 2019-01-27  Michael Catanzaro  <mcatanzaro@igalia.com>
539
540         Unreviewed, fix WPE/GTK debug builds after r240557
541         https://bugs.webkit.org/show_bug.cgi?id=192742
542         <rdar://problem/46757369>
543
544         Also fix an improper format string that was recently added in a different commit.
545
546         * rendering/RenderLayerCompositor.cpp:
547         (WebCore::RenderLayerCompositor::logLayerInfo):
548         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
549
550 2018-12-15  Darin Adler  <darin@apple.com>
551
552         Replace many uses of String::format with more type-safe alternatives
553         https://bugs.webkit.org/show_bug.cgi?id=192742
554
555         Reviewed by Mark Lam.
556
557         A while back, String::format was more efficient than string concatenation,
558         but that is no longer true, and we should prefer String::number, makeString,
559         or concatenation with the "+" operator to String::format for new code.
560
561         This is not as good for programmers who are fond of printf formatting
562         style, and in some cases it's a little harder to read the strings
563         interspersed with variables rather than a format string, but it's better
564         in a few ways:
565
566         - more efficient (I didn't measure the difference, but it's definitely
567           slower to use String::Format which calls vsnprintf twice than to use
568           the WTF code)
569         - works in a type-safe way without a need to use a format specifier such
570           as "%" PRIu64 or "%tu" making it much easier to avoid problems due to
571           subtle differences between platforms
572         - allows us to use StringView in some cases to sidestep the need to
573           allocate temporary WTF::String objects
574         - does not require converting each WTF::String to a C string, allowing
575           us to remove many cases of ".utf8().data()" and similar expressions,
576           eliminating the allocation of temporary WTF::CString objects
577
578         This patch covers a batch of easiest-to-convert call sites.
579         Later patches will allow us to deprecate or remove String::format.
580
581         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
582         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString.
583         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
584         (WebCore::IDBCursorInfo::loggingString const): Ditto.
585         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
586         (WebCore::IDBGetAllRecordsData::loggingString const): Ditto.
587         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
588         (WebCore::IDBGetRecordData::loggingString const): Ditto.
589         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
590         (WebCore::IDBIndexInfo::loggingString const): Ditto.
591         (WebCore::IDBIndexInfo::condensedLoggingString const): Ditto.
592         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
593         (WebCore::IDBIterateCursorData::loggingString const): Ditto.
594         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
595         (WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto.
596         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
597         (WebCore::IDBResourceIdentifier::loggingString const): Ditto.
598         * Modules/webdatabase/Database.cpp:
599         (WebCore::formatErrorMessage): Ditto.
600         * Modules/webdatabase/SQLError.h:
601         (WebCore::SQLError::create): Ditto.
602
603         * bindings/scripts/CodeGeneratorJS.pm:
604         (GenerateImplementation): Use makeString.
605
606         * bindings/scripts/test/JS/JSInterfaceName.cpp:
607         * bindings/scripts/test/JS/JSMapLike.cpp:
608         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
609         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
610         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
611         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
612         * bindings/scripts/test/JS/JSTestCallTracer.cpp:
613         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
614         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
615         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
616         * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
617         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
618         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
619         * bindings/scripts/test/JS/JSTestException.cpp:
620         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
621         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
622         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
623         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
624         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
625         * bindings/scripts/test/JS/JSTestInterface.cpp:
626         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
627         * bindings/scripts/test/JS/JSTestIterable.cpp:
628         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
629         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
630         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
631         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
632         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
633         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
634         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
635         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
636         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
637         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
638         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
639         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
640         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
641         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
642         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
643         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
644         * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
645         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
646         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
647         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
648         * bindings/scripts/test/JS/JSTestNode.cpp:
649         * bindings/scripts/test/JS/JSTestObj.cpp:
650         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
651         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
652         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
653         * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
654         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
655         * bindings/scripts/test/JS/JSTestSerialization.cpp:
656         * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
657         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
658         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
659         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
660         * bindings/scripts/test/JS/JSTestStringifier.cpp:
661         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
662         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
663         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
664         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
665         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
666         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
667         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
668         Updated expected results.
669 :
670         * css/parser/CSSPropertyParserHelpers.cpp:
671         (WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number
672         and makeString.
673
674         * html/HTMLSelectElement.cpp:
675         (WebCore::HTMLSelectElement::setLength): Use makeString.
676         * html/ImageDocument.cpp:
677         (WebCore::ImageDocument::imageUpdated): Ditto.
678         * html/parser/XSSAuditor.cpp:
679         (WebCore::XSSAuditor::init): Ditto.
680         * inspector/InspectorFrontendClientLocal.cpp:
681         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto.
682         (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto.
683         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto.
684         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto.
685         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto.
686         * inspector/agents/InspectorCSSAgent.cpp: Ditto.
687         * inspector/agents/InspectorIndexedDBAgent.cpp: Ditto.
688         * page/MemoryRelease.cpp:
689         (WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto.
690
691         * page/cocoa/ResourceUsageOverlayCocoa.mm:
692         (WebCore::formatByteNumber): Use String::number.
693         (WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation.
694
695         * page/cocoa/ResourceUsageThreadCocoa.mm:
696         (WebCore::logFootprintComparison): Use makeString.
697         * platform/animation/TimingFunction.cpp:
698         (WebCore::TimingFunction::cssText const): Ditto.
699
700         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
701         (WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number.
702         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
703         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto.
704
705         * platform/graphics/ca/GraphicsLayerCA.cpp:
706         (WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString.
707         (WebCore::GraphicsLayerCA::updateContentsImage): Ditto.
708         (WebCore::GraphicsLayerCA::updateContentsRects): Ditto.
709         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto.
710         * platform/mock/MockRealtimeVideoSource.cpp:
711         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
712
713         * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number.
714
715         * platform/network/ParsedContentRange.cpp:
716         (WebCore::ParsedContentRange::headerValue const): Use makeString.
717
718         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary
719         compiler conditionals and reorganized the start/stop of namespaces.
720         (WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString.
721
722         * platform/sql/SQLiteDatabase.cpp:
723         (WebCore::unauthorizedSQLFunction): Use makeString.
724         * rendering/RenderLayerCompositor.cpp:
725         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
726         * workers/service/server/RegistrationDatabase.cpp:
727         (WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto.
728         (WebCore::RegistrationDatabase::importRecords): Ditto.
729
730 2019-01-27  Wenson Hsieh  <wenson_hsieh@apple.com>
731
732         Remove a couple of PLATFORM defines intended for watchOS
733         https://bugs.webkit.org/show_bug.cgi?id=193888
734
735         Reviewed by Alexey Proskuryakov.
736
737         Remove the use of !PLATFORM(WATCH), since this is true on every platform.
738
739         * editing/cocoa/DictionaryLookup.mm:
740
741 2019-01-27  Jiewen Tan  <jiewen_tan@apple.com>
742
743         Use a load optimizer for some sites
744         https://bugs.webkit.org/show_bug.cgi?id=193881
745         <rdar://problem/46325455>
746
747         Reviewed by Brent Fulgham.
748
749         Expose FormData::flatten to be used by the load optimizer.
750
751         * WebCore.xcodeproj/project.pbxproj:
752         * platform/network/FormData.h:
753
754 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
755
756         Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent the iframe's scrolling node
757         https://bugs.webkit.org/show_bug.cgi?id=193879
758
759         Reviewed by Antti Koivisto.
760
761         Currently we parent iframe scrolling tree nodes by finding the closest ancestor layer with a scrolling tree node.
762         This results in scrolling tree nodes being connected across iframe boundaries in some arbitrary ancestor. This
763         makes updating scrolling tree geometry very error-prone, since changes in the parent document will need to trigger
764         updates of the scrolling tree node in an iframe.
765         
766         To address this, I already added a new "FrameHosting" scrolling node type. This patch actually instantiates these
767         nodes, which are owned by the RenderIFrame's composited layer. Connecting across frame boundaries is theforefore
768         simply a case of getting the FrameHosting node from the ownerElement's renderer; this is very similar to how we
769         connect GraphicsLayers together.
770         
771         RenderLayerBacking gains another scrolling role for FrameHosting and ScrollingNodeID.
772
773         Tested by existing tests.
774
775         * page/FrameView.h:
776         * rendering/RenderLayer.cpp:
777         (WebCore::outputPaintOrderTreeRecursive):
778         * rendering/RenderLayerBacking.cpp:
779         (WebCore::RenderLayerBacking::updateConfiguration):
780         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
781         * rendering/RenderLayerCompositor.cpp:
782         (WebCore::frameContentsRenderView):
783         (WebCore::RenderLayerCompositor::frameContentsCompositor):
784         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
785         (WebCore::RenderLayerCompositor::isLayerForIFrameWithScrollCoordinatedContents const):
786         (WebCore::RenderLayerCompositor::detachRootLayer):
787         (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
788         (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
789         (WebCore::scrollCoordinatedAncestorInParentOfFrame):
790         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
791         (WebCore::RenderLayerCompositor::attachScrollingNode):
792         (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
793         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
794         * rendering/RenderLayerCompositor.h:
795         * testing/Internals.cpp:
796         (WebCore::Internals::scrollingStateTreeAsText const):
797
798 2019-01-27  Chris Fleizach  <cfleizach@apple.com>
799
800         AX: Introduce a static accessibility tree
801         https://bugs.webkit.org/show_bug.cgi?id=193348
802         <rdar://problem/47203295>
803
804         Reviewed by Ryosuke Niwa.
805
806         In order to improve performance when requesting the accessibility hierarchy, we introduce the idea of a "static accessibility tree" which 
807         could be accessed on a different thread by assistive technologies.
808         That is accomplished by storing all the data needed to answer accessibility attribute queries in a static object that mirrors the 
809         "live" AccessibilityObjects (which interact with both DOM and Render trees).
810         These static objects are generally created after layout is done and final tasks are being performed. They are then stored in the static tree 
811         representation and able to be read from anywhere.
812         Tactically this is done with AXIsolatedTreeNodes inside of an AXIsolatedTree. The TreeNodes implement an AccessibilityObjectInterface shared 
813         with AccessibilityObject.
814         This allows the wrappers to access either one depending on conditions and platforms without significant code duplication or re-organization.
815
816         * CMakeLists.txt:
817         * Configurations/FeatureDefines.xcconfig:
818         * Sources.txt:
819         * WebCore.xcodeproj/project.pbxproj:
820         * accessibility/AXObjectCache.cpp:
821         (WebCore::AXObjectCache::remove):
822         (WebCore::AXObjectCache::createIsolatedAccessibilityTree):
823         (WebCore::AXObjectCache::generateStaticAccessibilityTreeIfNeeded):
824         * accessibility/AXObjectCache.h:
825         * accessibility/AccessibilityObject.h:
826         * accessibility/AccessibilityObjectInterface.h: Added.
827         * accessibility/isolatedtree: Added.
828         * accessibility/isolatedtree/AXIsolatedTree.cpp: Added.
829         (WebCore::AXIsolatedTree::treeCache):
830         (WebCore::AXIsolatedTree::AXIsolatedTree):
831         (WebCore::AXIsolatedTree::create):
832         (WebCore::AXIsolatedTree::treeForID):
833         (WebCore::AXIsolatedTree::treeForPageID):
834         (WebCore::AXIsolatedTree::nodeForID const):
835         (WebCore::AXIsolatedTree::rootNode):
836         (WebCore::AXIsolatedTree::removeNode):
837         (WebCore::AXIsolatedTree::appendNodeChanges):
838         (WebCore::AXIsolatedTree::applyPendingChanges):
839         * accessibility/isolatedtree/AXIsolatedTree.h: Added.
840         (WebCore::AXIsolatedTree::treeIdentifier const):
841         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added.
842             To note: we don't mark the attribute map const because even though attributes don't change after initial creation,
843             we may copy an existing node and replace specific values.
844         (WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode):
845         (WebCore::AXIsolatedTreeNode::create):
846         (WebCore::AXIsolatedTreeNode::initializeAttributeData):
847         (WebCore::AXIsolatedTreeNode::setProperty):
848         (WebCore::AXIsolatedTreeNode::doubleAttributeValue const):
849         (WebCore::AXIsolatedTreeNode::unsignedAttributeValue const):
850         (WebCore::AXIsolatedTreeNode::boolAttributeValue const):
851         (WebCore::AXIsolatedTreeNode::stringAttributeValue const):
852         (WebCore::AXIsolatedTreeNode::intAttributeValue const):
853         * accessibility/isolatedtree/AXIsolatedTreeNode.h: Added.
854         * accessibility/mac/AXObjectCacheMac.mm:
855         (WebCore::AXObjectCache::associateIsolatedTreeNode):
856         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
857         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
858         (-[WebAccessibilityObjectWrapperBase initWithAccessibilityObject:]):
859         (-[WebAccessibilityObjectWrapperBase isolatedTreeNode]):
860         (-[WebAccessibilityObjectWrapperBase detach]):
861         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
862         (-[WebAccessibilityObjectWrapperBase axBackingObject]):
863         (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
864         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
865         (-[WebAccessibilityObjectWrapper role]):
866         (-[WebAccessibilityObjectWrapper subrole]):
867         (-[WebAccessibilityObjectWrapper roleDescription]):
868         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
869         * dom/Document.cpp:
870         (WebCore::Document::pageID const):
871         * dom/Document.h:
872
873 2019-01-26  Simon Fraser  <simon.fraser@apple.com>
874
875         Allow scrolling tree nodes to exist in a detached state
876         https://bugs.webkit.org/show_bug.cgi?id=193754
877
878         Reviewed by Zalan Bujtas.
879
880         One of the (questionable?) design decisions of the scrolling tree is that the tree implementation
881         is hidden behind the ScrollingCoordinator interface. That interface only allowed nodes to exist
882         in a connected state; attachToStateTree() required a non-zero parent for any node that was not
883         the root.
884
885         This makes it impossible to coordinate the hookup of the scrolling tree across frame boundaries;
886         the scrolling tree has to have been fully constructed in ancestor frames before subframe nodes
887         can be attached. This is a significant difference from compositing, where a subframe can create
888         GraphicsLayers which don't have to be parented right away, and actually get parented later via
889         a compositing update in the parent frame.
890
891         We want to be able to hook up the scrolling tree via the same code paths as GraphicsLayer
892         connection (anything else is too confusing). So we need to be able to instantiate scrolling
893         tree nodes in a disconnected state, and attach them later.
894
895         To achieve this, add the notion of "unparented" nodes to ScrollingCoordinator and the ScrollingStateTree.
896         Allow clients to create unparented nodes, which can be attached later. ScrollingCoordinator stores
897         the roots of unparented subtrees in an owning HashMap. Nodes in unparented trees are still referenced
898         by m_stateNodeMap, so it's possible to find them and set state on them.
899
900         Clean up the ScrollingCoordinator interface to remove "state tree" terminology; the state vs. scrolling tree
901         is really an implementation detail.
902
903         This also removes the special-casing of ScrollingNodeType::Subframe nodes which ScrollingStateTree stored
904         in m_orphanedSubframeNodes; now the unparenting is controlled by the client.
905
906         Currently no code creates unparented nodes so there is no behavior change.
907
908         * dom/Document.cpp:
909         (WebCore::Document::setPageCacheState):
910         * page/scrolling/AsyncScrollingCoordinator.cpp:
911         (WebCore::AsyncScrollingCoordinator::createNode):
912         (WebCore::AsyncScrollingCoordinator::insertNode):
913         (WebCore::AsyncScrollingCoordinator::unparentNode):
914         (WebCore::AsyncScrollingCoordinator::unparentChildrenAndDestroyNode):
915         (WebCore::AsyncScrollingCoordinator::detachAndDestroySubtree):
916         (WebCore::AsyncScrollingCoordinator::clearAllNodes):
917         (WebCore::AsyncScrollingCoordinator::parentOfNode const):
918         (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView):
919         (WebCore::AsyncScrollingCoordinator::attachToStateTree): Deleted.
920         (WebCore::AsyncScrollingCoordinator::detachFromStateTree): Deleted.
921         (WebCore::AsyncScrollingCoordinator::clearStateTree): Deleted.
922         * page/scrolling/AsyncScrollingCoordinator.h:
923         * page/scrolling/ScrollingCoordinator.h:
924         (WebCore::ScrollingCoordinator::handleWheelEvent):
925         (WebCore::ScrollingCoordinator::createNode):
926         (WebCore::ScrollingCoordinator::insertNode):
927         (WebCore::ScrollingCoordinator::unparentNode):
928         (WebCore::ScrollingCoordinator::unparentChildrenAndDestroyNode):
929         (WebCore::ScrollingCoordinator::detachAndDestroySubtree):
930         (WebCore::ScrollingCoordinator::clearAllNodes):
931         (WebCore::ScrollingCoordinator::parentOfNode const):
932         (WebCore::ScrollingCoordinator::childrenOfNode const):
933         (WebCore::ScrollingCoordinator::attachToStateTree): Deleted.
934         (WebCore::ScrollingCoordinator::detachFromStateTree): Deleted.
935         (WebCore::ScrollingCoordinator::clearStateTree): Deleted.
936         * page/scrolling/ScrollingStateNode.cpp:
937         (WebCore::ScrollingStateNode::removeFromParent):
938         (WebCore::ScrollingStateNode::removeChild):
939         * page/scrolling/ScrollingStateNode.h:
940         * page/scrolling/ScrollingStateTree.cpp:
941         (WebCore::ScrollingStateTree::ScrollingStateTree):
942         (WebCore::ScrollingStateTree::createUnparentedNode):
943         (WebCore::ScrollingStateTree::insertNode):
944         (WebCore::ScrollingStateTree::unparentNode):
945         (WebCore::ScrollingStateTree::unparentChildrenAndDestroyNode):
946         (WebCore::ScrollingStateTree::detachAndDestroySubtree):
947         (WebCore::ScrollingStateTree::clear):
948         (WebCore::ScrollingStateTree::commit):
949         (WebCore::ScrollingStateTree::removeNodeAndAllDescendants):
950         (WebCore::ScrollingStateTree::recursiveNodeWillBeRemoved):
951         (showScrollingStateTree):
952         (WebCore::ScrollingStateTree::attachNode): Deleted.
953         (WebCore::ScrollingStateTree::detachNode): Deleted.
954         * page/scrolling/ScrollingStateTree.h:
955         (WebCore::ScrollingStateTree::nodeCount const):
956         * rendering/RenderLayerBacking.cpp:
957         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
958         * rendering/RenderLayerCompositor.cpp:
959         (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
960         (WebCore::RenderLayerCompositor::attachScrollingNode):
961
962 2019-01-26  Devin Rousso  <drousso@apple.com>
963
964         Web Inspector: provide a way to edit the user agent of a remote target
965         https://bugs.webkit.org/show_bug.cgi?id=193862
966         <rdar://problem/47359292>
967
968         Reviewed by Joseph Pecoraro.
969
970         Test: inspector/page/overrideUserAgent.html
971
972         * loader/FrameLoader.cpp:
973         (WebCore::FrameLoader::userAgent const):
974         (WebCore::FrameLoader::userAgentForJavaScript const):
975
976         * inspector/InspectorInstrumentation.h:
977         (WebCore::InspectorInstrumentation::applyUserAgentOverride): Added.
978         * inspector/InspectorInstrumentation.cpp:
979         (WebCore::InspectorInstrumentation::applyUserAgentOverrideImpl): Added.
980
981         * inspector/agents/InspectorPageAgent.h:
982         * inspector/agents/InspectorPageAgent.cpp:
983         (WebCore::InspectorPageAgent::disable):
984         (WebCore::InspectorPageAgent::overrideUserAgent): Added.
985         (WebCore::InspectorPageAgent::applyUserAgentOverride): Added.
986
987 2019-01-26  Zalan Bujtas  <zalan@apple.com>
988
989         [LFC] The initial values for top/bottom in contentHeightForFormattingContextRoot should not be 0.
990         https://bugs.webkit.org/show_bug.cgi?id=193867
991
992         Reviewed by Antti Koivisto.
993
994         The initial content top/bottom value is the border top + padding top.
995
996         This is only a problem when the box has float children only. While computing the height using the bottom-most float,
997         we call "top = std::min(floatTop, top)". With 0 initial top value, this returns an incorrect result when the box
998         has (top)border/padding.
999
1000         Test: fast/block/block-only/abs-pos-with-border-padding-and-float-child.html
1001
1002         * layout/FormattingContextGeometry.cpp:
1003         (WebCore::Layout::contentHeightForFormattingContextRoot):
1004
1005 2019-01-26  Zalan Bujtas  <zalan@apple.com>
1006
1007         [LFC][BFC] Ignore last inflow child's collapsed through margin after when computing containing block's height.
1008         https://bugs.webkit.org/show_bug.cgi?id=193865
1009
1010         Reviewed by Antti Koivisto.
1011
1012         Height computation ->
1013         // 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'
1014         // ...the bottom edge of the bottom (possibly collapsed) margin of its last in-flow child, if the child's bottom
1015         // margin does not collapse with the element's bottom margin
1016
1017         <div style="border: 1px solid green">
1018           <div style="margin-top: 100px;"></div>
1019         </div>
1020
1021         When the child vertical margins collapse through (margin-top = margin-bottom = 100px), the bottom edge of the bottom margin is
1022         the same as the bottom edge of the top margin which is alredy taken into use while positioning so technically the bottom margin value should be ignored. 
1023
1024         Test: fast/block/margin-collapse/collapsed-through-child-simple.html
1025
1026         * layout/MarginTypes.h:
1027         (WebCore::Layout::UsedVerticalMargin::isCollapsedThrough const):
1028         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1029         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1030         * layout/displaytree/DisplayBox.h:
1031         (WebCore::Display::Box::hasCollapsedThroughMargin const):
1032
1033 2019-01-26  Zalan Bujtas  <zalan@apple.com>
1034
1035         [LFC][BFC][MarginCollapsing] marginAfterCollapsesWithParentMarginAfter/marginAfterCollapsesWithLastInFlowChildMarginAfter should check for border/padding after values.
1036         https://bugs.webkit.org/show_bug.cgi?id=193864
1037
1038         Reviewed by Antti Koivisto.
1039
1040         * layout/blockformatting/BlockMarginCollapse.cpp:
1041         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter):
1042         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
1043
1044 2019-01-26  Zalan Bujtas  <zalan@apple.com>
1045
1046         [LFC] Box::nextInFlowOrFloatingSibling() should always return sibling floats as well.
1047         https://bugs.webkit.org/show_bug.cgi?id=193855
1048
1049         Reviewed by Antti Koivisto.
1050
1051         Use iterative algorithm to find next/previous siblings.
1052
1053         * layout/layouttree/LayoutBox.cpp:
1054         (WebCore::Layout::Box::nextInFlowOrFloatingSibling const):
1055
1056 2019-01-25  Ryosuke Niwa  <rniwa@webkit.org>
1057
1058         Need a mechanism to override navigator.userAgent
1059         https://bugs.webkit.org/show_bug.cgi?id=193762
1060         <rdar://problem/47504939>
1061
1062         Reviewed by Brent Fulgham.
1063
1064         Added the ability to specify user agent string just for navigator.userAgent via DocumentLoader.
1065
1066         * loader/DocumentLoader.h:
1067         (WebCore::DocumentLoader::setCustomJavaScriptUserAgent):
1068         (WebCore::DocumentLoader::customJavaScriptUserAgent const):
1069         * loader/FrameLoader.cpp:
1070         (WebCore::FrameLoader::userAgentForJavaScript const):
1071         * loader/FrameLoader.h:
1072         * page/Navigator.cpp:
1073         (WebCore::Navigator::userAgent const):
1074
1075 2019-01-25  Devin Rousso  <drousso@apple.com>
1076
1077         Web Inspector: provide a way to edit page settings on a remote target
1078         https://bugs.webkit.org/show_bug.cgi?id=193813
1079         <rdar://problem/47359510>
1080
1081         Reviewed by Joseph Pecoraro.
1082
1083         Test: inspector/page/overrideSetting.html
1084
1085         * page/Settings.yaml:
1086         * Scripts/GenerateSettings.rb:
1087         * Scripts/SettingsTemplates/Settings.cpp.erb:
1088         * Scripts/SettingsTemplates/Settings.h.erb:
1089         Add support for an `inspectorOverride` boolean value for each setting that will take
1090         precedence over the actual `Setting`'s value when set.
1091
1092         * inspector/agents/InspectorPageAgent.h:
1093         * inspector/agents/InspectorPageAgent.cpp:
1094         (WebCore::InspectorPageAgent::disable):
1095         (WebCore::InspectorPageAgent::overrideSetting): Added.
1096
1097         * inspector/InspectorFrontendHost.idl:
1098         * inspector/InspectorFrontendHost.h:
1099         * inspector/InspectorFrontendHost.cpp:
1100         (WebCore::InspectorFrontendHost::isRemote const): Added.
1101         * inspector/InspectorFrontendClient.h:
1102         (WebCore::InspectorFrontendClient::isRemote const): Added.
1103         * inspector/InspectorFrontendClientLocal.h:
1104         (WebCore::InspectorFrontendClientLocal::isRemote const): Added.
1105
1106 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1107
1108         Document::updateMainArticleElementAfterLayout() should be a no-op when no client depends on knowing the main article element
1109         https://bugs.webkit.org/show_bug.cgi?id=193843
1110
1111         Reviewed by Zalan Bujtas.
1112
1113         * dom/Document.cpp:
1114         (WebCore::Document::updateMainArticleElementAfterLayout):
1115
1116         This function currently does a bit of wasted work after every layout, on clients that don't listen to the
1117         "significant rendered text" layout milestone and therefore don't need to guess the main article element. Simply
1118         don't bother keeping the main article element up to date in this scenario by bailing from
1119         FrameView::updateHasReachedSignificantRenderedTextThreshold if the client doesn't care about the significant
1120         rendered text milestone.
1121
1122         * page/FrameView.cpp:
1123         (WebCore::FrameView::updateHasReachedSignificantRenderedTextThreshold):
1124
1125 2019-01-25  Jer Noble  <jer.noble@apple.com>
1126
1127         <video> elements not in the DOM should be allowed to AirPlay
1128         https://bugs.webkit.org/show_bug.cgi?id=193837
1129         <rdar://42559491>
1130
1131         Reviewed by Eric Carlson.
1132
1133         Test: media/airplay-allows-buffering.html
1134
1135         Some websites will switch between <video> elements backed by MSE to one backed by
1136         a media file in order to implement an AirPlay control. But when a <video> element is
1137         removed from the DOM and paused, further buffering is blocked. For some ports (namely
1138         Cocoa ones), this keeps AirPlay from engaging. Relax this buffering restriction for
1139         elements who have been asked to play wirelessly, but whose wireless playback has not
1140         started yet.
1141
1142         * html/MediaElementSession.cpp:
1143         (WebCore::MediaElementSession::dataBufferingPermitted const):
1144         (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
1145
1146 2019-01-25  Keith Rollin  <krollin@apple.com>
1147
1148         Update Xcode projects with "Check .xcfilelists" build phase
1149         https://bugs.webkit.org/show_bug.cgi?id=193790
1150         <rdar://problem/47201374>
1151
1152         Reviewed by Alex Christensen.
1153
1154         Support for XCBuild includes specifying inputs and outputs to various
1155         Run Script build phases. These inputs and outputs are specified as
1156         .xcfilelist files. Once created, these .xcfilelist files need to be
1157         kept up-to-date. In order to check that they are up-to-date or not,
1158         add an Xcode build step that invokes an external script that performs
1159         the checking. If the .xcfilelists are found to be out-of-date, update
1160         them, halt the build, and instruct the developer to restart the build
1161         with up-to-date files.
1162
1163         At this time, the checking and regenerating is performed only if the
1164         WK_ENABLE_CHECK_XCFILELISTS environment variable is set to 1. People
1165         who want to use this facility can set this variable and test out the
1166         checking/regenerating. Once it seems like there are no egregious
1167         issues that upset a developer's workflow, we'll unconditionally enable
1168         this facility.
1169
1170         No new tests since there should be no observable behavior difference.
1171
1172         * Scripts/check-xcfilelists.sh: Added.
1173         * WebCore.xcodeproj/project.pbxproj:
1174
1175 2019-01-25  Joseph Pecoraro  <pecoraro@apple.com>
1176
1177         Web Inspector: Exclude Debugger Threads from CPU Usage values in Web Inspector
1178         https://bugs.webkit.org/show_bug.cgi?id=193796
1179         <rdar://problem/47532910>
1180
1181         Reviewed by Devin Rousso.
1182
1183         * page/ResourceUsageData.h:
1184         * inspector/agents/InspectorCPUProfilerAgent.cpp:
1185         (WebCore::InspectorCPUProfilerAgent::collectSample):
1186         Show the CPU usage without debugger threads in the Web Inspector's timeline.
1187
1188         * page/ResourceUsageThread.h:
1189         * page/cocoa/ResourceUsageThreadCocoa.mm:
1190         (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
1191         For OS(DARWIN) ports, when starting to observe resource usage,
1192         we grab the mach_port_t of SamplingProfiler on the main thread
1193         in a thread safe way. For our purposes (Web Inspector timelines),
1194         this will be good enough to identify the SamplingProfiler thread
1195         during timeline recording. The SamplingProfiler thread won't change
1196         during a timeline recording and recording start/stops will never
1197         miss the SamplingProfiler changing.
1198
1199         (WebCore::filterThreads):
1200         (WebCore::threadSendRights):
1201         (WebCore::threadSendRightsExcludingDebuggerThreads):
1202         (WebCore::cpuUsage):
1203         (WebCore::ResourceUsageThread::platformCollectCPUData):
1204         Calculate CPU usage twice, the second time excluding some threads.
1205
1206         * page/linux/ResourceUsageThreadLinux.cpp:
1207         (WebCore::ResourceUsageThread::platformSaveStateBeforeStarting):
1208         (WebCore::ResourceUsageThread::platformCollectCPUData):
1209         Stubs for linux ports.
1210
1211 2019-01-25  Zalan Bujtas  <zalan@apple.com>
1212
1213         Remove FrameView::m_significantRenderedTextMilestonePending
1214         https://bugs.webkit.org/show_bug.cgi?id=193842
1215
1216         Reviewed by Wenson Hsieh.
1217
1218         Currently we keep processing the incoming text content until after the "SignificantRenderedTextMilestone" has been reached.
1219         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).
1220         This patch also ensures that we don't update Document::m_mainArticleElement once the threshold is reached.
1221
1222         * page/FrameView.cpp:
1223         (WebCore::FrameView::resetLayoutMilestones):
1224         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
1225         (WebCore::FrameView::hasReachedSignificantRenderedTextThreashold):
1226         (WebCore::FrameView::qualifiesAsSignificantRenderedText const):
1227         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
1228         (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded): Deleted.
1229         * page/FrameView.h:
1230
1231 2019-01-25  Keith Rollin  <krollin@apple.com>
1232
1233         Update Xcode projects with "Apply Configuration to XCFileLists" build target
1234         https://bugs.webkit.org/show_bug.cgi?id=193781
1235         <rdar://problem/47201153>
1236
1237         Reviewed by Alex Christensen.
1238
1239         Part of generating the .xcfilelists used as part of adopting XCBuild
1240         includes running `make DerivedSources.make` from a standalone script.
1241         It’s important for this invocation to have the same environment as
1242         when the actual build invokes `make DerivedSources.make`. If the
1243         environments are different, then the two invocations will provide
1244         different results. In order to get the same environment in the
1245         standalone script, have the script launch xcodebuild targeting the
1246         "Apply Configuration to XCFileLists" build target, which will then
1247         re-invoke our standalone script. The script is now running again, this
1248         time in an environment with all workspace, project, target, xcconfig
1249         and other environment variables established.
1250
1251         The "Apply Configuration to XCFileLists" build target accomplishes
1252         this task via a small embedded shell script that consists only of:
1253
1254             eval "${WK_SUBLAUNCH_SCRIPT_PARAMETERS[@]}"
1255
1256         The process that invokes "Apply Configuration to XCFileLists" first
1257         sets WK_SUBLAUNCH_SCRIPT_PARAMETERS to an array of commands to be
1258         evaluated and exports it into the shell environment. When xcodebuild
1259         is invoked, it inherits the value of this variable and can `eval` the
1260         contents of that variable. Our external standalone script can then set
1261         WK_SUBLAUNCH_SCRIPT_PARAMETERS to the path to itself, along with a set
1262         of command-line parameters needed to restart itself in the appropriate
1263         state.
1264
1265         No new tests since there should be no observable behavior difference.
1266
1267         * WebCore.xcodeproj/project.pbxproj:
1268
1269 2019-01-25  Keith Rollin  <krollin@apple.com>
1270
1271         Update WebKitAdditions.xcconfig with correct order of variable definitions
1272         https://bugs.webkit.org/show_bug.cgi?id=193793
1273         <rdar://problem/47532439>
1274
1275         Reviewed by Alex Christensen.
1276
1277         XCBuild changes the way xcconfig variables are evaluated. In short,
1278         all config file assignments are now considered in part of the
1279         evaluation. When using the new build system and an .xcconfig file
1280         contains multiple assignments of the same build setting:
1281
1282         - Later assignments using $(inherited) will inherit from earlier
1283           assignments in the xcconfig file.
1284         - Later assignments not using $(inherited) will take precedence over
1285           earlier assignments. An assignment to a more general setting will
1286           mask an earlier assignment to a less general setting. For example,
1287           an assignment without a condition ('FOO = bar') will completely mask
1288           an earlier assignment with a condition ('FOO[sdk=macos*] = quux').
1289
1290         This affects some of our .xcconfig files, in that sometimes platform-
1291         or sdk-specific definitions appear before the general definitions.
1292         Under the new evaluations rules, the general definitions alway take
1293         effect because they always overwrite the more-specific definitions. The
1294         solution is to swap the order, so that the general definitions are
1295         established first, and then conditionally overwritten by the
1296         more-specific definitions.
1297
1298         No new tests since there should be no observable behavior difference.
1299
1300         * Configurations/Base.xcconfig:
1301         * Configurations/Version.xcconfig:
1302
1303 2019-01-25  Keith Rollin  <krollin@apple.com>
1304
1305         Update existing .xcfilelists
1306         https://bugs.webkit.org/show_bug.cgi?id=193791
1307         <rdar://problem/47201706>
1308
1309         Reviewed by Alex Christensen.
1310
1311         Many .xcfilelist files were added in r238824 in order to support
1312         XCBuild. Update these with recent changes to the set of build files
1313         and with the current generate-xcfilelist script.
1314
1315         No new tests since there should be no observable behavior difference.
1316
1317         * DerivedSources-input.xcfilelist:
1318         * DerivedSources-output.xcfilelist:
1319         * UnifiedSources-input.xcfilelist:
1320         * UnifiedSources-output.xcfilelist:
1321
1322 2019-01-25  Brent Fulgham  <bfulgham@apple.com>
1323
1324         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
1325         https://bugs.webkit.org/show_bug.cgi?id=193297
1326         <rdar://problem/47158841>
1327
1328         Reviewed by Alex Christensen.
1329
1330         Trigger logging to the UIProcess when the ResourceLoadObserver is used in the NetworkProcess.
1331
1332         * Modules/websockets/WebSocket.cpp:
1333         (WebCore::WebSocket::connect): Notify NetworkProcess a connection was made to a resource.
1334         * loader/ResourceLoadObserver.cpp:
1335         (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback): Added.
1336         (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback): Added.
1337         (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback): Added.
1338         (WebCore::ResourceLoadObserver::logSubresourceLoading): Notify NetworkProcess of the load.
1339         (WebCore::ResourceLoadObserver::logWebSocketLoading): Ditto.
1340         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Ditto.
1341
1342 2019-01-25  Zalan Bujtas  <zalan@apple.com>
1343
1344         Remove FrameView::m_firstVisuallyNonEmptyLayoutCallbackPending
1345         https://bugs.webkit.org/show_bug.cgi?id=193835
1346
1347         Reviewed by Simon Fraser.
1348
1349         Currently updateIsVisuallyNonEmpty() is called from fireLayoutRelatedMilestonesIfNeeded() and from the incrementVisually*() functions.
1350         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.
1351         The milestone firing, as part of the post-layout tasks is triggered by a subsequent layout.
1352         However having multiple callers of updateIsVisuallyNonEmpty() requires an extra boolen (m_firstVisuallyNonEmptyLayoutCallbackPending) to maintain.
1353         Also calling updateIsVisuallyNonEmpty() repeatedly could be costly (with the current threshold of 200 characters, I don't think it is though).
1354
1355         This patch removes m_firstVisuallyNonEmptyLayoutCallbackPending and moves the logic from updateIsVisuallyNonEmpty() to fireLayoutRelatedMilestonesIfNeeded().
1356
1357         * page/FrameView.cpp:
1358         (WebCore::FrameView::resetLayoutMilestones):
1359         (WebCore::FrameView::loadProgressingStatusChanged):
1360         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
1361         (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
1362         (WebCore::FrameView::updateIsVisuallyNonEmpty): Deleted.
1363         * page/FrameView.h:
1364         (WebCore::FrameView::incrementVisuallyNonEmptyPixelCount):
1365
1366 2019-01-25  David Kilzer  <ddkilzer@apple.com>
1367
1368         Move soft-linking of Lookup.framework out of LookupSPI.h
1369         <https://webkit.org/b/193815>
1370
1371         Reviewed by Tim Horton.
1372
1373         * editing/cocoa/DictionaryLookup.mm:
1374         - Remove unused header.
1375
1376         * editing/mac/DictionaryLookupLegacy.mm:
1377         (WebCore::tokenRange):
1378         (WebCore::showPopupOrCreateAnimationController):
1379         (WebCore::DictionaryLookup::hidePopup):
1380         - Move soft-linking to LookupSoftLink.{h,mm}.
1381
1382         * platform/ios/ValidationBubbleIOS.mm:
1383         (WebCore::ValidationBubble::show):
1384         - Update for changes to UIKitSoftLink.{h,mm} now that
1385           UIAccessibilityAnnouncementNotification is using
1386           SOFT_LINK_CONSTANT*().
1387
1388 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1389
1390         [iOS] Rename some WebKit-internal functions and variables that reference "data interaction"
1391         https://bugs.webkit.org/show_bug.cgi?id=193829
1392
1393         Reviewed by Tim Horton.
1394
1395         No change in behavior.
1396
1397         * page/EventHandler.h:
1398         * page/ios/EventHandlerIOS.mm:
1399         (WebCore::EventHandler::tryToBeginDragAtPoint):
1400         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint): Deleted.
1401         * platform/ios/WebItemProviderPasteboard.mm:
1402         (linkTemporaryItemProviderFilesToDropStagingDirectory):
1403
1404 2019-01-25  Jon Davis  <jond@apple.com>
1405
1406         Updated feature status for several features 
1407         https://bugs.webkit.org/show_bug.cgi?id=193794
1408
1409         Reviewed by Joseph Pecoraro.
1410         
1411         Updated feature status for the following: CSS Font Display,
1412         CSS Text Decoration Level 4, SVG in OpenType Fonts, Web SQL,
1413         File and Directory Entries API, MediaStream Recording API,
1414         Readable Streams, Subresource Integrity, Visual Viewport API,
1415         and Web Audio.
1416
1417         * features.json:
1418
1419 2019-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
1420
1421         Need a way for JavaScript (or bundle) code to participate in undo
1422         https://bugs.webkit.org/show_bug.cgi?id=190009
1423         <rdar://problem/44807048>
1424
1425         Reviewed by Ryosuke Niwa.
1426
1427         Finish hooking up `UndoManager::addItems()` to CustomUndoStep.
1428
1429         Tests: editing/undo-manager/undo-manager-add-item-exceptions.html
1430                editing/undo-manager/undo-manager-add-item.html
1431                editing/undo-manager/undo-manager-delete-stale-undo-items.html
1432                editing/undo-manager/undo-manager-item-labels.html
1433                editing/undo-manager/undo-manager-undo-redo-after-garbage-collection.html
1434
1435         * editing/CompositeEditCommand.h:
1436         * editing/CustomUndoStep.cpp:
1437         (WebCore::CustomUndoStep::didRemoveFromUndoManager):
1438
1439         Add a method to invalidate CustomUndoStep. This clears out the pointer to the undo item, and also invalidates
1440         the UndoItem, removing it from its UndoManager.
1441
1442         * editing/CustomUndoStep.h:
1443         * editing/Editor.cpp:
1444         (WebCore::Editor::registerCustomUndoStep):
1445
1446         Add a helper method to register a CustomUndoStep as a platform undoable step.
1447
1448         * editing/Editor.h:
1449         * editing/UndoStep.h:
1450         * page/UndoItem.h:
1451         (WebCore::UndoItem::undoManager const):
1452         * page/UndoManager.cpp:
1453         (WebCore::UndoManager::addItem):
1454
1455         Create a CustomUndoStep with the given UndoItem, and register it with the platform undo manager.
1456
1457         * page/UndoManager.h:
1458         * page/UndoManager.idl:
1459
1460         Mark addItem() as capable of throwing exceptions.
1461
1462 2019-01-25  Zalan Bujtas  <zalan@apple.com>
1463
1464         [LFC][BFC][MarginCollapsing] Add "clear" to static position computation.
1465         https://bugs.webkit.org/show_bug.cgi?id=193824
1466
1467         Reviewed by Antti Koivisto.
1468
1469         When clear property is set and floats are present, we have to estimate and set the box's vertical position during
1470         static positioning to be able to properly layout its subtree.
1471
1472         <div style="float: left; width: 100px; height: 100px;"></div>
1473         <div style="clear: left;">
1474           <div style="float: left; width: 100px; height: 100px;"></div>
1475         </div>
1476
1477         In the above example since the second float's parent clears the first float, the second float is positioned below
1478         the first float. If we didn't push down (clear) the box, the float child would get placed next to the first float.
1479
1480         * layout/blockformatting/BlockFormattingContext.cpp:
1481         (WebCore::Layout::BlockFormattingContext::layout const):
1482         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1483         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
1484         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
1485         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
1486         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1487         (WebCore::Layout::BlockFormattingContext::verticalPositionWithMargin const):
1488         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const): Deleted.
1489         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const): Deleted.
1490         * layout/blockformatting/BlockFormattingContext.h:
1491         * layout/blockformatting/BlockMarginCollapse.cpp:
1492         (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginBefore):
1493         * layout/displaytree/DisplayBox.h:
1494
1495 2019-01-25  Zalan Bujtas  <zalan@apple.com>
1496
1497         [LFC][BFC][MarginCollapsing] Move positive/negative margin value updating to a dedicated function
1498         https://bugs.webkit.org/show_bug.cgi?id=193812
1499
1500         Reviewed by Antti Koivisto.
1501
1502         Move update logic to BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues().
1503
1504         * layout/blockformatting/BlockFormattingContext.cpp:
1505         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1506         * layout/blockformatting/BlockFormattingContext.h:
1507         * layout/blockformatting/BlockMarginCollapse.cpp:
1508         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updatePositiveNegativeMarginValues):
1509         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
1510         * page/FrameViewLayoutContext.cpp:
1511         (WebCore::layoutUsingFormattingContext):
1512
1513 2019-01-25  Antoine Quint  <graouts@apple.com>
1514
1515         Use ENABLE_POINTER_EVENTS for the touch-action property
1516         https://bugs.webkit.org/show_bug.cgi?id=193819
1517
1518         Reviewed by Antti Koivisto.
1519
1520         Since we've added an ENABLE_POINTER_EVENTS we should be using it for anything related to the implementation of the
1521         Pointer Events specification of which the touch-action property is a part.
1522
1523         * css/CSSComputedStyleDeclaration.cpp:
1524         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
1525         * css/CSSPrimitiveValueMappings.h:
1526         * css/CSSProperties.json:
1527         * css/CSSValueKeywords.in:
1528         * css/StyleBuilderConverter.h:
1529         * css/parser/CSSPropertyParser.cpp:
1530         (WebCore::CSSPropertyParser::parseSingleValue):
1531         * dom/Element.cpp:
1532         (WebCore::Element::allowsDoubleTapGesture const):
1533         * platform/TouchAction.h:
1534         * rendering/style/RenderStyle.h:
1535         * rendering/style/StyleRareNonInheritedData.cpp:
1536         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
1537         (WebCore::StyleRareNonInheritedData::operator== const):
1538         * rendering/style/StyleRareNonInheritedData.h:
1539
1540 2019-01-24  Zalan Bujtas  <zalan@apple.com>
1541
1542         [LFC][BFC][MarginCollapsing] Refactor MarginCollapse::updateCollapsedMarginAfter
1543         https://bugs.webkit.org/show_bug.cgi?id=193807
1544
1545         Reviewed by Simon Fraser.
1546
1547         Rename updateCollapsedMarginAfter to updateMarginAfterForPreviousSibling and make the margin updating logic more explicit.
1548
1549         * layout/blockformatting/BlockFormattingContext.cpp:
1550         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
1551         * layout/blockformatting/BlockFormattingContext.h:
1552         * layout/blockformatting/BlockMarginCollapse.cpp:
1553         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateMarginAfterForPreviousSibling):
1554         (WebCore::Layout::BlockFormattingContext::MarginCollapse::updateCollapsedMarginAfter): Deleted.
1555
1556 2019-01-24  Joseph Pecoraro  <pecoraro@apple.com>
1557
1558         Web Inspector: CPU Usage Timeline
1559         https://bugs.webkit.org/show_bug.cgi?id=193730
1560         <rdar://problem/46797201>
1561
1562         Reviewed by Devin Rousso.
1563
1564         Test: inspector/cpu-profiler/tracking.html
1565
1566         * Sources.txt:
1567         * UnifiedSources-input.xcfilelist:
1568         * WebCore.xcodeproj/project.pbxproj:
1569         New files.
1570
1571         * inspector/InspectorController.cpp:
1572         (WebCore::InspectorController::createLazyAgents):
1573         * inspector/InstrumentingAgents.cpp:
1574         (WebCore::InstrumentingAgents::reset):
1575         * inspector/InstrumentingAgents.h:
1576         (WebCore::InstrumentingAgents::inspectorCPUProfilerAgent const):
1577         (WebCore::InstrumentingAgents::setInspectorCPUProfilerAgent):
1578         Create and track the CPUProfilerAgent.
1579
1580         * inspector/agents/InspectorTimelineAgent.cpp:
1581         (WebCore::InspectorTimelineAgent::toggleInstruments):
1582         (WebCore::InspectorTimelineAgent::toggleCPUInstrument):
1583         Handle backend auto-start of the CPU instrument / timeline.
1584
1585         * inspector/agents/InspectorCPUProfilerAgent.h:
1586         * inspector/agents/InspectorCPUProfilerAgent.cpp: Added.
1587         (WebCore::InspectorCPUProfilerAgent::InspectorCPUProfilerAgent):
1588         (WebCore::InspectorCPUProfilerAgent::didCreateFrontendAndBackend):
1589         (WebCore::InspectorCPUProfilerAgent::willDestroyFrontendAndBackend):
1590         (WebCore::InspectorCPUProfilerAgent::startTracking):
1591         (WebCore::InspectorCPUProfilerAgent::stopTracking):
1592         (WebCore::InspectorCPUProfilerAgent::collectSample):
1593         CPUProfilerAgent uses the ResourceUsageThread to get CPU data.
1594
1595         * inspector/agents/InspectorTimelineAgent.h:
1596         * inspector/agents/InspectorMemoryAgent.cpp:
1597         (WebCore::InspectorMemoryAgent::startTracking):
1598         (WebCore::InspectorMemoryAgent::collectSample):
1599         Update the MemoryAgent to collect only Memory data and use a more accurate sample timestamp.
1600
1601         * page/ResourceUsageData.h:
1602         * page/ResourceUsageThread.cpp:
1603         (WebCore::ResourceUsageThread::addObserver):
1604         (WebCore::ResourceUsageThread::removeObserver):
1605         (WebCore::ResourceUsageThread::notifyObservers):
1606         (WebCore::ResourceUsageThread::recomputeCollectionMode):
1607         (WebCore::ResourceUsageThread::threadBody):
1608         * page/ResourceUsageThread.h:
1609         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1610         (WebCore::ResourceUsageOverlay::platformInitialize):
1611         * page/cocoa/ResourceUsageThreadCocoa.mm:
1612         (WebCore::ResourceUsageThread::platformCollectCPUData):
1613         (WebCore::ResourceUsageThread::platformCollectMemoryData):
1614         (WebCore::ResourceUsageThread::platformThreadBody): Deleted.
1615         * page/linux/ResourceUsageOverlayLinux.cpp:
1616         (WebCore::ResourceUsageOverlay::platformInitialize):
1617         * page/linux/ResourceUsageThreadLinux.cpp:
1618         (WebCore::ResourceUsageThread::platformCollectCPUData):
1619         (WebCore::ResourceUsageThread::platformCollectMemoryData):
1620         (WebCore::ResourceUsageThread::platformThreadBody):
1621         Give each observer their own collection mode. The ResourceUsageThread
1622         will then collect data that is the union of all of the active observers.
1623         This allows collecting CPU and Memory data separately, reducing the cost
1624         of each when gathered individually.
1625
1626 2019-01-24  Charles Vazac  <cvazac@akamai.com>
1627
1628         Implement PerformanceObserver.supportedEntryTypes
1629         https://bugs.webkit.org/show_bug.cgi?id=193428
1630
1631         PerformanceObserver.supportedEntryTypes should return an array of
1632         entryTypes that can be observed per specification
1633         https://w3c.github.io/performance-timeline/#supportedentrytypes-attribute
1634
1635         Reviewed by Joseph Pecoraro.
1636
1637         This is covered by web-platform-tests
1638         LayoutTests/imported/w3c/web-platform-tests/resource-timing/supported_resource_type.*.html.
1639
1640         * page/PerformanceObserver.cpp:
1641         (WebCore::PerformanceObserver::supportedEntryTypes):
1642         * page/PerformanceObserver.h:
1643         * page/PerformanceObserver.idl:
1644
1645 2019-01-24  Truitt Savell  <tsavell@apple.com>
1646
1647         Unreviewed, rolling out r240446.
1648
1649         Casued 5 API failures
1650
1651         Reverted changeset:
1652
1653         "Activate the WebResourceLoadStatisticsStore in the
1654         NetworkProcess and deactivate it in the UIProcess."
1655         https://bugs.webkit.org/show_bug.cgi?id=193297
1656         https://trac.webkit.org/changeset/240446
1657
1658 2019-01-24  Wenson Hsieh  <wenson_hsieh@apple.com>
1659
1660         [iOS] Unable to make a selection in jsfiddle.net using arrow keys when requesting desktop site
1661         https://bugs.webkit.org/show_bug.cgi?id=193758
1662         <rdar://problem/43614978>
1663
1664         Reviewed by Tim Horton.
1665
1666         CodeMirror's script adds a repeating timer that periodically normalizes the logical selection in the editor
1667         (this is distinct from the actual DOM selection, which is inside a hidden textarea element). This script defines
1668         a helper method to select all the text inside of a text form control, called `selectInput`, which normally
1669         invokes `node.select()`. However, in the case of iOS, the script works around broken `select()` behavior by
1670         setting `selectionStart` and `selectionEnd` to encompass all the content in the form control. When requesting
1671         the desktop version of the site, CodeMirror no longer attempts to apply its iOS workaround.
1672
1673         This iOS-specific behavior was introduced to fix <rdar://problem/4901923>. However, the original bug no longer
1674         reproduces even without this quirk. To fix CodeMirror, we make two adjustments:
1675
1676         1.  Roll out this ancient demo hack, in favor of standardized behavior.
1677         2.  Note that `select()` is also used when focusing an input. However, when focusing an input element on iOS, we
1678             want to match the platform (i.e. UITextField behavior) and move focus to the end of the text field. To
1679             achieve this, we introduce a new helper on HTMLInputElement that is called when setting the default
1680             selection of a text input after focus; on iOS, this helper method moves the selection to the end of the
1681             input, but everywhere else, it selects all the text in the input element.
1682
1683         This causes 6 existing layout tests to begin passing on iOS.
1684
1685         * html/HTMLInputElement.cpp:
1686         (WebCore::HTMLInputElement::updateFocusAppearance):
1687         (WebCore::HTMLInputElement::setDefaultSelectionAfterFocus):
1688         * html/HTMLInputElement.h:
1689         * html/HTMLTextFormControlElement.cpp:
1690         (WebCore::HTMLTextFormControlElement::select):
1691
1692 2019-01-24  Jer Noble  <jer.noble@apple.com>
1693
1694         Fix leak of AVSampleBufferRenderSynchronizer boundaryObserver object.
1695         https://bugs.webkit.org/show_bug.cgi?id=193778
1696
1697         Reviewed by Jon Lee.
1698
1699         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1700         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime):
1701
1702 2019-01-24  Zalan Bujtas  <zalan@apple.com>
1703
1704         DidFirstVisuallyNonEmptyLayout milestone should always fire at some point.
1705         https://bugs.webkit.org/show_bug.cgi?id=193741
1706         <rdar://problem/47135030>
1707
1708         Reviewed by Antti Koivisto and Simon Fraser.
1709
1710         fireLayoutRelatedMilestonesIfNeeded() is part of the post-layout tasks. In certain cases when
1711             1. the received data is not "contentful" yet
1712             2. and we are expecting some more (loading is not complete yet)
1713             3. but no layout is initiated anymore
1714         nothing triggers the milestone firing.
1715
1716         This patch ensures that we fire the DidFirstVisuallyNonEmptyLayout when the frame load is complete unless we already did.
1717
1718         * page/FrameView.cpp:
1719         (WebCore::FrameView::FrameView):
1720         (WebCore::FrameView::loadProgressingStatusChanged):
1721
1722 2019-01-24  Brent Fulgham  <bfulgham@apple.com>
1723
1724         Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
1725         https://bugs.webkit.org/show_bug.cgi?id=193297
1726         <rdar://problem/47158841>
1727
1728         Reviewed by Alex Christensen.
1729
1730         Trigger logging to the UIProcess when the ResourceLoadObserver is used in the NetworkProcess.
1731
1732         * Modules/websockets/WebSocket.cpp:
1733         (WebCore::WebSocket::connect): Notify NetworkProcess a connection was made to a resource.
1734         * loader/ResourceLoadObserver.cpp:
1735         (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback): Added.
1736         (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback): Added.
1737         (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback): Added.
1738         (WebCore::ResourceLoadObserver::logSubresourceLoading): Notify NetworkProcess of the load.
1739         (WebCore::ResourceLoadObserver::logWebSocketLoading): Ditto.
1740         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): Ditto.
1741
1742 2019-01-24  John Wilander  <wilander@apple.com>
1743
1744         Add Ad Click Attribution as an internal/experimental feature
1745         https://bugs.webkit.org/show_bug.cgi?id=193685
1746         <rdar://problem/47450399>
1747
1748         Reviewed by Brent Fulgham.
1749
1750         Test: http/tests/adClickAttribution/anchor-tag-attributes-reflect.html
1751
1752         * html/HTMLAnchorElement.h:
1753         * html/HTMLAnchorElement.idl:
1754         * html/HTMLAttributeNames.in:
1755             Addeed two new experimental attributes:
1756             - adcampaignid: Ad campaign ID.
1757             - addestination: Ad link destination site.
1758         * page/RuntimeEnabledFeatures.h:
1759         (WebCore::RuntimeEnabledFeatures::adClickAttributionEnabled const):
1760         (WebCore::RuntimeEnabledFeatures::setAdClickAttributionEnabled):
1761         * page/Settings.yaml:
1762
1763 2019-01-24  Youenn Fablet  <youenn@apple.com>
1764
1765         Use MonotonicTime in WorkerRunLoop
1766         https://bugs.webkit.org/show_bug.cgi?id=193417
1767
1768         Reviewed by Saam Barati.
1769
1770         Condition is based on MonotonicTime so MessageQueue should also be based on MonotonicTime.
1771         Ditto for WorkerRunLoop.
1772         No easy way to test the change which should not be easily observable.
1773
1774         * workers/WorkerRunLoop.cpp:
1775         (WebCore::WorkerRunLoop::runInMode):
1776
1777 2019-01-24  Ross Kirsling  <ross.kirsling@sony.com>
1778
1779         Move FileSystem to WTF
1780         https://bugs.webkit.org/show_bug.cgi?id=193602
1781
1782         Reviewed by Yusuke Suzuki.
1783
1784         * Modules/encryptedmedia/CDM.cpp:
1785         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1786         * Modules/entriesapi/DOMFileSystem.cpp:
1787         * Modules/entriesapi/FileSystemEntry.cpp:
1788         * Modules/indexeddb/IDBDatabaseIdentifier.cpp:
1789         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1790         * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
1791         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
1792         * Modules/webdatabase/DatabaseTracker.cpp:
1793         * Modules/webdatabase/OriginLock.cpp:
1794         * Modules/webdatabase/OriginLock.h:
1795         * Modules/webdatabase/cocoa/DatabaseManagerCocoa.mm:
1796         * PlatformMac.cmake:
1797         * PlatformPlayStation.cmake:
1798         * PlatformWin.cmake:
1799         * Sources.txt:
1800         * SourcesCocoa.txt:
1801         * WebCore.xcodeproj/project.pbxproj:
1802         * bindings/js/GCController.cpp:
1803         * dom/DataTransferItem.cpp:
1804         * editing/cocoa/WebContentReaderCocoa.mm:
1805         * fileapi/File.cpp:
1806         * fileapi/FileCocoa.mm:
1807         * html/FileInputType.cpp:
1808         * html/FileListCreator.cpp:
1809         * loader/appcache/ApplicationCacheHost.cpp:
1810         * loader/appcache/ApplicationCacheStorage.cpp:
1811         * page/Page.cpp:
1812         * page/SecurityOrigin.cpp:
1813         * page/SecurityOriginData.cpp:
1814         * platform/FileHandle.h:
1815         * platform/FileStream.cpp:
1816         * platform/FileStream.h:
1817         * platform/SharedBuffer.h:
1818         * platform/SourcesGLib.txt:
1819         * platform/cocoa/FileMonitorCocoa.mm:
1820         * platform/glib/FileMonitorGLib.cpp:
1821         * platform/glib/SharedBufferGlib.cpp:
1822         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
1823         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1824         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
1825         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1826         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1827         * platform/ios/QuickLook.mm:
1828         * platform/ios/WebItemProviderPasteboard.mm:
1829         * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm:
1830         * platform/network/BlobDataFileReference.cpp:
1831         * platform/network/BlobRegistryImpl.cpp:
1832         * platform/network/BlobResourceHandle.cpp:
1833         * platform/network/FormData.cpp:
1834         * platform/network/cf/FormDataStreamCFNet.cpp:
1835         * platform/network/cocoa/ResourceRequestCocoa.mm:
1836         * platform/network/curl/CookieJarDB.cpp:
1837         * platform/network/curl/CurlCacheEntry.h:
1838         * platform/network/curl/CurlCacheManager.cpp:
1839         * platform/network/curl/CurlFormDataStream.h:
1840         * platform/network/curl/CurlRequest.h:
1841         * platform/network/curl/NetworkStorageSessionCurl.cpp:
1842         * platform/network/curl/ResourceHandleCurl.cpp:
1843         * platform/network/mac/BlobDataFileReferenceMac.mm:
1844         * platform/network/soup/ResourceHandleSoup.cpp:
1845         * platform/network/soup/SoupNetworkSession.cpp:
1846         * platform/posix/SharedBufferPOSIX.cpp:
1847         * platform/sql/SQLiteFileSystem.cpp:
1848         * platform/text/hyphen/HyphenationLibHyphen.cpp:
1849         * platform/win/SearchPopupMenuDB.cpp:
1850         * rendering/RenderTheme.cpp:
1851         * rendering/RenderThemeGtk.cpp:
1852         * rendering/RenderThemeWin.cpp:
1853         * workers/service/server/RegistrationDatabase.cpp:
1854
1855 2019-01-24  Zalan Bujtas  <zalan@apple.com>
1856
1857         [LFC][BFC][MarginCollapsing] MarginCollapse::collapsedVerticalValues should not return computed non-collapsed values.
1858         https://bugs.webkit.org/show_bug.cgi?id=193768
1859
1860         Reviewed by Antti Koivisto.
1861
1862         When it comes to the actual used values it does not really matter, only from correctness point of view.
1863         (This patch also moves some checks to their correct place.)
1864
1865         * layout/blockformatting/BlockMarginCollapse.cpp:
1866         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSiblingMarginAfter):
1867         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
1868         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithLastInFlowChildMarginAfter):
1869         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginBefore):
1870         (WebCore::Layout::BlockFormattingContext::MarginCollapse::positiveNegativeMarginAfter):
1871         (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedVerticalValues):
1872
1873 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
1874
1875         Add "frame hosting" nodes to the scrolling tree
1876         https://bugs.webkit.org/show_bug.cgi?id=193753
1877
1878         Reviewed by Antti Koivisto.
1879
1880         When the scrolling tree crosses frame boundaries, mutations in the parent frame currently
1881         require the iframe's scrolling node to get reparented in a new ancestor, which requires
1882         a layer tree walk of the parent frame. This is error-prone, and not very future-proof.
1883
1884         Fix this by introducing "frame hosting" scrolling tree nodes. These are mostly inert
1885         nodes that are owned by the RenderIFrame's layer backing in the parent frame, and exist
1886         to provide a consistent parent node for the subframe's scrolling node.
1887
1888         This patch adds the node types, but does not instantiate them yet.
1889
1890         * Sources.txt:
1891         * WebCore.xcodeproj/project.pbxproj:
1892         * page/scrolling/ScrollingCoordinator.cpp:
1893         (WebCore::operator<<):
1894         * page/scrolling/ScrollingCoordinator.h:
1895         * page/scrolling/ScrollingStateFrameHostingNode.cpp: Added.
1896         (WebCore::ScrollingStateFrameHostingNode::create):
1897         (WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
1898         (WebCore::ScrollingStateFrameHostingNode::clone):
1899         (WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
1900         * page/scrolling/ScrollingStateFrameHostingNode.h: Added.
1901         * page/scrolling/ScrollingStateNode.h:
1902         (WebCore::ScrollingStateNode::isFrameHostingNode const):
1903         * page/scrolling/ScrollingStateTree.cpp:
1904         (WebCore::ScrollingStateTree::createNode):
1905         * page/scrolling/ScrollingTreeFrameHostingNode.cpp: Added.
1906         (WebCore::ScrollingTreeFrameHostingNode::create):
1907         (WebCore::ScrollingTreeFrameHostingNode::ScrollingTreeFrameHostingNode):
1908         (WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
1909         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange):
1910         (WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
1911         * page/scrolling/ScrollingTreeFrameHostingNode.h: Added.
1912         * page/scrolling/ScrollingTreeNode.h:
1913         (WebCore::ScrollingTreeNode::isFrameHostingNode const):
1914         * page/scrolling/ios/ScrollingTreeIOS.cpp:
1915         (WebCore::ScrollingTreeIOS::createScrollingTreeNode):
1916         * page/scrolling/mac/ScrollingTreeMac.cpp:
1917         (ScrollingTreeMac::createScrollingTreeNode):
1918         * rendering/RenderLayerBacking.cpp:
1919         (WebCore::RenderLayerBacking::~RenderLayerBacking):
1920         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
1921         (WebCore::operator<<):
1922         * rendering/RenderLayerBacking.h:
1923         * rendering/RenderLayerCompositor.cpp:
1924         (WebCore::scrollCoordinationRoleForNodeType):
1925         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayerWithRole):
1926         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
1927         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
1928         * rendering/RenderLayerCompositor.h:
1929
1930 2019-01-24  Eric Carlson  <eric.carlson@apple.com>
1931
1932         [iOS] Enable media element volume on iPad
1933         https://bugs.webkit.org/show_bug.cgi?id=193745
1934         <rdar://problem/47452297>
1935
1936         Reviewed by Jer Noble.
1937
1938         * html/HTMLMediaElement.cpp:
1939         (WebCore::HTMLMediaElement::setVolume):
1940         (WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
1941         (WebCore::HTMLMediaElement::updateVolume):
1942
1943         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1944         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):
1945
1946 2019-01-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1947
1948         [GTK][WPE] Support JPEG 2000 images
1949         https://bugs.webkit.org/show_bug.cgi?id=186272
1950
1951         Reviewed by Žan Doberšek.
1952
1953         Add JPEG2000ImageDecoder to support JPEG2000 images using OpenJPEG. For now only SRGB and SYCC color spaces are
1954         supported.
1955
1956         * platform/ImageDecoders.cmake:
1957         * platform/MIMETypeRegistry.cpp:
1958         (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
1959         * platform/image-decoders/ScalableImageDecoder.cpp:
1960         (WebCore::ScalableImageDecoder::create):
1961         * platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.cpp: Added.
1962         (WebCore::syccToRGB):
1963         (WebCore::sycc444ToRGB):
1964         (WebCore::sycc422ToRGB):
1965         (WebCore::sycc420ToRGB):
1966         (WebCore::JPEG2000ImageDecoder::JPEG2000ImageDecoder):
1967         (WebCore::JPEG2000ImageDecoder::frameBufferAtIndex):
1968         (WebCore::JPEG2000ImageDecoder::decode):
1969         * platform/image-decoders/jpeg2000/JPEG2000ImageDecoder.h: Added.
1970
1971 2019-01-23  Simon Fraser  <simon.fraser@apple.com>
1972
1973         Change some RenderLayerCompositor functions to use references
1974         https://bugs.webkit.org/show_bug.cgi?id=193760
1975
1976         Reviewed by Zalan Bujtas.
1977
1978         RenderWidget* -> RenderWidget&
1979
1980         * rendering/RenderLayerBacking.cpp:
1981         (WebCore::RenderLayerBacking::updateAfterWidgetResize):
1982         (WebCore::RenderLayerBacking::updateConfiguration):
1983         * rendering/RenderLayerCompositor.cpp:
1984         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
1985         (WebCore::RenderLayerCompositor::updateBacking):
1986         (WebCore::RenderLayerCompositor::frameContentsCompositor):
1987         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
1988         * rendering/RenderLayerCompositor.h:
1989
1990 2019-01-23  Benjamin Poulain  <benjamin@webkit.org>
1991
1992         <rdar://problem/27686430> Revert workaround AVPlayer.setMuted bug on macOS
1993         https://bugs.webkit.org/show_bug.cgi?id=193742
1994
1995         Reviewed by Eric Carlson.
1996
1997         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1998         The original bug was fixed, see radar: rdar://problem/27686430
1999
2000 2019-01-23  Sihui Liu  <sihui_liu@apple.com>
2001
2002         Clean up IndexedDB files between tests
2003         https://bugs.webkit.org/show_bug.cgi?id=192796
2004         <rdar://problem/46824999>
2005
2006         Reviewed by Geoffrey Garen.
2007
2008         We should clean up the IndexedDB files between tests to make sure each IDB test is independent of others.
2009
2010         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2011         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
2012         (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
2013
2014 2019-01-23  Oriol Brufau  <obrufau@igalia.com>
2015
2016         Add CSS Logical spec to features.json
2017         https://bugs.webkit.org/show_bug.cgi?id=193717
2018
2019         Reviewed by Manuel Rego Casasnovas.
2020
2021         * features.json:
2022
2023 2019-01-22  Conrad Shultz  <conrad_shultz@apple.com>
2024
2025         Clean up USE(WEB_THREAD)
2026         https://bugs.webkit.org/show_bug.cgi?id=193698
2027
2028         Rubber-stamped by Tim Horton.
2029
2030         * page/CaptionUserPreferencesMediaAF.cpp:
2031         (WebCore::userCaptionPreferencesChangedNotificationCallback):
2032         * platform/cf/MainThreadSharedTimerCF.cpp:
2033         (WebCore::applicationDidBecomeActive):
2034         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
2035         (WebCore::dispatchToMainThread):
2036         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
2037         (-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
2038         * platform/ios/LegacyTileCache.mm:
2039         (WebCore::LegacyTileCache::layoutTiles):
2040         (WebCore::LegacyTileCache::setTilingMode):
2041         * platform/ios/WebCoreMotionManager.mm:
2042         (-[WebCoreMotionManager sendAccelerometerData:]):
2043         (-[WebCoreMotionManager sendMotionData:withHeading:]):
2044         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2045         (VideoFullscreenControllerContext::requestUpdateInlineRect):
2046         (VideoFullscreenControllerContext::requestVideoContentLayer):
2047         (VideoFullscreenControllerContext::returnVideoContentLayer):
2048         (VideoFullscreenControllerContext::didSetupFullscreen):
2049         (VideoFullscreenControllerContext::willExitFullscreen):
2050         (VideoFullscreenControllerContext::didExitFullscreen):
2051         (VideoFullscreenControllerContext::didCleanupFullscreen):
2052         (VideoFullscreenControllerContext::fullscreenMayReturnToInline):
2053         (VideoFullscreenControllerContext::requestFullscreenMode):
2054         (VideoFullscreenControllerContext::setVideoLayerFrame):
2055         (VideoFullscreenControllerContext::setVideoLayerGravity):
2056         (VideoFullscreenControllerContext::fullscreenModeChanged):
2057         (VideoFullscreenControllerContext::play):
2058         (VideoFullscreenControllerContext::pause):
2059         (VideoFullscreenControllerContext::togglePlayState):
2060         (VideoFullscreenControllerContext::toggleMuted):
2061         (VideoFullscreenControllerContext::setMuted):
2062         (VideoFullscreenControllerContext::setVolume):
2063         (VideoFullscreenControllerContext::setPlayingOnSecondScreen):
2064         (VideoFullscreenControllerContext::beginScrubbing):
2065         (VideoFullscreenControllerContext::endScrubbing):
2066         (VideoFullscreenControllerContext::seekToTime):
2067         (VideoFullscreenControllerContext::fastSeek):
2068         (VideoFullscreenControllerContext::beginScanningForward):
2069         (VideoFullscreenControllerContext::beginScanningBackward):
2070         (VideoFullscreenControllerContext::endScanning):
2071         (VideoFullscreenControllerContext::selectAudioMediaOption):
2072         (VideoFullscreenControllerContext::selectLegibleMediaOption):
2073         (VideoFullscreenControllerContext::duration const):
2074         (VideoFullscreenControllerContext::currentTime const):
2075         (VideoFullscreenControllerContext::bufferedTime const):
2076         (VideoFullscreenControllerContext::isPlaying const):
2077         (VideoFullscreenControllerContext::playbackRate const):
2078         (VideoFullscreenControllerContext::seekableRanges const):
2079         (VideoFullscreenControllerContext::seekableTimeRangesLastModifiedTime const):
2080         (VideoFullscreenControllerContext::liveUpdateInterval const):
2081         (VideoFullscreenControllerContext::canPlayFastReverse const):
2082         (VideoFullscreenControllerContext::audioMediaSelectionOptions const):
2083         (VideoFullscreenControllerContext::audioMediaSelectedIndex const):
2084         (VideoFullscreenControllerContext::legibleMediaSelectionOptions const):
2085         (VideoFullscreenControllerContext::legibleMediaSelectedIndex const):
2086         (VideoFullscreenControllerContext::externalPlaybackEnabled const):
2087         (VideoFullscreenControllerContext::externalPlaybackTargetType const):
2088         (VideoFullscreenControllerContext::externalPlaybackLocalizedDeviceName const):
2089         (VideoFullscreenControllerContext::wirelessVideoPlaybackDisabled const):
2090         (VideoFullscreenControllerContext::setUpFullscreen):
2091         (VideoFullscreenControllerContext::exitFullscreen):
2092         (VideoFullscreenControllerContext::requestHideAndExitFullscreen):
2093         (-[WebVideoFullscreenController enterFullscreen:mode:]):
2094         (-[WebVideoFullscreenController exitFullscreen]):
2095         (-[WebVideoFullscreenController requestHideAndExitFullscreen]):
2096         * platform/ios/wak/WAKWindow.mm:
2097         (-[WAKWindow setVisible:]):
2098         (-[WAKWindow setScreenScale:]):
2099         (-[WAKWindow sendEvent:]):
2100         (-[WAKWindow sendMouseMoveEvent:contentChange:]):
2101         * platform/network/ios/NetworkStateNotifierIOS.mm:
2102         (WebCore::NetworkStateNotifier::startObserving):
2103         * rendering/RenderThemeIOS.mm:
2104         (WebCore::contentSizeCategoryDidChange):
2105
2106 2019-01-23  David Kilzer  <ddkilzer@apple.com>
2107
2108         REGRESSION (r240292): Attempt to fix WinCairo build
2109
2110         * platform/network/curl/CurlResourceHandleDelegate.cpp:
2111         (WebCore::handleCookieHeaders): Remove argument to
2112         NetworkingContext::storageSession().
2113
2114 2019-01-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2115
2116         Introduce UndoStep::label() and adopt it in WebKitLegacy and WebKit
2117         https://bugs.webkit.org/show_bug.cgi?id=193706
2118         <rdar://problem/44807048>
2119
2120         Reviewed by Ryosuke Niwa.
2121
2122         Refactors some existing logic when registering undoable actions, such that we propagate the undoable action's
2123         label string instead of the EditAction to the client layer. This will help make handling of CustomUndoStep's
2124         undo/redo label simpler, as the client layer won't need to worry about managing an EditAction and undo/redo
2125         label simultaneously. There should be no change in behavior.
2126
2127         * editing/CompositeEditCommand.cpp:
2128         (WebCore::EditCommandComposition::label const):
2129         * editing/CompositeEditCommand.h:
2130         * editing/CustomUndoStep.cpp:
2131         (WebCore::CustomUndoStep::label const):
2132         * editing/CustomUndoStep.h:
2133         * editing/EditAction.cpp:
2134         (WebCore::undoRedoLabel):
2135         (WebCore::nameForUndoRedo): Deleted.
2136         * editing/EditAction.h:
2137
2138         Rename nameForUndoRedo to undoRedoLabel, and remove the WEBCORE_EXPORT since it's no longer needed in WebKit or
2139         WebKitLegacy.
2140
2141         * editing/UndoStep.h:
2142
2143         Add UndoStep::label(). While EditCommandComposition implements this by mapping its EditAction to a
2144         localized string, CustomUndoStep implements this by returning the undoable action label provided by script.
2145
2146 2019-01-23  Michael Catanzaro  <mcatanzaro@igalia.com>
2147
2148         [SOUP] Clean up NetworkStorageSession
2149         https://bugs.webkit.org/show_bug.cgi?id=193707
2150
2151         Reviewed by Carlos Garcia Campos.
2152
2153         A NetworkStorageSession now always has a SoupNetworkSession, so we can remove a lot of
2154         complexity that is no longer needed. getOrCreateSoupNetworkSession can go away because we
2155         know the session has always already been created. The soupNetworkSession getter can now
2156         return a reference rather than a pointer, because it will never be NULL except after it has
2157         been cleared with clearSoupNetworkSession (renamed), and that should only happen immediately
2158         before process termination after nothing else is using it. Cookie jar syncing can also go
2159         away; the NetworkStorageSession can now rely on the SoupNetworkSession to exist and just
2160         use its cookie jar.
2161
2162         * platform/network/NetworkStorageSession.h:
2163         (WebCore::NetworkStorageSession::soupNetworkSession const): Deleted.
2164         * platform/network/soup/DNSResolveQueueSoup.cpp:
2165         (WebCore::DNSResolveQueueSoup::updateIsUsingProxy):
2166         (WebCore::DNSResolveQueueSoup::platformResolve):
2167         (WebCore::DNSResolveQueueSoup::resolve):
2168         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2169         (WebCore::NetworkStorageSession::NetworkStorageSession):
2170         (WebCore::NetworkStorageSession::~NetworkStorageSession):
2171         (WebCore::NetworkStorageSession::soupNetworkSession const):
2172         (WebCore::NetworkStorageSession::clearSoupNetworkSession):
2173         (WebCore::NetworkStorageSession::cookieStorage const):
2174         (WebCore::NetworkStorageSession::setCookieStorage):
2175         (WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession const): Deleted.
2176         (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage): Deleted.
2177         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
2178         (WebCore::SocketStreamHandleImpl::create):
2179
2180 2019-01-23  Zalan Bujtas  <zalan@apple.com>
2181
2182         [LFC][BFC] computeStaticPosition should include estimated computation as well.
2183         https://bugs.webkit.org/show_bug.cgi?id=193719
2184
2185         Reviewed by Antti Koivisto.
2186
2187         Consolidate all static position (non-estimated, estimated) computation in BlockFormattingContext::computeStaticPosition.
2188         It requires to compute width/horizontal margin first, since vertical top estimation needs valid horizontal widths (margin-top: 5% is computed using
2189         the containing block's width).
2190         This is also in preparation for moving 'clear' positioning to computeStaticPosition.
2191
2192         * layout/blockformatting/BlockFormattingContext.cpp:
2193         (WebCore::Layout::BlockFormattingContext::layout const):
2194         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2195         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
2196         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPosition const):
2197         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForAncestors const):
2198         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFormattingRoot const):
2199         (WebCore::Layout::BlockFormattingContext::computeEstimatedVerticalPositionForFloatClear const):
2200         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
2201         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
2202         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2203         (WebCore::Layout::BlockFormattingContext::adjustedVerticalPositionAfterMarginCollapsing const):
2204         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const): Deleted.
2205         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const): Deleted.
2206         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const): Deleted.
2207         * layout/blockformatting/BlockFormattingContext.h:
2208         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2209         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
2210         * layout/blockformatting/BlockMarginCollapse.cpp:
2211         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithFirstInFlowChildMarginBefore):
2212
2213 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
2214
2215         Compositing updates need to reparent scrolling tree nodes with a changed ancestor
2216         https://bugs.webkit.org/show_bug.cgi?id=193699
2217
2218         Reviewed by Frédéric Wang.
2219
2220         Now that compositing updates are incremental and may not do a full layer walk,
2221         we need to ensure that when a scrolling tree node is removed, we traverse to all
2222         descendant layers whose scrolling tree nodes refer to the removed node as their parent.
2223
2224         To achieve this, add a RenderLayer dirty bit for "NeedsScrollingTreeUpdate" which
2225         ensures that the updateBackingAndHierarchy part of the compositing update traverses
2226         layers with the bit set.
2227
2228         Adjust the compositing logging to make the legend easier to read.
2229
2230         Tests: scrollingcoordinator/reparent-across-compositing-layers.html
2231                scrollingcoordinator/reparent-with-layer-removal.html
2232
2233         * page/scrolling/AsyncScrollingCoordinator.cpp:
2234         (WebCore::AsyncScrollingCoordinator::childrenOfNode const):
2235         * page/scrolling/AsyncScrollingCoordinator.h:
2236         * page/scrolling/ScrollingCoordinator.h:
2237         (WebCore::ScrollingCoordinator::childrenOfNode const):
2238         * rendering/RenderLayer.cpp:
2239         (WebCore::outputPaintOrderTreeLegend):
2240         (WebCore::outputPaintOrderTreeRecursive):
2241         * rendering/RenderLayer.h:
2242         * rendering/RenderLayerCompositor.cpp:
2243         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
2244         (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
2245
2246 2019-01-23  Oriol Brufau  <obrufau@igalia.com>
2247
2248         [css-logical] Implement flow-relative inset properties
2249         https://bugs.webkit.org/show_bug.cgi?id=189441
2250
2251         Reviewed by Dean Jackson.
2252
2253         Implement 'inset', 'inset-block', 'inset-block-start', 'inset-block-end',
2254         'inset-inline', 'inset-inline-start' and 'inset-inline-end' CSS properties
2255         behind the CSSLogicalEnabled runtime flag.
2256
2257         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-inset.html
2258                webexposed/css-properties-behind-flags.html
2259
2260         * css/CSSComputedStyleDeclaration.cpp:
2261         (WebCore::isLayoutDependent):
2262         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2263         * css/CSSProperties.json:
2264         * css/CSSProperty.cpp:
2265         (WebCore::CSSProperty::resolveDirectionAwareProperty):
2266         (WebCore::CSSProperty::isDirectionAwareProperty):
2267         * css/StyleProperties.cpp:
2268         (WebCore::StyleProperties::getPropertyValue const):
2269         (WebCore::StyleProperties::asText const):
2270         * css/parser/CSSParserFastPaths.cpp:
2271         (WebCore::isSimpleLengthPropertyID):
2272         * css/parser/CSSPropertyParser.cpp:
2273         (WebCore::CSSPropertyParser::parseSingleValue):
2274         (WebCore::CSSPropertyParser::parseShorthand):
2275
2276 2019-01-23  Oriol Brufau  <obrufau@igalia.com>
2277
2278         [css-grid] Properly handle static positions of abspos inside grid items
2279         https://bugs.webkit.org/show_bug.cgi?id=193657
2280
2281         Reviewed by Javier Fernandez.
2282
2283         Rename findChildLogicalPosition to setLogicalPositionForChild and let it set the position.
2284         Add setLogicalOffsetForChild like setLogicalPositionForChild but just for one offset,
2285         and only if it's needed (not for abspos descentants in their static position).
2286         Add logicalOffsetForChild that finds the value to be set by the functions above.
2287         Rename existing logicalOffsetForChild to logicalOffsetForOutOfFlowChild.
2288
2289         Tests: imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-001.html
2290                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-002.html
2291                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-003.html
2292                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-004.html
2293                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-005.html
2294                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-006.html
2295                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-007.html
2296                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-008.html
2297                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-009.html
2298                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010.html
2299                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-011.html
2300                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-012.html
2301                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013.html
2302                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-014.html
2303                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015.html
2304                imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-016.html
2305                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-001.html
2306                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-002.html
2307                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-003.html
2308                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-004.html
2309                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-005.html
2310                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-006.html
2311                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-007.html
2312                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-008.html
2313                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-009.html
2314                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-010.html
2315                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-011.html
2316                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-012.html
2317                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-013.html
2318                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-014.html
2319                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-015.html
2320                imported/w3c/web-platform-tests/css/css-grid/abspos/positioned-grid-descendants-016.html
2321
2322         * rendering/RenderGrid.cpp:
2323         (WebCore::RenderGrid::layoutGridItems):
2324         (WebCore::RenderGrid::layoutPositionedObject):
2325         (WebCore::RenderGrid::logicalOffsetForOutOfFlowChild const):
2326         (WebCore::RenderGrid::gridAreaPositionForOutOfFlowChild const):
2327         (WebCore::RenderGrid::setLogicalPositionForChild const):
2328         (WebCore::RenderGrid::setLogicalOffsetForChild const):
2329         (WebCore::RenderGrid::logicalOffsetForChild const):
2330         * rendering/RenderGrid.h:
2331
2332 2019-01-23  Rob Buis  <rbuis@igalia.com>
2333
2334         Update MIME type parser
2335         https://bugs.webkit.org/show_bug.cgi?id=180526
2336
2337         Reviewed by Frédéric Wang.
2338
2339         Add an enum to allow two modes of MIME type parsing, one mode
2340         to keep supporting RFC2045 as before, and one mode to support
2341         the updated MIME parser from mimesniff [1]. Mimesniff support
2342         brings the following changes:
2343         - allows parameter names without matching =value.
2344         - skips whitespace after subtype, parameter value and before
2345           parameter name.
2346         - lower cases MIME type and parameter name.
2347         - parameter names parsed before are discarded.
2348
2349         The old mode is still used by CDM.cpp and MIMEHeader.cpp.
2350
2351         [1] https://mimesniff.spec.whatwg.org/
2352
2353         * Modules/encryptedmedia/CDM.cpp:
2354         (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
2355         * platform/network/MIMEHeader.cpp:
2356         (WebCore::MIMEHeader::parseHeader):
2357         * platform/network/ParsedContentType.cpp:
2358         (WebCore::DummyParsedContentType::setContentType const):
2359         (WebCore::DummyParsedContentType::setContentTypeParameter const):
2360         (WebCore::isQuotedStringTokenCharacter):
2361         (WebCore::isTokenCharacter):
2362         (WebCore::parseToken):
2363         (WebCore::containsNonTokenCharacters):
2364         (WebCore::parseQuotedString):
2365         (WebCore::isNotForwardSlash):
2366         (WebCore::isNotSemicolon):
2367         (WebCore::isNotSemicolonOrEqualSign):
2368         (WebCore::parseContentType):
2369         (WebCore::isValidContentType):
2370         (WebCore::ParsedContentType::ParsedContentType):
2371         (WebCore::ParsedContentType::setContentType):
2372         (WebCore::isNonTokenCharacter):
2373         (WebCore::isNonQuotedStringTokenCharacter):
2374         (WebCore::ParsedContentType::setContentTypeParameter):
2375         * platform/network/ParsedContentType.h:
2376
2377         Test: web-platform-tests/xhr/overridemimetype-blob.html
2378
2379 2019-01-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2380
2381         Introduce CustomUndoStep.h and CustomUndoStep.cpp
2382         https://bugs.webkit.org/show_bug.cgi?id=193704
2383         <rdar://problem/44807048>
2384
2385         Reviewed by Ryosuke Niwa.
2386
2387         This patch is more work in progress towards supporting `UndoManager.addItem()`. Here, we introduce a helper
2388         class, CustomUndoStep, that holds a weak reference to a script-defined UndoItem. See below for more details.
2389
2390         No change in behavior.
2391
2392         * Sources.txt:
2393         * WebCore.xcodeproj/project.pbxproj:
2394         * editing/CustomUndoStep.cpp:
2395         (WebCore::CustomUndoStep::CustomUndoStep):
2396
2397         Subclass UndoStep.
2398
2399         (WebCore::CustomUndoStep::unapply):
2400         (WebCore::CustomUndoStep::reapply):
2401
2402         If possible, invoke the UndoItem's undo and redo handlers.
2403
2404         (WebCore::CustomUndoStep::isValid const):
2405         * editing/CustomUndoStep.h:
2406         * editing/EditingStyle.cpp:
2407         * editing/InsertEditableImageCommand.cpp:
2408         (WebCore::InsertEditableImageCommand::doApply):
2409
2410         Unified build fixes.
2411
2412         * page/UndoItem.h:
2413
2414 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
2415
2416         Adding a child to a ScrollingStateNode needs to trigger a tree state commit
2417         https://bugs.webkit.org/show_bug.cgi?id=193682
2418
2419         Reviewed by Zalan Bujtas.
2420
2421         Scrolling tree mutations that re-arrange nodes (e.g. node reordering when z-index changes)
2422         need to trigger scrolling tree updates, and currently do not.
2423
2424         Fix by adding a "ChildNodes" dirty bit to ScrollingStateNode. There isn't any code that consults
2425         this flag when committing the scrolling tree because we always eagerly traverse children, but
2426         we could use it to optimize later. The important part is that we use it to trigger a tree update.
2427         
2428         Can't test via z-reordering until webkit.org/b/192529 is fixed.
2429
2430         Tests: scrollingcoordinator/gain-scrolling-node-parent.html
2431                scrollingcoordinator/lose-scrolling-node-parent.html
2432
2433         * page/scrolling/ScrollingStateNode.cpp:
2434         (WebCore::ScrollingStateNode::appendChild):
2435         (WebCore::ScrollingStateNode::insertChild):
2436         (WebCore::ScrollingStateNode::removeChildAtIndex):
2437         * page/scrolling/ScrollingStateNode.h:
2438         * page/scrolling/ScrollingStateTree.cpp:
2439         (WebCore::ScrollingStateTree::attachNode):
2440
2441 2019-01-22  Devin Rousso  <drousso@apple.com>
2442
2443         Web Inspector: InspectorInstrumentation::willEvaluateScript should include column number
2444         https://bugs.webkit.org/show_bug.cgi?id=116191
2445         <rdar://problem/13905910>
2446
2447         Reviewed by Joseph Pecoraro.
2448
2449         Test inspector/timeline/line-column.html
2450
2451         * bindings/js/ScriptController.cpp:
2452         (WebCore::ScriptController::evaluateInWorld):
2453         (WebCore::ScriptController::evaluateModule):
2454
2455         * bindings/js/JSExecStateInstrumentation.h:
2456         (WebCore::JSExecState::instrumentFunctionInternal):
2457
2458         * inspector/InspectorInstrumentation.h:
2459         (WebCore::InspectorInstrumentation::willCallFunction):
2460         (WebCore::InspectorInstrumentation::willEvaluateScript):
2461         * inspector/InspectorInstrumentation.cpp:
2462         (WebCore::InspectorInstrumentation::willCallFunctionImpl):
2463         (WebCore::InspectorInstrumentation::willEvaluateScriptImpl):
2464
2465         * inspector/agents/InspectorTimelineAgent.h:
2466         * inspector/agents/InspectorTimelineAgent.cpp:
2467         (WebCore::InspectorTimelineAgent::willCallFunction):
2468         (WebCore::InspectorTimelineAgent::willEvaluateScript):
2469
2470         * inspector/TimelineRecordFactory.h:
2471         * inspector/TimelineRecordFactory.cpp:
2472         (WebCore::TimelineRecordFactory::createFunctionCallData):
2473         (WebCore::TimelineRecordFactory::createEvaluateScriptData):
2474
2475         * bindings/js/ScriptSourceCode.h:
2476         (WebCore::ScriptSourceCode::startColumn const): Added.
2477
2478 2019-01-22  Devin Rousso  <drousso@apple.com>
2479
2480         Web Inspector: expose Audit and Recording versions to the frontend
2481         https://bugs.webkit.org/show_bug.cgi?id=193262
2482         <rdar://problem/47130684>
2483
2484         Reviewed by Joseph Pecoraro.
2485
2486         Tests: inspector/audit/version.html
2487                inspector/recording/version.html
2488
2489         * inspector/agents/InspectorCanvasAgent.cpp:
2490         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
2491
2492 2019-01-22  Wenson Hsieh  <wenson_hsieh@apple.com>
2493
2494         Add some bindings-related bookkeeping to UndoManager and UndoItem
2495         https://bugs.webkit.org/show_bug.cgi?id=193111
2496         <rdar://problem/44807048>
2497
2498         Reviewed by Ryosuke Niwa.
2499
2500         This patch is work in progress towards supporting `UndoManager.addItem()`. Here, we add helper methods to
2501         UndoItem and UndoManager which later patches will exercise, as well as introduce some custom bindings to
2502         properly handle the case where UndoItems are given anonymous JavaScript functions (see below for more details).
2503
2504         No new tests, because there is no script-observable change in behavior yet. When `addItems()` is hooked up, I
2505         will write a test to verify that the undo and redo JavaScript functions survive garbage collection.
2506
2507         * Sources.txt:
2508         * WebCore.xcodeproj/project.pbxproj:
2509         * bindings/js/JSUndoItemCustom.cpp:
2510         (WebCore::JSUndoItem::visitAdditionalChildren):
2511
2512         Have each JSUndoItem visit its undo and redo callback functions to ensure that the JavaScript wrapper objects
2513         for these functions are not garbage collected underneath the item.
2514
2515         (WebCore::JSUndoItemOwner::isReachableFromOpaqueRoots):
2516
2517         Consider the undo item wrapper reachable from opaque roots if it is associated with its UndoManager's Document.
2518         This ensures that if script isn't holding on to a reference to the wrapper (for instance, by calling
2519         `UndoManager.addItem(new UndoItem({ ... }))`), we still protect the corresponding JSUndoItem as long as the
2520         UndoManager's Document is alive. In the case where the undo item is not associated with a document, either (1)
2521         script is keeping a reference to it, in which case it will be trivially reachable, or (2) script won't be able
2522         to observe the destruction of the wrapper anyways (e.g. calling `new UndoItem({ ... })` by itself).
2523
2524         * dom/Document.cpp:
2525         (WebCore::Document::prepareForDestruction):
2526
2527         Invalidate all undo items when the document is about to go away.
2528
2529         * page/UndoItem.cpp:
2530         (WebCore::UndoItem::setUndoManager):
2531         (WebCore::UndoItem::invalidate):
2532         (WebCore::UndoItem::isValid const):
2533
2534         Add a few helpers, to be used in a future patch. We consider an UndoItem valid if it has been added to an
2535         UndoManager, and is thus associated with a document.
2536
2537         (WebCore::UndoItem::document const):
2538         * page/UndoItem.h:
2539         * page/UndoItem.idl:
2540         * page/UndoManager.cpp:
2541         (WebCore::UndoManager::UndoManager):
2542         (WebCore::UndoManager::addItem):
2543
2544         Have an UndoManager keep its UndoItems alive. These UndoItems remain in this set until either the document will
2545         be destroyed, or the corresponding undo action is no longer needed because the platform undo stack has changed
2546         (this latter behavior is yet to be implemented).
2547
2548         (WebCore::UndoManager::removeItem):
2549         (WebCore::UndoManager::removeAllItems):
2550         * page/UndoManager.h:
2551         (WebCore::UndoManager::UndoManager): Deleted.
2552         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2553
2554         Unified build fix.
2555
2556 2019-01-22  Fujii Hironori  <Hironori.Fujii@sony.com>
2557
2558         [WinCairo][WebKitTestRunner] Null dereference of GraphicsContext::m_data in GraphicsContext::releaseWindowsContext
2559         https://bugs.webkit.org/show_bug.cgi?id=193664
2560
2561         Reviewed by Brent Fulgham.
2562
2563         WinCairo WebKitTestRunner always crash on openning test cases of
2564         HTMLMeterElement.
2565
2566         If GraphicsContext::getWindowsContext retruned null HDC,
2567         LocalWindowsContext shouldn't release the null HDC.
2568
2569         Covered by existing tests.
2570
2571         * platform/graphics/win/LocalWindowsContext.h:
2572         (WebCore::LocalWindowsContext::~LocalWindowsContext):
2573         Release m_hdc only if it isn't null.
2574
2575 2019-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
2576
2577         Unreviewed, fix -Wsign-compare warning
2578         https://bugs.webkit.org/show_bug.cgi?id=188697
2579         <rdar://problem/46105624>
2580
2581         * css/StyleProperties.cpp:
2582         (WebCore::StyleProperties::asText const):
2583
2584 2019-01-22  Devin Rousso  <drousso@apple.com>
2585
2586         Web Inspector: Audit: provide a way to get related Accessibility properties for a given node
2587         https://bugs.webkit.org/show_bug.cgi?id=193227
2588         <rdar://problem/46787862>
2589
2590         Reviewed by Joseph Pecoraro.
2591
2592         Test: inspector/audit/run-accessibility.html
2593
2594         * inspector/InspectorAuditAccessibilityObject.idl:
2595         * inspector/InspectorAuditAccessibilityObject.h:
2596         * inspector/InspectorAuditAccessibilityObject.cpp:
2597         (WebCore::InspectorAuditAccessibilityObject::getComputedProperties): Added.
2598
2599 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
2600
2601         Remove an iOS quirk where iframe renderers are identified as "RenderPartObject" in layout test results
2602         https://bugs.webkit.org/show_bug.cgi?id=193692
2603
2604         Reviewed by Zalan Bujtas.
2605
2606         Remove the iOS-specific renderName() implementation.
2607
2608         * rendering/RenderIFrame.h:
2609
2610 2019-01-22  Said Abou-Hallawa  <sabouhallawa@apple.com>
2611
2612         Dynamic changes in the style attributes of an SVGElement do no affect the <use> instances
2613         https://bugs.webkit.org/show_bug.cgi?id=193647
2614
2615         Reviewed by Simon Fraser.
2616
2617         Changing a style attribute of an SVGELement needs to call invalidateInstances().
2618
2619         Tests: svg/custom/svg-use-style-dynamic-change-invalidate.svg
2620
2621         * svg/SVGElement.cpp:
2622         (WebCore::SVGElement::attributeChanged):
2623
2624 2019-01-22  Alex Christensen  <achristensen@webkit.org>
2625
2626         Fix more builds.
2627
2628         * platform/network/curl/CurlResourceHandleDelegate.cpp:
2629         (WebCore::handleCookieHeaders):
2630         (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
2631
2632 2019-01-22  Alex Christensen  <achristensen@webkit.org>
2633
2634         Fix some builds after r240292
2635         https://bugs.webkit.org/show_bug.cgi?id=193580
2636
2637         * platform/network/curl/ResourceHandleCurl.cpp:
2638         (WebCore::ResourceHandle::createCurlRequest):
2639         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2640         (WebCore::ResourceHandle::receivedCredential):
2641         (WebCore::ResourceHandle::getCredential):
2642
2643 2019-01-22  Alex Christensen  <achristensen@webkit.org>
2644
2645         Move NetworkStorageSession ownership to NetworkProcess
2646         https://bugs.webkit.org/show_bug.cgi?id=193580
2647
2648         Reviewed by Geoff Garen.
2649
2650         NetworkStorageSessions used to be owned by a process-global map living in WebCore.
2651         This patch moves the ownership to the WebKit/WebKitLegacy layer.
2652         In WebKitLegacy they are still owned by a process-global map for compatibility.
2653         In WebKit they are owned by a map owned by the NetworkProcess object.
2654         There were three non-NetworkProcess uses of NetworkStorageSessions which have been dealt with thusly:
2655         1. The WebProcess used to clear credentials from a NetworkStorageSession.  Since this was the only use
2656         of a NetworkStorageSession in the WebProcess we can conclude there were no credentials to clear,
2657         so this code was removed with no change in behavior.
2658         2. The WebProcess used NetworkStorageSessions to get persistent credentials.  This was turned
2659         into a static method that does the same thing.  We should audit these calls and decide if we really want them.
2660         3. The UIProcess used NetworkStorageSessions in APIHTTPCookieStore to interact with the default cookie
2661         storage on Cocoa platforms.  This has been replaced by functions that do the same thing directly.
2662
2663         * platform/network/CredentialStorage.h:
2664         * platform/network/NetworkStorageSession.cpp:
2665         (WebCore::NetworkStorageSession::processMayUseCookieAPI):
2666         (WebCore::NetworkStorageSession::globalSessionMap): Deleted.
2667         (WebCore::NetworkStorageSession::storageSession): Deleted.
2668         (WebCore::NetworkStorageSession::destroySession): Deleted.
2669         (WebCore::NetworkStorageSession::forEach): Deleted.
2670         * platform/network/NetworkStorageSession.h:
2671         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2672         (WebCore::NetworkStorageSession::createCFStorageSessionForIdentifier):
2673         (WebCore::createCFStorageSessionForIdentifier): Deleted.
2674         (WebCore::defaultNetworkStorageSession): Deleted.
2675         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
2676         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
2677         (WebCore::NetworkStorageSession::ensureSession): Deleted.
2678         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2679         (WebCore::SocketStreamHandleImpl::getStoredCONNECTProxyCredentials):
2680         * platform/network/cocoa/CookieStorageObserver.h:
2681         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2682         (WebCore::defaultSession): Deleted.
2683         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
2684         (WebCore::NetworkStorageSession::ensureSession): Deleted.
2685         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
2686         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2687         (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage):
2688         (WebCore::defaultSession): Deleted.
2689         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
2690         (WebCore::NetworkStorageSession::ensureSession): Deleted.
2691         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
2692
2693 2019-01-22  Devin Rousso  <drousso@apple.com>
2694
2695         Web Inspector: Audit: provide a way to get related Accessibility nodes for a given node
2696         https://bugs.webkit.org/show_bug.cgi?id=193225
2697         <rdar://problem/46799956>
2698
2699         Reviewed by Joseph Pecoraro.
2700
2701         Test: inspector/audit/run-accessibility.html
2702
2703         * inspector/InspectorAuditAccessibilityObject.idl:
2704         * inspector/InspectorAuditAccessibilityObject.h:
2705         * inspector/InspectorAuditAccessibilityObject.cpp:
2706         (WebCore::InspectorAuditAccessibilityObject::getActiveDescendant): Added.
2707         (WebCore::addChildren): Added.
2708         (WebCore::InspectorAuditAccessibilityObject::getChildNodes): Added.
2709         (WebCore::InspectorAuditAccessibilityObject::getControlledNodes): Added.
2710         (WebCore::InspectorAuditAccessibilityObject::getFlowedNodes): Added.
2711         (WebCore::InspectorAuditAccessibilityObject::getMouseEventNode): Added.
2712         (WebCore::InspectorAuditAccessibilityObject::getOwnedNodes): Added.
2713         (WebCore::InspectorAuditAccessibilityObject::getParentNode): Added.
2714         (WebCore::InspectorAuditAccessibilityObject::getSelectedChildNodes): Added.
2715
2716 2019-01-22  David Kilzer  <ddkilzer@apple.com>
2717
2718         Switch remaining QuickLook soft-linking in WebCore, WebKit over to QuickLookSoftLink.{cpp,h}
2719         <https://webkit.org/b/193654>
2720         <rdar://problem/47430290>
2721
2722         Reviewed by Alex Christensen.
2723
2724         - Moves QuickLookSoftLink.{h,mm} to PAL.
2725         - Adds soft-link to 3 classes to consolidate QuickLook.framework
2726           soft-linking.
2727         - Updates existing source to work with above changes.
2728
2729         * SourcesCocoa.txt:
2730         * UnifiedSources-input.xcfilelist:
2731         * WebCore.xcodeproj/project.pbxproj:
2732         - Remove QuickLookSoftLink.{h,mm} due to move to PAL.
2733
2734         * platform/ios/QuickLook.mm:
2735         (WebCore::QLPreviewGetSupportedMIMETypesSet):
2736         (WebCore::registerQLPreviewConverterIfNeeded):
2737         - Update for QuickLookSoftLink.{h,mm} move to PAL.
2738
2739         * platform/network/ios/PreviewConverter.mm:
2740         (WebCore::optionsWithPassword):
2741         (WebCore::PreviewConverter::PreviewConverter):
2742         - Switch to using QuickLookSoftLink.{h,mm} in PAL.
2743
2744         * platform/network/ios/WebCoreURLResponseIOS.mm:
2745         (WebCore::adjustMIMETypeIfNecessary):
2746         - Update for QuickLookSoftLink.{h,mm} move to PAL.
2747
2748 2019-01-22  Simon Fraser  <simon.fraser@apple.com>
2749
2750         Fix the position of layers nested inside of composited overflow-scroll
2751         https://bugs.webkit.org/show_bug.cgi?id=193642
2752
2753         Reviewed by Antti Koivisto and Sam Weinig.
2754
2755         Remove an iOS #ifdef so that layers inside composited overflow gets the correct
2756         positions on macOS too.
2757
2758         Test: compositing/geometry/fixed-inside-overflow-scroll.html
2759
2760         * rendering/RenderLayerBacking.cpp:
2761         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
2762
2763 2019-01-22  Claudio Saavedra  <csaavedra@igalia.com>
2764
2765         [GTK] Build fix for Ubuntu LTS 16.04
2766         https://bugs.webkit.org/show_bug.cgi?id=193672
2767
2768         Unreviewed build fix.
2769
2770         * html/canvas/CanvasStyle.h: Add default copy constructor for
2771         CMYKAColor struct.
2772
2773 2019-01-22  David Kilzer  <ddkilzer@apple.com>
2774
2775         Leak of NSMutableArray (128 bytes) in com.apple.WebKit.WebContent running WebKit layout tests
2776         <https://webkit.org/b/193673>
2777         <rdar://problem/47448241>
2778
2779         Reviewed by Dean Jackson.
2780
2781         * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm:
2782         (WebCore::appendArgumentToArray): Use adoptNS() to fix the leak.
2783
2784 2019-01-22  Zalan Bujtas  <zalan@apple.com>
2785
2786         [LFC][Floats] Decouple clearance computation and margin collapsing reset.
2787         https://bugs.webkit.org/show_bug.cgi?id=193670
2788
2789         Reviewed by Antti Koivisto.
2790
2791         Move margin collapsing reset logic from FloatingContext to BlockFormattingContext. It's the BlockFormattingContext's job to do.
2792         This is also in preparation for adding clear to static position.
2793
2794         * layout/FormattingContext.cpp:
2795         (WebCore::Layout::FormattingContext::mapTopToAncestor):
2796         (WebCore::Layout::FormattingContext::mapTopLeftToAncestor): Deleted.
2797         * layout/FormattingContext.h:
2798         * layout/blockformatting/BlockFormattingContext.cpp:
2799         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
2800         * layout/floats/FloatingContext.cpp:
2801         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2802         * layout/floats/FloatingContext.h:
2803
2804 2019-01-22  Frederic Wang  <fwang@igalia.com>
2805
2806         Minor refactoring of the scrolling code
2807         https://bugs.webkit.org/show_bug.cgi?id=192398
2808
2809         Unreviewed build fix.
2810
2811         * page/scrolling/ScrollingTreeScrollingNode.cpp: Add missing header.
2812
2813 2019-01-22  Oriol Brufau  <obrufau@igalia.com>
2814
2815         [css-logical] Implement flow-relative margin, padding and border shorthands
2816         https://bugs.webkit.org/show_bug.cgi?id=188697
2817
2818         Reviewed by Simon Fraser and Antti Koivisto.
2819
2820         Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
2821                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
2822                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
2823                imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
2824                imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
2825                imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
2826                webexposed/css-properties-behind-flags.html
2827
2828         * css/CSSComputedStyleDeclaration.cpp:
2829         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
2830         Allow the new properties to serialize their computed value.
2831
2832         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand):
2833         (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand):
2834         * css/CSSComputedStyleDeclaration.h:
2835         Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand,
2836         and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided
2837         shorthands.
2838
2839         * css/CSSProperties.json:
2840         Add the new properties behind the CSSLogicalEnabled runtime flag.
2841
2842         * css/CSSStyleDeclaration.cpp:
2843         (WebCore::CSSStyleDeclaration::supportedPropertyNames const):
2844         Prevent CSS properties disabled behind a runtime flag from being exposed in
2845         style declarations.
2846
2847         * css/StyleProperties.cpp:
2848         (WebCore::StyleProperties::getPropertyValue const):
2849         Allow the new properties to serialize their specified value.
2850
2851         (WebCore::StyleProperties::get2Values const):
2852         Add get2Values, analogous to get4Values, for serializing 2-sided shorthands.
2853
2854         (WebCore::StyleProperties::borderPropertyValue const):
2855         Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands
2856         corresponding to width, style and color.
2857
2858         (WebCore::MutableStyleProperties::setProperty):
2859         Prevent CSS properties disabled behind a runtime flag from being set a value.
2860
2861         (WebCore::StyleProperties::asText const):
2862         Allow the new properties to be serialized in cssText.
2863         Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText,
2864         and serialize the longhands instead. Note that there could be another shorthand
2865         available which is enabled, but a proper solution would require bug 190496.
2866
2867         * css/StyleProperties.h:
2868         Update declarations of borderPropertyValue and get2Values.
2869
2870         * css/makeprop.pl:
2871         (addProperty):
2872         Add isEnabledCSSProperty function for checking that a CSS property is not
2873         disabled behind a runtime flag.
2874
2875         * css/parser/CSSPropertyParser.cpp:
2876         (WebCore::cssPropertyID):
2877         Prevent CSS properties disabled behind a runtime flag from being exposed in
2878         computed styles.
2879
2880         (WebCore::CSSPropertyParser::addProperty):
2881         Prevent CSS properties disabled behind a runtime flag from being set a value.
2882
2883         (WebCore::CSSPropertyParser::consumeBorder):
2884         Change consumeBorder to provide the caller with the parsed values instead of
2885         setting properties. Then the caller can decide to which properties the values
2886         should be set, and whether border-image should be reset or not.
2887
2888         (WebCore::CSSPropertyParser::consume2ValueShorthand):
2889         (WebCore::CSSPropertyParser::consume4ValueShorthand):
2890         Rename consume4Values to consume4ValueShorthand, and add analogous
2891         consume2ValueShorthand for parsing shorthands with two longhands.
2892
2893         (WebCore::CSSPropertyParser::parseShorthand):
2894         Allow the new properties to be parsed.
2895
2896         * css/parser/CSSPropertyParser.h:
2897         Update declarations of consumeBorder, consume2ValueShorthand and
2898         consume4ValueShorthand.
2899
2900         * inspector/agents/InspectorCSSAgent.cpp:
2901         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
2902         Prevent CSS properties disabled behind a runtime flag from being exposed in
2903         the CSS inspector tool.
2904
2905         * page/RuntimeEnabledFeatures.h:
2906         (WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled):
2907         (WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const):
2908         Add the CSSLogicalEnabled runtime flag.
2909
2910 2019-01-21  Antti Koivisto  <antti@apple.com>
2911
2912         [iOS] Handle hit testing for subframes
2913         https://bugs.webkit.org/show_bug.cgi?id=192303
2914
2915         Reviewed by Frédéric Wang.
2916
2917         Don't set delegatesScrolling bit for subframes on iOS. It is meant for top level application
2918         controlled scrolling. This fixes coordinate conversions for subframes and makes events work.
2919
2920         Test by Frederic Wang.
2921
2922         Test: fast/scrolling/ios/hit-testing-iframe.html
2923
2924         * platform/ScrollView.cpp:
2925         (WebCore::ScrollView::managesScrollbars const):
2926
2927         Add a function that tells if the scrollview should deal with scrollbars at all
2928         This is always false on iOS and not connected to delegatesScrolling bit.
2929
2930         (WebCore::ScrollView::updateScrollbars):
2931         * platform/ScrollView.h:
2932         * rendering/RenderLayerCompositor.cpp:
2933         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls const):
2934
2935 2019-01-21  Brent Fulgham  <bfulgham@apple.com>
2936
2937         Implement message handlers for NetworkProcess-based ResourceLoadStatistics
2938         https://bugs.webkit.org/show_bug.cgi?id=193556
2939         <rdar://problem/47368501>
2940
2941         Reviewed by Alex Christensen.
2942
2943         This patch adds a new observer callback used to message the NetworkProcess when
2944         user interaction events are received. This is needed when the ResourceLoadStatistics
2945         data is not being managed by the UIProcess.
2946
2947         Tested by existing ResourceLoadStatistics and storageAccess tests.
2948
2949         * loader/ResourceLoadObserver.cpp:
2950         (WebCore::ResourceLoadObserver::setLogUserInteractionNotificationCallback):
2951         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2952         * loader/ResourceLoadObserver.h:
2953         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2954         (WebCore::NetworkStorageSession::setCookiesFromDOM):
2955
2956 2019-01-21  Zalan Bujtas  <zalan@apple.com>
2957
2958         [LFC][Floats] Take float top position into account when computing containing block height.
2959         https://bugs.webkit.org/show_bug.cgi?id=193655
2960
2961         Reviewed by Antti Koivisto.
2962
2963         When computing the containing block height, we take the first in-flow child's top position and use it as the base position.
2964         However when the first in-flow child clears a previous sibling, its vertical position is not necessarily the correct base for
2965         computing the containing block's height. Let's take the relevant floats into account as well.
2966
2967         Test: fast/block/float/float-first-child-and-clear-sibling.html
2968
2969         * layout/FormattingContextGeometry.cpp:
2970         (WebCore::Layout::contentHeightForFormattingContextRoot):
2971         * layout/floats/FloatingContext.cpp:
2972         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2973         * layout/floats/FloatingState.cpp:
2974         (WebCore::Layout::FloatingState::top const):
2975         * layout/floats/FloatingState.h:
2976
2977 2019-01-21  David Kilzer  <ddkilzer@apple.com>
2978
2979         REGRESSION (r240237): Revert changes to WebCore Xcode project
2980
2981         * WebCore.xcodeproj/project.pbxproj: Revert changes that were
2982         fixed in r240135.  Darin's patch must have been made prior to
2983         r240135.
2984
2985 2019-01-21  David Kilzer  <ddkilzer@apple.com>
2986
2987         REGRESSION (r240201): Add a POINTER_EVENTS feature flag
2988         https://bugs.webkit.org/show_bug.cgi?id=193577
2989         <rdar://problem/47408511>
2990
2991         * dom/ios/PointerEventIOS.cpp: Add ENABLE(POINTER_EVENTS) macro
2992         to fix tvOS & watchOS builds.
2993
2994 2019-01-15  Darin Adler  <darin@apple.com>
2995
2996         Use references rather than pointers for register/unregister functions, and more
2997         https://bugs.webkit.org/show_bug.cgi?id=175028
2998
2999         Reviewed by Daniel Bates.
3000
3001         * Modules/applepay/ApplePaySession.cpp:
3002         (WebCore::ApplePaySession::begin): Pass a reference.
3003         (WebCore::ApplePaySession::completePayment): Ditto.
3004         (WebCore::ApplePaySession::didReachFinalState): Ditto.
3005         * Modules/cache/DOMCache.cpp:
3006         (WebCore::DOMCache::retrieveRecords): Ditto.
3007         (WebCore::DOMCache::batchDeleteOperation): Ditto.
3008         (WebCore::DOMCache::batchPutOperation): Ditto.
3009         * Modules/cache/DOMCacheStorage.cpp:
3010         (WebCore::DOMCacheStorage::match): Ditto.
3011         * Modules/fetch/FetchBodyOwner.cpp:
3012         (WebCore::FetchBodyOwner::loadBlob): Ditto.
3013         (WebCore::FetchBodyOwner::finishBlobLoading): Ditto.
3014         * Modules/fetch/FetchBodySource.cpp:
3015         (WebCore::FetchBodySource::setActive): Ditto.
3016         (WebCore::FetchBodySource::setInactive): Ditto.
3017         * Modules/fetch/FetchResponse.cpp:
3018         (WebCore::FetchResponse::BodyLoader::BodyLoader): Ditto.
3019         (WebCore::FetchResponse::BodyLoader::~BodyLoader): Ditto.
3020         * Modules/mediasource/MediaSource.cpp:
3021         (WebCore::MediaSource::addedToRegistry): Ditto.
3022         (WebCore::MediaSource::removedFromRegistry): Ditto.
3023         * Modules/mediastream/MediaStream.cpp:
3024         (WebCore::MediaStream::~MediaStream): Ditto.
3025         (WebCore::MediaStream::startProducingData): Ditto.
3026         * Modules/mediastream/MediaStreamTrack.cpp:
3027         (WebCore::MediaStreamTrack::MediaStreamTrack): Ditto.
3028         (WebCore::MediaStreamTrack::~MediaStreamTrack): Ditto.
3029         * Modules/mediastream/RTCDataChannel.cpp:
3030         (WebCore::RTCDataChannel::create): Ditto.
3031         (WebCore::RTCDataChannel::close): Ditto.
3032         * Modules/mediastream/RTCPeerConnection.cpp:
3033         (WebCore::RTCPeerConnection::create): Use auto.
3034         * Modules/notifications/Notification.cpp:
3035         (WebCore::Notification::show): Pass a reference.
3036         (WebCore::Notification::finalize): Ditto.
3037         * Modules/webaudio/AudioBasicInspectorNode.cpp:
3038         (WebCore::AudioBasicInspectorNode::updatePullStatus): Ditto.
3039
3040         * Modules/webaudio/AudioContext.cpp:
3041         (WebCore::AudioContext::constructCommon): Ditto.
3042         (WebCore::AudioContext::lazyInitialize): Ditto.
3043         (WebCore::AudioContext::clear): Ditto.
3044         (WebCore::AudioContext::uninitialize): Ditto.
3045         (WebCore::AudioContext::markForDeletion): Take a reference.
3046         (WebCore::AudioContext::addAutomaticPullNode): Ditto.
3047         (WebCore::AudioContext::removeAutomaticPullNode): Ditto.
3048         (WebCore::AudioContext::willBeginPlayback): Pass a reference.
3049         (WebCore::AudioContext::willPausePlayback): Ditto.
3050         * Modules/webaudio/AudioContext.h: Update above functions to take
3051         references rather than pointers.
3052
3053         * Modules/webaudio/AudioNode.cpp:
3054         (WebCore::AudioNode::finishDeref): Pass a reference.
3055         * Modules/websockets/WebSocket.cpp:
3056         (WebCore::WebSocket::connect): Ditto.
3057         (WebCore::WebSocket::stop): Ditto.
3058         (WebCore::WebSocket::didClose): Ditto.
3059
3060         * WebCore.xcodeproj/project.pbxproj: Allowed Xcode to update this file.
3061
3062         * bindings/js/JSDOMWindowBase.cpp:
3063         (WebCore::JSDOMWindowBase::moduleLoaderResolve): Update since
3064         moduleLoader is now a reference.
3065         (WebCore::JSDOMWindowBase::moduleLoaderFetch): Ditto.
3066         (WebCore::JSDOMWindowBase::moduleLoaderEvaluate): Ditto.
3067         (WebCore::JSDOMWindowBase::moduleLoaderImportModule): Ditto.
3068         (WebCore::JSDOMWindowBase::moduleLoaderCreateImportMetaProperties): Ditto.
3069
3070         * dom/ActiveDOMObject.h:
3071         (WebCore::ActiveDOMObject::setPendingActivity): Take a reference.
3072         (WebCore::ActiveDOMObject::unsetPendingActivity): Ditto.
3073
3074         * dom/CharacterData.cpp:
3075         (WebCore::CharacterData::setData): Pass a reference.
3076         (WebCore::CharacterData::insertData): Ditto.
3077         (WebCore::CharacterData::deleteData): Ditto.
3078         (WebCore::CharacterData::replaceData): Ditto.
3079
3080         * dom/Document.cpp:
3081         (WebCore::Document::getElementByAccessKey): Pass a reference.
3082         (WebCore::Document::buildAccessKeyMap): Take a reference.
3083         (WebCore::Document::registerForVisibilityStateChangedCallbacks): Ditto.
3084         (WebCore::Document::unregisterForVisibilityStateChangedCallbacks): Ditto.
3085         (WebCore::Document::addAudioProducer): Ditto.
3086         (WebCore::Document::removeAudioProducer): Ditto.
3087         (WebCore::Document::hoveredElementDidDetach): Ditto.
3088         (WebCore::Document::elementInActiveChainDidDetach): Ditto.
3089         (WebCore::Document::attachNodeIterator): Ditto.
3090         (WebCore::Document::detachNodeIterator): Ditto.
3091         (WebCore::Document::moveNodeIteratorsToNewDocumentSlowCase): Pass
3092         a reference.
3093         (WebCore::Document::nodeChildrenWillBeRemoved): Ditto.
3094         (WebCore::Document::nodeWillBeRemoved): Ditto.
3095         (WebCore::Document::textInserted): Take a reference.
3096         (WebCore::Document::textRemoved): Ditto.
3097         (WebCore::Document::textNodesMerged): Ditto.
3098         (WebCore::Document::textNodeSplit): Ditto.
3099         (WebCore::Document::takeDOMWindowFrom): Ditto.
3100         (WebCore::Document::registerForDocumentSuspensionCallbacks): Ditto.
3101         (WebCore::Document::unregisterForDocumentSuspensionCallbacks): Ditto.
3102         (WebCore::Document::registerForMediaVolumeCallbacks): Ditto.
3103         (WebCore::Document::unregisterForMediaVolumeCallbacks): Ditto.
3104         (WebCore::Document::registerForPrivateBrowsingStateChangedCallbacks): Ditto.
3105         (WebCore::Document::unregisterForPrivateBrowsingStateChangedCallbacks): Ditto.
3106         (WebCore::Document::registerForCaptionPreferencesChangedCallbacks): Ditto.
3107         (WebCore::Document::unregisterForCaptionPreferencesChangedCallbacks): Ditto.
3108         (WebCore::Document::registerForPageScaleFactorChangedCallbacks): Ditto.
3109         (WebCore::Document::unregisterForPageScaleFactorChangedCallbacks): Ditto.
3110         (WebCore::Document::finishedParsing): Use a reference.
3111         (WebCore::Document::attachRange): Take a reference.
3112         (WebCore::Document::detachRange): Ditto.
3113         (WebCore::Document::suspendScheduledTasks): Use a reference.
3114         (WebCore::Document::resumeScheduledTasks): Ditto.
3115         (WebCore::Document::addMediaCanStartListener): Take a reference.
3116         (WebCore::Document::removeMediaCanStartListener): Ditto.
3117         (WebCore::Document::deviceMotionController const): Return a reference.
3118         (WebCore::Document::deviceOrientationController const): Ditto.
3119         (WebCore::Document::simulateDeviceOrientationChange): Use a reference.
3120         (WebCore::Document::fullScreenIsAllowedForElement const): Take a reference.
3121         (WebCore::Document::requestFullScreenForElement): Pass a reference.
3122         (WebCore::Document::webkitExitFullscreen): Ditto.
3123         (WebCore::Document::webkitWillEnterFullScreen): Renamed to remove the
3124         "ForElement" from the function name. Take a reference rather than a pointer.
3125         (WebCore::Document::webkitDidEnterFullScreen): Renamed to remove the
3126         "ForElement" from the function name and removed the unused element argument.
3127         (WebCore::Document::webkitWillExitFullScreen): Ditto.
3128         (WebCore::Document::webkitDidExitFullScreen): Ditto.
3129         (WebCore::Document::pushFullscreenElementStack): Take a reference.
3130         (WebCore::Document::addDocumentToFullScreenChangeEventQueue): Ditto.
3131         (WebCore::DocumentParserYieldToken::DocumentParserYieldToken): Use a reference.
3132         (WebCore::DocumentParserYieldToken::~DocumentParserYieldToken): Ditto.
3133         (WebCore::Document::updateHoverActiveState): Updated name of isInActiveChain.
3134
3135         * dom/Document.h: Updated argument types as described above. Changed a couple
3136         of inline functions to return references.
3137
3138         * dom/DocumentMarkerController.cpp:
3139         (WebCore::DocumentMarkerController::addMarker): Take a reference.
3140         (WebCore::DocumentMarkerController::addMarkerToNode): Ditto.
3141         (WebCore::DocumentMarkerController::addTextMatchMarker): Ditto.
3142         (WebCore::DocumentMarkerController::addDictationPhraseWithAlternativesMarker): Ditto.
3143         (WebCore::DocumentMarkerController::addDictationResultMarker): Ditto.
3144         (WebCore::DocumentMarkerController::addDraggedContentMarker): Ditto.
3145         (WebCore::DocumentMarkerController::removeMarkers): Ditto.
3146         (WebCore::DocumentMarkerController::copyMarkers): Ditto.
3147         (WebCore::DocumentMarkerController::shiftMarkers): Ditto.
3148         (WebCore::DocumentMarkerController::setMarkersActive): DItto.
3149         * dom/DocumentMarkerController.h: Updated argument types as described above.
3150
3151         * dom/Element.cpp:
3152         (WebCore::Element::~Element): Pass a reference.
3153         (WebCore::Element::isUserActionElementInActiveChain const): Updated name of
3154         isInActiveChain.
3155         (WebCore::Element::hasEquivalentAttributes const): Take a reference.
3156         (WebCore::Element::removedFromAncestor): Pass a reference.
3157         (WebCore::Element::clearHoverAndActiveStatusBeforeDetachingRenderer):
3158         Pass a reference and updated name of isInActiveChain.
3159
3160         * dom/Element.h: Renamed inActiveChain to isInActiveChain, updated argument
3161         types to be references, and removed unneeded friend declaration and made
3162         SynchronizationOfLazyAttribute private.
3163
3164         * dom/Node.cpp:
3165         (WebCore::Node::normalize): Pass a reference.
3166         (WebCore::Node::isEqualNode const): Ditto.
3167         * dom/NodeIterator.cpp:
3168         (WebCore::NodeIterator::NodeIterator): Ditto.
3169         (WebCore::NodeIterator::~NodeIterator): Ditto.
3170
3171         * dom/RadioButtonGroups.cpp:
3172         (WebCore::RadioButtonGroup::add): Take a reference.
3173         (WebCore::RadioButtonGroup::updateCheckedState): Ditto.
3174         (WebCore::RadioButtonGroup::remove): Ditto.
3175         (WebCore::RadioButtonGroup::contains const): Ditto.
3176         (WebCore::RadioButtonGroups::addButton): Ditto.
3177         (WebCore::RadioButtonGroups::updateCheckedState): Ditto.
3178         (WebCore::RadioButtonGroups::hasCheckedButton const): Ditto.
3179         (WebCore::RadioButtonGroups::isInRequiredGroup const): Ditto.
3180         (WebCore::RadioButtonGroups::removeButton): Ditto.
3181         * dom/RadioButtonGroups.h: Updated argument types.
3182
3183         * dom/Range.cpp:
3184         (WebCore::Range::Range): Pass a reference.
3185         (WebCore::Range::~Range): Ditto.
3186         (WebCore::Range::setDocument): Ditto.
3187         (WebCore::Range::createContextualFragment): Ditto.
3188         (WebCore::boundaryTextInserted): Ditto.
3189         (WebCore::Range::textInserted): Ditto.
3190         (WebCore::boundaryTextRemoved): Ditto.
3191         (WebCore::Range::textRemoved): Ditto.
3192         (WebCore::boundaryTextNodesSplit): Ditto.
3193         (WebCore::Range::textNodeSplit): Ditto.
3194         * dom/Range.h: Take references instead of pointers.
3195
3196         * dom/ScriptElement.cpp:
3197         (WebCore::ScriptElement::prepareScript): Use reference.
3198
3199         * dom/Text.cpp:
3200         (WebCore::Text::splitText): Pass reference.
3201
3202         * dom/UserActionElementSet.h: Renamed inActiveChain to isInActiveChain to
3203         match the naming scheme of the other similar functions, like isActive.
3204
3205         * editing/AlternativeTextController.cpp:
3206         (WebCore::AlternativeTextController::applyAlternativeTextToRange):
3207         Pass a reference.
3208         (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): Ditto.
3209         (WebCore::AlternativeTextController::handleAlternativeTextUIResult): Ditto.
3210         (WebCore::AlternativeTextController::respondToUnappliedEditing): Ditto.
3211         (WebCore::AlternativeTextController::markReversed): Ditto.
3212         (WebCore::AlternativeTextController::markCorrection): Ditto.
3213         (WebCore::AlternativeTextController::recordSpellcheckerResponseForModifiedCorrection): Ditto.
3214         (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand): Ditto.
3215         * editing/CompositeEditCommand.cpp:
3216         (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): Ditto.
3217         * editing/DictationCommand.cpp: Ditto.
3218         * editing/Editing.cpp:
3219         (WebCore::areIdenticalElements): Ditto.
3220         * editing/Editor.cpp:
3221         (WebCore::Editor::ignoreSpelling): Ditto.
3222         (WebCore::Editor::learnSpelling): Ditto.
3223         (WebCore::Editor::advanceToNextMisspelling): Ditto.
3224         (WebCore::Editor::clearMisspellingsAndBadGrammar): Ditto.
3225         (WebCore::Editor::markMisspellingsAfterTypingToWord): Ditto.
3226         (WebCore::Editor::markAndReplaceFor): Ditto.
3227         (WebCore::Editor::changeBackToReplacedString): Ditto.
3228         (WebCore::Editor::updateMarkersForWordsAffectedByEditing): Ditto.
3229         (WebCore::Editor::countMatchesForText): Ditto.
3230         (WebCore::Editor::scanRangeForTelephoneNumbers): Ditto.
3231         (WebCore::Editor::editorUIUpdateTimerFired): Ditto.
3232         (WebCore::Editor::handleAcceptedCandidate): Ditto.
3233
3234         * editing/InsertTextCommand.cpp:
3235         (WebCore::InsertTextCommand::doApply): Pass a reference.
3236         * editing/InsertTextCommand.h: Take a reference.
3237
3238         * editing/SpellChecker.cpp:
3239         (WebCore::SpellChecker::didCheckSucceed): Pass a reference.
3240         * editing/SplitTextNodeCommand.cpp:
3241         (WebCore::SplitTextNodeCommand::doApply): Ditto.
3242         (WebCore::SplitTextNodeCommand::doUnapply): Ditto.
3243         * editing/TextCheckingHelper.cpp:
3244         (WebCore::TextCheckingHelper::findFirstMisspelling): Pass a reference.
3245         (WebCore::TextCheckingHelper::findFirstGrammarDetail const): Ditto.
3246         * editing/ios/DictationCommandIOS.cpp:
3247         (WebCore::DictationCommandIOS::doApply): Ditto.
3248         Also added a comment about a possible missing null check; behavior should
3249         be no different than before, but using a reference helps make clear there
3250         was never any null check.
3251         * editing/ios/EditorIOS.mm:
3252         (WebCore::Editor::setDictationPhrasesAsChildOfElement): Ditto.
3253         * fileapi/FileReader.cpp:
3254         (WebCore::FileReader::readInternal): Ditto.
3255         (WebCore::FileReader::abort): Ditto.
3256         (WebCore::FileReader::didFinishLoading): Ditto.
3257         (WebCore::FileReader::didFail): Ditto.
3258
3259         * html/HTMLAppletElement.cpp: Removed unneeded include of HTMLDocument.h.
3260         There's very little left that is truly specific to HTMLDocument vs. Document.
3261
3262         * html/HTMLDocument.h:
3263         (WebCore::HTMLDocument::create): Take a reference.
3264         (WebCore::HTMLDocument::createSynthesizedDocument): Ditto.
3265
3266         * html/HTMLFormElement.cpp:
3267         (WebCore::HTMLFormElement::~HTMLFormElement): Pass a reference.
3268         (WebCore::HTMLFormElement::parseAttribute): Ditto.
3269         (WebCore::HTMLFormElement::didMoveToNewDocument): Ditto.
3270
3271         * html/HTMLIFrameElement.cpp: Removed unneeded include of HTMLDocument.h.
3272
3273         * html/HTMLInputElement.cpp:
3274         (WebCore::HTMLInputElement::~HTMLInputElement): Pass a reference.
3275         (WebCore::HTMLInputElement::setChecked): Ditto.
3276         (WebCore::HTMLInputElement::registerForSuspensionCallbackIfNeeded): Ditto.
3277         (WebCore::HTMLInputElement::unregisterForSuspensionCallbackIfNeeded): Ditto.
3278         (WebCore::HTMLInputElement::didMoveToNewDocument): Ditto.
3279         (WebCore::HTMLInputElement::isInRequiredRadioButtonGroup): Ditto.
3280         (WebCore::HTMLInputElement::addToRadioButtonGroup): Ditto.
3281         (WebCore::HTMLInputElement::removeFromRadioButtonGroup): Ditto.
3282         * html/HTMLMediaElement.cpp:
3283         (WebCore::HTMLMediaElement::registerWithDocument): Ditto.
3284         (WebCore::HTMLMediaElement::unregisterWithDocument): Ditto.
3285         (WebCore::HTMLMediaElement::selectMediaResource): Ditto.
3286         (WebCore::HTMLMediaElement::addTextTrack): Ditto.
3287         (WebCore::HTMLMediaElement::clearMediaPlayer): Ditto.
3288         (WebCore::HTMLMediaElement::resume): Ditto.
3289         (WebCore::HTMLMediaElement::setMediaControlsDependOnPageScaleFactor): Ditto.
3290
3291         * html/HTMLNameCollection.cpp: Removed unneeded include of HTMLDocument.h.
3292
3293         * html/HTMLPlugInImageElement.cpp:
3294         (WebCore::HTMLPlugInImageElement::~HTMLPlugInImageElement): Pass a reference.
3295         (WebCore::HTMLPlugInImageElement::createElementRenderer): Ditto.
3296         (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Ditto.
3297
3298         * html/HTMLSourceElement.cpp: Removed unneeded include of HTMLDocument.h.
3299         * html/HTMLTemplateElement.cpp: Ditto.
3300
3301         * html/RadioInputType.cpp:
3302         (WebCore::RadioInputType::matchesIndeterminatePseudoClass const):
3303         Pass a reference.
3304         * loader/DocumentWriter.cpp:
3305         (WebCore::DocumentWriter::begin): Ditto.
3306         * page/DOMWindow.cpp:
3307         (WebCore::DOMWindow::addEventListener): Ditto.
3308         (WebCore::DOMWindow::removeEventListener): Ditto.
3309         (WebCore::DOMWindow::removeAllEventListeners): Ditto.
3310
3311         * page/EventHandler.cpp:
3312         (WebCore::EventHandler::didStartDrag): Use a reference.
3313
3314         * page/EventSource.cpp:
3315         (WebCore::EventSource::create): Pass reference.
3316         (WebCore::EventSource::networkRequestEnded): Ditto.
3317         (WebCore::EventSource::close): Ditto.
3318         (WebCore::EventSource::abortConnectionAttempt): Ditto.
3319
3320         * page/Frame.cpp: Removed unneeded include of HTMLDocument.h.
3321         * page/FrameView.cpp: Ditto.
3322         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const): Use reference.
3323
3324         * page/animation/AnimationBase.cpp:
3325         (WebCore::AnimationBase::updateStateMachine): Pass reference.
3326
3327         * page/animation/CSSAnimationController.cpp:
3328         (WebCore::CSSAnimationControllerPrivate::addToAnimationsWaitingForStyle): Take reference.
3329         (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsWaitingForStyle): Ditto.
3330         (WebCore::CSSAnimationControllerPrivate::addToAnimationsWaitingForStartTimeResponse): Ditto.
3331         (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsWaitingForStartTimeResponse): Ditto.
3332         (WebCore::CSSAnimationControllerPrivate::animationWillBeRemoved): Ditto.
3333         * page/animation/CSSAnimationControllerPrivate.h: Ditto.
3334
3335         * page/animation/CompositeAnimation.cpp:
3336         (WebCore::CompositeAnimation::clearElement): Pass reference.
3337         (WebCore::CompositeAnimation::updateTransitions): Ditto.
3338         (WebCore::CompositeAnimation::updateKeyframeAnimations): Ditto.
3339         * page/ios/FrameIOS.mm:
3340         (WebCore::Frame::initWithSimpleHTMLDocument): Ditto.
3341
3342         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3343         (WebCore::layerContentsFormat): Add ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END so
3344         I can continue to compile with latest headers.
3345
3346         * rendering/CSSFilter.cpp:
3347         (WebCore::CSSFilter::buildReferenceFilter): Pass reference, small coding style
3348         tweaks as well.
3349
3350         * rendering/svg/RenderSVGResource.cpp:
3351         (WebCore::removeFromCacheAndInvalidateDependencies): Pass reference.
3352         * rendering/svg/RenderSVGResourceContainer.cpp:
3353         (WebCore::RenderSVGResourceContainer::registerResource): Ditto.
3354         * rendering/svg/SVGResources.cpp:
3355         (WebCore::registerPendingResource): Ditto.
3356         * rendering/svg/SVGResourcesCache.cpp:
3357         (WebCore::SVGResourcesCache::resourceDestroyed): Ditto.
3358
3359         * svg/SVGDocumentExtensions.cpp:
3360         (WebCore::SVGDocumentExtensions::addTimeContainer): Take reference.
3361         (WebCore::SVGDocumentExtensions::removeTimeContainer): Ditto.
3362         (WebCore::SVGDocumentExtensions::addResource): Ditto.
3363         (WebCore::SVGDocumentExtensions::addPendingResource): Ditto.
3364         (WebCore::SVGDocumentExtensions::isElementWithPendingResources const): Ditto.
3365         (WebCore::SVGDocumentExtensions::isPendingResource const): Ditto.
3366         (WebCore::SVGDocumentExtensions::clearHasPendingResourcesIfPossible): Ditto.
3367         (WebCore::SVGDocumentExtensions::removeElementFromPendingResources): Ditto.
3368         (WebCore::SVGDocumentExtensions::setOfElementsReferencingTarget): Ditto.
3369         (WebCore::SVGDocumentExtensions::addElementReferencingTarget): Ditto.
3370         (WebCore::SVGDocumentExtensions::removeAllTargetReferencesForElement): Ditto.
3371         (WebCore::SVGDocumentExtensions::clearTargetDependencies): Ditto.
3372         (WebCore::SVGDocumentExtensions::removeAllElementReferencesForTarget): Ditto.
3373         (WebCore::SVGDocumentExtensions::registerSVGFontFaceElement): Ditto.
3374         (WebCore::SVGDocumentExtensions::unregisterSVGFontFaceElement): Ditto.
3375         * svg/SVGDocumentExtensions.h: Ditto.
3376
3377         * svg/SVGElement.cpp:
3378         (WebCore::SVGElement::~SVGElement): Pass reference.
3379         (WebCore::SVGElement::removedFromAncestor): Ditto.
3380         (WebCore::SVGElement::buildPendingResourcesIfNeeded): Ditto.
3381         * svg/SVGFEImageElement.cpp:
3382         (WebCore::SVGFEImageElement::clearResourceReferences): Ditto.
3383         (WebCore::SVGFEImageElement::buildPendingResource): Ditto.
3384         * svg/SVGFontFaceElement.cpp:
3385         (WebCore::SVGFontFaceElement::insertedIntoAncestor): Ditto.
3386         (WebCore::SVGFontFaceElement::removedFromAncestor): Ditto.
3387         * svg/SVGMPathElement.cpp:
3388         (WebCore::SVGMPathElement::buildPendingResource): Ditto.
3389         (WebCore::SVGMPathElement::clearResourceReferences): Ditto.
3390         * svg/SVGPathElement.cpp:
3391         (WebCore::SVGPathElement::invalidateMPathDependencies): Ditto.
3392         * svg/SVGSVGElement.cpp:
3393         (WebCore::SVGSVGElement::SVGSVGElement): Ditto.
3394         (WebCore::SVGSVGElement::~SVGSVGElement): Ditto.
3395         (WebCore::SVGSVGElement::didMoveToNewDocument): Ditto.
3396         (WebCore::SVGSVGElement::insertedIntoAncestor): Ditto.
3397         (WebCore::SVGSVGElement::removedFromAncestor): Ditto.
3398         * svg/SVGTRefElement.cpp:
3399         (WebCore::SVGTRefElement::detachTarget): Ditto.
3400         (WebCore::SVGTRefElement::buildPendingResource): Ditto.
3401         * svg/SVGTextPathElement.cpp:
3402         (WebCore::SVGTextPathElement::clearResourceReferences): Ditto.
3403         (WebCore::SVGTextPathElement::buildPendingResource): Ditto.
3404         * svg/SVGUseElement.cpp:
3405         (WebCore::SVGUseElement::updateShadowTree): Ditto.
3406         * svg/animation/SVGSMILElement.cpp:
3407         (WebCore::SVGSMILElement::clearResourceReferences): Ditto.
3408         (WebCore::SVGSMILElement::buildPendingResource): Ditto.
3409         * testing/Internals.cpp:
3410         (WebCore::Internals::addTextMatchMarker): Ditto.
3411         (WebCore::Internals::webkitWillEnterFullScreenForElement): Ditto.
3412         (WebCore::Internals::webkitDidEnterFullScreenForElement): Ditto.
3413         (WebCore::Internals::webkitWillExitFullScreenForElement): Ditto.
3414         (WebCore::Internals::webkitDidExitFullScreenForElement): Ditto.
3415         * workers/Worker.cpp:
3416         (WebCore::Worker::create): Ditto.
3417         (WebCore::Worker::notifyFinished): Ditto.
3418         * workers/service/ServiceWorkerContainer.cpp:
3419         (WebCore::ServiceWorkerContainer::scheduleJob): Ditto.
3420         (WebCore::ServiceWorkerContainer::jobDidFinish): Ditto.
3421         * xml/XMLHttpRequest.cpp:
3422         (WebCore::XMLHttpRequest::prepareToSend): Ditto.
3423         (WebCore::XMLHttpRequest::createRequest): Ditto.
3424         (WebCore::XMLHttpRequest::internalAbort): Ditto.
3425         (WebCore::XMLHttpRequest::networkErrorTimerFired): Ditto.
3426         (WebCore::XMLHttpRequest::didFail): Ditto.
3427         (WebCore::XMLHttpRequest::didFinishLoading): Ditto.
3428
3429         * xml/XPathStep.cpp: Removed unneeded include of HTMLDocument.h.
3430         (WebCore::XPath::nodeMatchesBasicTest): Changed code to call isHTMLDocument
3431         rather than is<HTMLDocument> since this is not a type check for a downcast,
3432         but rather a behavioral difference that does not depend on any of the data
3433         stored in an HTMLDocument or the use of a distinct C++ class for it.
3434
3435         * xml/XSLTProcessor.cpp:
3436         (WebCore::XSLTProcessor::createDocumentFromSource): Pass a reference.
3437
3438 2019-01-21  David Kilzer  <ddkilzer@apple.com>
3439
3440         Switch remaining VideoToolbox soft-linking in WebCore over to VideoToolboxSoftLink.{cpp,h}
3441         <https://webkit.org/b/193645>
3442         <rdar://problem/47421574>
3443
3444         Reviewed by Alex Christensen.
3445
3446         * platform/cocoa/VideoToolboxSoftLink.cpp:
3447         * platform/cocoa/VideoToolboxSoftLink.h:
3448         - Move soft-linking of VTPixelBufferConformer* functions from
3449           PixelBufferConformerCV.cpp to here.
3450         * platform/graphics/cv/PixelBufferConformerCV.cpp:
3451         - Remove local soft-linking of VideoToolbox.framework and switch
3452           to VideoToolboxSoftLink.h.
3453
3454 2019-01-21  Antti Koivisto  <antti@apple.com>
3455
3456         Move delegatesScrolling() tests to lower level conversion function in ScrollView
3457         https://bugs.webkit.org/show_bug.cgi?id=193649
3458
3459         Reviewed by Frédéric Wang.
3460
3461         This reduces places where these tests are needed and helps avoid mistakes.
3462
3463         * dom/Document.cpp:
3464         (WebCore::computeIntersectionState):
3465         * page/FrameView.cpp:
3466         (WebCore::FrameView::convertFromRendererToContainingView const):
3467         (WebCore::FrameView::convertFromContainingViewToRenderer const):
3468         * platform/ScrollView.cpp:
3469         (WebCore::ScrollView::viewToContents const):
3470         (WebCore::ScrollView::contentsToView const):
3471         (WebCore::ScrollView::contentsToContainingViewContents const):
3472         (WebCore::ScrollView::rootViewToContents const):
3473         (WebCore::ScrollView::contentsToRootView const):
3474         (WebCore::ScrollView::windowToContents const):
3475         (WebCore::ScrollView::contentsToWindow const):
3476
3477 2019-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3478
3479         REGRESSION(r239915): about 130 test failures on WPE
3480         https://bugs.webkit.org/show_bug.cgi?id=193395
3481
3482         Reviewed by Žan Doberšek.
3483
3484         Since r239915 we are only overriding the characters with Default_Ignorable unicode property when the font
3485         doesn't support the code point. If the font happens to provide a glyph for the character, it's later ignored by
3486         harfbuzz when shaping, but the simple text code path doesn't ignore them unless there isn't a glyph.
3487
3488         * platform/graphics/WidthIterator.cpp:
3489         (WebCore::WidthIterator::advanceInternal): Always ignore characters with Default_Ignorable unicode property.
3490         (WebCore::characterMustDrawSomething): Moved to CharacterProperties.h and renamed as isDefaultIgnorableCodePoint().
3491         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
3492         (WebCore::GlyphPage::fill): Use isDefaultIgnorableCodePoint().
3493         * platform/text/CharacterProperties.h:
3494         (WebCore::isDefaultIgnorableCodePoint): Return whether the character has Default_Ignorable unicode property.
3495
3496 2019-01-20  Myles C. Maxfield  <mmaxfield@apple.com>
3497
3498         [WHLSL] Implement Metal code generation
3499         https://bugs.webkit.org/show_bug.cgi?id=193531
3500
3501         Reviewed by Dean Jackson.
3502
3503         This implements the majority of the metal code generation piece. There are still a few pieces missing,
3504         that I'll add in follow up patches. There's still enough complexity here that this is worth reviewing
3505         on its own, though.
3506
3507         This patch includes a few pieces:
3508         - Metal typedefs for every WHLSL type. This analysis is actually pretty interesting, because complex
3509               types depend on their inner types, and the inner types need to be emitted first. Therefore,
3510               this patch implements a topological sort when emitting types. Also, WHLSL types need to be de-
3511               duped because array references are implemented in MSL as structs, and if you have two structs
3512               in MSL with the same contents, those two structs are not equal and cannot be assigned to each
3513               other. So, this patch creates a trie to de-dup all the UnnamedTypes, and implements a
3514               dependency graph which includes both nodes in the trie as well as NamedTypes which don't appear
3515               in the trie.
3516         - WHLSL enumeration code generation
3517         - A name mangler, which ensures that no text from the source program is contained within the result
3518               program
3519         - Full support for expressions. An expression like "y = *x + 7;" would be converted to something like
3520               Type1 variable1 = *x;
3521               Type2 variable2 = 7;
3522               Type3 variable3 = variable1 + variable2;
3523               y = variable3;
3524         - Mostly complete support for control flow. This is tricky because of how we transform WHLSL
3525               expressions into C++ statements. Therefore, things like "for ( ; *x + 7; )" is difficult to
3526               compile, because we can't put the "*x + 7" generated statements into the for loop itself.
3527               Instead, we have to emit this code inside the loop, in all the places that would implicitly run
3528               it. This patch doesn't fully handle this, see below. (If MSL supported lambdas, we could put
3529               the statements into a lambda and do something like "for ( ; theLambda(); )" but MSL doesn't
3530               support lambdas.)
3531
3532         Missing pieces:
3533         - Entry point pack / unpack code
3534         - Support for "continue" (See above regarding control flow)
3535         - Knowing whether or not a switch case should end with break or fallthrough
3536         - Trapping
3537         - Zero filling variables
3538         - Code generation for compiler-generated native functions (this patch supports native functions in the
3539               standard library), texture functions, and HLSL's half <-> int functions.
3540
3541         No new tests because it isn't hooked up yet. As soon as we can do entry point packing and unpacking,
3542         I'll start porting the test suite.
3543
3544         * Modules/webgpu/WHLSL/AST/WHLSLBuiltInSemantic.h:
3545         (WebCore::WHLSL::AST::BuiltInSemantic::targetIndex):
3546         * Modules/webgpu/WHLSL/AST/WHLSLExpression.h:
3547         (WebCore::WHLSL::AST::Expression::resolvedType):
3548         (WebCore::WHLSL::AST::Expression::type): Deleted.
3549         * Modules/webgpu/WHLSL/AST/WHLSLFunctionDeclaration.h:
3550         (WebCore::WHLSL::AST::FunctionDeclaration::name):
3551         * Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h:
3552         (WebCore::WHLSL::AST::StructureDefinition::find):
3553         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.cpp: Added.
3554         (WebCore::WHLSL::Metal::EntryPointScaffolding::EntryPointScaffolding):
3555         (WebCore::WHLSL::Metal::EntryPointScaffolding::helperTypes):
3556         (WebCore::WHLSL::Metal::EntryPointScaffolding::signature):
3557         (WebCore::WHLSL::Metal::EntryPointScaffolding::unpack):
3558         (WebCore::WHLSL::Metal::EntryPointScaffolding::pack):
3559         * Modules/webgpu/WHLSL/Metal/WHLSLEntryPointScaffolding.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
3560         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.cpp: Added.
3561         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::FunctionDeclarationWriter):
3562         (WebCore::WHLSL::Metal::FunctionDeclarationWriter::toString):
3563         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::FunctionDefinitionWriter):
3564         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::toString):
3565         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::constantExpressionString):
3566         (WebCore::WHLSL::Metal::FunctionDefinitionWriter::generateNextVariableName):
3567         (WebCore::WHLSL::Metal::metalFunctions):
3568         * Modules/webgpu/WHLSL/Metal/WHLSLFunctionWriter.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
3569         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.cpp: Copied from Source/WebCore/Modules/webgpu/WHLSL/AST/WHLSLStructureDefinition.h.
3570         (WebCore::WHLSL::Metal::generateMetalCode):
3571         * Modules/webgpu/WHLSL/Metal/WHLSLMetalCodeGenerator.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
3572         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.cpp: Added.
3573         (WebCore::WHLSL::Metal::getNativeName):
3574         (WebCore::WHLSL::Metal::mapFunctionName):
3575         (WebCore::WHLSL::Metal::convertAddressSpace):
3576         (WebCore::WHLSL::Metal::writeNativeFunction):
3577         * Modules/webgpu/WHLSL/Metal/WHLSLNativeFunctionWriter.h: Copied from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
3578         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.cpp: Added.
3579         (WebCore::WHLSL::Metal::BaseTypeNameNode::BaseTypeNameNode):
3580         (WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayTypeNameNode const):
3581         (WebCore::WHLSL::Metal::BaseTypeNameNode::isArrayReferenceTypeNameNode const):
3582         (WebCore::WHLSL::Metal::BaseTypeNameNode::isPointerTypeNameNode const):
3583         (WebCore::WHLSL::Metal::BaseTypeNameNode::isReferenceTypeNameNode const):
3584         (WebCore::WHLSL::Metal::BaseTypeNameNode::children):
3585         (WebCore::WHLSL::Metal::BaseTypeNameNode::append):
3586         (WebCore::WHLSL::Metal::BaseTypeNameNode::parent):
3587         (WebCore::WHLSL::Metal::BaseTypeNameNode::mangledName const):
3588         (WebCore::WHLSL::Metal::ArrayTypeNameNode::ArrayTypeNameNode):
3589         (WebCore::WHLSL::Metal::ArrayTypeNameNode::numElements const):
3590         (WebCore::WHLSL::Metal::ArrayReferenceTypeNameNode::ArrayReferenceTypeNameNode):
3591         (WebCore::WHLSL::Metal::ArrayReferenceTypeNameNode::addressSpace const):
3592         (WebCore::WHLSL::Metal::PointerTypeNameNode::PointerTypeNameNode):
3593         (WebCore::WHLSL::Metal::PointerTypeNameNode::addressSpace const):
3594         (WebCore::WHLSL::Metal::ReferenceTypeNameNode::ReferenceTypeNameNode):
3595         (WebCore::WHLSL::Metal::ReferenceTypeNameNode::namedType):
3596         (WebCore::WHLSL::Metal::TypeNamer::TypeNamer):
3597         (WebCore::WHLSL::Metal::TypeNamer::visit):
3598         (WebCore::WHLSL::Metal::findInVector):
3599         (WebCore::WHLSL::Metal::find):
3600         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForType):
3601         (WebCore::WHLSL::Metal::TypeNamer::createNameNode):
3602         (WebCore::WHLSL::Metal::TypeNamer::insert):
3603         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::MetalTypeDeclarationWriter):
3604         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::toString):
3605         (WebCore::WHLSL::Metal::MetalTypeDeclarationWriter::visit):
3606         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDeclarations):
3607         (WebCore::WHLSL::Metal::toString):
3608         (WebCore::WHLSL::Metal::TypeNamer::emitUnnamedTypeDefinition):
3609         (WebCore::WHLSL::Metal::TypeNamer::emitNamedTypeDefinition):
3610         (WebCore::WHLSL::Metal::TypeNamer::metalTypeDefinitions):
3611         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForEnumerationMember):
3612         (WebCore::WHLSL::Metal::TypeNamer::mangledNameForStructureElement):
3613         (WebCore::WHLSL::Metal::TypeNamer::metalTypes):
3614         * Modules/webgpu/WHLSL/Metal/WHLSLTypeNamer.h: Added.
3615         (WebCore::WHLSL::Metal::TypeNamer::generateNextTypeName):
3616         (WebCore::WHLSL::Metal::TypeNamer::generateNextStructureElementName):
3617         (WebCore::WHLSL::Metal::TypeNamer::generateNextEnumerationMemberName):
3618         * Modules/webgpu/WHLSL/WHLSLChecker.cpp:
3619         (WebCore::WHLSL::checkSemantics):
3620         (WebCore::WHLSL::Checker::visit):
3621         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.cpp:
3622         (WebCore::WHLSL::Gatherer::visit):
3623         * Modules/webgpu/WHLSL/WHLSLGatherEntryPointItems.h:
3624         (WebCore::WHLSL::EntryPointItem::EntryPointItem):
3625         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Removed.
3626         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp: Added.
3627         (WebCore::WHLSL::StatementBehaviorChecker::takeFunctionBehavior):
3628         (WebCore::WHLSL::checkStatementBehavior):
3629         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h: Renamed from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
3630         * Sources.txt:
3631         * WebCore.xcodeproj/project.pbxproj:
3632
3633 2019-01-20  Myles C. Maxfield  <mmaxfield@apple.com>
3634
3635         [WHLSL] Add the statement behavior checker
3636         https://bugs.webkit.org/show_bug.cgi?id=193487
3637
3638         Reviewed by Dean Jackson.
3639
3640         This is a translation of https://github.com/gpuweb/WHLSL/blob/master/Spec/source/index.rst#typing-statements
3641         into C++. It is meant to replace the ReturnChecker and UnreachableCodeChecker in the reference implementation.
3642
3643         No new tests because it isn't hooked up yet. Not enough of the compiler exists to have any meaningful sort
3644         of test. When enough of the compiler is present, I'll port the reference implementation's test suite.
3645
3646         * Modules/webgpu/WHLSL/WHLSLLoopChecker.cpp: Removed. StatementBehaviorChecker does everything that LoopChecker
3647         does.
3648         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.cpp: Added.
3649         (WebCore::WHLSL::StatementBehaviorChecker::takeFunctionBehavior):
3650         (WebCore::WHLSL::checkStatementBehavior):
3651         * Modules/webgpu/WHLSL/WHLSLStatementBehaviorChecker.h: Renamed from Source/WebCore/Modules/webgpu/WHLSL/WHLSLLoopChecker.h.
3652         * Sources.txt:
3653         * WebCore.xcodeproj/project.pbxproj:
3654
3655 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
3656
3657         REGRESSION(r240174): Wrong preprocessor guards in RenderImage::paintAreaElementFocusRing
3658         https://bugs.webkit.org/show_bug.cgi?id=193630
3659
3660         Reviewed by Daniel Bates.
3661
3662         r240174 inadvertently disabled this function on non-Apple platforms.
3663
3664         This fixes layout test fast/images/image-map-outline-in-positioned-container.html.
3665
3666         * rendering/RenderImage.cpp:
3667         (WebCore::RenderImage::paintAreaElementFocusRing):
3668
3669 2019-01-20  chris fleizach  <cfleizach@apple.com>
3670
3671         AX: Support returning relative frames for accessibility
3672         https://bugs.webkit.org/show_bug.cgi?id=193414
3673         <rdar://problem/47268501>
3674
3675         Reviewed by Zalan Bujtas.
3676
3677         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.
3678
3679         Consolidate rect/point conversion methods for macOS and iOS.
3680         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.
3681
3682         Tests: accessibility/mac/relative-frame.html
3683
3684         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3685         (-[WebAccessibilityObjectWrapper _accessibilityConvertPointToViewSpace:]):
3686         (-[WebAccessibilityObjectWrapper _accessibilityRelativeFrame]):
3687         (-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
3688         (-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
3689         (-[WebAccessibilityObjectWrapper accessibilityFrame]):
3690         (-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
3691         (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
3692         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
3693         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]): Deleted.
3694         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
3695         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
3696         (convertPathToScreenSpaceFunction):
3697         (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
3698         (-[WebAccessibilityObjectWrapperBase convertPointToScreenSpace:]): Deleted.
3699         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3700         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
3701         (-[WebAccessibilityObjectWrapper position]):
3702         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3703         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
3704
3705 2019-01-20  Simon Fraser  <simon.fraser@apple.com>
3706
3707         On RenderBox, make client sizing be derived from padding box sizing
3708         https://bugs.webkit.org/show_bug.cgi?id=193621
3709
3710         Reviewed by Daniel Bates.
3711
3712         I never liked how clientWidth/Height, an IE-originated term, was used as the basis
3713         for various RenderBox geometry functions.
3714
3715         Fix by adding some functions which return the dimensions of the padding box (which
3716         is the inside of the border and any scrollbar), and define clientWidth/Height in
3717         terms of them.
3718
3719         Also add paddingBoxRectIncludingScrollbar() function that is used by compositing code.
3720
3721         * rendering/RenderBox.cpp:
3722         (WebCore::RenderBox::clientWidth const):
3723         (WebCore::RenderBox::clientHeight const):
3724         * rendering/RenderBox.h:
3725         (WebCore::RenderBox::borderBoxRect const):
3726         (WebCore::RenderBox::computedCSSContentBoxRect const):
3727         (WebCore::RenderBox::contentWidth const):
3728         (WebCore::RenderBox::contentHeight const):
3729         (WebCore::RenderBox::paddingBoxWidth const):
3730         (WebCore::RenderBox::paddingBoxHeight const):
3731         (WebCore::RenderBox::paddingBoxRect const):
3732         (WebCore::RenderBox::paddingBoxRectIncludingScrollbar const):
3733         (WebCore::RenderBox::hasHorizontalOverflow const):
3734         (WebCore::RenderBox::hasVerticalOverflow const):
3735         * rendering/RenderLayerBacking.cpp:
3736         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const):
3737         (WebCore::RenderLayerBacking::updateGeometry):
3738
3739 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
3740
3741         Unreviewed, rolling out r238275.
3742
3743         Regressed css3/shapes/shape-outside/shape-image/shape-
3744         image-025.html
3745
3746         Reverted changeset:
3747
3748         "ScalableImageDecoder: don't forcefully decode image data when
3749         querying frame completeness, duration"
3750         https://bugs.webkit.org/show_bug.cgi?id=191354
3751         https://trac.webkit.org/changeset/238275
3752
3753 2019-01-19  Zalan Bujtas  <zalan@apple.com>
3754
3755         [LFC][BFC] <body>'s overflow property value is propagated to viewport
3756         https://bugs.webkit.org/show_bug.cgi?id=193617
3757
3758         Reviewed by Antti Koivisto.
3759
3760         When the root element is an HTML "HTML" element or an XHTML "html" element, and that element has an HTML "BODY" element
3761         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,
3762         if the value on the root element is 'visible'. The 'visible' value when used for the viewport must be interpreted as 'auto'.
3763         The element from which the value is propagated must have a used value for 'overflow' of 'visible'.
3764
3765         This also has impact on layout since <body style="overflow: hidden"> would establish a block formatting context.
3766
3767         * layout/layouttree/LayoutBox.cpp:
3768         (WebCore::Layout::Box::isOverflowVisible const):
3769
3770 2019-01-20  Michael Catanzaro  <mcatanzaro@igalia.com>
3771
3772         Unreviewed, rolling out r240209.
3773
3774         Broke GTK/WPE injected bundle
3775
3776         Reverted changeset:
3777
3778         "AX: Support returning relative frames for accessibility"
3779         https://bugs.webkit.org/show_bug.cgi?id=193414
3780         https://trac.webkit.org/changeset/240209
3781
3782 2019-01-12  Dan Bernstein  <mitz@apple.com>
3783
3784         [Cocoa] Avoid importing directly from subumbrella frameworks
3785         https://bugs.webkit.org/show_bug.cgi?id=186016
3786         <rdar://problem/40591038>
3787
3788         Reviewed by Sam Weinig.
3789
3790         * Configurations/WebCore.xcconfig: Removed -iframework options from OTHER_CFLAGS and
3791           OTHER_CPLUSPLUSFLAGS.
3792         * editing/mac/DictionaryLookupLegacy.mm: Import Quartz.h instead of a PDFKit header.
3793         * platform/mac/PlatformEventFactoryMac.mm: Import Carbon.h instead of HIToolbox headers.
3794         * platform/text/mac/TextEncodingRegistryMac.mm: Import Carbon.h instead of CarbonCore.h.
3795
3796 2019-01-20  chris fleizach  <cfleizach@apple.com>
3797
3798         AX: Support returning relative frames for accessibility
3799         https://bugs.webkit.org/show_bug.cgi?id=193414
3800         <rdar://problem/47268501>
3801
3802         Reviewed by Zalan Bujtas.
3803
3804         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.
3805
3806         Consolidate rect/point conversion methods for macOS and iOS.
3807         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.
3808
3809         Tests: accessibility/mac/relative-frame.html
3810
3811         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3812         (-[WebAccessibilityObjectWrapper _accessibilityConvertPointToViewSpace:]):
3813         (-[WebAccessibilityObjectWrapper _accessibilityRelativeFrame]):
3814         (-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
3815         (-[WebAccessibilityObjectWrapper accessibilityActivationPoint]):
3816         (-[WebAccessibilityObjectWrapper accessibilityFrame]):
3817         (-[WebAccessibilityObjectWrapper frameForTextMarkers:]):
3818         (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
3819         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
3820         (-[WebAccessibilityObjectWrapper convertRectToScreenSpace:]): Deleted.
3821         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
3822         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
3823         (convertPathToScreenSpaceFunction):
3824         (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
3825         (-[WebAccessibilityObjectWrapperBase convertPointToScreenSpace:]): Deleted.
3826         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3827         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
3828         (-[WebAccessibilityObjectWrapper position]):
3829         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3830         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): Deleted.
3831
3832 2019-01-20  Antoine Quint  <graouts@apple.com>
3833
3834         Add a POINTER_EVENTS feature flag
3835         https://bugs.webkit.org/show_bug.cgi?id=193577
3836         <rdar://problem/47408511>
3837
3838         Unreviewed. Also enable Pointer Events for iosmac.
3839
3840         * Configurations/FeatureDefines.xcconfig:
3841
3842 2019-01-19  Zalan Bujtas  <zalan@apple.com>
3843
3844         [LFC][Floats] Ensure that floats in FloatingContext::m_floats are always horizontally ordered.
3845         https://bugs.webkit.org/show_bug.cgi?id=193613
3846
3847         Reviewed by Antti Koivisto.
3848
3849         Float items in m_floats list should stay in horizontal position order (left/right edge).
3850
3851         When adding a new float item to floating state list, we have to ensure that it is definitely the left(right)-most item.
3852         Normally it is, but negative horizontal margins can push the float box beyond another float box.
3853
3854         <div style="float: left; height: 10px; width: 10px;"></div>
3855         <div style="float: left; height: 10px; width: 10px; margin-left: -80px;"></div>
3856
3857         The second float's right edge beyond the first float' left edge. THe second float is not the right(inner)-most float anymore.
3858
3859         Test: fast/block/float/floats-with-negative-horizontal-margin.html
3860
3861         * layout/floats/FloatingContext.cpp:
3862         (WebCore::Layout::areFloatsHorizontallySorted):
3863         (WebCore::Layout::FloatingContext::positionForFloat const):
3864         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
3865         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
3866         * layout/floats/FloatingState.cpp:
3867         (WebCore::Layout::FloatingState::append):
3868
3869 2019-01-19  Youenn Fablet  <youenn@apple.com>
3870
3871         getUserMedia with a deviceId exact constraint with an empty string value should succeed
3872         https://bugs.webkit.org/show_bug.cgi?id=193541
3873         <rdar://problem/47357218>
3874
3875         Reviewed by Eric Carlson.
3876
3877         If there is a deviceId constraint, remove any empty string from ideal/exact string list.
3878         This will make the device selection be solely based on other constraints.
3879         An improvement might be for 'exact' constraint to pick the default device.
3880         There is currently no such notion of a default device.
3881         Picking the best fitting device seems a good tradeoff.
3882         Covered by updated test.
3883
3884         * platform/mediastream/MediaConstraints.cpp:
3885         (WebCore::MediaTrackConstraintSetMap::set):
3886         * platform/mediastream/MediaConstraints.h:
3887         (WebCore::StringConstraint::removeEmptyStringConstraint):
3888
3889 2019-01-19  Eric Liang  <ericliang@apple.com>
3890
3891         AXSelected attribute on RadioButton should not be settable.
3892         https://bugs.webkit.org/show_bug.cgi?id=193371
3893
3894         Reviewed by Chris Fleizach.
3895
3896         Test: accessibility/set-selected-editable.html
3897
3898         * accessibility/AccessibilityNodeObject.cpp:
3899         (WebCore::AccessibilityNodeObject::canSetSelectedAttribute const):
3900
3901 2019-01-19  Antoine Quint  <graouts@apple.com>
3902
3903         Add a POINTER_EVENTS feature flag
3904         https://bugs.webkit.org/show_bug.cgi?id=193577
3905
3906         Reviewed by Dean Jackson.
3907
3908         Only expose the PointerEvent interface if the POINTER_EVENTS feature is enabled.
3909
3910         * Configurations/FeatureDefines.xcconfig:
3911         * dom/EventNames.in:
3912         * dom/PointerEvent.cpp:
3913         * dom/PointerEvent.h:
3914         * dom/PointerEvent.idl:
3915
3916 2019-01-18  Ryosuke Niwa  <rniwa@webkit.org>
3917
3918         iOS: Updating input mode should update the software keyboard
3919         https://bugs.webkit.org/show_bug.cgi?id=193565
3920         <rdar://problem/47376334>
3921
3922         Reviewed by Wenson Hsieh.
3923
3924         Let the chrome client know that the focused element's inputmode had changed.
3925
3926         Test: fast/forms/ios/inputmode-none-removed.html
3927
3928         * html/HTMLElement.cpp:
3929         (WebCore::HTMLElement::parseAttribute):
3930         * page/ChromeClient.h:
3931
3932 2019-01-18  Brian Burg  <bburg@apple.com>
3933
3934         Automation.computeElementLayout should return visual viewport-aware coordinates
3935         https://bugs.webkit.org/show_bug.cgi?id=193598
3936         <rdar://problem/35325644>