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