11cfad13cfccbad756839e446e6de82df7cbd6be
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-09-13  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Capturing event listeners are called during bubbling phase for shadow hosts
4         https://bugs.webkit.org/show_bug.cgi?id=174288
5         <rdar://problem/33530455>
6
7         Reviewed by Darin Adler.
8
9         Implemented the new behavior proposed in https://github.com/whatwg/dom/pull/686 [1] to fix the problem
10         that capturing event listeners on a shadow host is invoked during bubbling phase when an event is
11         dispatched within its shadow tree.
12
13         To see why this is a problem, suppose we fire a composed event at span#target in the following DOM tree:
14           section#hostParent
15             + div#host -- ShadowRoot
16                             - p#parent
17                                 - span#target
18         Then capturing and bubbling event listeners on #target, #parent, #host, and #hostParent are invoked in
19         the following order in WebKit & Chrome right now:
20
21         1. #hostParent, capturing, eventPhase: CAPTURING_PHASE
22         2. #parent, capturing, eventPhase: CAPTURING_PHASE
23         3. #target, capturing, eventPhase: AT_TARGET
24         4. #target, non-capturing, eventPhase: AT_TARGET
25         5. #parent, non-capturing, eventPhase: BUBBLING_PHASE
26         6. #host, capturing, eventPhase: AT_TARGET
27         7. #host, non-capturing, eventPhase: AT_TARGET
28         8. #hostParent, non-capturing, eventPhase: BUBBLING_PHASE
29
30         This is counter-intuitive because capturing event listeners on #host isn't invoked until bubblign phase
31         started. A more natural ordering would be:
32
33         1. #hostParent, capturing, eventPhase: CAPTURING_PHASE
34         2. #host, capturing, eventPhase: AT_TARGET
35         3. #parent, capturing, eventPhase: CAPTURING_PHASE
36         4. #target, capturing, eventPhase: AT_TARGET
37         5. #target, non-capturing, eventPhase: AT_TARGET
38         6. #parent, non-capturing, eventPhase: BUBBLING_PHASE
39         7. #host, non-capturing, eventPhase: AT_TARGET
40         8. #hostParent, non-capturing, eventPhase: BUBBLING_PHASE
41
42         This also happens to be the order by which Gecko's current shadow DOM implementation invoke event listners.
43         This patch implements this new behavior using the spec-change proposed in [1]. Note that this patch also
44         impacts the invocation order of event listeners when there is no shadow tree. Namely, before this patch,
45         event listeners on the event's target is invoked in the registration order. After this patch, all capturing
46         event listeners are invoked before bubbling event listeners are invoked.
47
48         To implement this behavior, this patch introduces EventTarget::EventInvokePhase indicating whether we're
49         in the capturing phase or bubbling phase to EventTarget::fireEventListeners. We can't use Event's eventPhase
50         enum because that's set to Event::Phase::AT_TARGET when we're at a shadow host.
51
52         Test: fast/shadow-dom/capturing-and-bubbling-event-listeners-across-shadow-trees.html
53
54         * Modules/modern-media-controls/media/media-controller-support.js:
55         (MediaControllerSupport.prototype.enable): Use capturing event listeners so that we can update the states of
56         media controls before author scripts recieve the event.
57         (MediaControllerSupport.prototype.disable): Ditto.
58         * dom/EventContext.cpp:
59         (WebCore::EventContext::handleLocalEvents const):
60         (WebCore::MouseOrFocusEventContext::handleLocalEvents const):
61         (WebCore::TouchEventContext::handleLocalEvents const):
62         * dom/EventContext.h:
63         * dom/EventDispatcher.cpp:
64         (WebCore::dispatchEventInDOM): Invoke capturing event listners even when target and current target are same.
65         This happens when the current target is a shadow host and event's target is in its shadow tree. Also merged
66         the special code path for the event's target with the code in the bubbling phase.
67         * dom/EventPath.cpp:
68         (WebCore::WindowEventContext::handleLocalEvents const):
69         * dom/EventTarget.cpp:
70         (WebCore::EventTarget::dispatchEvent): Invoke capturing and bubbling event listeners in the order.
71         (WebCore::EventTarget::fireEventListeners):
72         (WebCore::EventTarget::innerInvokeEventListeners): Renamed from fireEventListeners to match the spec. Use
73         EventInvokePhase to filter out event listeners so that we can invoke capturing event listners before bubbling
74         event listeners even when eventPhase is Event::Phase::AT_TARGET.
75         * dom/EventTarget.h:
76         * dom/Node.cpp:
77         (WebCore::Node::handleLocalEvents):
78         * dom/Node.h:
79         * html/HTMLFormElement.cpp:
80         (WebCore::HTMLFormElement::handleLocalEvents):
81         * html/HTMLFormElement.h:
82         * page/DOMWindow.cpp:
83         (WebCore::DOMWindow::dispatchEvent):
84
85 2018-09-13  Megan Gardner  <megan_gardner@apple.com>
86
87         Fix color stop blending in conic gradients for stops past 1
88         https://bugs.webkit.org/show_bug.cgi?id=189532
89         <rdar://problem/44158221>
90
91         Reviewed by Simon Fraser.
92
93         Calculation was wrong, fixed it, and wrote a test that failed
94         without the change, and passes with it.
95
96         Test: fast/gradients/conic-repeating-last-stop.html
97
98         * css/CSSGradientValue.cpp:
99         (WebCore::ConicGradientAdapter::normalizeStopsAndEndpointsOutsideRange):
100
101 2018-09-13  Chris Dumez  <cdumez@apple.com>
102
103         Regression(PSON): setting window.opener to null allows process swapping in cases that are not web-compatible
104         https://bugs.webkit.org/show_bug.cgi?id=189590
105         <rdar://problem/44422725>
106
107         Reviewed by Geoffrey Garen.
108
109         Set a flag on the navigation action to indicate if the page was opened via window.open() without 'noopener'.
110
111         Test: http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html
112
113         * loader/FrameLoader.cpp:
114         (WebCore::FrameLoader::loadURL):
115         * loader/NavigationAction.h:
116         (WebCore::NavigationAction::openedViaWindowOpenWithOpener const):
117         (WebCore::NavigationAction::setOpenedViaWindowOpenWithOpener):
118         * page/DOMWindow.cpp:
119         (WebCore::DOMWindow::createWindow):
120         * page/Page.h:
121         (WebCore::Page::openedViaWindowOpenWithOpener const):
122         (WebCore::Page::setOpenedViaWindowOpenWithOpener):
123
124 2018-09-13  Jer Noble  <jer.noble@apple.com>
125
126         Enable USE_MEDIAREMOTE on iOS
127         https://bugs.webkit.org/show_bug.cgi?id=189096
128
129         Reviewed by Eric Carlson.
130
131         Migrate to using MediaRemote.framework on iOS from MediaPlayer.framework. This unifies the
132         Now Playing implementation on iOS and Mac.
133
134         * SourcesCocoa.txt:
135         * WebCore.xcodeproj/project.pbxproj:
136         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Removed.
137         * platform/audio/cocoa/MediaSessionManagerCocoa.h:
138         * platform/audio/cocoa/MediaSessionManagerCocoa.mm: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm.
139         (PlatformMediaSessionManager::sharedManager):
140         (PlatformMediaSessionManager::sharedManagerIfExists):
141         (MediaSessionManagerCocoa::updateSessionState):
142         (MediaSessionManagerCocoa::beginInterruption):
143         (MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo):
144         (MediaSessionManagerCocoa::sessionWillBeginPlayback):
145         (MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing):
146         (MediaSessionManagerCocoa::removeSession):
147         (MediaSessionManagerCocoa::sessionWillEndPlayback):
148         (MediaSessionManagerCocoa::clientCharacteristicsChanged):
149         (MediaSessionManagerCocoa::sessionCanProduceAudioChanged):
150         (MediaSessionManagerCocoa::nowPlayingEligibleSession):
151         (MediaSessionManagerCocoa::updateNowPlayingInfo):
152         * platform/audio/ios/MediaSessionManagerIOS.h:
153         (): Deleted.
154         * platform/audio/ios/MediaSessionManagerIOS.mm:
155         (WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): Deleted.
156         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Deleted.
157         (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Deleted.
158         (WebCore::MediaSessionManageriOS::removeSession): Deleted.
159         (WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Deleted.
160         (WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Deleted.
161         * platform/audio/mac/MediaSessionManagerMac.h: Removed.
162
163 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
164
165         Remove the workaround for friend class LazyNeverDestroyed<X> statements for MSVC
166         https://bugs.webkit.org/show_bug.cgi?id=189576
167
168         Reviewed by Alex Christensen.
169
170         Old MSVC can't compile "friend class LazyNeverDestroyed<X>"
171         statements, but "friend LazyNeverDestroyed<X>".
172
173         No new tests (No behavior change).
174
175         * css/CSSInheritedValue.h: Removed the code for COMPILER(MSVC).
176         Removed 'class' keyword in "friend class LazyNeverDestroyed<X>"
177         statement.
178         * css/CSSInitialValue.h: Ditto.
179         * css/CSSPrimitiveValue.h: Ditto.
180         * css/CSSRevertValue.h: Ditto.
181         * css/CSSUnsetValue.h: Ditto.
182
183 2018-09-13  Ms2ger  <Ms2ger@igalia.com>
184
185         [GLib] Fix format string in KeyedEncoderGlib::beginObject().
186         https://bugs.webkit.org/show_bug.cgi?id=189585
187
188         Reviewed by Michael Catanzaro.
189
190         This appears to fix the following assertion locally:
191
192         GLib-CRITICAL **: g_variant_builder_add_value: assertion '!GVSB(builder)->expected_type || g_variant_is_of_type (value, GVSB(builder)->expected_type)' failed
193
194         Covered by existing tests.
195
196         * platform/glib/KeyedEncoderGlib.cpp:
197         (WebCore::KeyedEncoderGlib::beginObject):
198
199 2018-09-13  Ryan Haddad  <ryanhaddad@apple.com>
200
201         Unreviewed, rolling out r235953.
202
203         Caused layout test crashes under GuardMalloc.
204
205         Reverted changeset:
206
207         "Make GraphicsLayers ref-counted, so their tree can persist
208         when disconnected from RenderLayerBackings"
209         https://bugs.webkit.org/show_bug.cgi?id=189521
210         https://trac.webkit.org/changeset/235953
211
212 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
213
214         Remove a MSVC workaround in XPath::Step::NodeTest
215         https://bugs.webkit.org/show_bug.cgi?id=189578
216
217         Reviewed by Alex Christensen.
218
219         XPath::Step::NodeTest has a special code for MSVC bug workaround.
220         It has been introduced in 5 years ago in Bug 121082 Comment 19.
221
222         I think it is safe just to remove the workaround.
223
224         No new tests (No behavior change).
225
226         * xml/XPathStep.h: Removed the MSVC workaround.
227
228 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
229
230         Remove a MSVC workaround in InspectorStyle::styleWithProperties
231         https://bugs.webkit.org/show_bug.cgi?id=189577
232
233         Reviewed by Alex Christensen.
234
235         No new tests (No behavior change).
236
237         * inspector/InspectorStyleSheet.cpp:
238         (WebCore::InspectorStyle::styleWithProperties const): Use 'auto' for the type of 'status'.
239
240 2018-09-13  Alex Christensen  <achristensen@webkit.org>
241
242         Use a Variant instead of a union in CSSSelector
243         https://bugs.webkit.org/show_bug.cgi?id=188559
244
245         Reviewed by Antti Koivisto.
246
247         No change in behavior. This just makes some of the existing problems more obvious and easy to fix.
248
249         I moved m_caseInsensitiveAttributeValueMatching to RareData because it's only used with RareData.
250         I only have m_isForPage when assertions are enabled because it's only used for an assertion.
251         The rest is pretty straightforward translating union syntax to Variant syntax.
252         I use RefPtr for now where I could use Ref because it's never null to make copying easier, but that's temporary.
253
254         * css/CSSSelector.cpp:
255         (WebCore::CSSSelector::CSSSelector):
256         (WebCore::CSSSelector::createRareData):
257         (WebCore::CSSSelector::setAttribute):
258         (WebCore::CSSSelector::setArgument):
259         (WebCore::CSSSelector::setLangArgumentList):
260         (WebCore::CSSSelector::setSelectorList):
261         (WebCore::CSSSelector::setNth):
262         (WebCore::CSSSelector::matchNth const):
263         (WebCore::CSSSelector::nthA const):
264         (WebCore::CSSSelector::nthB const):
265         (WebCore::CSSSelector::RareData::RareData):
266         * css/CSSSelector.h:
267         (WebCore::CSSSelector::argument const):
268         (WebCore::CSSSelector::langArgumentList const):
269         (WebCore::CSSSelector::selectorList const):
270         (WebCore::CSSSelector::attribute const):
271         (WebCore::CSSSelector::attributeCanonicalLocalName const):
272         (WebCore::CSSSelector::setValue):
273         (WebCore::CSSSelector::CSSSelector):
274         (WebCore::CSSSelector::~CSSSelector):
275         (WebCore::CSSSelector::tagQName const):
276         (WebCore::CSSSelector::tagLowercaseLocalName const):
277         (WebCore::CSSSelector::value const):
278         (WebCore::CSSSelector::serializingValue const):
279         (WebCore::CSSSelector::attributeValueMatchingIsCaseInsensitive const):
280         (WebCore::CSSSelector::RareData::create): Deleted.
281         * css/parser/CSSParserImpl.cpp:
282         (WebCore::CSSParserImpl::parsePageSelector):
283         * css/parser/CSSParserSelector.h:
284
285 2018-09-13  Fujii Hironori  <Hironori.Fujii@sony.com>
286
287         [Win][Clang] error: type 'float' cannot be narrowed to 'LONG' (aka 'long') in initializer list in WheelEventWin.cpp
288         https://bugs.webkit.org/show_bug.cgi?id=189575
289
290         Reviewed by Alex Christensen.
291
292         No new tests (No behavior change).
293
294         * platform/win/WheelEventWin.cpp:
295         (WebCore::PlatformWheelEvent::PlatformWheelEvent): Use flooredIntPoint to convert FloatPoint to POINT.
296
297 2018-09-13  Youenn Fablet  <youenn@apple.com>
298
299         Introduce RTCRtpSendParameters
300         https://bugs.webkit.org/show_bug.cgi?id=189563
301
302         Reviewed by Eric Carlson.
303
304         Introduce RTCRtpSendParameters to match the WebRTC specification.
305         Split RTCRtpPrameters fields accordingly and update call sites.
306
307         Covered by updated test.
308
309         * CMakeLists.txt:
310         * DerivedSources.make:
311         * Modules/mediastream/PeerConnectionBackend.h:
312         * Modules/mediastream/RTCRtpCodingParameters.h: Added
313         * Modules/mediastream/RTCRtpCodingParameters.idl: Added
314         * Modules/mediastream/RTCRtpDecodingParameters.h: Added
315         * Modules/mediastream/RTCRtpDecodingParameters.idl: Added
316         * Modules/mediastream/RTCRtpEncodingParameters.h:
317         * Modules/mediastream/RTCRtpEncodingParameters.idl:
318         * Modules/mediastream/RTCRtpParameters.h:
319         * Modules/mediastream/RTCRtpParameters.idl:
320         * Modules/mediastream/RTCRtpReceiver.cpp:
321         * Modules/mediastream/RTCRtpSendParameters.h: Added.
322         (WebCore::RTCRtpSendParameters::RTCRtpSendParameters):
323         * Modules/mediastream/RTCRtpSendParameters.idl: Added.
324         * Modules/mediastream/RTCRtpSender.cpp:
325         (WebCore::RTCRtpSender::getParameters):
326         (WebCore::RTCRtpSender::setParameters):
327         * Modules/mediastream/RTCRtpSender.h:
328         * Modules/mediastream/RTCRtpSender.idl:
329         * Modules/mediastream/RTCRtpSenderBackend.h:
330         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
331         (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
332         (WebCore::LibWebRTCRtpSenderBackend::setParameters):
333         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
334         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
335         (WebCore::toRTCRtpParameters):
336         (WebCore::toRTCRtpSendParameters):
337         (WebCore::fromRTCRtpSendParameters):
338         * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
339         * Sources.txt:
340         * WebCore.xcodeproj/project.pbxproj:
341
342 2018-09-13  Xabier Rodriguez Calvar  <calvaris@igalia.com>
343
344         [GStreamer][EME] decrypt-key-needed message renamed to drm-cdm-instance-needed
345         https://bugs.webkit.org/show_bug.cgi?id=189547
346
347         Reviewed by Philippe Normand.
348
349         decrypt-key-needed message renamed to drm-cdm-instance-needed.
350
351         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
352         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Apart from
353         renaming the message, removed the class prefix for
354         dispatchCDMInstance.
355         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
356         (webkitMediaCommonEncryptionDecryptTransformInPlace):
357
358 2018-09-11  Ryosuke Niwa  <rniwa@webkit.org>
359
360         imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html hits assertion
361         https://bugs.webkit.org/show_bug.cgi?id=189493
362
363         Reviewed by Alex Christensen.
364
365         The debug assertion was caused by RefPtr in FormAssociatedElement::formOwnerRemovedFromTree introduced
366         by r224390 and r223644 ref'ing ShadowRoot while calling removeDetachedChildren inside ~ShadowRoot.
367         When a form (or any other) element has more than one ref inside removeDetachedChildren,
368         addChildNodesToDeletionQueue calls notifyChildNodeRemoved in the tree oreder.
369
370         However, when a form associated element of this form element appears later in the tree order,
371         FormAssociatedElement::formOwnerRemovedFromTree can traverse up ancestors including the ShadowRoot.
372
373         Fixed the bug by using raw pointers instead. Luckily, there is no DOM mutations or other non-trivial
374         operations happening in this function so this should be safe.
375
376         Test: imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html
377
378         * html/FormAssociatedElement.cpp:
379         (WebCore::FormAssociatedElement::formOwnerRemovedFromTree): Fixed the bug.
380
381 2018-09-12  Dan Bernstein  <mitz@apple.com>
382
383         [Cocoa] Complete support for Paste as Quotation
384         https://bugs.webkit.org/show_bug.cgi?id=189504
385
386         Reviewed by Wenson Hsieh.
387
388         Tests: editing/pasteboard/4930986-1-paste-as-quotation.html
389                editing/pasteboard/4930986-2-paste-as-quotation.html
390                editing/pasteboard/4930986-3-paste-as-quotation.html
391
392         * editing/Editor.cpp:
393           Added ClipboardEventKind::PasteAsQuotation.
394         (WebCore::eventNameForClipboardEvent): Map PasteAsQuotation to the "paste" DOM event name.
395         (WebCore::createDataTransferForClipboardEvent): Place the unquoted content in the event.
396           This means that currently event handlers can’t emulate pasting as quotation, because they
397           neither have the quoted content nor knowledge that quoting has been requested. We could
398           change this in the future if needed.
399         (WebCore::Editor::paste): Updated for change in pasteWithPasteboard’s argument type.
400         (WebCore::Editor::pasteAsQuotation): Added. Similar to paste, but passes
401           PasteOption::AsQuotation to pasteWithPasteboard.
402         (WebCore::Editor::quoteFragmentForPasting): Added. Quoting for pasting consists of enclosing
403           the fragment in a blockquote element with the "type" attribute set to "cite" and the
404           "class" attribute set to a well-known value, which is used to trigger special behavior in
405           ReplaceSelectionCommand. The behavior includes removing the "class" attribute in the end,
406           so eventually, we could stop using this form of in-band signaling.
407         * editing/Editor.h: Declared PasteOption enum class to encompass the existing allowPlainText
408           and MailBlockquoteHandling arguments to pasteWithPasteboard as well as the new AsQuotation
409           behavior.
410
411         * editing/EditorCommand.cpp:
412         (WebCore::executePasteAsQuotation): Added. Similar to executing Paste.
413         (WebCore::createCommandMap): Added an entry for PasteAsQuotation, based on the Paste entry.
414
415         * editing/cocoa/EditorCocoa.mm:
416         (WebCore::Editor::webContentFromPasteboard): Moved from EditorIOS.mm and EditorMac.mm to
417           here.
418
419         * editing/gtk/EditorGtk.cpp:
420         (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
421           quote the fragment if needed.
422
423         * editing/ios/EditorIOS.mm:
424         (WebCore::Editor::pasteWithPasteboard): Ditto.
425         (WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm.
426
427         * editing/mac/EditorMac.mm:
428         (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
429           quote the fragment if needed.
430         (WebCore::Editor::readSelectionFromPasteboard): Updated for new OptionSet argument to
431           pasteWithPasteboard.
432         (WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm.
433
434         * editing/win/EditorWin.cpp:
435         (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to
436           quote the fragment if needed.
437
438         * editing/wpe/EditorWPE.cpp:
439         (WebCore::Editor::pasteWithPasteboard): Ditto.
440
441 2018-09-11  Simon Fraser  <simon.fraser@apple.com>
442
443         Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings
444         https://bugs.webkit.org/show_bug.cgi?id=189521
445
446         Reviewed by Tim Horton.
447         
448         Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>.
449         
450         RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>.
451         
452         All the other changes are just to adapt to the new ownership patterns.
453         
454         I verified that no GraphicsLayers were leaked or abandoned after this change.
455
456         No behavior change.
457
458         * page/PageOverlayController.cpp:
459         (WebCore::PageOverlayController::layerWithDocumentOverlays):
460         (WebCore::PageOverlayController::layerWithViewOverlays):
461         (WebCore::PageOverlayController::installPageOverlay):
462         (WebCore::PageOverlayController::uninstallPageOverlay):
463         (WebCore::PageOverlayController::setPageOverlayNeedsDisplay):
464         (WebCore::PageOverlayController::didChangeViewSize):
465         (WebCore::PageOverlayController::didChangeDocumentSize):
466         (WebCore::PageOverlayController::didChangeSettings):
467         (WebCore::PageOverlayController::paintContents):
468         (WebCore::PageOverlayController::didChangeOverlayFrame):
469         (WebCore::PageOverlayController::didChangeOverlayBackgroundColor):
470         * page/PageOverlayController.h:
471         * page/mac/ServicesOverlayController.h:
472         (WebCore::ServicesOverlayController::Highlight::layer const):
473         * page/mac/ServicesOverlayController.mm:
474         (WebCore::ServicesOverlayController::Highlight::Highlight):
475         (WebCore::ServicesOverlayController::Highlight::invalidate):
476         (WebCore::ServicesOverlayController::Highlight::fadeIn):
477         (WebCore::ServicesOverlayController::Highlight::fadeOut):
478         (WebCore::ServicesOverlayController::Highlight::didFinishFadeOutAnimation):
479         (WebCore::ServicesOverlayController::determineActiveHighlight):
480         * platform/graphics/GraphicsLayer.cpp:
481         (WebCore::GraphicsLayer::GraphicsLayer):
482         (WebCore::GraphicsLayer::willBeDestroyed):
483         (WebCore::GraphicsLayer::setChildren):
484         (WebCore::GraphicsLayer::addChild):
485         (WebCore::GraphicsLayer::addChildAtIndex):
486         (WebCore::GraphicsLayer::addChildBelow):
487         (WebCore::GraphicsLayer::addChildAbove):
488         (WebCore::GraphicsLayer::replaceChild):
489         (WebCore::GraphicsLayer::removeAllChildren):
490         (WebCore::GraphicsLayer::removeFromParent):
491         (WebCore::GraphicsLayer::setMaskLayer):
492         (WebCore::GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants):
493         (WebCore::GraphicsLayer::distributeOpacity):
494         (WebCore::GraphicsLayer::traverse):
495         (WebCore::dumpChildren):
496         * platform/graphics/GraphicsLayer.h:
497         (WebCore::GraphicsLayer::children const):
498         (WebCore::GraphicsLayer::children):
499         (WebCore::GraphicsLayer::maskLayer const):
500         (WebCore::GraphicsLayer::replicaLayer const):
501         (WebCore::GraphicsLayer::beingDestroyed const):
502         (WebCore::GraphicsLayer:: const): Deleted.
503         * platform/graphics/GraphicsLayerFactory.h:
504         * platform/graphics/ca/GraphicsLayerCA.cpp:
505         (WebCore::GraphicsLayer::create):
506         (WebCore::GraphicsLayerCA::setChildren):
507         (WebCore::GraphicsLayerCA::addChild):
508         (WebCore::GraphicsLayerCA::addChildAtIndex):
509         (WebCore::GraphicsLayerCA::addChildBelow):
510         (WebCore::GraphicsLayerCA::addChildAbove):
511         (WebCore::GraphicsLayerCA::replaceChild):
512         (WebCore::GraphicsLayerCA::setMaskLayer):
513         (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const):
514         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
515         (WebCore::GraphicsLayerCA::updateSublayerList):
516         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
517         * platform/graphics/ca/GraphicsLayerCA.h:
518         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
519         (WebCore::GraphicsLayer::create):
520         (WebCore::GraphicsLayerTextureMapper::setChildren):
521         (WebCore::GraphicsLayerTextureMapper::addChild):
522         (WebCore::GraphicsLayerTextureMapper::addChildAtIndex):
523         (WebCore::GraphicsLayerTextureMapper::addChildAbove):
524         (WebCore::GraphicsLayerTextureMapper::addChildBelow):
525         (WebCore::GraphicsLayerTextureMapper::replaceChild):
526         (WebCore::GraphicsLayerTextureMapper::setMaskLayer):
527         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers):
528         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
529         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
530         (WebCore::GraphicsLayer::create):
531         (WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect):
532         (WebCore::CoordinatedGraphicsLayer::addChild):
533         (WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
534         (WebCore::CoordinatedGraphicsLayer::addChildAbove):
535         (WebCore::CoordinatedGraphicsLayer::addChildBelow):
536         (WebCore::CoordinatedGraphicsLayer::replaceChild):
537         (WebCore::CoordinatedGraphicsLayer::setMaskLayer):
538         (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
539         (WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers):
540         (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
541         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
542         * platform/graphics/win/GraphicsLayerDirect2D.cpp:
543         (WebCore::GraphicsLayer::create):
544         (WebCore::GraphicsLayerDirect2D::GraphicsLayerDirect2D): Deleted.
545         (WebCore::GraphicsLayerDirect2D::initialize): Deleted.
546         (WebCore::GraphicsLayerDirect2D::~GraphicsLayerDirect2D): Deleted.
547         (WebCore::GraphicsLayerDirect2D::setNeedsDisplay): Deleted.
548         (WebCore::GraphicsLayerDirect2D::setNeedsDisplayInRect): Deleted.
549         * rendering/RenderLayerBacking.cpp:
550         (WebCore::RenderLayerBacking::createGraphicsLayer):
551         (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
552         (WebCore::RenderLayerBacking::updateConfiguration):
553         (WebCore::RenderLayerBacking::updateInternalHierarchy):
554         (WebCore::RenderLayerBacking::updateMaskingLayer):
555         (WebCore::RenderLayerBacking::updateChildClippingStrategy):
556         (WebCore::RenderLayerBacking::updateScrollingLayers):
557         * rendering/RenderLayerBacking.h:
558         * rendering/RenderLayerCompositor.cpp:
559         (WebCore::RenderLayerCompositor::updateCompositingLayers):
560         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
561         (WebCore::RenderLayerCompositor::setCompositingParent):
562         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
563         (WebCore::RenderLayerCompositor::parentFrameContentLayers):
564         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
565         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
566         (WebCore::RenderLayerCompositor::updateLayerForHeader):
567         (WebCore::RenderLayerCompositor::updateLayerForFooter):
568         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
569         (WebCore::RenderLayerCompositor::ensureRootLayer):
570         (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged):
571         * rendering/RenderLayerCompositor.h:
572
573 2018-09-12  Alex Christensen  <achristensen@webkit.org>
574
575         Expose fewer of URL's internal members
576         https://bugs.webkit.org/show_bug.cgi?id=189528
577
578         Reviewed by Chris Dumez.
579
580         * loader/appcache/ApplicationCacheStorage.cpp:
581         (WebCore::urlHostHash):
582         * platform/URL.cpp:
583         (WebCore::URL::hostStart const):
584         (WebCore::protocolHostAndPortAreEqual):
585         (WebCore::hostsAreEqual):
586         * platform/URL.h:
587         (WebCore::URL::hostStart const): Deleted.
588         (WebCore::URL::hostEnd const): Deleted.
589
590 2018-09-12  Basuke Suzuki  <Basuke.Suzuki@sony.com>
591
592         [Curl] Implement correct total received bytes.
593         https://bugs.webkit.org/show_bug.cgi?id=189555
594
595         Reviewed by Alex Christensen.
596
597         Curl port only reported total network received bytes before decoding.
598
599         No new test. InspectorTest is only available for WebKitTestRunner.
600
601         * platform/network/curl/CurlRequest.cpp:
602         (WebCore::CurlRequest::didReceiveData):
603         (WebCore::CurlRequest::updateNetworkLoadMetrics):
604         * platform/network/curl/CurlRequest.h:
605
606 2018-09-12  Youenn Fablet  <youenn@apple.com>
607
608         Split RTCRtpParameters idl and header file
609         https://bugs.webkit.org/show_bug.cgi?id=189524
610
611         Reviewed by Eric Carlson.
612
613         This will be easier to manage and will allow to more easily introduce sender/receiver parameters.
614         No change of behavior.
615
616         * CMakeLists.txt:
617         * DerivedSources.make:
618         * Modules/mediastream/RTCDegradationPreference.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
619         * Modules/mediastream/RTCDegradationPreference.idl: Added.
620         * Modules/mediastream/RTCDtxStatus.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
621         * Modules/mediastream/RTCDtxStatus.idl: Added.
622         * Modules/mediastream/RTCPriorityType.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
623         * Modules/mediastream/RTCPriorityType.idl: Added.
624         * Modules/mediastream/RTCRtpCodecParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
625         * Modules/mediastream/RTCRtpCodecParameters.idl: Added.
626         * Modules/mediastream/RTCRtpEncodingParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
627         * Modules/mediastream/RTCRtpEncodingParameters.idl: Added.
628         * Modules/mediastream/RTCRtpFecParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
629         * Modules/mediastream/RTCRtpFecParameters.idl: Added.
630         * Modules/mediastream/RTCRtpHeaderExtensionParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
631         * Modules/mediastream/RTCRtpHeaderExtensionParameters.idl: Added.
632         * Modules/mediastream/RTCRtpParameters.h:
633         * Modules/mediastream/RTCRtpParameters.idl:
634         * Modules/mediastream/RTCRtpRtxParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h.
635         * Modules/mediastream/RTCRtpRtxParameters.idl: Added.
636         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
637         (WebCore::toRTCEncodingParameters):
638         (WebCore::fromRTCEncodingParameters):
639         (WebCore::toRTCHeaderExtensionParameters):
640         (WebCore::fromRTCHeaderExtensionParameters):
641         (WebCore::toRTCCodecParameters):
642         (WebCore::toRTCRtpParameters):
643         (WebCore::fromRTCRtpParameters):
644         * Sources.txt:
645         * WebCore.xcodeproj/project.pbxproj:
646
647 2018-09-12  Ali Juma  <ajuma@chromium.org>
648
649         [IntersectionObserver] Implement rootMargin expansion
650         https://bugs.webkit.org/show_bug.cgi?id=189525
651
652         Reviewed by Simon Fraser.
653
654         Expand the root intersection rectangle by the observer's rootMargin when computing
655         intersections.
656
657         Test: imported/w3c/web-platform-tests/intersection-observer/root-margin.html
658
659         * dom/Document.cpp:
660         (WebCore::expandRootBoundsWithRootMargin):
661         (WebCore::computeIntersectionRects):
662         * page/IntersectionObserver.h:
663         (WebCore::IntersectionObserver::rootMarginBox const):
664         * platform/graphics/FloatRect.h:
665         (WebCore::FloatRect::expand):
666
667 2018-09-12  Fujii Hironori  <Hironori.Fujii@sony.com>
668
669         [Win][Clang] error: non-constant-expression cannot be narrowed from type 'int' to 'SHORT'
670         https://bugs.webkit.org/show_bug.cgi?id=189542
671
672         Reviewed by Alex Christensen.
673
674         No new tests (No behavior change).
675
676         * platform/graphics/win/IntPointWin.cpp:
677         (WebCore::IntPoint::operator POINTS const): Narrowed m_x and m_y by using static_cast.
678
679 2018-09-12  Guillaume Emont  <guijemont@igalia.com>
680
681         Add IGNORE_WARNING_.* macros
682         https://bugs.webkit.org/show_bug.cgi?id=188996
683
684         Reviewed by Michael Catanzaro.
685
686         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
687         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
688         * accessibility/mac/AXObjectCacheMac.mm:
689         (WebCore::AXObjectCache::postPlatformNotification):
690         * accessibility/mac/AccessibilityObjectMac.mm:
691         (WebCore::AccessibilityObject::overrideAttachmentParent):
692         (WebCore::AccessibilityObject::accessibilityIgnoreAttachment const):
693         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
694         (-[WebAccessibilityObjectWrapper renderWidgetChildren]):
695         (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]):
696         (-[WebAccessibilityObjectWrapper role]):
697         (-[WebAccessibilityObjectWrapper roleDescription]):
698         * bridge/objc/WebScriptObject.mm:
699         * bridge/objc/objc_class.mm:
700         (JSC::Bindings::ObjcClass::fieldNamed const):
701         * crypto/CommonCryptoUtilities.cpp:
702         (WebCore::getCommonCryptoDigestAlgorithm):
703         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
704         (WebCore::encryptAES_GCM):
705         (WebCore::decyptAES_GCM):
706         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
707         (WebCore::wrapSerializedCryptoKey):
708         (WebCore::unwrapSerializedCryptoKey):
709         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
710         * css/makeSelectorPseudoElementsMap.py:
711         * editing/TextIterator.cpp:
712         * editing/mac/EditorMac.mm:
713         (WebCore::Editor::pasteWithPasteboard):
714         (WebCore::Editor::takeFindStringFromSelection):
715         (WebCore::Editor::replaceNodeFromPasteboard):
716         * page/mac/EventHandlerMac.mm:
717         (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking):
718         * page/mac/ServicesOverlayController.mm:
719         (WebCore::ServicesOverlayController::Highlight::paintContents):
720         * platform/LocalizedStrings.cpp:
721         (WebCore::formatLocalizedString):
722         * platform/ScreenProperties.h:
723         (WebCore::ScreenData::decode):
724         * platform/gamepad/mac/HIDGamepadProvider.cpp:
725         (WebCore::HIDGamepadProvider::stopMonitoringInput):
726         * platform/graphics/PlatformDisplay.cpp:
727         (WebCore::PlatformDisplay::sharedDisplay):
728         * platform/graphics/SurrogatePairAwareTextIterator.cpp:
729         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
730         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
731         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
732         (WebCore::CDMSessionAVStreamSession::update):
733         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
734         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
735         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack):
736         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const):
737         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
738         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
739         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
740         (WebCore::IGNORE_CLANG_WARNING_END):
741         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
742         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
743         (-[WebAVSampleBufferErrorListener beginObservingRenderer:]):
744         (-[WebAVSampleBufferErrorListener stopObservingRenderer:]):
745         (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]):
746         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
747         (WebCore::IGNORE_CLANG_WARNING_END):
748         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
749         (PlatformCALayer::drawLayerContents):
750         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
751         (WebCore::FontCascade::fontForCombiningCharacterSequence const):
752         * platform/graphics/cg/ImageDecoderCG.cpp:
753         (WebCore::ImageDecoderCG::createFrameImageAtIndex):
754         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
755         (WebCore::GraphicsContext::drawLineForDocumentMarker):
756         * platform/graphics/cocoa/WebGLLayer.h:
757         (IGNORE_CLANG_WARNING):
758         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
759         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
760         * platform/graphics/mac/IconMac.mm:
761         (WebCore::Icon::Icon):
762         * platform/graphics/mac/PDFDocumentImageMac.mm:
763         (WebCore::PDFDocumentImage::drawPDFPage):
764         * platform/graphics/mac/WebKitNSImageExtras.mm:
765         (-[NSImage _web_lockFocusWithDeviceScaleFactor:]):
766         * platform/ios/DragImageIOS.mm:
767         * platform/mac/DragImageMac.mm:
768         (WebCore::scaleDragImage):
769         (WebCore::createDragImageForLink):
770         * platform/mac/LegacyNSPasteboardTypes.h:
771         * platform/mac/LocalCurrentGraphicsContext.mm:
772         (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext):
773         * platform/mac/PasteboardMac.mm:
774         (WebCore::Pasteboard::createForCopyAndPaste):
775         (WebCore::Pasteboard::createForDragAndDrop):
776         (WebCore::setDragImageImpl):
777         * platform/mac/PlatformEventFactoryMac.mm:
778         (WebCore::globalPoint):
779         * platform/mac/SSLKeyGeneratorMac.mm:
780         * platform/mac/ScrollViewMac.mm:
781         (WebCore::ScrollView::platformContentsToScreen const):
782         (WebCore::ScrollView::platformScreenToContents const):
783         * platform/mac/ThemeMac.mm:
784         (WebCore::drawCellFocusRingWithFrameAtTime):
785         * platform/mac/WebPlaybackControlsManager.mm:
786         * platform/mac/WidgetMac.mm:
787         (WebCore::Widget::paint):
788         * platform/mediastream/RealtimeIncomingAudioSource.h:
789         * platform/mediastream/RealtimeIncomingVideoSource.h:
790         * platform/mediastream/RealtimeOutgoingAudioSource.h:
791         * platform/mediastream/RealtimeOutgoingVideoSource.h:
792         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
793         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
794         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
795         * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
796         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
797         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
798         * platform/network/cf/ResourceHandleCFNet.cpp:
799         (WebCore::ResourceHandle::createCFURLConnection):
800         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
801         (WebCore::SocketStreamHandleImpl::reportErrorToClient):
802         * platform/network/create-http-header-name-table:
803         * platform/text/TextEncoding.cpp:
804         * testing/MockLibWebRTCPeerConnection.h:
805         * xml/XPathGrammar.cpp:
806
807 2018-09-12  Pablo Saavedra  <psaavedra@igalia.com>
808
809         Linking against libWPEWebKit-0.1.so is not posible when WPE is build with ENABLE_VIDEO=OFF and ENABLE_WEB_AUDIO=OFF
810         https://bugs.webkit.org/show_bug.cgi?id=189540
811
812         Reviewed by Philippe Normand.
813
814         Related issues:
815
816         This issue is related with changes in https://bugs.webkit.org/show_bug.cgi?id=183080
817         This issue is introduced in https://bugs.webkit.org/show_bug.cgi?id=186547
818
819         No new tests, no changes in the functionality.
820
821         * platform/GStreamer.cmake:
822         * platform/SourcesGLib.txt:
823         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
824         (WebCore::LibWebRTCProvider::webRTCAvailable):
825
826 2018-09-11  Zan Dobersek  <zdobersek@igalia.com>
827
828         Unreviewed WPE build fix.
829
830         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
831         Add extra header inclusions to get this code building after the unified
832         sources system shifted it into a different translation unit.
833
834 2018-09-11  Basuke Suzuki  <Basuke.Suzuki@sony.com>
835
836         [Curl] WebInspector doesn't display request headers added during processing.
837         https://bugs.webkit.org/show_bug.cgi?id=189531
838
839         Reviewed by Alex Christensen.
840
841         While processing the request, Curl port network layer adds some headers to the request
842         such as cookies. Those headers should be displayed in the WebInspector.
843
844         Tested on MiniBrowser.
845
846         * platform/network/curl/CurlRequest.cpp:
847         (WebCore::CurlRequest::didReceiveHeader):
848         (WebCore::CurlRequest::didCompleteTransfer):
849         (WebCore::CurlRequest::updateNetworkLoadMetrics):
850         * platform/network/curl/CurlRequest.h:
851
852 2018-09-11  James Savage  <james.savage@apple.com>
853
854         Follow up to:
855         Expose -apple-system-container-border color to internal web views.
856         https://bugs.webkit.org/show_bug.cgi?id=189178.
857
858         Reviewed by Timothy Hatcher.
859
860         * rendering/RenderThemeMac.mm:
861         (WebCore::RenderThemeMac::systemColor const): Add a separate #if block for
862         Mojave. When I used CSSValueAppleSystemFindHighlightBackground as a template
863         for this change, I had to write out the condition in the first change, but
864         mistakenly thought I could reuse the block here. Turns out the versions were
865         different, and I could not.
866
867 2018-09-11  Youenn Fablet  <youenn@apple.com>
868
869         Remove MediaDevices NoInterfaceObject
870         https://bugs.webkit.org/show_bug.cgi?id=189512
871
872         Reviewed by Alex Christensen.
873
874         Covered by rebased WPT tests.
875
876         * Modules/mediastream/MediaDevices.idl:
877
878 2018-09-11  Jer Noble  <jer.noble@apple.com>
879
880         [MediaCapabilities] Implement MediaEngineConfigurationFactory registration
881         https://bugs.webkit.org/show_bug.cgi?id=189438
882
883         Reviewed by Eric Carlson.
884
885         Implement a mechanism to register platform-specific MediaEngineConfigurationFactory methods, and a mechanism to iterate
886         over those registered factories when createDecodingConfiguration() and createEncodingConfiguration() are called.
887
888         The Factory has been radically simplified; the concept of MediaEngineDecodingConfiguration
889         and MediaEngineEncodingConfiguration and its subclasess have been removed. Since the primary
890         objects representing video and audio configurations are IDLDictionaries, the native objects
891         are just structs full of POD types (and Strings). Since these have no dependencies on
892         higher-level HTML concepts, they can be moved into platform/ and accessed from there. This
893         patch also converts MediaCapabilitiesInfo to an Interface, so its implementation also can
894         become a struct and live in platform/. The MediaEngineDecodingConfigurationMock and
895         MediaEngineEncodingConfigurationMock have been consolidated in a single class which simply
896         parses MediaDecodingConfiguration and MediaEncodingConifguration objects (now that they live
897         in Platform) and return a MediaCapabilitiesInfo object (now that it does too).
898
899         * Modules/mediacapabilities/MediaCapabilities.cpp:
900         (WebCore::isValidVideoConfiguration):
901         (WebCore::MediaCapabilities::decodingInfo):
902         (WebCore::MediaCapabilities::encodingInfo):
903         * Modules/mediacapabilities/MediaCapabilitiesInfo.h: Removed.
904         * Modules/mediacapabilities/MediaCapabilitiesInfo.idl:
905         * Modules/mediacapabilities/VideoConfiguration.idl:
906         * Sources.txt:
907         * WebCore.xcodeproj/project.pbxproj:
908         * platform/MediaCapabilitiesInfo.h: Copied from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h.
909         * platform/mediacapabilities/AudioConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/AudioConfiguration.h.
910         * platform/mediacapabilities/MediaConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaConfiguration.h.
911         * platform/mediacapabilities/MediaDecodingConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaDecodingConfiguration.h.
912         * platform/mediacapabilities/MediaDecodingType.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h.
913         * platform/mediacapabilities/MediaEncodingConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaEncodingConfiguration.h.
914         * platform/mediacapabilities/MediaEncodingType.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaEncodingType.h.
915         * platform/mediacapabilities/MediaEngineConfiguration.cpp: Removed.
916         * platform/mediacapabilities/MediaEngineConfiguration.h: Removed.
917         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
918         (WebCore::factories):
919         (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
920         (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
921         * platform/mediacapabilities/MediaEngineConfigurationFactory.h:
922         * platform/mediacapabilities/MediaEngineEncodingConfiguration.h: Removed.
923         * platform/mediacapabilities/VideoConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/VideoConfiguration.h.
924         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
925         * platform/mock/MediaEngineConfigurationFactoryMock.cpp: Added.
926         (WebCore::canDecodeMedia):
927         (WebCore::canSmoothlyDecodeMedia):
928         (WebCore::canPowerEfficientlyDecodeMedia):
929         (WebCore::canEncodeMedia):
930         (WebCore::canSmoothlyEncodeMedia):
931         (WebCore::canPowerEfficientlyEncodeMedia):
932         (WebCore::MediaEngineConfigurationFactoryMock::createDecodingConfiguration):
933         (WebCore::MediaEngineConfigurationFactoryMock::createEncodingConfiguration):
934         * platform/mock/MediaEngineConfigurationFactoryMock.h: Renamed from Source/WebCore/platform/mediacapabilities/MediaEngineDecodingConfiguration.h.
935         * platform/mock/MediaEngineDecodingConfigurationMock.cpp: Removed.
936         * platform/mock/MediaEngineDecodingConfigurationMock.h: Removed.
937         * platform/mock/MediaEngineEncodingConfigurationMock.cpp: Removed.
938         * platform/mock/MediaEngineEncodingConfigurationMock.h: Removed.
939
940 2018-09-08  Ryosuke Niwa  <rniwa@webkit.org>
941
942         :first-child, :last-child, :nth-child, and :nth-of-type don't work on shadow root's children
943         https://bugs.webkit.org/show_bug.cgi?id=166748
944         <rdar://problem/29649177>
945
946         Reviewed by Yusuke Suzuki.
947
948         Added the support for matching positional pseudo classes. For now, we invalidate whenever a child node
949         of a non-UA ShadowRoot is mutated instead of a fine-grained style invalidation as done for regular elements.
950
951         Tests: fast/shadow-dom/nth-node-on-shadow-child-invalidation.html
952                fast/shadow-dom/nth-node-on-shadow-child-no-jit.html
953                fast/shadow-dom/nth-node-on-shadow-child.html
954
955         * css/SelectorChecker.cpp:
956         (WebCore::SelectorChecker::checkOne const):
957         * cssjit/SelectorCompiler.cpp:
958         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElementOrShadowRoot):
959         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstChild):
960         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsLastChild):
961         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsOnlyChild):
962         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthChildParentCheckAndRelationUpdate):
963         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
964         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf):
965         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthLastChildParentCheckAndRelationUpdate):
966         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild):
967         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChildOf):
968         * dom/ShadowRoot.cpp:
969         (WebCore::ShadowRoot::childrenChanged): Invalidate the subtree whenever a child node is mutated.
970         * dom/ShadowRoot.h:
971         * domjit/DOMJITHelpers.h:
972         (WebCore::DOMJIT::branchTestIsShadowRootFlagOnNode): Added.
973         (WebCore::DOMJIT::branchTestIsElementOrShadowRootFlagOnNode): Added.
974
975 2018-09-11  Per Arne Vollan  <pvollan@apple.com>
976
977         Addressing post-review feedback on r235619.
978         https://bugs.webkit.org/show_bug.cgi?id=187925
979
980         Unreviewed.
981
982         * testing/Internals.cpp:
983         (WebCore::Internals::primaryScreenDisplayID):
984         * testing/Internals.h:
985
986 2018-09-11  Wenson Hsieh  <wenson_hsieh@apple.com>
987
988         [macOS] [WK2] Support changing foreground colors via color panel
989         https://bugs.webkit.org/show_bug.cgi?id=189382
990         <rdar://problem/44227311>
991
992         Reviewed by Ryosuke Niwa.
993
994         Small adjustments to support changing foreground text color using NSColorPanel in WebKit2. See comments below.
995         Tested by FontManagerTests.ChangeFontColorWithColorPanel.
996
997         * editing/EditingStyle.cpp:
998         (WebCore::StyleChange::extractTextStyles):
999
1000         Support setting foreground text color with alpha by using a styled span element rather than a font element with
1001         attributes. To do this, only populate `StyleChange::m_applyFontColor` if the color is opaque. This is because
1002         the font element does not support `rgba()` syntax, so any font colors here with alpha that are serialized to
1003         `rgba()` result in a garbage value for the computed color style.
1004
1005         * editing/FontAttributeChanges.cpp:
1006         (WebCore::FontAttributeChanges::editAction const):
1007
1008         Add a helper to return the relevant EditAction describing this set of FontAttributeChanges.
1009
1010         * editing/FontAttributeChanges.h:
1011         (WebCore::FontChanges::isEmpty const):
1012
1013 2018-09-11  Yusuke Suzuki  <yusukesuzuki@slowstart.org>
1014
1015         Shrink size of ResourseResponseBase
1016         https://bugs.webkit.org/show_bug.cgi?id=189501
1017
1018         Reviewed by Simon Fraser.
1019
1020         We reduce the size of ResourceResponseBase by the following two optimizations.
1021
1022         1. Use bitfields for bool flags and reorder them.
1023
1024         2. Use Markable<> in CacheControlDirectives, which is held by ResourceResponseBase.
1025
1026         This patch reduces the size of ResourceResponseBase from 416 to 392 bytes.
1027
1028         No behavior change.
1029
1030         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1031         (WebCore::WebCoreAVFResourceLoader::responseReceived):
1032         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
1033         * platform/network/CacheValidation.h:
1034         (WebCore::CacheControlDirectives::CacheControlDirectives):
1035         * platform/network/ResourceResponseBase.cpp:
1036         (WebCore::ResourceResponseBase::ResourceResponseBase):
1037         (WebCore::ResourceResponseBase::contentRange const):
1038         * platform/network/ResourceResponseBase.h:
1039         (WebCore::ResourceResponseBase::decode):
1040
1041 2018-09-11  Michael Catanzaro  <mcatanzaro@igalia.com>
1042
1043         Unreviewed, fix some -Wreturn-type warnings
1044
1045         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1046         (WebCore::sourceFromNewReceiver):
1047         * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
1048         (WebCore::toRTCRtpTransceiverDirection):
1049         (WebCore::fromRTCRtpTransceiverDirection):
1050
1051 2018-09-11  Jiewen Tan  <jiewen_tan@apple.com>
1052
1053         Unreviewed, a speculative build fix for r235888.
1054
1055         * Modules/mediastream/MediaDevices.h:
1056         Add class Document forward declaration.
1057
1058 2018-09-11  Woodrow Wang  <woodrow_wang@apple.com>
1059
1060         Add Web API Statistics Collection
1061         https://bugs.webkit.org/show_bug.cgi?id=187773
1062         <rdar://problem/44155162>
1063
1064         Reviewed by Brent Fulgham.
1065
1066         Added data collection for web API statistics, specifically regarding the canvas, font loads, 
1067         screen functions, and navigator functions. The data collection code is placed under a runtime 
1068         enabled feature flag. The statistics are stored in a ResourceLoadStatistics object and written 
1069         to a plist on disk. Added a new file CanvasActivityRecord.h and CanvasActivityRecord.cpp which
1070         includes a struct to keep track of HTML5 canvas element read and writes. 
1071
1072         Tests: http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html
1073                http/tests/webAPIStatistics/font-load-data-collection.html
1074                http/tests/webAPIStatistics/navigator-functions-accessed-data-collection.html
1075                http/tests/webAPIStatistics/screen-functions-accessed-data-collection.html
1076
1077         * Sources.txt:
1078         * WebCore.xcodeproj/project.pbxproj:
1079         * css/CSSFontFaceSource.cpp:
1080         (WebCore::CSSFontFaceSource::load):
1081         * css/CSSFontSelector.cpp:
1082         (WebCore::CSSFontSelector::fontRangesForFamily):
1083         (WebCore::CSSFontSelector::fallbackFontAt):
1084
1085         The following are the functions where we'd like to record a canvas read.
1086
1087         * html/HTMLCanvasElement.cpp:
1088         (WebCore::HTMLCanvasElement::toDataURL):
1089         (WebCore::HTMLCanvasElement::toBlob):
1090         (WebCore::HTMLCanvasElement::getImageData):
1091         (WebCore::HTMLCanvasElement::toMediaSample):
1092         (WebCore::HTMLCanvasElement::captureStream):
1093
1094         The following are the functions where we'd like to record a canvas write.
1095
1096         * html/canvas/CanvasRenderingContext2D.cpp:
1097         (WebCore::CanvasRenderingContext2D::measureText):
1098         (WebCore::CanvasRenderingContext2D::drawTextInternal):
1099
1100         The following files and functions handle the CanvasActivityRecord struct and
1101         its respective functions.
1102
1103         * loader/CanvasActivityRecord.cpp: Added.
1104         (WebCore::CanvasActivityRecord::recordWrittenOrMeasuredText):
1105         (WebCore::CanvasActivityRecord::mergeWith):
1106         * loader/CanvasActivityRecord.h: Added.
1107         (WebCore::CanvasActivityRecord::encode const):
1108         (WebCore::CanvasActivityRecord::decode):
1109
1110         * loader/DocumentThreadableLoader.cpp:
1111         * loader/FrameLoader.cpp:
1112         * loader/ResourceLoadObserver.cpp:
1113         (WebCore::ResourceLoadObserver::logFontLoad):
1114         (WebCore::ResourceLoadObserver::logCanvasRead):
1115         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
1116         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
1117         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
1118
1119         Before, entries in the ResourceLoadStatistics involving HashSets used "origin" as the key. 
1120         Now the encodeHashSet function has been generalized to take any key to encode the entries 
1121         in the HashSet. Also added functionality to encode an OptionSet by converting it to its 
1122         raw bitmask state. 
1123
1124         * loader/ResourceLoadObserver.h:
1125         * loader/ResourceLoadStatistics.cpp:
1126         (WebCore::encodeHashSet):
1127         (WebCore::encodeOriginHashSet):
1128         (WebCore::encodeOptionSet):
1129         (WebCore::encodeFontHashSet):
1130         (WebCore::encodeCanvasActivityRecord):
1131         (WebCore::ResourceLoadStatistics::encode const):
1132         (WebCore::decodeHashSet):
1133         (WebCore::decodeOriginHashSet):
1134         (WebCore::decodeOptionSet):
1135         (WebCore::decodeFontHashSet):
1136         (WebCore::decodeCanvasActivityRecord):
1137         (WebCore::ResourceLoadStatistics::decode):
1138         (WebCore::navigatorAPIEnumToString):
1139         (WebCore::screenAPIEnumToString):
1140         (WebCore::appendNavigatorAPIOptionSet):
1141         (WebCore::appendScreenAPIOptionSet):
1142         (WebCore::ResourceLoadStatistics::toString const):
1143         (WebCore::ResourceLoadStatistics::merge):
1144         * loader/ResourceLoadStatistics.h:
1145         * loader/ResourceTiming.cpp:
1146
1147         The following are the navigator functions recorded for the web API statistics.
1148
1149         * page/Navigator.cpp:
1150         (WebCore::Navigator::appVersion const):
1151         (WebCore::Navigator::userAgent const):
1152         (WebCore::Navigator::plugins):
1153         (WebCore::Navigator::mimeTypes):
1154         (WebCore::Navigator::cookieEnabled const):
1155         (WebCore::Navigator::javaEnabled const):
1156
1157         The following are the screen functions recorded for the web API statistics.
1158
1159         * page/Screen.cpp:
1160         (WebCore::Screen::height const):
1161         (WebCore::Screen::width const):
1162         (WebCore::Screen::colorDepth const):
1163         (WebCore::Screen::pixelDepth const):
1164         (WebCore::Screen::availLeft const):
1165         (WebCore::Screen::availTop const):
1166         (WebCore::Screen::availHeight const):
1167         (WebCore::Screen::availWidth const):
1168
1169 2018-09-11  Pablo Saavedra  <psaavedra@igalia.com>
1170
1171         playbackControlsManagerUpdateTimerFired and
1172         m_playbackControlsManagerUpdateTimer must be
1173         guarded with ENABLE(VIDEO), otherwise the following
1174         error occurs with the VIDEO feature turned off:
1175
1176           error: 'MediaElementSession' has not been declared
1177
1178         Add missing #if ENABLE(VIDEO) Page.cpp and Page.h
1179         https://bugs.webkit.org/show_bug.cgi?id=189500
1180
1181         Reviewed by Anders Carlsson.
1182
1183         * page/Page.cpp:
1184         (WebCore::Page::Page):
1185         (WebCore::Page::schedulePlaybackControlsManagerUpdate):
1186         * page/Page.h:
1187
1188 2018-09-11  Frederic Wang  <fwang@igalia.com>
1189
1190         Refactor filter list checking code
1191         https://bugs.webkit.org/show_bug.cgi?id=185087
1192
1193         Reviewed by Antonio Gomes.
1194
1195         No new tests, behavior unchanged.
1196
1197         * page/animation/KeyframeAnimation.h: Add missing forward-declaration FilterOperations.
1198
1199 == Rolled over to ChangeLog-2018-09-11 ==