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