[iOS] position:fixed inside touch-scrollable overflow is mispositioned
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-01-30  Simon Fraser  <simon.fraser@apple.com>
2
3         [iOS] position:fixed inside touch-scrollable overflow is mispositioned
4         https://bugs.webkit.org/show_bug.cgi?id=167604
5         rdar://problem/29500273
6
7         Reviewed by Zalan Bujtas.
8         
9         For layers inside touch-scrollable overflow, RenderLayerBacking::computeParentGraphicsLayerRect() needs
10         to account for the offset from the ancestor compositing layer's origin, to handle scrollable elements with
11         box-shadow, for example.
12         
13         Also make the compositing log output a little easier to read.
14
15         Test: compositing/scrolling/fixed-inside-scroll.html
16
17         * rendering/RenderLayerBacking.cpp:
18         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect):
19         * rendering/RenderLayerCompositor.cpp:
20         (WebCore::RenderLayerCompositor::logLayerInfo):
21
22 2017-01-30  Jer Noble  <jer.noble@apple.com>
23
24         NULL-deref crash at PlatformMediaSession::endInterruption
25         https://bugs.webkit.org/show_bug.cgi?id=167595
26
27         Reviewed by Eric Carlson.
28
29         Use the same, NULL-aware forEachSession() iterator rather than iterating over m_sessions directly.
30
31         * platform/audio/PlatformMediaSessionManager.cpp:
32         (WebCore::PlatformMediaSessionManager::beginInterruption):
33         (WebCore::PlatformMediaSessionManager::endInterruption):
34
35 2017-01-30  Myles C. Maxfield  <mmaxfield@apple.com>
36
37         Correct spacing regression on inter-element complex path shaping on some fonts
38         https://bugs.webkit.org/show_bug.cgi?id=166013
39
40         Reviewed by Simon Fraser.
41
42         This patch brings the implementation of ComplexTextController in-line with the
43         design at https://trac.webkit.org/wiki/ComplexTextController. Previously,
44         ComplexTextController had a few problems:
45         - The total width computed by ComplexTextController didn't match the width if
46         you iterated over the entire string and added up the advances
47         - FontCascade::getGlyphsAndAdvancesForComplexText() tried to compensate for
48         the above by construing the concepts of paint advances as distinct from layout
49         advances
50         - Initial advances were considered part of layout sometimes and part of painting
51         other times, depending on which function reports the information
52         - For RTL runs, the wrong origin was added to the initial advance, and the origin
53         should have been subtracted instead of added
54
55         This patch exhaustively updates every function in ComplexTextController to be
56         consistent with the design linked to above. This design solves all of these
57         problems.
58
59         Tests: ComplexTextControllerTest.InitialAdvanceWithLeftRunInRTL
60                ComplexTextControllerTest.InitialAdvanceInRTL
61                ComplexTextControllerTest.InitialAdvanceWithLeftRunInLTR
62                ComplexTextControllerTest.InitialAdvanceInLTR
63                ComplexTextControllerTest.InitialAdvanceInRTLNoOrigins
64                ComplexTextControllerTest.LeadingExpansion
65                ComplexTextControllerTest.VerticalAdvances
66
67         * platform/graphics/GlyphBuffer.h:
68         (WebCore::GlyphBuffer::setLeadingExpansion): Deleted. No longer necessary.
69         (WebCore::GlyphBuffer::leadingExpansion): Deleted. Ditto.
70         * platform/graphics/cocoa/FontCascadeCocoa.mm:
71         (WebCore::FontCascade::adjustSelectionRectForComplexText): Removed use of
72         unnecessary leadingExpansion().
73         (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText): This function needs
74         to compute paint advances, which means that it can't base this information off
75         of layout advances. This function uses the trick mentioned at the end of the
76         above link to compute the paint offset of an arbitrary glyph in the middle of
77         an RTL run.
78         * platform/graphics/mac/ComplexTextController.cpp:
79         (WebCore::ComplexTextController::computeExpansionOpportunity): Refactored for
80         testing.
81         (WebCore::ComplexTextController::ComplexTextController): Ditto.
82         (WebCore::ComplexTextController::finishConstruction): Ditto.
83         (WebCore::ComplexTextController::offsetForPosition): This function operates on
84         layout advances, and the initial layout advance is already added into the
85         m_adjustedBaseAdvances vector by adjustGlyphsAndAdvances(). Therefore, there is
86         no need to add it again here.
87         (WebCore::ComplexTextController::advance): This function had completely busted
88         logic about the relationship between initial advances and the first origin in
89         each run. Because of the fortunate choice of only representing layout advances 
90         in m_adjustedBaseAdvances, this entire block can be removed and the raw paint
91         initial advance can be reported to the GlyphBuffer. Later in the function, we
92         have to update the logic about how to compute a paint advance given a layout
93         advance and some origins. In particular, there are two tricky pieces here: 1.
94         The layout advance for the first glyph is equal to (initial advance - first
95         origin + first Core Text advance, so computing the paint offset must cancel out
96         the initial layout offset, and 2. the last paint advance in a run must actually
97         end up at the position of the first glyph in the next run, so the next run's
98         initial advance must be queried.
99         (WebCore::ComplexTextController::adjustGlyphsAndAdvances): Previously, we
100         represented an initial advance of a successive run by just adding it to the
101         previous run's last advance. However, this is incompatible with the new model
102         presented in the link above, so we remove this section. We also have to add in
103         the logic that the layout advance for the first glyph is equal to the formula
104         presented above.
105         * platform/graphics/mac/ComplexTextController.h:
106         (WebCore::ComplexTextController::ComplexTextRun::initialAdvance): Adjust comment
107         to reflect reality.
108         (WebCore::ComplexTextController::leadingExpansion): Deleted.
109
110 2017-01-30  Simon Fraser  <simon.fraser@apple.com>
111
112         Fixed elements should not rubber-band in WK2, nor remain at negative offsets
113         https://bugs.webkit.org/show_bug.cgi?id=167484
114         rdar://problem/29453068
115
116         Reviewed by Dean Jackson.
117
118         There were various problems with the layout rect computation:
119         1. It ignored the scrollBehaviorForFixedElements() which we use to avoid rubber-banding fixed
120            elements in WK2, but allow in WK1, so make use of that.
121         2. Sometimes layouts/paints of fixed elements would be triggered when coalesced calls to
122            AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll() failed to
123            copy the layoutViewportOrigin to the scheduled update.
124         3. The layout viewport could be left with a negative top/left after rubber-banding.
125         
126         Also add a way to do unconstrained scrollTo(), so that a test can call window.scrollTo(-10, -10) to
127         simulate rubberbanding.
128
129         Tests: fast/visual-viewport/rubberbanding-viewport-rects-header-footer.html
130                fast/visual-viewport/rubberbanding-viewport-rects.html
131
132         * page/FrameView.cpp:
133         (WebCore::FrameView::computeLayoutViewportOrigin): Handle ScrollBehaviorForFixedElements, incorporating it
134         into logic that clamps layoutViewportOrigin between min/max when rubberbanding is not allowed, or not in progress.
135         (WebCore::FrameView::updateLayoutViewport): Pass in scrollBehaviorForFixedElements().
136         (WebCore::FrameView::visibleDocumentRect): The clamping here was preventing the visible rect from
137         escaping the document bounds, which caused fixed elements to bounce with rubber-banding, so remove the clamping,
138         and fix the logic to allow rubber-banding while taking headers and footers into account.
139         * page/FrameView.h:
140         * page/scrolling/AsyncScrollingCoordinator.cpp:
141         (WebCore::AsyncScrollingCoordinator::scheduleUpdateScrollPositionAfterAsyncScroll): layoutViewportOrigin has to
142         be pushed onto the scheduled update, just like scroll position.
143         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
144         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition): Pass in m_behaviorForFixed.
145         * platform/ScrollView.cpp:
146         (WebCore::ScrollView::ScrollView):
147         (WebCore::ScrollView::adjustScrollPositionWithinRange):
148         (WebCore::ScrollView::setScrollOffset):
149         * platform/ScrollView.h:
150         (WebCore::ScrollView::setAllowsUnclampedScrollPositionForTesting):
151         (WebCore::ScrollView::allowsUnclampedScrollPosition):
152         * testing/InternalSettings.cpp:
153         (WebCore::InternalSettings::setAllowUnclampedScrollPosition):
154         * testing/InternalSettings.h:
155         * testing/InternalSettings.idl:
156
157 2017-01-30  Wenson Hsieh  <wenson_hsieh@apple.com>
158
159         Web content process crashes when initiating a drag on a very large image
160         https://bugs.webkit.org/show_bug.cgi?id=167564
161
162         Reviewed by Beth Dakin.
163
164         If we begin dragging an image element that is too large to show the cached image for, we will show an image file
165         icon instead of the cached image. This may return null if createDragImageIconForCachedImageFilename is
166         unimplemented, so in the meantime, we should not assume that dragImage will always exist before calling into
167         doSystemDrag in doImageDrag and bail from the drag operation if that is the case.
168
169         * page/DragController.cpp:
170         (WebCore::DragController::doImageDrag):
171
172 2017-01-30  Chris Dumez  <cdumez@apple.com>
173
174         Update DiagnosticLoggingClient::logDiagnosticMessageWithValue() to take in the value as a double
175         https://bugs.webkit.org/show_bug.cgi?id=167536
176
177         Reviewed by Darin Adler.
178
179         Update DiagnosticLoggingClient::logDiagnosticMessageWithValue() to take in the value as a double
180         instead of a string. The value needs to be numeric and the current API is error-prone.
181
182         * html/HTMLMediaElement.cpp:
183         (WebCore::HTMLMediaElement::mediaPlayerEngineFailedToLoad):
184         * loader/EmptyClients.cpp:
185         * page/DiagnosticLoggingClient.h:
186
187 2017-01-30  Ryan Haddad  <ryanhaddad@apple.com>
188
189         Unreviewed, rollout r211235 Pointer lock events should be delivered directly to the target element.
190
191         The LayoutTest for this change is frequently failing.
192
193         * page/EventHandler.cpp:
194         (WebCore::EventHandler::handleMousePressEvent):
195         (WebCore::EventHandler::handleMouseDoubleClickEvent):
196         (WebCore::EventHandler::handleMouseMoveEvent):
197         (WebCore::EventHandler::handleMouseReleaseEvent):
198         (WebCore::EventHandler::handleMouseForceEvent):
199         (WebCore::EventHandler::handleWheelEvent):
200         * page/PointerLockController.cpp:
201         (WebCore::PointerLockController::isLocked): Deleted.
202         (WebCore::PointerLockController::dispatchLockedWheelEvent): Deleted.
203         * page/PointerLockController.h:
204
205 2017-01-30  Antoine Quint  <graouts@apple.com>
206
207         LayoutTest media/modern-media-controls/media-controller/media-controller-auto-hide-mouse-leave-after-play.html is flaky
208         https://bugs.webkit.org/show_bug.cgi?id=167254
209         <rdar://problem/30259293>
210
211         Reviewed by Dean Jackson.
212
213         When we would identify that we need to prolong an existing auto-hide timer, when the previous
214         auto-hide timer was marked as non-cancelable, calling _cancelAutoHideTimer() would not actually
215         cancel the previous timer, which would let it fire and hide the controls bar. We now have two
216         methods, _cancelAutoHideTimer() which always cancels the current auto-hide timer, and
217         _cancelNonEnforcedAutoHideTimer() which is used from all other existing call sites, which only
218         cancels the current auto-hide timer if it was marked as cancelable. This, and revised timing in
219         the test itself, make media/modern-media-controls/media-controller/media-controller-auto-hide-
220         mouse-leave-after-play.html a lot more reliable.
221
222         We also make a small drive-by fix where we ensure the "autoHideDelay" property is set first so
223         that setting other members which may set a timer do not used an undefined value for the auto-hide
224         timer delay.
225
226         * Modules/modern-media-controls/controls/controls-bar.js:
227         (ControlsBar.prototype.set visible):
228         (ControlsBar.prototype.handleEvent):
229         (ControlsBar.prototype._cancelNonEnforcedAutoHideTimer):
230         (ControlsBar.prototype._cancelAutoHideTimer):
231
232 2017-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
233
234         REGRESSION(r202615?): [GStreamer] ASSERTION FAILED: isMainThread() in WebCore::BuiltinResourceHandleConstructorMap& WebCore::builtinResourceHandleConstructorMap()
235         https://bugs.webkit.org/show_bug.cgi?id=167003
236
237         Reviewed by Michael Catanzaro.
238
239         Add a way to create a ResourceHandle for a given SoupNetworkSession and use it in the GStreamer streaming client
240         to ensure both the session and the handle are created and destroyed in the secondary thread. This way we also
241         avoid using the default session for downloading HLS fragments.
242
243         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
244         (ResourceHandleStreamingClient::ResourceHandleStreamingClient): Create a SoupNetworkSession and pass it to ResourceHandle::create().
245         * platform/network/ResourceHandle.h: Add create and constructor to receive a SoupNetworkSession.
246         * platform/network/ResourceHandleInternal.h: Add SoupNetworkSession member.
247         * platform/network/soup/ResourceHandleSoup.cpp:
248         (WebCore::ResourceHandleInternal::soupSession): Return the SoupNetworkSession if not nullptr.
249         (WebCore::ResourceHandle::create): Create a ResourceHandle without trying to use any builtin constructor and
250         using the given SoupNetworkSession.
251         (WebCore::ResourceHandle::ResourceHandle): Set the SoupNetworkSession if early request validations didn't fail.
252
253 2017-01-30  Youenn Fablet  <youennf@gmail.com>
254
255         [WebRTC] Add support for libwebrtc data channel
256         https://bugs.webkit.org/show_bug.cgi?id=167489
257
258         Reviewed by Alex Christensen.
259
260         Partially covered by webrtc/datachannel/basic.html but not yet enabled on bots.
261
262         Introducing LibWebRTCDataChannelHandler as the integration layer between WebCore (RTCDataChannel)
263         and libwebrtc (DataChannelObserver).
264
265         * Modules/mediastream/RTCDataChannel.cpp:
266         (WebCore::RTCDataChannel::create):
267         (WebCore::RTCDataChannel::RTCDataChannel):
268         (WebCore::RTCDataChannel::bufferedAmount):
269         (WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
270         * Modules/mediastream/RTCDataChannel.h:
271         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp: Added.
272         (WebCore::LibWebRTCDataChannelHandler::~LibWebRTCDataChannelHandler):
273         (WebCore::LibWebRTCDataChannelHandler::setClient):
274         (WebCore::LibWebRTCDataChannelHandler::sendStringData):
275         (WebCore::LibWebRTCDataChannelHandler::sendRawData):
276         (WebCore::LibWebRTCDataChannelHandler::close):
277         (WebCore::LibWebRTCDataChannelHandler::OnStateChange):
278         (WebCore::LibWebRTCDataChannelHandler::OnMessage):
279         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
280         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
281         (WebCore::LibWebRTCMediaEndpoint::OnRemoveStream):
282         (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
283         (): Deleted.
284         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
285         (WebCore::LibWebRTCPeerConnectionBackend::createDataChannelHandler):
286         * dom/EventNames.h:
287         * platform/mediastream/RTCDataChannelHandler.h:
288         * platform/mediastream/RTCDataChannelHandlerClient.h:
289         * platform/mock/RTCDataChannelHandlerMock.h:
290
291 2017-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
292
293         Several web timing tests crash in GTK+ and AppleWin bots
294         https://bugs.webkit.org/show_bug.cgi?id=167577
295
296         Reviewed by Ryosuke Niwa.
297
298         The problem is that entry is used in both the key, to get name, and in the value with WTFMove. So, the name is
299         invalidated by the move. It could be fixed by simply copying the name, instead of using entry->name, but I think
300         that code could be simplified using HashMap::ensure and then we don't need any string copy, nor even the static
301         insertPerformanceEntry().
302
303         Fix crashes in several imported/w3c/web-platform-tests/user-timing/ tests.
304
305         * page/PerformanceUserTiming.cpp:
306         (WebCore::UserTiming::mark):
307         (WebCore::UserTiming::measure):
308         (WebCore::insertPerformanceEntry): Deleted.
309
310 2017-01-30  Carlos Garcia Campos  <cgarcia@igalia.com>
311
312         [Threaded Compositor] Crash in GraphicsContext3D::deleteTexture when destroying TextureMapperPlatformLayerProxy
313         https://bugs.webkit.org/show_bug.cgi?id=167575
314
315         Reviewed by Žan Doberšek.
316
317         We should clear all the buffers on invalidate to ensure we don't have textures alive after CoordinatedGraphicsScene::purgeGLResources().
318
319         Fix crash in media/video-poster-background.html.
320
321         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
322         (WebCore::TextureMapperPlatformLayerProxy::invalidate): Clear current, pending and all used buffers.
323
324 2017-01-29  Carlos Garcia Campos  <cgarcia@igalia.com>
325
326         [Threaded Compositor] Crash on WebCore::GLContext::version()
327         https://bugs.webkit.org/show_bug.cgi?id=167559
328
329         Reviewed by Michael Catanzaro.
330
331         Fixes crashes in several media tests.
332
333         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
334         (WebCore::TextureMapperPlatformLayerProxy::invalidate): Clear m_compositorThreadUpdateTimer and call the update function.
335
336 2017-01-29  Nan Wang  <n_wang@apple.com>
337
338         AX: WKContentView needs to implement UITextInput methods to make speak selection highlighting work
339         https://bugs.webkit.org/show_bug.cgi?id=166955
340
341         Reviewed by Ryosuke Niwa.
342
343         Created a new version of Range::collectSelectionRect() that returns rects for each
344         line, so that Speak Selection doesn't need to handle searching for soft line breaks.
345         Also added a variant of findPlainText to search for the closest matched range to the given position.
346
347         Test: editing/text-iterator/range-of-string-closest-to-position.html
348
349         * dom/Range.cpp:
350         (WebCore::Range::collectSelectionRectsWithoutUnionInteriorLines):
351         (WebCore::Range::collectSelectionRects):
352         * dom/Range.h:
353         * editing/TextIterator.cpp:
354         (WebCore::findPlainTextMatches):
355         (WebCore::updateSearchBuffer):
356         (WebCore::findIteratorOptions):
357         (WebCore::rangeMatches):
358         (WebCore::findClosestPlainText):
359         (WebCore::findPlainText):
360         (WebCore::findPlainTextOffset): Deleted.
361         * editing/TextIterator.h:
362         * editing/htmlediting.h:
363         * testing/Internals.cpp:
364         (WebCore::Internals::rangeOfStringNearLocation):
365         * testing/Internals.h:
366         * testing/Internals.idl:
367
368 2017-01-29  Andy Estes  <aestes@apple.com>
369
370         [QuickLook] Add a WebPreference to enable saving QuickLook documents in WebKitLegacy
371         https://bugs.webkit.org/show_bug.cgi?id=167563
372         <rdar://problem/30253207>
373
374         Reviewed by Andreas Kling.
375
376         * loader/ios/QuickLook.h: Removed unused declarations.
377         (WebCore::QuickLookHandle::firstRequestURL): Deleted.
378         * loader/ios/QuickLook.mm:
379         (WebCore::removeQLPreviewConverterForURL): Stopped deleting the temporary file here; that's
380         now done in QuickLookDocumentWriter.
381         (addQLPreviewConverterWithFileForURL): Changed from an exported function to a static
382         function since it's now only called inside QuickLook.mm.
383         (WebCore::QuickLookHandle::QuickLookHandle): Stopped initializing m_firstRequestURL.
384         (WebCore::addQLPreviewConverterWithFileForURL): Deleted.
385         (WebCore::qlPreviewConverterFileNameForURL): Deleted.
386         (WebCore::qlPreviewConverterUTIForURL): Deleted.
387         (WebCore::QuickLookHandle::previewRequestURL): Deleted.
388         (WebCore::QuickLookHandle::converter): Deleted.
389
390 2017-01-29  Zalan Bujtas  <zalan@apple.com>
391
392         Simple line layout: PerformanceTests/Layout/simple-line-layout-innertext.html regressed at r211108
393         https://bugs.webkit.org/show_bug.cgi?id=167562
394
395         Reviewed by Antti Koivisto.
396
397         Apparently RunResolver::Run::constructStringForHyphenIfNeeded() is in a superhot codepath.
398         The Run should not have any additional members anyway, so let's construct the hyphenated
399         string on demand.
400         Progression on simple-line-layout-innertext.html is from ~34runs/sec back to ~50runs/sec.
401
402         Covered by existing text.
403
404         * rendering/RenderTreeAsText.cpp:
405         (WebCore::writeSimpleLine):
406         * rendering/SimpleLineLayoutFunctions.cpp:
407         (WebCore::SimpleLineLayout::paintFlow):
408         * rendering/SimpleLineLayoutResolver.cpp:
409         (WebCore::SimpleLineLayout::RunResolver::Run::Run):
410         (WebCore::SimpleLineLayout::RunResolver::Run::textWithHyphen):
411         (WebCore::SimpleLineLayout::RunResolver::Run::text):
412         (WebCore::SimpleLineLayout::RunResolver::Run::constructStringForHyphenIfNeeded): Deleted.
413         * rendering/SimpleLineLayoutResolver.h:
414
415 2017-01-28  Tim Horton  <timothy_horton@apple.com>
416
417         Don't flash a tap highlight for the entirety of an editable WKWebView
418         https://bugs.webkit.org/show_bug.cgi?id=167486
419         <rdar://problem/30193996>
420
421         Reviewed by Dan Bernstein.
422
423         * dom/Document.h:
424         Export.
425
426 2017-01-28  Wenson Hsieh  <wenson_hsieh@apple.com>
427
428         Check USE(APPLE_INTERNAL_SDK) instead of specific headers when importing from WebKitAdditions
429         https://bugs.webkit.org/show_bug.cgi?id=167555
430
431         Reviewed by Dan Bernstein.
432
433         Instead of guarding #import <WebKitAdditions/*> on the existence of the imported file, consult
434         USE(APPLE_INTERNAL_SDK) instead.
435
436         * page/ios/EventHandlerIOS.mm:
437         * platform/ios/DragImageIOS.mm:
438         * platform/ios/PasteboardIOS.mm:
439         * platform/mac/DragDataMac.mm:
440
441 2017-01-28  Yoav Weiss  <yoav@yoav.ws>
442
443         Add Link Preload as an off-by-default experimental feature menu item.
444         https://bugs.webkit.org/show_bug.cgi?id=167201
445
446         Reviewed by Ryosuke Niwa.
447
448         Removed the explicit setting of the Link Preload experimental feature,
449         as it is now on by default for testing.
450
451         No new tests as this just removes methods from settings.
452
453         * testing/InternalSettings.cpp:
454         (WebCore::InternalSettings::Backup::Backup):
455         (WebCore::InternalSettings::Backup::restoreTo):
456         * testing/InternalSettings.h:
457         * testing/InternalSettings.idl:
458
459 2017-01-28  Joseph Pecoraro  <pecoraro@apple.com>
460
461         Fix typo in error message
462         https://bugs.webkit.org/show_bug.cgi?id=167554
463
464         Reviewed by Sam Weinig.
465
466         * bindings/scripts/CodeGenerator.pm:
467         (GetEnumByType):
468
469 2017-01-28  Antoine Quint  <graouts@apple.com>
470
471         [Modern Media Controls] REGRESSION: Video stops playing after going into Full Screen in media documents
472         https://bugs.webkit.org/show_bug.cgi?id=167552
473         <rdar://problem/29601646>
474
475         Reviewed by Eric Carlson.
476
477         In the case of media documents, there is a built-in behavior, implemented in MediaDocument::defaultEventHandler(),
478         that toggles playback when clicking or double-clicking the video. We disable this behavior by adding a "click" event
479         handler on the entire media shadow root and calling "preventDefault()".
480
481         Test: media/modern-media-controls/media-documents/click-on-video-should-not-pause.html
482
483         * Modules/modern-media-controls/media/media-controller.js:
484         (MediaController):
485         (MediaController.prototype.handleEvent):
486         (MediaController.prototype._containerWasClicked):
487
488 2017-01-28  Dan Bernstein  <mitz@apple.com>
489
490         [Xcode] Clean up PAL and WebCore’s build settings a little
491         https://bugs.webkit.org/show_bug.cgi?id=167292
492
493         Reviewed by Sam Weinig.
494
495         * Configurations/Base.xcconfig: Simplified the definition of
496           GCC_WARN_64_TO_32_BIT_CONVERSION, removed the unused build setting PREBINDING, removed
497           a duplicate definition of GCC_GENERATE_DEBUGGING_SYMBOLS, and removed definitions specific
498           to OS X versions that are no longer supported.
499
500         * Configurations/DebugRelease.xcconfig: Removed definitions specific to OS X versions
501           that are no longer supported.
502
503 2017-01-28  Zalan Bujtas  <zalan@apple.com>
504
505         Resolve beforeChild's render tree position before calling addChildIgnoringContinuation.
506         https://bugs.webkit.org/show_bug.cgi?id=167540
507         <rdar://problem/30126535>
508
509         Reviewed by Simon Fraser.
510
511         Use the actual render tree position for the beforeChild when inside a flow thread.
512
513         Test: fast/multicol/assert-on-continuation-with-spanner.html
514
515         * rendering/RenderBlockFlow.cpp:
516         (WebCore::RenderBlockFlow::addChild):
517         * rendering/RenderInline.cpp:
518         (WebCore::RenderInline::addChild):
519         * rendering/RenderMultiColumnFlowThread.cpp:
520         (WebCore::RenderMultiColumnFlowThread::resolveMovedChild):
521
522 2017-01-28  Andreas Kling  <akling@apple.com>
523
524         Avoid synchronous style recalc in dispatchUnloadEvents().
525         <https://webkit.org/b/167551>
526
527         Reviewed by Antti Koivisto.
528
529         It shouldn't be necessary to force a synchronous style resolution in an unloading document.
530         This call has been here since the import of KHTMLPart.
531
532         * loader/FrameLoader.cpp:
533         (WebCore::FrameLoader::dispatchUnloadEvents):
534
535 2017-01-28  Andreas Kling  <akling@apple.com>
536
537         REGRESSION(r196383): Automatic shrink-to-fit of RuleSet no longer works.
538         <https://webkit.org/b/167543>
539
540         Reviewed by Antti Koivisto.
541
542         Re-enable the automatic shrink-to-fit optimization in RuleSet.
543         This was disabled accidentally, which I discovered while investigating
544         the memory footprint of extension stylesheets.
545
546         * css/RuleSet.h:
547
548 2017-01-28  Antti Koivisto  <antti@apple.com>
549
550         Give scripts 'high' load priority
551         https://bugs.webkit.org/show_bug.cgi?id=167550
552
553         Reviewed by Andreas Kling.
554
555         For historical reasons it is currently 'medium', same as web fonts and some other non-parsing blocking things.
556
557         * loader/cache/CachedResource.cpp:
558         (WebCore::CachedResource::defaultPriorityForResourceType):
559
560 2017-01-28  Joseph Pecoraro  <pecoraro@apple.com>
561
562         Add User Timing Experimental Feature
563         https://bugs.webkit.org/show_bug.cgi?id=167542
564         <rdar://problem/22746307>
565
566         Reviewed by Ryosuke Niwa.
567
568         * page/RuntimeEnabledFeatures.h:
569         (WebCore::RuntimeEnabledFeatures::performanceTimelineEnabled):
570         * page/Performance.idl:
571         * page/PerformanceEntry.idl:
572         Make a better RuntimeEnabledFeature named "PerformanceTiming" which
573         is enabled if either UserTiming or ResourceTiming is enabled. This
574         will then expose the APIs that are only useful when at least one of
575         the APIs are available.
576
577         * page/PerformanceEntry.cpp:
578         (WebCore::PerformanceEntry::name): Deleted.
579         (WebCore::PerformanceEntry::entryType): Deleted.
580         (WebCore::PerformanceEntry::startTime): Deleted.
581         (WebCore::PerformanceEntry::duration): Deleted.
582         * page/PerformanceEntry.h:
583         (WebCore::PerformanceEntry::name):
584         (WebCore::PerformanceEntry::entryType):
585         (WebCore::PerformanceEntry::startTime):
586         (WebCore::PerformanceEntry::duration):
587         Inline simple accessors.
588
589         * page/PerformanceUserTiming.cpp:
590         (WebCore::UserTiming::measure):
591         Fix a bug introduced by ExceptionOr refactoring.
592
593         (WebCore::UserTiming::clearMarks):
594         (WebCore::UserTiming::clearMeasures):
595         (WebCore::clearPerformanceEntries):
596         (WebCore::clearPeformanceEntries): Deleted.
597         Fix method name typo.
598
599 2017-01-27  Dan Bernstein  <mitz@apple.com>
600
601         Ignore Xcode’s project.xcworkspace and userdata directories in this new project like we do
602         in other projects.
603
604         * PAL/PAL.xcodeproj: Added property svn:ignore.
605
606 2017-01-27  Andy Estes  <aestes@apple.com>
607
608         Fix the iOS build when USE(QUICK_LOOK) is disabled.
609
610         * testing/Internals.cpp:
611         (WebCore::Internals::setQuickLookPassword):
612         * testing/Internals.h:
613
614 2017-01-27  Yusuke Suzuki  <utatane.tea@gmail.com>
615
616         setTimeout / setInterval's string execution should inherit SourceOrigin correctly
617         https://bugs.webkit.org/show_bug.cgi?id=167097
618
619         Reviewed by Darin Adler.
620
621         Tests: js/dom/modules/import-from-set-interval.html
622                js/dom/modules/import-from-set-timeout.html
623
624         * bindings/js/ScriptController.cpp:
625         (WebCore::ScriptController::executeScriptInWorld):
626
627 2017-01-27  Yusuke Suzuki  <utatane.tea@gmail.com>
628
629         Merge CachedModuleScript and LoadableModuleScript
630         https://bugs.webkit.org/show_bug.cgi?id=167500
631
632         Reviewed by Darin Adler.
633
634         CachedModuleScript becomes duplicate with LoadableModuleScript.
635         And CachedModuleScript does not offer any meaningful functionality
636         to LoadableModuleScript.
637         This patch merges CachedModuleScript to LoadableModuleScript.
638
639         No behavior change.
640
641         * CMakeLists.txt:
642         * WebCore.xcodeproj/project.pbxproj:
643         * bindings/js/CachedModuleScript.cpp: Removed.
644         * bindings/js/CachedModuleScript.h: Removed.
645         * bindings/js/CachedModuleScriptClient.h: Removed.
646         * bindings/js/JSBindingsAllInOne.cpp:
647         * bindings/js/ScriptController.cpp:
648         (WebCore::ScriptController::loadModuleScriptInWorld):
649         (WebCore::ScriptController::loadModuleScript):
650         (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
651         (WebCore::ScriptController::linkAndEvaluateModuleScript):
652         (WebCore::ScriptController::setupModuleScriptHandlers):
653         * bindings/js/ScriptController.h:
654         * dom/LoadableModuleScript.cpp:
655         (WebCore::LoadableModuleScript::create):
656         (WebCore::LoadableModuleScript::LoadableModuleScript):
657         (WebCore::LoadableModuleScript::~LoadableModuleScript):
658         (WebCore::LoadableModuleScript::isLoaded):
659         (WebCore::LoadableModuleScript::error):
660         (WebCore::LoadableModuleScript::wasCanceled):
661         (WebCore::LoadableModuleScript::notifyLoadCompleted):
662         (WebCore::LoadableModuleScript::notifyLoadFailed):
663         (WebCore::LoadableModuleScript::notifyLoadWasCanceled):
664         (WebCore::LoadableModuleScript::execute):
665         (WebCore::LoadableModuleScript::load):
666         (WebCore::LoadableModuleScript::notifyFinished): Deleted.
667         * dom/LoadableModuleScript.h:
668         * dom/ScriptElement.cpp:
669         (WebCore::ScriptElement::executeModuleScript):
670         * dom/ScriptElement.h:
671
672 2017-01-27  Michael Saboff  <msaboff@apple.com>
673
674         JSCustomElementInterface::invokeCallback can be called with a null callback because Weak<>
675         https://bugs.webkit.org/show_bug.cgi?id=167522
676
677         Reviewed by Filip Pizlo.
678
679         Added all provided callbacks to the global object with a private name the same way 
680         that the constructor was added.  This will keep these callbacks from being GC'ed.
681
682         * bindings/js/JSCustomElementRegistryCustom.cpp:
683         (WebCore::JSCustomElementRegistry::define):
684
685 2017-01-27  Myles C. Maxfield  <mmaxfield@apple.com>
686
687         [Cocoa] Prepare ComplexTextController for unit testing
688         https://bugs.webkit.org/show_bug.cgi?id=167493
689
690         Reviewed by Simon Fraser.
691
692         Addressing post-review comments from Simon Fraser.
693
694         * platform/graphics/FontCascade.h:
695         * platform/graphics/mac/ComplexTextController.h:
696         (WebCore::ComplexTextController::ComplexTextRun::createForTesting):
697         * platform/graphics/mac/ComplexTextControllerCoreText.h:
698         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
699
700 2017-01-27  Simon Fraser  <simon.fraser@apple.com>
701
702         Element with a backdrop-filter and a mask may not correctly mask the backdrop
703         https://bugs.webkit.org/show_bug.cgi?id=167456
704         rdar://problem/29320059
705
706         Reviewed by Antoine Quint.
707
708         If a layer had a backdrop filter, but also corner radii that triggered using a mask layer,
709         then the call to updateClippingStrategy() in GraphicsLayerCA::updateBackdropFiltersRect() would
710         set the backdrop layer's mask, but GraphicsLayerCA::updateMaskLayer() would promptly then set
711         the mask layer back to nil.
712
713         Fix by having GraphicsLayerCA::updateMaskLayer() put the mask on the structural layer, if there
714         is one. We always have a structural layer with backdrops, so this will mask both the layer
715         and the backdrop.
716
717         Test: css3/filters/backdrop/backdrop-filter-uneven-corner-radii.html
718
719         * platform/graphics/ca/GraphicsLayerCA.cpp:
720         (WebCore::GraphicsLayerCA::updateMaskLayer):
721         * platform/graphics/mac/WebLayer.mm:
722         (-[CALayer _descriptionWithPrefix:]): Dump the mask layer.
723
724 2017-01-27  Chris Dumez  <cdumez@apple.com>
725
726         Fix remaining bad uses of logDiagnosticMessageWithValue()
727         https://bugs.webkit.org/show_bug.cgi?id=167526
728
729         Reviewed by Alex Christensen.
730
731         Drop unused keys, add new ones.
732
733         * page/DiagnosticLoggingKeys.cpp:
734         (WebCore::DiagnosticLoggingKeys::networkCacheFailureReasonKey):
735         (WebCore::DiagnosticLoggingKeys::networkCacheUnusedReasonKey):
736         (WebCore::DiagnosticLoggingKeys::networkCacheReuseFailureKey):
737         (WebCore::DiagnosticLoggingKeys::backNavigationDeltaKey):
738         (WebCore::DiagnosticLoggingKeys::userZoomActionKey):
739         (WebCore::DiagnosticLoggingKeys::deltaKey): Deleted.
740         (WebCore::DiagnosticLoggingKeys::backNavigationKey): Deleted.
741         (WebCore::DiagnosticLoggingKeys::requestKey): Deleted.
742         (WebCore::DiagnosticLoggingKeys::unusableCachedEntryKey): Deleted.
743         (WebCore::DiagnosticLoggingKeys::userKey): Deleted.
744         (WebCore::DiagnosticLoggingKeys::zoomedKey): Deleted.
745         (WebCore::DiagnosticLoggingKeys::notInCacheKey): Deleted.
746         * page/DiagnosticLoggingKeys.h:
747
748 2017-01-27  Myles C. Maxfield  <mmaxfield@apple.com>
749
750         Proclaim that we are considering font-display, rhythmic sizing, and text decoration level 4
751         https://bugs.webkit.org/show_bug.cgi?id=167340
752
753         Reviewed by Saam Barati.
754
755         * features.json:
756
757 2017-01-27  Chris Dumez  <cdumez@apple.com>
758
759         Fix diagnostic logging under loader/
760         https://bugs.webkit.org/show_bug.cgi?id=167512
761
762         Reviewed by Alex Christensen.
763
764         Fix diagnostic logging under loader/. We should not be using logDiagnosticLoggingWithValue()
765         without a numeric value.
766
767         * loader/ResourceLoader.cpp:
768         (WebCore::logResourceResponseSource):
769         * loader/SubresourceLoader.cpp:
770         (WebCore::logResourceLoaded):
771         * loader/cache/CachedResourceLoader.cpp:
772         (WebCore::logMemoryCacheResourceRequest):
773         (WebCore::CachedResourceLoader::requestResource):
774         (WebCore::logRevalidation):
775         * page/DiagnosticLoggingKeys.cpp:
776         (WebCore::DiagnosticLoggingKeys::memoryCacheEntryDecisionKey):
777         (WebCore::DiagnosticLoggingKeys::memoryCacheUsageKey):
778         (WebCore::DiagnosticLoggingKeys::cachedResourceRevalidationReasonKey):
779         (WebCore::DiagnosticLoggingKeys::resourceLoadedKey):
780         (WebCore::DiagnosticLoggingKeys::resourceResponseSourceKey):
781         * page/DiagnosticLoggingKeys.h:
782
783 2017-01-27  Chris Dumez  <cdumez@apple.com>
784
785         Fix diagnostic logging in media code
786         https://bugs.webkit.org/show_bug.cgi?id=167510
787
788         Reviewed by Alex Christensen.
789
790         Fix diagnostic logging in media code. It should not use logDiagnosticMessageWithValue()
791         with a non-numeric value.
792
793         * html/HTMLMediaElement.cpp:
794         (WebCore::HTMLMediaElement::loadResource):
795         (WebCore::HTMLMediaElement::updatePlayState):
796
797 2017-01-27  Myles C. Maxfield  <mmaxfield@apple.com>
798
799         [Cocoa] Prepare ComplexTextController for unit testing
800         https://bugs.webkit.org/show_bug.cgi?id=167493
801
802         Reviewed by Dean Jackson.
803
804         ComplexTextController has three phases:
805         1. Interrogate Core Text about some text
806         2. Compute layout advances and paint advances from the information retrieved from
807         Core Text
808         3. Iterate through the layout advances or paint advances.
809
810         This patch tests phases 2 and 3 by chopping ComplexTextController between
811         phases 1 and 2, and injecting foreign metrics from a unit test. These metrics
812         have been gathered from real-world uses; however, a layout test is not appropriate
813         because the fonts which produced these metrics are not licensed appropriately.
814         The tests can enforce the correct behavior by using ComplexTextController's
815         public API.
816
817         This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=166013.
818         However, the fix for that bug is quite large, so I've split out this smaller piece
819         to ease the reviewing burden. The tests I've added are disabled for now (because
820         they fail), but will be enabled by the fix to that bug.
821
822         No new tests because there is no behavior change.
823
824         * WebCore.xcodeproj/project.pbxproj:
825         * platform/graphics/FontCascade.h:
826         * platform/graphics/FontDescription.h:
827         * platform/graphics/mac/ComplexTextController.cpp:
828         (WebCore::ComplexTextController::ComplexTextController):
829         (WebCore::ComplexTextController::finishConstruction):
830         * platform/graphics/mac/ComplexTextController.h:
831         (WebCore::ComplexTextController::ComplexTextRun::createForTesting):
832         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
833         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
834
835 2017-01-27  Zalan Bujtas  <zalan@apple.com>
836
837         Simple line layout: Do not bail out on -webkit-line-box-contain: block glyphs unless text overflows vertically.
838         https://bugs.webkit.org/show_bug.cgi?id=167481
839         <rdar://problem/30180150>
840
841         Reviewed by Antti Koivisto.
842
843         Since -webkit-line-box-contain: glyphs requires variable line height support, we can use simple line layout
844         only when each line happen to have the same height ('block' property value is set, glyphs do not overflow the block line height).  
845
846         Test: fast/text/simple-line-layout-line-box-contain-glyphs.html
847
848         * rendering/SimpleLineLayout.cpp:
849         (WebCore::SimpleLineLayout::canUseForText):
850         (WebCore::SimpleLineLayout::canUseForFontAndText):
851         (WebCore::SimpleLineLayout::canUseForStyle):
852         (WebCore::SimpleLineLayout::printReason):
853
854 2017-01-27  Chris Dumez  <cdumez@apple.com>
855
856         Fix PageCache diagnostic logging
857         https://bugs.webkit.org/show_bug.cgi?id=167508
858
859         Reviewed by Sam Weinig.
860
861         Fix PageCache diagnostic logging. It should not call logDiagnosticMessageWithValue()
862         with a non-numeric value. Use logDiagnosticMessage() instead.
863
864         * history/PageCache.cpp:
865         (WebCore::logPageCacheFailureDiagnosticMessage):
866         (WebCore::canCacheFrame):
867         * page/DiagnosticLoggingKeys.cpp:
868         (WebCore::DiagnosticLoggingKeys::pageCacheFailureKey):
869         (WebCore::DiagnosticLoggingKeys::successKey): Deleted.
870         (WebCore::DiagnosticLoggingKeys::failureKey): Deleted.
871         * page/DiagnosticLoggingKeys.h:
872
873 2017-01-27  Devin Rousso  <dcrousso+webkit@gmail.com>
874
875         Styles should not show background-repeat-x/y, or -webkit-mask-repeat-x/y
876         https://bugs.webkit.org/show_bug.cgi?id=167255
877
878         Reviewed by Joseph Pecoraro.
879
880         Test: inspector/css/css-property.html
881
882         * css/makeprop.pl:
883         (addProperty):
884         Add a generated function `isInternalCSSProperty` that checks the given CSSPropertyID against
885         a derived list of properties from CSSProperties.json with "internal-only".
886
887         * inspector/InspectorCSSAgent.cpp:
888         (WebCore::InspectorCSSAgent::getSupportedCSSProperties):
889         * inspector/InspectorStyleSheet.cpp:
890         (WebCore::InspectorStyle::styleWithProperties):
891         Only pass CSS property payloads to the frontend if they are not internal.
892
893 2017-01-27  Antti Koivisto  <antti@apple.com>
894
895         Implement Cache-control: immutable
896         https://bugs.webkit.org/show_bug.cgi?id=167497
897
898         Reviewed by Chris Dumez.
899
900         Cache-control value 'immutable' indicates that a subresource does not change and so does not need to be
901         revalidated on a normal reload. This can significantly speed up reloads and reduce network traffic.
902
903         It is has been implemented in Firefox and is already used by Facebook.
904
905         https://tools.ietf.org/html/draft-mcmanus-immutable-00
906         https://hacks.mozilla.org/2017/01/using-immutable-caching-to-speed-up-the-web/
907
908         This patch implements Cache-control: immutable for memory cache only. A disk cache implementation
909         doesn't seem necessary as the resource is basically always expected to be in memory cache on reload.
910
911         Immutable is only supported for https as suggested by the draft specification (and Gecko implementation).
912
913         Test: http/tests/cache/cache-control-immutable-http.html
914               http/tests/cache/cache-control-immutable-https.html
915
916         * loader/cache/CachedResource.cpp:
917         (WebCore::CachedResource::makeRevalidationDecision):
918
919             On normal reloads (CachePolicyRevalidate) of https resources check for 'Cache-control: immutable'.
920             If the resource is not expired don't revalidate it.
921
922         * platform/network/CacheValidation.cpp:
923         (WebCore::parseCacheControlDirectives):
924         * platform/network/CacheValidation.h:
925         * platform/network/ResourceResponseBase.cpp:
926         (WebCore::ResourceResponseBase::cacheControlContainsImmutable):
927         * platform/network/ResourceResponseBase.h:
928
929 2017-01-27  Youenn Fablet  <youennf@gmail.com>
930
931         [WebRTC] Use MediaEndPointPeerConnection if not using libwebrtc
932         https://bugs.webkit.org/show_bug.cgi?id=167504
933
934         Reviewed by Alex Christensen.
935
936         No change of behavior.
937
938         * Modules/mediastream/MediaEndpointPeerConnection.cpp: If libwebrtc, we should use libwebrtc peer connection backend.
939
940 2017-01-27  Ryan Haddad  <ryanhaddad@apple.com>
941
942         Rebaseline bindings tests after r211238.
943
944         Unreviewed test gardening.
945
946         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
947         (WebCore::JSTestDOMJIT::visitChildren):
948         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
949         (WebCore::JSTestEventTarget::visitChildren):
950         * bindings/scripts/test/JS/JSTestNode.cpp:
951         (WebCore::JSTestNode::visitChildren):
952
953 2017-01-25  Sergio Villar Senin  <svillar@igalia.com>
954
955         [css-grid] Move Grid class out of RenderGrid
956         https://bugs.webkit.org/show_bug.cgi?id=167418
957
958         Reviewed by Antti Koivisto.
959
960         The RenderGrid should be able to use different implementations of
961         the Grid class. The latter is big enough to be in its own file. That
962         would help on the effort of moving the grid track sizing algorithm
963         out of RenderGrid too.
964
965         No new tests required as we're just moving code.
966
967         * CMakeLists.txt:
968         * rendering/Grid.cpp: Added.
969         (WebCore::Grid::Grid):
970         (WebCore::Grid::numTracks):
971         (WebCore::Grid::ensureGridSize):
972         (WebCore::Grid::insert):
973         (WebCore::Grid::setSmallestTracksStart):
974         (WebCore::Grid::smallestTrackStart):
975         (WebCore::Grid::gridItemArea):
976         (WebCore::Grid::setGridItemArea):
977         (WebCore::Grid::setAutoRepeatTracks):
978         (WebCore::Grid::autoRepeatTracks):
979         (WebCore::Grid::setAutoRepeatEmptyColumns):
980         (WebCore::Grid::setAutoRepeatEmptyRows):
981         (WebCore::Grid::hasAutoRepeatEmptyTracks):
982         (WebCore::Grid::isEmptyAutoRepeatTrack):
983         (WebCore::Grid::autoRepeatEmptyTracks):
984         (WebCore::Grid::gridItemSpan):
985         (WebCore::Grid::setNeedsItemsPlacement):
986         (WebCore::GridIterator::GridIterator):
987         (WebCore::GridIterator::nextGridItem):
988         (WebCore::GridIterator::isEmptyAreaEnough):
989         (WebCore::GridIterator::nextEmptyGridArea):
990         * rendering/Grid.h: Added.
991         * rendering/RenderGrid.cpp:
992         (WebCore::RenderGrid::computeEmptyTracksForAutoRepeat):
993         (WebCore::RenderGrid::Grid::numTracks): Deleted.
994         (WebCore::RenderGrid::Grid::ensureGridSize): Deleted.
995         (WebCore::RenderGrid::Grid::insert): Deleted.
996         (WebCore::RenderGrid::Grid::setSmallestTracksStart): Deleted.
997         (WebCore::RenderGrid::Grid::smallestTrackStart): Deleted.
998         (WebCore::RenderGrid::Grid::gridItemArea): Deleted.
999         (WebCore::RenderGrid::Grid::setGridItemArea): Deleted.
1000         (WebCore::RenderGrid::Grid::setAutoRepeatTracks): Deleted.
1001         (WebCore::RenderGrid::Grid::autoRepeatTracks): Deleted.
1002         (WebCore::RenderGrid::Grid::setAutoRepeatEmptyColumns): Deleted.
1003         (WebCore::RenderGrid::Grid::setAutoRepeatEmptyRows): Deleted.
1004         (WebCore::RenderGrid::Grid::hasAutoRepeatEmptyTracks): Deleted.
1005         (WebCore::RenderGrid::Grid::isEmptyAutoRepeatTrack): Deleted.
1006         (WebCore::RenderGrid::Grid::autoRepeatEmptyTracks): Deleted.
1007         (WebCore::RenderGrid::Grid::gridItemSpan): Deleted.
1008         (WebCore::RenderGrid::Grid::setNeedsItemsPlacement): Deleted.
1009         (WebCore::RenderGrid::GridIterator::GridIterator): Deleted.
1010         (WebCore::RenderGrid::GridIterator::nextGridItem): Deleted.
1011         (WebCore::RenderGrid::GridIterator::isEmptyAreaEnough): Deleted.
1012         (WebCore::RenderGrid::GridIterator::nextEmptyGridArea): Deleted.
1013         * rendering/RenderGrid.h:
1014
1015 2017-01-27  Yusuke Suzuki  <utatane.tea@gmail.com>
1016
1017         Implement dynamic-import for WebCore
1018         https://bugs.webkit.org/show_bug.cgi?id=166926
1019
1020         Reviewed by Ryosuke Niwa.
1021
1022         This patch introduces browser side dynamic-import implementation.
1023         The dynamic-import is new ES feature which is now stage 3.
1024         The JSC shell already implements it.
1025
1026         The dynamic-import allows us to kick module loading in a dynamic manner.
1027         For example, you can write,
1028
1029             await module = import(`${HOST}/hello.js`);
1030
1031         The dynamic `import` operator (this is not a function) returns a promise with
1032         module namespace object if the module loading succeeds. Otherwise, it returns
1033         a rejected promise.
1034
1035         And importantly, this feature allows us to kick module loading from classic script.
1036         Previously, module loading can be only used from <script type="module"> tag. And
1037         all the module loading is done statically.
1038
1039         * CMakeLists.txt:
1040         * WebCore.xcodeproj/project.pbxproj:
1041         * bindings/js/CachedModuleScriptLoader.cpp:
1042         (WebCore::CachedModuleScriptLoader::load):
1043         * bindings/js/CachedScriptFetcher.cpp:
1044         (WebCore::CachedScriptFetcher::create):
1045         (WebCore::CachedScriptFetcher::requestModuleScript):
1046         requestModuleScript function is used only when loading a new module script.
1047         So, LoadableClassicScript should use requestScriptWithCache to load itself.
1048         We pass String() for cross origin mode for null cross origin attribute as
1049         specified.
1050
1051         (WebCore::CachedScriptFetcher::requestScriptWithCache):
1052         * bindings/js/CachedScriptFetcher.h:
1053         (WebCore::CachedScriptFetcher::CachedScriptFetcher):
1054         * bindings/js/JSDOMWindowBase.cpp:
1055         (WebCore::JSDOMWindowBase::moduleLoaderImportModule):
1056         * bindings/js/JSDOMWindowBase.h:
1057         * bindings/js/JSLazyEventListener.cpp:
1058         (WebCore::JSLazyEventListener::initializeJSFunction):
1059         * bindings/js/ScriptController.cpp:
1060         (WebCore::ScriptController::executeScript):
1061         * bindings/js/ScriptModuleLoader.cpp:
1062         (WebCore::resolveModuleSpecifier):
1063         Extract the part of resolving module specifier to a static function to use
1064         it in ScriptModuleLoader::resolve and ScriptModuleLoader::importModule.
1065
1066         (WebCore::ScriptModuleLoader::resolve):
1067         (WebCore::rejectPromise):
1068         (WebCore::ScriptModuleLoader::importModule):
1069         New hook moduleLoaderImportModule is implemented. This hook is called when
1070         `import` operator is used. This hook is responsible to
1071             1. resolve the module name to obtain module specifier. (like, resolve the
1072                 relative URL to get absolute URL.)
1073             2. kick module loading with the resolved specifier.
1074         When resolving the module name, the referrer information is needed.
1075         For example, "./script.js" will be resolved to "http://example.com/script.js" if
1076         the referrer module specifier is "http://example.com/".
1077         If `import("./script.js")` is executed in the classic script
1078         src="http://example.com/test.js", it starts loading "http://example.com/script.js".
1079         So the information of the caller of `import` operator is necessary here.
1080         This appropriate referrer is propagated by SourceOrigin.
1081
1082         * bindings/js/ScriptModuleLoader.h:
1083         * dom/InlineClassicScript.h:
1084         * dom/LoadableClassicScript.cpp:
1085         (WebCore::LoadableClassicScript::load):
1086         * dom/LoadableClassicScript.h:
1087         * dom/LoadableModuleScript.h:
1088         * dom/LoadableScript.h:
1089         (WebCore::LoadableScript::LoadableScript):
1090         (WebCore::LoadableScript::isClassicScript): Deleted.
1091         (WebCore::LoadableScript::isModuleScript): Deleted.
1092         * dom/ScriptElement.h:
1093         * dom/ScriptElementCachedScriptFetcher.cpp: Copied from Source/WebCore/dom/InlineClassicScript.h.
1094         (WebCore::ScriptElementCachedScriptFetcher::requestModuleScript):
1095         This requestModuleScript will be used when the script tag (or modules imported from the script tag) uses `import` operator.
1096         In classic scripts, `crossorigin` mode always becomes "omit" while module scripts
1097         propagate the original `crossorigin` value.
1098
1099         * dom/ScriptElementCachedScriptFetcher.h: Copied from Source/WebCore/bindings/js/CachedScriptFetcher.h.
1100         (WebCore::ScriptElementCachedScriptFetcher::crossOriginMode):
1101         (WebCore::ScriptElementCachedScriptFetcher::ScriptElementCachedScriptFetcher):
1102
1103 2017-01-26  Chris Dumez  <cdumez@apple.com>
1104
1105         Revert r210474 it is no longer needed
1106         https://bugs.webkit.org/show_bug.cgi?id=167487
1107
1108         Reviewed by Daniel Bates.
1109
1110         Revert r210474 it is no longer needed after r211254.
1111
1112         * dom/Document.cpp:
1113         (WebCore::Document::canNavigate):
1114         * html/HTMLAnchorElement.cpp:
1115         (WebCore::HTMLAnchorElement::handleClick):
1116         * html/HTMLLinkElement.cpp:
1117         (WebCore::HTMLLinkElement::handleClick):
1118         * loader/FrameLoader.cpp:
1119         (WebCore::FrameLoader::urlSelected):
1120         (WebCore::FrameLoader::submitForm):
1121         (WebCore::FrameLoader::loadFrameRequest):
1122         * mathml/MathMLElement.cpp:
1123         (WebCore::MathMLElement::defaultEventHandler):
1124         * svg/SVGAElement.cpp:
1125         (WebCore::SVGAElement::defaultEventHandler):
1126
1127 2017-01-26  Youenn Fablet  <youennf@gmail.com>
1128
1129         [WebRTC] Implement WebRTC PeerConnection backend based on libwebrtc
1130         https://bugs.webkit.org/show_bug.cgi?id=167289
1131
1132         Reviewed by Alex Christensen.
1133
1134         Introducing an initial implementation of WebRTC peer connection backend based on LibWebRTC.
1135         This is done behind a compilation flag which is off by default, until the implementation is ready.
1136
1137         The backend implements the PeerConnectionBackend API.
1138         The implementation is split into LibWebRTCPeerConnectionBackend which contains mostly generic code and
1139         passes the real work to LibWebRTCMediaEndpoint.
1140         The latter class is implementing the API using LibWebRTC.
1141
1142         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: Added.
1143         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
1144         (WebCore::sessionDescriptionType):
1145         (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
1146         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
1147         (WebCore::LibWebRTCMediaEndpoint::addPendingIceCandidates):
1148         (WebCore::streamId):
1149         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
1150         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
1151         (WebCore::LibWebRTCMediaEndpoint::getStats):
1152         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::StatsCollector):
1153         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
1154         (WebCore::signalingState):
1155         (WebCore::LibWebRTCMediaEndpoint::OnSignalingChange):
1156         (WebCore::trackId):
1157         (WebCore::createMediaStreamTrack):
1158         (WebCore::LibWebRTCMediaEndpoint::addStream):
1159         (WebCore::LibWebRTCMediaEndpoint::OnAddStream):
1160         (WebCore::LibWebRTCMediaEndpoint::OnRemoveStream):
1161         (WebCore::LibWebRTCMediaEndpoint::OnDataChannel):
1162         (WebCore::LibWebRTCMediaEndpoint::stop):
1163         (WebCore::LibWebRTCMediaEndpoint::OnRenegotiationNeeded):
1164         (WebCore::iceConnectionState):
1165         (WebCore::LibWebRTCMediaEndpoint::OnIceConnectionChange):
1166         (WebCore::LibWebRTCMediaEndpoint::OnIceGatheringChange):
1167         (WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
1168         (WebCore::LibWebRTCMediaEndpoint::OnIceCandidatesRemoved):
1169         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
1170         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed):
1171         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionSucceeded):
1172         (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed):
1173         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionSucceeded):
1174         (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed):
1175         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: Added.
1176         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: Added.
1177         (WebCore::createLibWebRTCPeerConnectionBackend):
1178         (WebCore::libWebRTCProvider):
1179         (WebCore::LibWebRTCPeerConnectionBackend::LibWebRTCPeerConnectionBackend):
1180         (WebCore::configurationFromMediaEndpointConfiguration):
1181         (WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
1182         (WebCore::LibWebRTCPeerConnectionBackend::getStats):
1183         (WebCore::LibWebRTCPeerConnectionBackend::doSetLocalDescription):
1184         (WebCore::LibWebRTCPeerConnectionBackend::doSetRemoteDescription):
1185         (WebCore::LibWebRTCPeerConnectionBackend::doCreateOffer):
1186         (WebCore::LibWebRTCPeerConnectionBackend::doCreateAnswer):
1187         (WebCore::LibWebRTCPeerConnectionBackend::doStop):
1188         (WebCore::LibWebRTCPeerConnectionBackend::doAddIceCandidate):
1189         (WebCore::LibWebRTCPeerConnectionBackend::markAsNeedingNegotiation):
1190         (WebCore::LibWebRTCPeerConnectionBackend::createReceiver):
1191         (WebCore::LibWebRTCPeerConnectionBackend::createDataChannelHandler):
1192         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: Added.
1193         * WebCore.xcodeproj/project.pbxproj:
1194
1195 2017-01-26  Chris Dumez  <cdumez@apple.com>
1196
1197         Crash when navigating back to a page in PacheCache when one of its frames has been removed
1198         https://bugs.webkit.org/show_bug.cgi?id=167421
1199         <rdar://problem/30188490>
1200
1201         Reviewed by Darin Adler.
1202
1203         Disallow page caching of a page if:
1204         1. The main window has an opener (i.e. it was opened via window.open)
1205         2. It has ever used window.open()
1206
1207         This is because allowing page caching in this case would allow such
1208         windows to script each other even after one of them entered Page
1209         Cache. Allowing this is dangerous and easily causes crashes.
1210
1211         This is a short term workaround until we find a better solution to
1212         the problem. One issue is this workaround is that navigating back
1213         to a page that has an opener or used window.open() will not longer
1214         get the page from PageCache. As a result, state may be lost upon
1215         navigating back. However, we never guarantee that pages get page
1216         cached, and Chrome does not have a PageCache.
1217
1218         Tests: fast/history/page-cache-after-window-open.html
1219                fast/history/page-cache-back-navigation-crash.html
1220                fast/history/page-cache-with-opener.html
1221
1222         * dom/Document.cpp:
1223         (WebCore::Document::hasEverCalledWindowOpen):
1224         (WebCore::Document::markHasCalledWindowOpen):
1225         * dom/Document.h:
1226         * history/PageCache.cpp:
1227         (WebCore::canCachePage):
1228         * page/DOMWindow.cpp:
1229         (WebCore::DOMWindow::createWindow):
1230         * page/DiagnosticLoggingKeys.cpp:
1231         (WebCore::DiagnosticLoggingKeys::hasCalledWindowOpenKey):
1232         (WebCore::DiagnosticLoggingKeys::hasOpenerKey):
1233         * page/DiagnosticLoggingKeys.h:
1234         * page/Page.cpp:
1235         (WebCore::Page::openedByWindowOpen):
1236         * page/Page.h:
1237         * page/Settings.in:
1238
1239 2017-01-26  Youenn Fablet  <youennf@gmail.com>
1240
1241         [WebRTC] Add a LibWebRTC mock for testing
1242         https://bugs.webkit.org/show_bug.cgi?id=167429
1243
1244         Reviewed by Alex Christensen.
1245
1246         Covered by updated tests although feature is behind a flag, off by default.
1247         MockLibWebRTCPeerConnection will allow us testing the code above the WebRTC implementation above LibWebRTC,
1248         without reyling on it and controlling the way that the peer connections will behave.
1249         Adding support for mock factory to create real peer connections in case where we want to do full testing through the local loopback.
1250
1251         Tests: fast/mediastream/getUserMedia-webaudio.html
1252                webrtc/datachannel/basic.html
1253                webrtc/video.html
1254
1255         * WebCore.xcodeproj/project.pbxproj:
1256         * testing/Internals.cpp:
1257         (WebCore::Internals::Internals):
1258         (WebCore::Internals::useMockRTCPeerConnectionFactory):
1259         * testing/Internals.h:
1260         * testing/Internals.idl:
1261         * testing/MockLibWebRTCPeerConnection.cpp: Added.
1262         (WebCore::useMockRTCPeerConnectionFactory):
1263         (WebCore::MockLibWebRTCPeerConnectionForIceCandidates::MockLibWebRTCPeerConnectionForIceCandidates):
1264         (WebCore::MockLibWebRTCPeerConnectionForIceCandidates::gotLocalDescription):
1265         (WebCore::MockLibWebRTCPeerConnectionForIceConnectionState::MockLibWebRTCPeerConnectionForIceConnectionState):
1266         (WebCore::MockLibWebRTCPeerConnectionForIceConnectionState::gotLocalDescription):
1267         (WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory):
1268         (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
1269         (WebCore::MockLibWebRTCPeerConnectionFactory::CreateLocalMediaStream):
1270         (WebCore::MockLibWebRTCPeerConnection::SetLocalDescription):
1271         (WebCore::MockLibWebRTCPeerConnection::SetRemoteDescription):
1272         (WebCore::MockLibWebRTCPeerConnection::CreateDataChannel):
1273         (WebCore::MockLibWebRTCPeerConnection::AddStream):
1274         (WebCore::MockLibWebRTCPeerConnection::RemoveStream):
1275         (WebCore::MockLibWebRTCPeerConnection::CreateOffer):
1276         (WebCore::MockLibWebRTCPeerConnection::CreateAnswer):
1277         * testing/MockLibWebRTCPeerConnection.h: Added.
1278         (WebCore::MockLibWebRTCPeerConnection::~MockLibWebRTCPeerConnection):
1279         (WebCore::MockLibWebRTCPeerConnection::MockLibWebRTCPeerConnection):
1280         (WebCore::MockLibWebRTCPeerConnection::local_streams):
1281         (WebCore::MockLibWebRTCPeerConnection::remote_streams):
1282         (WebCore::MockLibWebRTCPeerConnection::CreateDtmfSender):
1283         (WebCore::MockLibWebRTCPeerConnection::GetStats):
1284         (WebCore::MockLibWebRTCPeerConnection::local_description):
1285         (WebCore::MockLibWebRTCPeerConnection::remote_description):
1286         (WebCore::MockLibWebRTCPeerConnection::AddIceCandidate):
1287         (WebCore::MockLibWebRTCPeerConnection::RegisterUMAObserver):
1288         (WebCore::MockLibWebRTCPeerConnection::signaling_state):
1289         (WebCore::MockLibWebRTCPeerConnection::ice_connection_state):
1290         (WebCore::MockLibWebRTCPeerConnection::ice_gathering_state):
1291         (WebCore::MockLibWebRTCPeerConnection::StopRtcEventLog):
1292         (WebCore::MockLibWebRTCPeerConnection::Close):
1293         (WebCore::MockLibWebRTCPeerConnection::gotLocalDescription):
1294         (WebCore::MockLibWebRTCIceCandidate::MockLibWebRTCIceCandidate):
1295         (WebCore::MockLibWebRTCAudioTrack::MockLibWebRTCAudioTrack):
1296         (WebCore::MockLibWebRTCVideoTrack::MockLibWebRTCVideoTrack):
1297         (WebCore::MockLibWebRTCDataChannel::MockLibWebRTCDataChannel):
1298         (WebCore::MockLibWebRTCPeerConnectionFactory::create):
1299
1300 2017-01-26  Jeremy Jones  <jeremyj@apple.com>
1301
1302         Page should be able to request pointer lock without user gesture if it relinquished it without a user gesture
1303         https://bugs.webkit.org/show_bug.cgi?id=167126
1304
1305         Reviewed by Jon Lee.
1306
1307         Enabled pointer-lock/locked-element-removed-from-dom.html for WK2.
1308         Not enable in WK1 because of https://bugs.webkit.org/show_bug.cgi?id=167127
1309
1310         This change allows a page to lock the pointer again without a user gesture if it was unlocked by
1311         the page and not by the user. See https://www.w3.org/TR/2016/REC-pointerlock-20161027/ 5.1 Methods
1312
1313         * page/PointerLockController.cpp:
1314
1315         When a document acquires pointer lock with a user gesture, that document is allowed to request pointer lock again
1316         until the user takes an action to end pointer lock. We know it is a user action because user actions always
1317         call requestPointerUnlockAndForceCursorVisible().
1318
1319         When the page requests a pointer unlock (via requestPointerUnlock), that document is allowed to continue to relock
1320         the page. This continues until there is either an unlock request form the user 
1321         via requestPointerUnlockAndForceCursorVisible or a didLosePointerLock without a pointer unlock request.
1322
1323         (WebCore::PointerLockController::PointerLockController):
1324         (WebCore::PointerLockController::requestPointerLock):
1325         (WebCore::PointerLockController::requestPointerUnlock):
1326         (WebCore::PointerLockController::requestPointerUnlockAndForceCursorVisible):
1327         (WebCore::PointerLockController::elementRemoved):
1328         (WebCore::PointerLockController::documentDetached):
1329         (WebCore::PointerLockController::didAcquirePointerLock):
1330         (WebCore::PointerLockController::didLosePointerLock):
1331         (WebCore::PointerLockController::clearElement):
1332         * page/PointerLockController.h:
1333
1334 2017-01-26  Andy Estes  <aestes@apple.com>
1335
1336         [QuickLook] REGRESSION (WebKit2): Requests are made to invalid x-apple-ql-id: URLs
1337         https://bugs.webkit.org/show_bug.cgi?id=167453
1338
1339         Reviewed by Brent Fulgham.
1340
1341         Requests to x-apple-ql-id: URLs should be filtered by
1342         -[QLPreviewConverter safeRequestForRequest:]. This method checks that the URL is one of the
1343         ones generated for the current preview, and changes it to "about:" if it isn't.
1344
1345         WebCore::safeQLURLForDocumentURLAndResourceURL() was responsible for finding the
1346         QLPreviewConverter instance to use by looking it up in an NSMutableDictionary using the
1347         document URL as a key. In WebKit1, this dictionary was populated by the
1348         QuickLookHandleClient when new QuickLookHandles were created, but the WebKit2
1349         QuickLookHandleClient never did this. As a result, requests to invalid URLs were not being
1350         rewritten.
1351
1352         An easy way to load a QuickLook document with invalid URLs is to create an HTML file with a
1353         Microsoft Office extension (e.g. .xls); QuickLook, iWork, and Office support opening HTML
1354         files with Office document extensions. In r207155 we applied a Content Security Policy to
1355         QuickLook documents that only allows x-apple-ql-id: resources to load. This blocked
1356         cross-origin requests from loading, but same-origin requests to URLs that weren't generated
1357         by QLPreviewConverter were still allowed to load.
1358
1359         This change blocks these URLs by calling -[QLPreviewConverter safeRequestForRequest:] in a
1360         way that works for both WebKit1 and WebKit2.
1361
1362         After implementing QuickLook for WebKit2, we found a bug when loading HTML-as-Office
1363         documents (webkit.org/b/135651) that presented as a nil MIME type in the preview
1364         NSURLResponse returned by QLPreviewConverter. Unfortunately r172159 papered over the actual
1365         bug by failing to load previews with nil MIME types.
1366
1367         The real issue was that we were asking for the preview response before QuickLook had
1368         received enough data to determine a MIME type, so this change also removes the bad fix from
1369         r172159 and instead waits until QuickLook has converted the document to ask for its preview
1370         response. This restores the ability to load HTML files with Office document extensions.
1371         These two fixes are combined in a single patch because I don't know how to create an invalid
1372         QuickLook URL for testing without loading an HTML-as-Office document.
1373
1374         Test: quicklook/invalid-ql-id-url.html
1375
1376         * loader/ResourceLoader.cpp:
1377         (WebCore::ResourceLoader::willSendRequestInternal): Called
1378         QuickLookHandle::willSendRequest() if m_documentLoader has a QuickLookHandle.
1379         * loader/cache/CachedResource.cpp:
1380         (WebCore::CachedResource::load): Removed the call to
1381         WebCore::safeQLURLForDocumentURLAndResourceURL().
1382         * loader/ios/QuickLook.h: Removed safeQLURLForDocumentURLAndResourceURL() and declared
1383         QuickLookHandle::willSendRequest().
1384         * loader/ios/QuickLook.mm: Removed _previewResponse and _hasFailed ivars from
1385         WebPreviewConverter.
1386         (-[WebPreviewConverter initWithResourceLoader:resourceResponse:quickLookHandle:]): Stopped
1387         setting _previewResponse.
1388         (-[WebPreviewConverter _sendDidReceiveResponseIfNecessary]): Only emptied _bufferedDataArray
1389         if we haven't already called -_sendDidReceiveResponseIfNecessary; removed the check for a
1390         nil _previewResponse MIME type; accessed -[QLPreviewConverter previewResponse] now that the
1391         document has been converted and asserted its MIME type is non-nil.
1392         (-[WebPreviewConverter connection:didReceiveData:lengthReceived:]): Removed _hasFailed check.
1393         (-[WebPreviewConverter connectionDidFinishLoading:]): Ditto.
1394         (isQuickLookPasswordError): Moved the check for password failure errors to here from
1395         -connection:didFailWithError: for better readability.
1396         (-[WebPreviewConverter connection:didFailWithError:]): Removed _hasFailed check and used
1397         more early returns.
1398         (WebCore::QuickLookHandle::willSendRequest): Filtered the request through
1399         -[QLPreviewConverter safeRequestWithRequest:] if the request URL's scheme is x-apple-ql-id:.
1400         (WebCore::safeQLURLForDocumentURLAndResourceURL): Deleted.
1401
1402 2017-01-26  Keith Miller  <keith_miller@apple.com>
1403
1404         classInfo should take a VM so it is not materialized from the object on each call
1405         https://bugs.webkit.org/show_bug.cgi?id=167424
1406
1407         Rubber Stamped by Michael Saboff.
1408
1409         Previously, classInfo() would get the VM from the target's
1410         MarkedBlock.  Most callers already have a VM on hand, so it is
1411         wasteful to compute the VM from the marked block every time. This
1412         patch refactors some of the most common callers of classInfo(),
1413         jsDynamicCast and inherits to take a VM as well.
1414
1415         * Modules/fetch/FetchBody.cpp:
1416         (WebCore::FetchBody::extract):
1417         * Modules/plugins/QuickTimePluginReplacement.mm:
1418         (WebCore::QuickTimePluginReplacement::installReplacement):
1419         * bindings/js/IDBBindingUtilities.cpp:
1420         (WebCore::createIDBKeyFromValue):
1421         * bindings/js/JSCommandLineAPIHostCustom.cpp:
1422         (WebCore::JSCommandLineAPIHost::getEventListeners):
1423         (WebCore::JSCommandLineAPIHost::databaseId):
1424         (WebCore::JSCommandLineAPIHost::storageId):
1425         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
1426         (WebCore::JSCryptoAlgorithmDictionary::parseAlgorithmIdentifier):
1427         (WebCore::createRsaKeyGenParams):
1428         * bindings/js/JSCryptoCustom.cpp:
1429         (WebCore::JSCrypto::getRandomValues):
1430         * bindings/js/JSCryptoOperationData.cpp:
1431         (WebCore::cryptoOperationDataFromJSValue):
1432         * bindings/js/JSCustomElementInterface.cpp:
1433         (WebCore::constructCustomElementSynchronously):
1434         (WebCore::JSCustomElementInterface::upgradeElement):
1435         * bindings/js/JSDOMBinding.cpp:
1436         (WebCore::valueToDate):
1437         (WebCore::reportException):
1438         (WebCore::retrieveErrorMessage):
1439         * bindings/js/JSDOMBinding.h:
1440         (WebCore::castThisValue):
1441         (WebCore::toPossiblySharedArrayBufferView):
1442         (WebCore::toUnsharedArrayBufferView):
1443         (WebCore::toPossiblySharedInt8Array):
1444         (WebCore::toPossiblySharedInt16Array):
1445         (WebCore::toPossiblySharedInt32Array):
1446         (WebCore::toPossiblySharedUint8Array):
1447         (WebCore::toPossiblySharedUint8ClampedArray):
1448         (WebCore::toPossiblySharedUint16Array):
1449         (WebCore::toPossiblySharedUint32Array):
1450         (WebCore::toPossiblySharedFloat32Array):
1451         (WebCore::toPossiblySharedFloat64Array):
1452         (WebCore::toUnsharedInt8Array):
1453         (WebCore::toUnsharedInt16Array):
1454         (WebCore::toUnsharedInt32Array):
1455         (WebCore::toUnsharedUint8Array):
1456         (WebCore::toUnsharedUint8ClampedArray):
1457         (WebCore::toUnsharedUint16Array):
1458         (WebCore::toUnsharedUint32Array):
1459         (WebCore::toUnsharedFloat32Array):
1460         (WebCore::toUnsharedFloat64Array):
1461         (WebCore::toRefNativeArray):
1462         * bindings/js/JSDOMConstructor.h:
1463         (WebCore::JSDOMConstructorNotConstructable<JSClass>::finishCreation):
1464         (WebCore::JSDOMConstructor<JSClass>::finishCreation):
1465         (WebCore::JSDOMNamedConstructor<JSClass>::finishCreation):
1466         (WebCore::JSBuiltinConstructor<JSClass>::finishCreation):
1467         * bindings/js/JSDOMConvert.h:
1468         (WebCore::Converter<IDLInterface<T>>::convert):
1469         (WebCore::Converter<IDLXPathNSResolver<T>>::convert):
1470         * bindings/js/JSDOMGlobalObject.cpp:
1471         (WebCore::JSDOMGlobalObject::finishCreation):
1472         (WebCore::JSDOMGlobalObject::scriptExecutionContext):
1473         * bindings/js/JSDOMIterator.h:
1474         (WebCore::IteratorTraits>::next):
1475         (WebCore::IteratorTraits>::finishCreation):
1476         * bindings/js/JSDOMWindowBase.cpp:
1477         (WebCore::JSDOMWindowBase::finishCreation):
1478         (WebCore::toJSDOMWindow):
1479         * bindings/js/JSDOMWindowBase.h:
1480         * bindings/js/JSDOMWindowCustom.cpp:
1481         (WebCore::jsDOMWindowWebKit):
1482         (WebCore::JSDOMWindow::toWrapped):
1483         * bindings/js/JSDOMWindowShell.cpp:
1484         (WebCore::JSDOMWindowShell::finishCreation):
1485         (WebCore::JSDOMWindowShell::toWrapped):
1486         * bindings/js/JSDOMWindowShell.h:
1487         * bindings/js/JSDocumentCustom.cpp:
1488         (WebCore::cachedDocumentWrapper):
1489         (WebCore::JSDocument::createTouchList):
1490         * bindings/js/JSDynamicDowncast.h:
1491         (WebCore::JSDynamicCastTrait::cast):
1492         (WebCore::JSDynamicCastTrait<JSNode>::cast):
1493         (WebCore::JSDynamicCastTrait<JSElement>::cast):
1494         (WebCore::JSDynamicCastTrait<JSDocument>::cast):
1495         (WebCore::JSDynamicCastTrait<JSEvent>::cast):
1496         (WebCore::jsDynamicDowncast):
1497         * bindings/js/JSEventListener.cpp:
1498         (WebCore::JSEventListener::handleEvent):
1499         * bindings/js/JSEventTargetCustom.cpp:
1500         (WebCore::JSEventTarget::toWrapped):
1501         (WebCore::jsEventTargetCast):
1502         * bindings/js/JSEventTargetCustom.h:
1503         (WebCore::BindingCaller<JSEventTarget>::callOperation):
1504         * bindings/js/JSExceptionBase.cpp:
1505         (WebCore::toExceptionBase):
1506         * bindings/js/JSExceptionBase.h:
1507         * bindings/js/JSInspectorFrontendHostCustom.cpp:
1508         (WebCore::populateContextMenuItems):
1509         (WebCore::JSInspectorFrontendHost::showContextMenu):
1510         * bindings/js/JSNodeCustom.cpp:
1511         (WebCore::JSNode::insertBefore):
1512         (WebCore::JSNode::replaceChild):
1513         (WebCore::JSNode::removeChild):
1514         (WebCore::JSNode::appendChild):
1515         (WebCore::JSNode::pushEventHandlerScope):
1516         * bindings/js/JSPluginElementFunctions.cpp:
1517         (WebCore::pluginElementPropertyGetter):
1518         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
1519         (WebCore::constructJSReadableStreamDefaultReader):
1520         * bindings/js/JSReadableStreamSourceCustom.cpp:
1521         (WebCore::startReadableStream):
1522         (WebCore::JSReadableStreamSource::start):
1523         (WebCore::pullReadableStream):
1524         * bindings/js/JSSubtleCryptoCustom.cpp:
1525         (WebCore::toCryptoKey):
1526         (WebCore::jsSubtleCryptoFunctionEncryptPromise):
1527         (WebCore::jsSubtleCryptoFunctionDecryptPromise):
1528         (WebCore::jsSubtleCryptoFunctionSignPromise):
1529         (WebCore::jsSubtleCryptoFunctionVerifyPromise):
1530         (WebCore::jsSubtleCryptoFunctionDigestPromise):
1531         (WebCore::jsSubtleCryptoFunctionWrapKeyPromise):
1532         (WebCore::jsSubtleCryptoFunctionUnwrapKeyPromise):
1533         * bindings/js/JSTrackCustom.cpp:
1534         (WebCore::toTrack): Deleted.
1535         * bindings/js/JSTrackCustom.h:
1536         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
1537         (WebCore::JSWebKitSubtleCrypto::encrypt):
1538         (WebCore::JSWebKitSubtleCrypto::decrypt):
1539         (WebCore::JSWebKitSubtleCrypto::sign):
1540         (WebCore::JSWebKitSubtleCrypto::verify):
1541         (WebCore::JSWebKitSubtleCrypto::exportKey):
1542         (WebCore::JSWebKitSubtleCrypto::wrapKey):
1543         (WebCore::JSWebKitSubtleCrypto::unwrapKey):
1544         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1545         (WebCore::JSWorkerGlobalScopeBase::finishCreation):
1546         (WebCore::toJSDedicatedWorkerGlobalScope):
1547         (WebCore::toJSWorkerGlobalScope):
1548         * bindings/js/JSWorkerGlobalScopeBase.h:
1549         * bindings/js/JSXMLHttpRequestCustom.cpp:
1550         (WebCore::JSXMLHttpRequest::send):
1551         * bindings/js/JSXPathNSResolverCustom.cpp:
1552         (WebCore::JSXPathNSResolver::toWrapped):
1553         * bindings/js/ScriptController.cpp:
1554         (WebCore::ScriptController::setupModuleScriptHandlers):
1555         * bindings/js/ScriptModuleLoader.cpp:
1556         (WebCore::ScriptModuleLoader::fetch):
1557         (WebCore::ScriptModuleLoader::evaluate):
1558         * bindings/js/ScriptState.cpp:
1559         (WebCore::domWindowFromExecState):
1560         (WebCore::scriptExecutionContextFromExecState):
1561         * bindings/js/SerializedScriptValue.cpp:
1562         (WebCore::CloneSerializer::isArray):
1563         (WebCore::CloneSerializer::isMap):
1564         (WebCore::CloneSerializer::isSet):
1565         (WebCore::CloneSerializer::dumpArrayBufferView):
1566         (WebCore::CloneSerializer::dumpIfTerminal):
1567         (WebCore::CloneSerializer::serialize):
1568         (WebCore::CloneDeserializer::CloneDeserializer):
1569         (WebCore::CloneDeserializer::readArrayBufferView):
1570         (WebCore::CloneDeserializer::readTerminal):
1571         (WebCore::transferArrayBuffers):
1572         (WebCore::SerializedScriptValue::create):
1573         * bindings/js/StructuredClone.cpp:
1574         (WebCore::structuredCloneArrayBuffer):
1575         (WebCore::structuredCloneArrayBufferView):
1576         * bindings/js/WorkerScriptController.cpp:
1577         (WebCore::WorkerScriptController::evaluate):
1578         * bindings/scripts/CodeGeneratorJS.pm:
1579         (GenerateHeader):
1580         (GenerateOverloadedFunctionOrConstructor):
1581         (GenerateImplementation):
1582         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1583         (WebCore::JSInterfaceName::finishCreation):
1584         (WebCore::jsInterfaceNameConstructor):
1585         (WebCore::setJSInterfaceNameConstructor):
1586         (WebCore::JSInterfaceName::toWrapped):
1587         * bindings/scripts/test/JS/JSInterfaceName.h:
1588         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1589         (WebCore::JSTestActiveDOMObject::finishCreation):
1590         (WebCore::BindingCaller<JSTestActiveDOMObject>::castForAttribute):
1591         (WebCore::BindingCaller<JSTestActiveDOMObject>::castForOperation):
1592         (WebCore::jsTestActiveDOMObjectConstructor):
1593         (WebCore::setJSTestActiveDOMObjectConstructor):
1594         (WebCore::JSTestActiveDOMObject::toWrapped):
1595         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1596         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1597         (WebCore::JSTestCEReactions::finishCreation):
1598         (WebCore::BindingCaller<JSTestCEReactions>::castForAttribute):
1599         (WebCore::BindingCaller<JSTestCEReactions>::castForOperation):
1600         (WebCore::jsTestCEReactionsConstructor):
1601         (WebCore::setJSTestCEReactionsConstructor):
1602         (WebCore::JSTestCEReactions::toWrapped):
1603         * bindings/scripts/test/JS/JSTestCEReactions.h:
1604         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1605         (WebCore::JSTestCEReactionsStringifier::finishCreation):
1606         (WebCore::BindingCaller<JSTestCEReactionsStringifier>::castForAttribute):
1607         (WebCore::BindingCaller<JSTestCEReactionsStringifier>::castForOperation):
1608         (WebCore::jsTestCEReactionsStringifierConstructor):
1609         (WebCore::setJSTestCEReactionsStringifierConstructor):
1610         (WebCore::JSTestCEReactionsStringifier::toWrapped):
1611         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
1612         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1613         (WebCore::JSTestClassWithJSBuiltinConstructor::finishCreation):
1614         (WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
1615         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
1616         (WebCore::JSTestClassWithJSBuiltinConstructor::toWrapped):
1617         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
1618         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1619         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::finishCreation):
1620         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
1621         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
1622         (WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
1623         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
1624         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1625         (WebCore::JSTestCustomNamedGetter::finishCreation):
1626         (WebCore::BindingCaller<JSTestCustomNamedGetter>::castForOperation):
1627         (WebCore::jsTestCustomNamedGetterConstructor):
1628         (WebCore::setJSTestCustomNamedGetterConstructor):
1629         (WebCore::JSTestCustomNamedGetter::toWrapped):
1630         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1631         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
1632         (WebCore::JSTestDOMJIT::finishCreation):
1633         (WebCore::BindingCaller<JSTestDOMJIT>::castForAttribute):
1634         (WebCore::BindingCaller<JSTestDOMJIT>::castForOperation):
1635         (WebCore::jsTestDOMJITConstructor):
1636         (WebCore::setJSTestDOMJITConstructor):
1637         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1638         (WebCore::JSTestEventConstructor::finishCreation):
1639         (WebCore::BindingCaller<JSTestEventConstructor>::castForAttribute):
1640         (WebCore::jsTestEventConstructorConstructor):
1641         (WebCore::setJSTestEventConstructorConstructor):
1642         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1643         (WebCore::JSTestEventTarget::finishCreation):
1644         (WebCore::BindingCaller<JSTestEventTarget>::castForOperation):
1645         (WebCore::jsTestEventTargetConstructor):
1646         (WebCore::setJSTestEventTargetConstructor):
1647         (WebCore::JSTestEventTarget::toWrapped):
1648         * bindings/scripts/test/JS/JSTestEventTarget.h:
1649         * bindings/scripts/test/JS/JSTestException.cpp:
1650         (WebCore::JSTestException::finishCreation):
1651         (WebCore::BindingCaller<JSTestException>::castForAttribute):
1652         (WebCore::jsTestExceptionConstructor):
1653         (WebCore::setJSTestExceptionConstructor):
1654         (WebCore::JSTestException::toWrapped):
1655         * bindings/scripts/test/JS/JSTestException.h:
1656         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1657         (WebCore::JSTestGenerateIsReachable::finishCreation):
1658         (WebCore::jsTestGenerateIsReachableConstructor):
1659         (WebCore::setJSTestGenerateIsReachableConstructor):
1660         (WebCore::JSTestGenerateIsReachable::toWrapped):
1661         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
1662         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1663         (WebCore::JSTestGlobalObject::finishCreation):
1664         (WebCore::BindingCaller<JSTestGlobalObject>::castForAttribute):
1665         (WebCore::BindingCaller<JSTestGlobalObject>::castForOperation):
1666         (WebCore::jsTestGlobalObjectConstructor):
1667         (WebCore::setJSTestGlobalObjectConstructor):
1668         (WebCore::JSTestGlobalObject::toWrapped):
1669         * bindings/scripts/test/JS/JSTestGlobalObject.h:
1670         * bindings/scripts/test/JS/JSTestInterface.cpp:
1671         (WebCore::JSTestInterface::finishCreation):
1672         (WebCore::BindingCaller<JSTestInterface>::castForAttribute):
1673         (WebCore::BindingCaller<JSTestInterface>::castForOperation):
1674         (WebCore::jsTestInterfaceConstructor):
1675         (WebCore::setJSTestInterfaceConstructor):
1676         (WebCore::JSTestInterface::toWrapped):
1677         * bindings/scripts/test/JS/JSTestInterface.h:
1678         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
1679         (WebCore::JSTestInterfaceLeadingUnderscore::finishCreation):
1680         (WebCore::BindingCaller<JSTestInterfaceLeadingUnderscore>::castForAttribute):
1681         (WebCore::jsTestInterfaceLeadingUnderscoreConstructor):
1682         (WebCore::setJSTestInterfaceLeadingUnderscoreConstructor):
1683         (WebCore::JSTestInterfaceLeadingUnderscore::toWrapped):
1684         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h:
1685         * bindings/scripts/test/JS/JSTestIterable.cpp:
1686         (WebCore::JSTestIterable::finishCreation):
1687         (WebCore::BindingCaller<JSTestIterable>::castForOperation):
1688         (WebCore::jsTestIterableConstructor):
1689         (WebCore::setJSTestIterableConstructor):
1690         (WebCore::JSTestIterable::toWrapped):
1691         * bindings/scripts/test/JS/JSTestIterable.h:
1692         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1693         (WebCore::JSTestJSBuiltinConstructor::finishCreation):
1694         (WebCore::BindingCaller<JSTestJSBuiltinConstructor>::castForAttribute):
1695         (WebCore::BindingCaller<JSTestJSBuiltinConstructor>::castForOperation):
1696         (WebCore::jsTestJSBuiltinConstructorConstructor):
1697         (WebCore::setJSTestJSBuiltinConstructorConstructor):
1698         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1699         (WebCore::JSTestMediaQueryListListener::finishCreation):
1700         (WebCore::BindingCaller<JSTestMediaQueryListListener>::castForOperation):
1701         (WebCore::jsTestMediaQueryListListenerConstructor):
1702         (WebCore::setJSTestMediaQueryListListenerConstructor):
1703         (WebCore::JSTestMediaQueryListListener::toWrapped):
1704         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
1705         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1706         (WebCore::JSTestNamedConstructor::finishCreation):
1707         (WebCore::jsTestNamedConstructorConstructor):
1708         (WebCore::setJSTestNamedConstructorConstructor):
1709         (WebCore::JSTestNamedConstructor::toWrapped):
1710         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
1711         * bindings/scripts/test/JS/JSTestNode.cpp:
1712         (WebCore::JSTestNode::finishCreation):
1713         (WebCore::BindingCaller<JSTestNode>::castForAttribute):
1714         (WebCore::BindingCaller<JSTestNode>::castForOperation):
1715         (WebCore::jsTestNodeConstructor):
1716         (WebCore::setJSTestNodeConstructor):
1717         * bindings/scripts/test/JS/JSTestObj.cpp:
1718         (WebCore::JSTestObj::finishCreation):
1719         (WebCore::BindingCaller<JSTestObj>::castForAttribute):
1720         (WebCore::BindingCaller<JSTestObj>::castForOperation):
1721         (WebCore::jsTestObjConstructor):
1722         (WebCore::setJSTestObjConstructor):
1723         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
1724         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
1725         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithDistinguishingUnion):
1726         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWith2DistinguishingUnions):
1727         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithNonDistinguishingUnion):
1728         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableUnion):
1729         (WebCore::jsTestObjPrototypeFunctionOverloadWithNullableNonDistinguishingParameter):
1730         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
1731         (WebCore::JSTestObj::toWrapped):
1732         * bindings/scripts/test/JS/JSTestObj.h:
1733         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1734         (WebCore::JSTestOverloadedConstructorsConstructor::construct):
1735         (WebCore::JSTestOverloadedConstructors::finishCreation):
1736         (WebCore::jsTestOverloadedConstructorsConstructor):
1737         (WebCore::setJSTestOverloadedConstructorsConstructor):
1738         (WebCore::JSTestOverloadedConstructors::toWrapped):
1739         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
1740         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1741         (WebCore::JSTestOverloadedConstructorsWithSequence::finishCreation):
1742         (WebCore::jsTestOverloadedConstructorsWithSequenceConstructor):
1743         (WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):
1744         (WebCore::JSTestOverloadedConstructorsWithSequence::toWrapped):
1745         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
1746         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1747         (WebCore::JSTestOverrideBuiltins::finishCreation):
1748         (WebCore::BindingCaller<JSTestOverrideBuiltins>::castForOperation):
1749         (WebCore::jsTestOverrideBuiltinsConstructor):
1750         (WebCore::setJSTestOverrideBuiltinsConstructor):
1751         (WebCore::JSTestOverrideBuiltins::toWrapped):
1752         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
1753         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1754         (WebCore::JSTestSerialization::finishCreation):
1755         (WebCore::BindingCaller<JSTestSerialization>::castForAttribute):
1756         (WebCore::BindingCaller<JSTestSerialization>::castForOperation):
1757         (WebCore::jsTestSerializationConstructor):
1758         (WebCore::setJSTestSerializationConstructor):
1759         (WebCore::JSTestSerialization::toWrapped):
1760         * bindings/scripts/test/JS/JSTestSerialization.h:
1761         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1762         (WebCore::JSTestSerializedScriptValueInterface::finishCreation):
1763         (WebCore::BindingCaller<JSTestSerializedScriptValueInterface>::castForAttribute):
1764         (WebCore::BindingCaller<JSTestSerializedScriptValueInterface>::castForOperation):
1765         (WebCore::jsTestSerializedScriptValueInterfaceConstructor):
1766         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
1767         (WebCore::JSTestSerializedScriptValueInterface::toWrapped):
1768         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1769         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1770         (WebCore::JSTestTypedefs::finishCreation):
1771         (WebCore::BindingCaller<JSTestTypedefs>::castForAttribute):
1772         (WebCore::BindingCaller<JSTestTypedefs>::castForOperation):
1773         (WebCore::jsTestTypedefsConstructor):
1774         (WebCore::setJSTestTypedefsConstructor):
1775         (WebCore::JSTestTypedefs::toWrapped):
1776         * bindings/scripts/test/JS/JSTestTypedefs.h:
1777         * bridge/c/CRuntimeObject.cpp:
1778         (JSC::Bindings::CRuntimeObject::finishCreation):
1779         * bridge/c/c_instance.cpp:
1780         (JSC::Bindings::CRuntimeMethod::finishCreation):
1781         (JSC::Bindings::CInstance::invokeMethod):
1782         * bridge/c/c_utility.cpp:
1783         (JSC::Bindings::convertValueToNPVariant):
1784         * bridge/objc/ObjCRuntimeObject.mm:
1785         (JSC::Bindings::ObjCRuntimeObject::finishCreation):
1786         * bridge/objc/WebScriptObject.mm:
1787         (-[WebScriptObject setValue:forKey:]):
1788         (+[WebScriptObject _convertValueToObjcValue:originRootObject:rootObject:]):
1789         * bridge/objc/objc_instance.mm:
1790         (ObjCRuntimeMethod::finishCreation):
1791         (ObjcInstance::invokeMethod):
1792         * bridge/objc/objc_runtime.mm:
1793         (JSC::Bindings::ObjcFallbackObjectImp::finishCreation):
1794         (JSC::Bindings::callObjCFallbackObject):
1795         * bridge/runtime_array.cpp:
1796         (JSC::RuntimeArray::finishCreation):
1797         (JSC::RuntimeArray::lengthGetter):
1798         * bridge/runtime_method.cpp:
1799         (JSC::RuntimeMethod::finishCreation):
1800         (JSC::RuntimeMethod::lengthGetter):
1801         (JSC::callRuntimeMethod):
1802         * bridge/runtime_object.cpp:
1803         (JSC::Bindings::RuntimeObject::finishCreation):
1804         (JSC::Bindings::callRuntimeObject):
1805         (JSC::Bindings::callRuntimeConstructor):
1806         * css/FontFace.cpp:
1807         (WebCore::FontFace::create):
1808         * html/HTMLMediaElement.cpp:
1809         (WebCore::controllerJSValue):
1810         (WebCore::HTMLMediaElement::updateCaptionContainer):
1811         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
1812         * inspector/InspectorController.cpp:
1813         (WebCore::InspectorController::canAccessInspectedScriptState):
1814         * inspector/InspectorDOMAgent.cpp:
1815         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1816         (WebCore::InspectorDOMAgent::scriptValueAsNode):
1817         * inspector/WebInjectedScriptHost.cpp:
1818         (WebCore::WebInjectedScriptHost::subtype):
1819         (WebCore::WebInjectedScriptHost::isHTMLAllCollection):
1820         * inspector/WebInjectedScriptHost.h:
1821
1822 2017-01-26  Dean Jackson  <dino@apple.com>
1823
1824         WebGL content in Safari sticks to GPU that it was started on, sometimes causing extra battery drain and difficulty interacting with UI
1825         https://bugs.webkit.org/show_bug.cgi?id=167477
1826         <rdar://problem/29956321>
1827
1828         Reviewed by Tim Horton.
1829
1830         We were not implementing the recommended approach to properly handle
1831         GPU switching, causing some contexts to remain on a GPU and slow
1832         down the machine's UI. It also could stop the discrete GPU from
1833         turning off.
1834
1835         Register for CGL's display reconfiguration notification, so that we
1836         can alert any active CGLContexts and cause them to update.
1837
1838         The code change here doesn't lend itself to automated testing because
1839         it is specific to hardware with multiple GPUs, relies on some separate
1840         tools to detect which GPU is active, and an external method of triggering
1841         a GPU switch. It's best tested by the manual workflow in Radar.
1842
1843         * platform/graphics/GraphicsContext3D.h: Add a macOS-specific update
1844         call.
1845         * platform/graphics/mac/GraphicsContext3DMac.mm:
1846         (WebCore::displayWasReconfigured): The callback for display reconfigurations.
1847         (WebCore::addActiveContext): Helper to keep track of active contexts, so we
1848         can register/unregister the callback when necessary.
1849         (WebCore::removeActiveContext):
1850         (WebCore::GraphicsContext3D::create): Use the new helpers.
1851         (WebCore::GraphicsContext3D::~GraphicsContext3D):
1852         (WebCore::GraphicsContext3D::updateCGLContext): Tell the CGLContextRef to update.
1853
1854 2017-01-26  Commit Queue  <commit-queue@webkit.org>
1855
1856         Unreviewed, rolling out r210328.
1857         https://bugs.webkit.org/show_bug.cgi?id=167476
1858
1859         Blocking bug is fixed <rdar://problem/29957753> (Requested by
1860         keith_miller on #webkit).
1861
1862         Reverted changeset:
1863
1864         "Disable smooth playhead animation for main content media in
1865         the Touch Bar"
1866         https://bugs.webkit.org/show_bug.cgi?id=166715
1867         http://trac.webkit.org/changeset/210328
1868
1869 2017-01-26  Joseph Pecoraro  <pecoraro@apple.com>
1870
1871         Web Inspector: iOS: Memory timeline shows impossible values for Page size (underflowed)
1872         https://bugs.webkit.org/show_bug.cgi?id=167468
1873         <rdar://problem/30099051>
1874
1875         Reviewed by Andreas Kling.
1876
1877         * page/cocoa/ResourceUsageThreadCocoa.mm:
1878         (WebCore::vmPageSize):
1879         This value matches the sysctl value we were attempting to access, and is
1880         the most appropriate when dealing with mach APIs, as we are using here.
1881
1882 2017-01-26  Jer Noble  <jer.noble@apple.com>
1883
1884         Autoplay muted videos stop playback of any streaming app in the background
1885         https://bugs.webkit.org/show_bug.cgi?id=163993
1886         <rdar://problem/29020431>
1887
1888         Reviewed by Eric Carlson.
1889
1890         Added test in TestWebKitAPI, WebKit1.AudioSessionCategoryIOS.
1891
1892         Previously, we would set the audio session category to "playback" if there was a media-
1893         element-type media session, and if there was a session capable of playing audio. But because
1894         this was an "or" operation, we would incorrectly set the category to "playback" if there was
1895         a video element incapable of rendering audio (due to being muted, without an audio track,
1896         etc.), and also a session capable of producing audio, such as WebAudio.
1897
1898         With this change, this turns into an "and" operation; there must be a media element capable
1899         of rendering audio in order to switch the audio session category to "playback".
1900
1901         Additionally, we no longer cache the value of "canProduceAudio()"; it's queried directly
1902         whenever updateSessionState() is called.
1903
1904         * Modules/webaudio/AudioContext.cpp:
1905         (WebCore::AudioContext::constructCommon):
1906         * Modules/webaudio/AudioContext.h:
1907         * html/HTMLMediaElement.cpp:
1908         (WebCore::HTMLMediaElement::insertedInto):
1909         (WebCore::HTMLMediaElement::loadResource):
1910         (WebCore::HTMLMediaElement::setMuted):
1911         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
1912         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
1913         (WebCore::HTMLMediaElement::clearMediaPlayer):
1914         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged):
1915         (WebCore::HTMLMediaElement::presentationType):
1916         (WebCore::HTMLMediaElement::characteristics):
1917         (WebCore::HTMLMediaElement::canProduceAudio):
1918         * html/HTMLMediaElement.h:
1919         * platform/audio/PlatformMediaSession.cpp:
1920         (WebCore::PlatformMediaSession::activeAudioSessionRequired):
1921         (WebCore::PlatformMediaSession::canProduceAudio):
1922         (WebCore::PlatformMediaSession::canProduceAudioChanged):
1923         (WebCore::PlatformMediaSession::setCanProduceAudio): Deleted.
1924         * platform/audio/PlatformMediaSession.h:
1925         (WebCore::PlatformMediaSessionClient::canProduceAudio):
1926         (WebCore::PlatformMediaSession::canProduceAudio): Deleted.
1927         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
1928         (PlatformMediaSessionManager::updateSessionState):
1929
1930 2017-01-26  Filip Pizlo  <fpizlo@apple.com>
1931
1932         EventTarget should visit the JSEventListeners using visitAdditionalChildren
1933         https://bugs.webkit.org/show_bug.cgi?id=167462
1934
1935         Reviewed by Michael Saboff.
1936
1937         No new tests because this is already caught by existing testing. This would show up as ASSERTs
1938         in debug, and we suspect it might be at fault for null deref crashes.
1939         
1940         Previously, EventTarget would have its event listeners visited by its subclasses' visitChildren
1941         methods. Every subclass of EventTarget would call EventTarget's visitJSEventListeners. For
1942         example, this means that if JSFoo has seven classes between it and JSEventTarget in the JSCell
1943         class hierarchy, then JSFoo::visitChildren would end up calling visitJSEventListeners seven extra
1944         times.
1945         
1946         Also, the weird way that visitJSEventListeners was called meant that it was not part of the GC's
1947         output constraint processing. This meant that it would not be called when the GC tried to
1948         terminate. So, if something about the event listener changes during a GC cycle, the GC would
1949         potentially fail to mark one of the references.
1950         
1951         Both problems can be solved by simply moving the call to visitJSEventListeners into
1952         visitAdditionalChildren.
1953
1954         * bindings/js/JSDOMWindowCustom.cpp:
1955         (WebCore::JSDOMWindow::visitAdditionalChildren):
1956         * bindings/js/JSEventTargetCustom.cpp:
1957         (WebCore::JSEventTarget::visitAdditionalChildren):
1958         * bindings/scripts/CodeGeneratorJS.pm:
1959         (GenerateImplementation):
1960         * dom/EventTarget.idl:
1961
1962 2017-01-26  Andy Estes  <aestes@apple.com>
1963
1964         [QuickLook] Create temporary files with NSFileProtectionCompleteUnlessOpen
1965         https://bugs.webkit.org/show_bug.cgi?id=167455
1966         <rdar://problem/12499118>
1967
1968         Reviewed by David Kilzer.
1969
1970         Add the NSFileProtectionKey attribute with value NSFileProtectionCompleteUnlessOpen to
1971         temporary directories created for QuickLook files. Also:
1972
1973         1. Stop calling -[NSFileManager _web_pathWithUniqueFilenameForPath:], since the temporary
1974         directory is already unique and only one file will be placed inside it.
1975         2. Create the temporary file with -[NSFileManager _web_createFileAtPath:contents:attributes:]
1976         instead of with -[NSFileManager _web_createFileAtPathWithIntermediateDirectories:contents:attributes:directoryAttributes:],
1977         since the intermediate directories were already created by createTemporaryDirectory().
1978         3. Explicitly set the temporary directory's attributes with
1979         -[NSFileManager setAttributes:ofItemAtPath:error:].
1980         4. Append the lastPathComponent of fileName to downloadDirectory to ensure fileName isn't
1981         really a relative path.
1982
1983         * loader/ios/QuickLook.h: Stopped declaring QLFileAttributes() and QLDirectoryAttributes().
1984         * loader/ios/QuickLook.mm:
1985         (WebCore::temporaryFileAttributes): Renamed from QLFileAttributes().
1986         (WebCore::temporaryDirectoryAttributes): Renamed from QLDirectoryAttributes().
1987         (WebCore::createTemporaryFileForQuickLook):
1988         (WebCore::QLFileAttributes): Deleted.
1989         (WebCore::QLDirectoryAttributes): Deleted.
1990         * platform/spi/cocoa/NSFileManagerSPI.h: Declared -_web_createFileAtPath:contents:attributes:
1991         and removed declarations for -_web_createFileAtPathWithIntermediateDirectories:contents:attributes:directoryAttributes:
1992         and -_web_pathWithUniqueFilenameForPath:
1993
1994 2017-01-26  Jeremy Jones  <jeremyj@apple.com>
1995
1996         Pointer lock events should be delivered directly to the target element
1997         https://bugs.webkit.org/show_bug.cgi?id=167134
1998
1999         Reviewed by Jon Lee.
2000
2001         pointer-lock/mouse-event-delivery.html: Enabled for mac, added wheel event tests.
2002
2003         When pointer is locked on an element, route mouse events directly to the target element, instead of 
2004         doing the normal event disptach.
2005
2006         * page/EventHandler.cpp:
2007         (WebCore::EventHandler::handleMousePressEvent):
2008         (WebCore::EventHandler::handleMouseDoubleClickEvent):
2009         (WebCore::EventHandler::handleMouseMoveEvent):
2010         (WebCore::EventHandler::handleMouseReleaseEvent):
2011         (WebCore::EventHandler::handleMouseForceEvent):
2012         (WebCore::EventHandler::handleWheelEvent):
2013         * page/PointerLockController.cpp:
2014         (WebCore::PointerLockController::isLocked): Added.
2015         (WebCore::PointerLockController::dispatchLockedWheelEvent): Added.
2016         * page/PointerLockController.h:
2017
2018 2017-01-26  Chris Dumez  <cdumez@apple.com>
2019
2020         Fix CPU / Memory diagnostic logging in PerformanceMonitor
2021         https://bugs.webkit.org/show_bug.cgi?id=167469
2022         <rdar://problem/30220959>
2023
2024         Reviewed by Alex Christensen.
2025
2026         Fix CPU / Memory diagnostic logging in PerformanceMonitor to use logDiagnosticMessage()
2027         instead of logDiagnosticMessageWithValue(). logDiagnosticMessageWithValue() should only
2028         be used with numeric values but we already take care of the bucketing on our side.
2029
2030         * page/DiagnosticLoggingClient.h:
2031         * page/DiagnosticLoggingKeys.cpp:
2032         (WebCore::DiagnosticLoggingKeys::postPageBackgroundingCPUUsageKey):
2033         (WebCore::DiagnosticLoggingKeys::postPageBackgroundingMemoryUsageKey):
2034         (WebCore::DiagnosticLoggingKeys::postPageLoadCPUUsageKey):
2035         (WebCore::DiagnosticLoggingKeys::postPageLoadMemoryUsageKey):
2036         (WebCore::DiagnosticLoggingKeys::foregroundCPUUsageToDiagnosticLoggingKey):
2037         (WebCore::DiagnosticLoggingKeys::backgroundCPUUsageToDiagnosticLoggingKey):
2038         (WebCore::DiagnosticLoggingKeys::postPageBackgroundingKey): Deleted.
2039         (WebCore::DiagnosticLoggingKeys::postPageLoadKey): Deleted.
2040         (WebCore::DiagnosticLoggingKeys::memoryUsageKey): Deleted.
2041         * page/DiagnosticLoggingKeys.h:
2042         * page/PerformanceMonitor.cpp:
2043         (WebCore::PerformanceMonitor::measurePostLoadCPUUsage):
2044         (WebCore::PerformanceMonitor::measurePostLoadMemoryUsage):
2045         (WebCore::PerformanceMonitor::measurePostBackgroundingMemoryUsage):
2046         (WebCore::PerformanceMonitor::measurePostBackgroundingCPUUsage):
2047
2048 2017-01-26  Brady Eidson  <beidson@apple.com>
2049
2050         Gamepads: Some DPads are still not exposed in the HID backend.
2051         rdar://problem/30217518 and https://bugs.webkit.org/show_bug.cgi?id=167465
2052
2053         Reviewed by Alex Christensen.
2054
2055         No new tests (Currently unable to test HID backend directly)
2056
2057         * platform/gamepad/mac/HIDGamepad.cpp:
2058         (WebCore::HIDGamepad::maybeAddButton): Allow GenericDesktop paged elements that are DPads to be buttons.
2059
2060 2017-01-26  Commit Queue  <commit-queue@webkit.org>
2061
2062         Unreviewed, rolling out r210095.
2063         https://bugs.webkit.org/show_bug.cgi?id=167464
2064
2065         broke tiling on mac (Requested by thorton on #webkit).
2066
2067         Reverted changeset:
2068
2069         "TileGrid revalidates tiles twice during flush, first with
2070         wrong visible rect"
2071         https://bugs.webkit.org/show_bug.cgi?id=166406
2072         http://trac.webkit.org/changeset/210095
2073
2074 2017-01-26  Chris Dumez  <cdumez@apple.com>
2075
2076         Fix WebGL diagnostic logging
2077         https://bugs.webkit.org/show_bug.cgi?id=167463
2078         <rdar://problem/30216981>
2079
2080         Reviewed by Alex Christensen.
2081
2082         Fix WebGL diagnostic logging so that it no longer uses logDiagnosticMessageWithValue().
2083         This is because the value apparently needs to be numeric on Mac.
2084
2085         * html/canvas/WebGLRenderingContextBase.cpp:
2086         (WebCore::WebGLRenderingContextBase::checkForContextLossHandling):
2087         * page/DiagnosticLoggingKeys.cpp:
2088         (WebCore::DiagnosticLoggingKeys::pageHandlesWebGLContextLossKey):
2089         (WebCore::WebCore::DiagnosticLoggingKeys::webGLStateKey):
2090         (WebCore::DiagnosticLoggingKeys::stateKey): Deleted.
2091         (WebCore::DiagnosticLoggingKeys::handlesContextLossKey): Deleted.
2092         (WebCore::WebCore::DiagnosticLoggingKeys::webGLKey): Deleted.
2093         * page/DiagnosticLoggingKeys.h:
2094
2095 2017-01-26  Zalan Bujtas  <zalan@apple.com>
2096
2097         Simple line layout: Add support for -webkit-hyphenate-limit-lines
2098         https://bugs.webkit.org/show_bug.cgi?id=167446
2099         <rdar://problem/30194030>
2100
2101         Reviewed by Antti Koivisto.
2102
2103         Now we can set the limit on the number of lines that a word can split across through hyphenation.
2104
2105         Tests: fast/text/simple-line-layout-hyphen-limit-lines.html
2106                fast/text/simple-line-layout-hyphen-limit-lines2.html
2107
2108         * rendering/SimpleLineLayout.cpp:
2109         (WebCore::SimpleLineLayout::canUseForStyle):
2110         (WebCore::SimpleLineLayout::splitFragmentToFitLine):
2111         (WebCore::SimpleLineLayout::printReason):
2112         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2113         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
2114         * rendering/SimpleLineLayoutTextFragmentIterator.h:
2115         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
2116         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::wrappingWithHyphenCounter):
2117         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen): The right side of the split has +1 on the wrapping counter.
2118
2119 2017-01-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2120
2121         Add support for recognizing data interaction gestures in WebKit2
2122         https://bugs.webkit.org/show_bug.cgi?id=167444
2123
2124         Reviewed by Beth Dakin.
2125
2126         Minor tweaks to pasteboard code to support data interaction.
2127
2128         * WebCore.xcodeproj/project.pbxproj:
2129         * platform/PlatformPasteboard.h:
2130         * platform/ios/PasteboardIOS.mm:
2131         (WebCore::Pasteboard::read):
2132         * platform/ios/PlatformPasteboardIOS.mm:
2133         (WebCore::PlatformPasteboard::PlatformPasteboard):
2134
2135         If the pasteboard is the special data interaction type, use the shared item provider pasteboard; otherwise,
2136         fall back to the general pasteboard.
2137
2138         (WebCore::PlatformPasteboard::getTypes):
2139
2140         Actually populate the list of available types using available pasteboardTypes.
2141
2142         (WebCore::PlatformPasteboard::write):
2143
2144         Add UTF8 plaintext type (kUTTypeUTF8PlainText) when vending data representations of rich text.
2145
2146         * platform/ios/WebItemProviderPasteboard.mm:
2147         (-[WebItemProviderPasteboard setItems:]):
2148         (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
2149         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
2150
2151         Move off of deprecated methods when retrieving and supplying data to the item provider pasteboard.
2152
2153         * platform/spi/ios/UIKitSPI.h:
2154
2155 2017-01-26  Matt Rajca  <mrajca@apple.com>
2156
2157         Notify clients when the user plays media otherwise prevented from autoplaying
2158         https://bugs.webkit.org/show_bug.cgi?id=167390
2159
2160         Reviewed by Alex Christensen.
2161
2162         The API is tested.
2163
2164         * html/HTMLMediaElement.cpp:
2165         (WebCore::HTMLMediaElement::playInternal):
2166         * page/ChromeClient.h:
2167
2168 2017-01-26  Enrique Ocaña González  <eocanha@igalia.com>
2169
2170         [GStreamer] ASSERTION FAILED: !g_object_is_floating(ptr) in adoptGRef(GstContext* ptr)
2171         https://bugs.webkit.org/show_bug.cgi?id=167458
2172
2173         Reviewed by Xabier Rodriguez-Calvar.
2174
2175         GstContext is a mini_object, not a GObject. Therefore it shouldn't (and can't) be checked for floatingness.
2176
2177         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
2178         (WTF::adoptGRef): Removed incorrect assertion.
2179
2180 2017-01-26  Zalan Bujtas  <zalan@apple.com>
2181
2182         Simple line layout: Add support for -webkit-hyphenate-limit-after and -webkit-hyphenate-limit-before
2183         https://bugs.webkit.org/show_bug.cgi?id=167439
2184         <rdar://problem/30180184>
2185
2186         Reviewed by Antti Koivisto.
2187
2188         Implement pre and post hyphen length constrains for simple line layout.
2189
2190         Tests: fast/text/simple-line-layout-hyphen-limit-after.html
2191                fast/text/simple-line-layout-hyphen-limit-before.html
2192
2193         * rendering/SimpleLineLayout.cpp:
2194         (WebCore::SimpleLineLayout::canUseForStyle):
2195         (WebCore::SimpleLineLayout::printReason):
2196         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2197         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style): Same as normal line layout default values.
2198         (WebCore::SimpleLineLayout::TextFragmentIterator::lastHyphenPosition):
2199         * rendering/SimpleLineLayoutTextFragmentIterator.h:
2200
2201 2017-01-26  Brady Eidson  <beidson@apple.com>
2202
2203         Gamepad support shows wrong values for PS4 controllers (D-pad is missing).
2204         <rdar://problem/29578619> and https://bugs.webkit.org/show_bug.cgi?id=165588
2205
2206         Reviewed by Alex Christensen.
2207
2208         No new tests (Currently unable to test HID backend directly)
2209
2210         DPads report their HID type as "a button", but their HID usage is "Hatswitch".
2211         This patch adds a new element type that maps a "hatswitch" value to 4 additional buttons.
2212         
2213         * platform/gamepad/mac/HIDGamepad.cpp:
2214         (WebCore::HIDGamepad::initElements):
2215         (WebCore::HIDGamepad::initElementsFromArray):
2216         (WebCore::HIDGamepad::maybeAddButton):
2217         (WebCore::HIDGamepad::maybeAddDPad):
2218         (WebCore::HIDGamepad::maybeAddAxis):
2219         (WebCore::fillInButtonValues):
2220         (WebCore::HIDGamepad::valueChanged):
2221
2222         * platform/gamepad/mac/HIDGamepad.h:
2223         (WebCore::HIDGamepadElement::isDPad):
2224         (WebCore::HIDGamepadDPad::HIDGamepadDPad):
2225         (WebCore::HIDGamepadDPad::normalizedValue):
2226
2227 2017-01-26  Antoine Quint  <graouts@apple.com>
2228
2229         [Modern Media Controls] Hiding controls, changing their width and showing them again shows an incorrect layout
2230         https://bugs.webkit.org/show_bug.cgi?id=167160
2231         <rdar://problem/29612318>
2232
2233         Reviewed by Dean Jackson.
2234
2235         When we toggle visibility of the controls bar, we notify the hosting media controls and in the case of the
2236         macOS inline media controls, we update the controls layout which would have failed to run last time it tried
2237         due to the controls bar being hidden.
2238
2239         Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-resize-with-hidden-controls-bar.html
2240
2241         * Modules/modern-media-controls/controls/controls-bar.js:
2242         (ControlsBar.prototype.set visible):
2243         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
2244         (MacOSInlineMediaControls.prototype.controlsBarVisibilityDidChange):
2245         * Modules/modern-media-controls/controls/media-controls.js:
2246         (MediaControls.prototype.controlsBarVisibilityDidChange):
2247
2248 2017-01-26  Csaba Osztrogonác  <ossy@webkit.org>
2249
2250         [Mac][cmake] Unreviewed speculative buildfix after r211161.
2251         https://bugs.webkit.org/show_bug.cgi?id=167294
2252
2253         * PlatformMac.cmake:
2254
2255 2017-01-26  Zan Dobersek  <zdobersek@igalia.com>
2256
2257         ImageBufferCairo: cairo_image_surface should use bmalloc-allocated memory
2258         https://bugs.webkit.org/show_bug.cgi?id=165751
2259
2260         Reviewed by Carlos Garcia Campos.
2261
2262         Allocate the underlying memory for cairo_image_surface objects through FastMalloc.
2263         This way we can steer such large allocations away from the default libc allocator.
2264
2265         Objects of this class can create Cairo surfaces that need as much as 4MB of memory
2266         for the underlying pixel buffer. Allocating such objects through the default
2267         libc allocator can lead to increased memory usage because of non-optimal allocation
2268         strategy in libc. In contrast, bmalloc performs large allocations by directly using
2269         mmap() to reserve the necessary memory.
2270
2271         The improvements can be significant. On nytimes.com, with the threaded version of
2272         the CoordinatedGraphics system, the memory consumption can drop by roughly 20%.
2273
2274         * platform/graphics/cairo/ImageBufferCairo.cpp:
2275         (WebCore::ImageBuffer::ImageBuffer): Zero-allocate the necessary memory via FastMalloc.
2276         Tie that memory lifetime to the lifetime of the surface by using
2277         cairo_surface_set_user_data() with the specific user data key.
2278
2279 2017-01-26  Miguel Gomez  <magomez@igalia.com>
2280
2281         [GTK] WebProcess from WebKitGtk+ 2.15.3 SIGSEVs in WebCore::GraphicsContext3D::drawArrays(unsigned int, int, int) at Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:740
2282         https://bugs.webkit.org/show_bug.cgi?id=167296
2283
2284         Reviewed by Sergio Villar Senin.
2285
2286         Use a VBO to pass the vertex data when using the stencil for clipping. Passing a custom array without
2287         using an VBO is deprecated when using OpenGL >= 3.0 and a Core profile.
2288
2289         No behaviour change, no new tests.
2290
2291         * platform/graphics/texmap/TextureMapperGL.cpp:
2292         (WebCore::TextureMapperGL::beginClip):
2293
2294 2017-01-25  Ryosuke Niwa  <rniwa@webkit.org>
2295
2296         Crash under DOMSelection::deleteFromDocument()
2297         https://bugs.webkit.org/show_bug.cgi?id=167232
2298
2299         Reviewed by Chris Dumez.
2300
2301         The crash was caused by DOMSelection's deleteFromDocument() mutating contents inside the user-agent
2302         shadow tree of an input element when the text field is readonly. Fixed the bug by exiting early
2303         whenever the selection is inside a shadow tree since getSelection().getRangeAt(0) always returns
2304         a range outside the input element or any shadow tree for that matter.
2305
2306         New behavior matches that of Gecko. The working draft spec of which I'm the editor states that
2307         deleteFromDocument() must invoke Range's deleteContents() on the associated range, which is
2308         the collapsed range returned by getSelection().getRangeAt(0) in the spec:
2309         https://www.w3.org/TR/2016/WD-selection-api-20160921/#widl-Selection-deleteFromDocument-void
2310         And Range's deleteContents() immediately terminates in step 1 when start and end are identical:
2311         https://dom.spec.whatwg.org/commit-snapshots/6b7621282c2e3b222ac585650e484abf4c0a416b/
2312
2313         Note that Range's DOM mutating methods are not available inside an user-agent shadow tree because
2314         WebKit never returns a Range whose end boundary points are inside the tree to author scripts.
2315         Editing commands (ones executable from document.execCommand) that mutate DOM like this check whether
2316         the content is editable or not. Since VisibleSelection's validate() function makes sure the selection
2317         is either entirely within or outside of an root editable element (editing host in the W3C spec lingo),
2318         editing commands should never mutate a random node inside an user-agent shadow tree.
2319
2320         Test: editing/selection/deleteFromDocument-shadow-tree-crash.html
2321
2322         * page/DOMSelection.cpp:
2323         (WebCore::DOMSelection::deleteFromDocument):
2324
2325 2017-01-25  Ryan Haddad  <ryanhaddad@apple.com>
2326
2327         Unreviewed, rolling out r211193.
2328
2329         This change broke internal builds.
2330
2331         Reverted changeset:
2332
2333         "Notify clients when the user plays media otherwise prevented
2334         from autoplaying"
2335         https://bugs.webkit.org/show_bug.cgi?id=167390
2336         http://trac.webkit.org/changeset/211193
2337
2338 2017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2339
2340         Add infrastructure to support data interaction in WebKit2
2341         https://bugs.webkit.org/show_bug.cgi?id=167443
2342
2343         Reviewed by Simon Fraser.
2344
2345         Adds support in WebCore to determine whether there is interactive data at a given position. No new tests, since
2346         there should be no behavior change yet.
2347
2348         * page/EventHandler.h:
2349         * page/Page.cpp:
2350         (WebCore::Page::hasDataInteractionAtPosition):
2351         * page/Page.h:
2352
2353 2017-01-25  Matt Rajca  <mrajca@apple.com>
2354
2355         Notify clients when the user plays media otherwise prevented from autoplaying
2356         https://bugs.webkit.org/show_bug.cgi?id=167390
2357
2358         Reviewed by Alex Christensen.
2359
2360         The API is tested.
2361
2362         * html/HTMLMediaElement.cpp:
2363         (WebCore::HTMLMediaElement::playInternal):
2364         * page/ChromeClient.h:
2365
2366 2017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2367
2368         Refactor drag and drop implementation on Mac
2369         https://bugs.webkit.org/show_bug.cgi?id=167427
2370
2371         Reviewed by Enrica Casucci.
2372
2373         Refactors some code around drag and drop on Mac, and cleans up some other related code as needed. This patch
2374         should result in no behavior change.
2375
2376         * dom/DataTransfer.cpp:
2377         * page/EventHandler.cpp:
2378         * page/ios/EventHandlerIOS.mm:
2379         (WebCore::EventHandler::eventLoopHandleMouseDragged):
2380         * page/mac/EventHandlerMac.mm:
2381         * platform/DragImage.cpp:
2382         * platform/Pasteboard.h:
2383         * platform/ios/DragImageIOS.mm:
2384         * platform/ios/PasteboardIOS.mm:
2385         * platform/mac/DragDataMac.mm:
2386         (rtfPasteboardType):
2387         (rtfdPasteboardType):
2388         (stringPasteboardType):
2389         (urlPasteboardType):
2390         (htmlPasteboardType):
2391         (colorPasteboardType):
2392         (pdfPasteboardType):
2393         (tiffPasteboardType):
2394         (WebCore::DragData::DragData):
2395         (WebCore::DragData::containsColor):
2396         (WebCore::DragData::containsFiles):
2397         (WebCore::DragData::numberOfFiles):
2398         (WebCore::DragData::asFilenames):
2399         (WebCore::DragData::containsPlainText):
2400         (WebCore::DragData::containsCompatibleContent):
2401         (WebCore::DragData::containsPromise):
2402         (WebCore::DragData::asURL):
2403         * platform/mac/DragImageMac.mm:
2404
2405 2017-01-25  Youenn Fablet  <youenn@apple.com>
2406
2407         [WebRTC] Add support for incoming and outgoing libwebrtc audio tracks
2408         https://bugs.webkit.org/show_bug.cgi?id=167438
2409
2410         Reviewed by Eric Carlson.
2411
2412         RealtimeIncomingAudioSource consumes audio buffers given by libwebrtc.
2413         RealtimeOutgoingAudioSource consumes audio buffers from WebCore tracks (capture typically) and feeds libwebrtc with them.
2414         To be covered by Layout/mock tests once LibWebRTC peer connection will be added.
2415         These are only skeletons right now, the conversion between WebCore and LibWebRTC data is not yet implemented.
2416
2417         * WebCore.xcodeproj/project.pbxproj:
2418         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp: Added.
2419         (WebCore::RealtimeIncomingAudioSource::create):
2420         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
2421         (WebCore::RealtimeIncomingAudioSource::OnData):
2422         (WebCore::RealtimeIncomingAudioSource::startProducingData):
2423         (WebCore::RealtimeIncomingAudioSource::stopProducingData):
2424         (WebCore::RealtimeIncomingAudioSource::capabilities):
2425         (WebCore::RealtimeIncomingAudioSource::settings):
2426         (WebCore::RealtimeIncomingAudioSource::supportedConstraints):
2427         (WebCore::RealtimeIncomingAudioSource::addObserver):
2428         (WebCore::RealtimeIncomingAudioSource::removeObserver):
2429         (WebCore::RealtimeIncomingAudioSource::start):
2430         (WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
2431         * platform/mediastream/mac/RealtimeIncomingAudioSource.h: Added.
2432         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: Added.
2433         (WebCore::RealtimeOutgoingAudioSource::sourceHasMoreMediaData):
2434         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: Added.
2435
2436 2017-01-25  Youenn Fablet  <youenn@apple.com>
2437
2438         [WebRTC] Add support for libwebrtc video incoming and outgoing video tracks
2439         https://bugs.webkit.org/show_bug.cgi?id=167432
2440
2441         Reviewed by Eric Carlson.
2442
2443         Not covered by tests right now, this will be covered by layout/mock tests.
2444         RealtimeIncomingVideoSource consumes video frames given by libwebrtc.
2445         RealtimeOutgoingVideoSource consumes video frames from WebCore tracks (capture typically) and feeds libwebrtc with them.
2446
2447         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp: Added.
2448         (WebCore::RealtimeIncomingVideoSource::create):
2449         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
2450         (WebCore::RealtimeIncomingVideoSource::startProducingData):
2451         (WebCore::RealtimeIncomingVideoSource::stopProducingData):
2452         (WebCore::RealtimeIncomingVideoSource::OnFrame):
2453         (WebCore::RealtimeIncomingVideoSource::processNewSample):
2454         (WebCore::drawImage):
2455         (WebCore::RealtimeIncomingVideoSource::currentFrameImage):
2456         (WebCore::RealtimeIncomingVideoSource::paintCurrentFrameInContext):
2457         (WebCore::RealtimeIncomingVideoSource::capabilities):
2458         (WebCore::RealtimeIncomingVideoSource::settings):
2459         (WebCore::RealtimeIncomingVideoSource::supportedConstraints):
2460         * platform/mediastream/mac/RealtimeIncomingVideoSource.h: Added.
2461         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: Added.
2462         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
2463         (WebCore::RealtimeOutgoingVideoSource::GetStats):
2464         (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
2465         (WebCore::RealtimeOutgoingVideoSource::RemoveSink):
2466         (WebCore::RealtimeOutgoingVideoSource::sourceHasMoreMediaData):
2467         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h: Added.
2468
2469 2017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2470
2471         Introduce an item-provider-based pasteboard wrapper
2472         https://bugs.webkit.org/show_bug.cgi?id=167410
2473
2474         Reviewed by Enrica Casucci.
2475
2476         Introduces WebItemProviderPasteboard, a pasteboard-like object backed by a number of item providers. No new
2477         tests, since there is no behavior change.
2478
2479         * WebCore.xcodeproj/project.pbxproj:
2480         * platform/ios/AbstractPasteboard.h: Copied from Source/WebCore/platform/spi/ios/UIKitSPI.h.
2481         * platform/ios/WebItemProviderPasteboard.h: Copied from Source/WebCore/platform/spi/ios/UIKitSPI.h.
2482         * platform/ios/WebItemProviderPasteboard.mm: Added.
2483         (isRichTextType):
2484         (isStringType):
2485         (isURLType):
2486         (isColorType):
2487         (isImageType):
2488         (+[WebItemProviderPasteboard sharedInstance]):
2489         (-[WebItemProviderPasteboard init]):
2490         (-[WebItemProviderPasteboard dealloc]):
2491         (-[WebItemProviderPasteboard pasteboardTypes]):
2492         (-[WebItemProviderPasteboard setItemProviders:]):
2493         (-[WebItemProviderPasteboard numberOfItems]):
2494         (-[WebItemProviderPasteboard setItems:]):
2495         (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
2496         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
2497         (-[WebItemProviderPasteboard changeCount]):
2498         (-[WebItemProviderPasteboard itemProviderAtIndex:]):
2499         * platform/spi/ios/UIKitSPI.h:
2500
2501 2017-01-25  Konstantin Tokarev  <annulen@yandex.ru>
2502
2503         Removed leftovers of pre-2015 VisualStudio support
2504         https://bugs.webkit.org/show_bug.cgi?id=167434
2505
2506         Reviewed by Alex Christensen.
2507
2508         No new tests needed.
2509
2510         * platform/graphics/filters/FEConvolveMatrix.cpp: Replaced MSC_VER
2511         usage with COMPILER(MSVC)
2512
2513 2017-01-25  Youenn Fablet  <youenn@apple.com>
2514
2515         Fixing typos in r211161
2516         https://bugs.webkit.org/show_bug.cgi?id=167433
2517
2518         Reviewed by Alex Christensen.
2519
2520         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2521
2522 2017-01-25  Simon Fraser  <simon.fraser@apple.com>
2523
2524         Revert r210882, removing support for background-repeat-x/y
2525         https://bugs.webkit.org/show_bug.cgi?id=167223
2526
2527         Reviewed by Myles C. Maxfield.
2528         
2529         Followup from r211149; I missed part of the patch when committing.
2530
2531         * css/parser/CSSParserFastPaths.cpp:
2532         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
2533
2534 2017-01-25  Youenn Fablet  <youennf@gmail.com>
2535
2536         [WebRTC] Introduce libwebrtc abstraction for WK1/WK2 implementations
2537         https://bugs.webkit.org/show_bug.cgi?id=167294
2538
2539         Reviewed by Alex Christensen.
2540
2541         Introducing LibWebRTCMacros.h which should be included before any libwebrtc header.
2542
2543         Introducing LibWebRTCProvider as the abstraction allowing to suport WK1 and WK2 libwebrtc-based WebRTC endpoints.
2544         It  will create a libwebrtc peerconnection object differently in WK1 and WK2 as networking will be done differently.
2545
2546         LibWebRTCUtils contains routines used by WK1 and WK2 RTC providers to create the libwebrtc peerconnection object
2547         and implement the necessary functionalities for it.
2548
2549         Updating PageConfiguration accordingly.
2550
2551         * WebCore.xcodeproj/project.pbxproj:
2552         * page/Page.cpp:
2553         (WebCore::Page::Page):
2554         * page/Page.h:
2555         (WebCore::Page::libWebRTCProvider):
2556         * page/PageConfiguration.cpp:
2557         (WebCore::PageConfiguration::PageConfiguration):
2558         * page/PageConfiguration.h:
2559         * platform/mediastream/libwebrtc/LibWebRTCMacros.h: Added.
2560         * platform/mediastream/libwebrtc/LibWebRTCProvider.h: Added.
2561         * platform/mediastream/libwebrtc/LibWebRTCUtils.cpp: Added.
2562         (WebCore::staticFactoryAndThreads):
2563         (WebCore::ThreadMessageData::ThreadMessageData):
2564         (WebCore::PeerConnectionFactoryAndThreads::OnMessage):
2565         (WebCore::callOnWebRTCNetworkThread):
2566         (WebCore::initializePeerConnectionFactoryAndThreads):
2567         (WebCore::initializeLibWebRTCInternalsWithSocketServer):
2568         (WebCore::peerConnectionFactory):
2569         (WebCore::createPeerConnection):
2570         * platform/mediastream/libwebrtc/LibWebRTCUtils.h: Added.
2571         * svg/graphics/SVGImage.cpp:
2572         (WebCore::SVGImage::dataChanged):
2573
2574 2017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
2575
2576         Add support for named pasteboards, pasteboard strategies and platform pasteboards
2577         https://bugs.webkit.org/show_bug.cgi?id=167404
2578
2579         Reviewed by Enrica Casucci.
2580
2581         Refactors some pasteboard-related code to plumb the name of the pasteboard across from WebCore to the client
2582         layer. No new tests, because there should be no change in behavior.
2583
2584         * platform/DragData.h:
2585         * platform/Pasteboard.h:
2586         * platform/PasteboardStrategy.h:
2587         * platform/PlatformPasteboard.h:
2588         * platform/ios/PasteboardIOS.mm:
2589         (WebCore::Pasteboard::Pasteboard):
2590         (WebCore::Pasteboard::write):
2591         (WebCore::Pasteboard::writePlainText):
2592         (WebCore::Pasteboard::read):
2593         (WebCore::Pasteboard::hasData):
2594         (WebCore::Pasteboard::clear):
2595         (WebCore::Pasteboard::readString):
2596         (WebCore::Pasteboard::writeString):
2597         (WebCore::Pasteboard::types):
2598
2599 2017-01-25  Antoine Quint  <graouts@apple.com>
2600
2601         LayoutTest media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-containers-styles.html is flaky
2602         https://bugs.webkit.org/show_bug.cgi?id=167253
2603
2604         Reviewed by Jon Lee.
2605
2606         An IconButton loads its image asynchronously and waits for its load to obtain metrics. Once that happens,
2607         its layout delegate needs to be notified that it needs a new layout. The test was a flaky failure because
2608         the images would sometime load prior to layout, and sometime after, which would cause a failure. The test
2609         is now robust with a controls layout happening after all buttons had loaded.
2610
2611         * Modules/modern-media-controls/controls/icon-button.js:
2612         (IconButton.prototype._updateImage):
2613         (IconButton):
2614
2615 2017-01-25  Timothy Hatcher  <timothy@hatcher.name>
2616
2617         Fix the !HAVE(ACCESSIBILITY) build by properly instantiating AXObjectCache member timers.
2618
2619         * accessibility/AXObjectCache.h:
2620         (WebCore::AXObjectCache::AXObjectCache):
2621
2622 2017-01-25  Chris Dumez  <cdumez@apple.com>
2623
2624         Measure how common it is for content to deal with WebGL context loss
2625         https://bugs.webkit.org/show_bug.cgi?id=166866
2626         <rdar://problem/30171195>
2627
2628         Reviewed by Alex Christensen.
2629
2630         Add diagnostic logging to measure how common it is for sites to handle
2631         WebGL context loss via the webglcontextlost & webglcontextrestored
2632         events.
2633
2634         * html/canvas/WebGLRenderingContextBase.cpp:
2635         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
2636         (WebCore::WebGLRenderingContextBase::checkForContextLossHandling):
2637         * html/canvas/WebGLRenderingContextBase.h:
2638         * page/DiagnosticLoggingKeys.cpp:
2639         (WebCore::DiagnosticLoggingKeys::noKey):
2640         (WebCore::DiagnosticLoggingKeys::yesKey):
2641         (WebCore::DiagnosticLoggingKeys::handlesContextLossKey):
2642         * page/DiagnosticLoggingKeys.h:
2643
2644 2017-01-25  Simon Fraser  <simon.fraser@apple.com>
2645
2646         Revert r210882, removing support for background-repeat-x/y
2647         https://bugs.webkit.org/show_bug.cgi?id=167223
2648
2649         Reviewed by Myles Maxfield.
2650
2651         CSSPropertyBackgroundRepeatX and CSSPropertyBackgroundRepeatY only exist to make it easier
2652         to parse CSSPropertyBackgroundRepeat as if it were a shorthand; they were never intended to
2653         be web-exposed. r210882 mistakenly expose them to the web, so undo that patch, and annotate
2654         the properties in CSSProperties.json with a flag which indicates their special status.
2655
2656         In addition, remove background-repeat-x/y from the list of properties allowed in video cues,
2657         since these are not valid properties.
2658
2659         * css/CSSProperties.json:
2660         * css/StyleResolver.cpp:
2661         (WebCore::StyleResolver::isValidCueStyleProperty):
2662         * css/makeprop.pl:
2663         (addProperty):
2664         * css/parser/CSSParserFastPaths.cpp:
2665         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
2666
2667 2017-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2668
2669         [GTK] UIProcess from WebKitGtk+ 2.15.x SIGSEGVs because of X Error BadDamage in WebKit::AcceleratedBackingStoreX11::update(WebKit::LayerTreeContext const&) () at Source/WebKit2/UIProcess/gtk/AcceleratedBackingStoreX11.cpp:145
2670         https://bugs.webkit.org/show_bug.cgi?id=165656
2671
2672         Reviewed by Michael Catanzaro.
2673
2674         Also return the base error code from PlatformDisplayX11::supportsXDamage().
2675
2676         * platform/graphics/x11/PlatformDisplayX11.cpp:
2677         (WebCore::PlatformDisplayX11::supportsXDamage):
2678         * platform/graphics/x11/PlatformDisplayX11.h:
2679
2680 2017-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2681
2682         Unreviewed. Fix 32 bit build after r211140.
2683
2684         Include glib-object.h instead of forward declaring GType.
2685
2686         * platform/network/soup/SoupNetworkSession.h:
2687
2688 2017-01-25  Miguel Gomez  <magomez@igalia.com>
2689
2690         [GTK] The inspector is broken when AC support is disabled
2691         https://bugs.webkit.org/show_bug.cgi?id=165237
2692
2693         Reviewed by Carlos Garcia Campos.
2694
2695         Ensure that PageOverlayController destroys its root GraphicsLayers when leaving AC. They
2696         will be recreated if we enter AC again, avoiding a crash because the layers don't belong to
2697         the appropriate compositor. Also, don't append the document overlay layers if we are not
2698         in compositing mode.
2699
2700         No new tests added.
2701
2702         * page/PageOverlayController.cpp:
2703         (WebCore::PageOverlayController::willDetachRootLayer):
2704         * page/PageOverlayController.h:
2705         * rendering/RenderLayerCompositor.cpp:
2706         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
2707         (WebCore::RenderLayerCompositor::detachRootLayer):
2708
2709 2017-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2710
2711         [SOUP] Custom protocols don't work in private browsing mode
2712         https://bugs.webkit.org/show_bug.cgi?id=167236
2713
2714         Reviewed by Sergio Villar Senin.
2715
2716         Add static method to set the global custom protocols request type and setup method to add the feature to the session.
2717
2718         * platform/network/soup/SoupNetworkSession.cpp:
2719         (WebCore::SoupNetworkSession::SoupNetworkSession):
2720         (WebCore::SoupNetworkSession::setCustomProtocolRequestType):
2721         (WebCore::SoupNetworkSession::setupCustomProtocols):
2722         * platform/network/soup/SoupNetworkSession.h:
2723
2724 2017-01-25  Ryosuke Niwa  <rniwa@webkit.org>
2725
2726         collectMatchingElementsInFlatTree should not find elements inside an user agent shadow tree
2727         https://bugs.webkit.org/show_bug.cgi?id=167409
2728
2729         Reviewed by Antti Koivisto.
2730
2731         The bug was caused by collectMatchingElementsInFlatTree including elements inside an user agent shadow tree
2732         even though it shouldn't. Fixed the bug by checking that condition.
2733
2734         Also added matchingElementInFlatTree to find the first element matching a selector as opposed to all,
2735         again, only exposed in a world which forces all shadow trees to be accessible.
2736
2737         * page/DOMWindow.cpp:
2738         (WebCore::selectorQueryInFrame):
2739         (WebCore::DOMWindow::collectMatchingElementsInFlatTree):
2740         (WebCore::DOMWindow::matchingElementInFlatTree):
2741         * page/DOMWindow.h:
2742         * page/DOMWindow.idl:
2743
2744 2017-01-24  Alex Christensen  <achristensen@webkit.org>
2745
2746         REGRESSION (r208902): URLWithUserTypedString returns nil with file URLs
2747         https://bugs.webkit.org/show_bug.cgi?id=167402
2748         <rdar://problem/29896656>
2749
2750         Reviewed by Ryosuke Niwa.
2751
2752         Covered by a new API test.
2753
2754         * platform/mac/WebCoreNSURLExtras.mm:
2755         (WebCore::mapHostNameWithRange):
2756         uidna_IDNToASCII succeeds when length is 0.
2757         uidna_nameToASCII fails when length is 0.
2758         This causes bad things to happen with file URLs, which have no host, so their host length is 0.
2759         This makes us match behavior before r208902.
2760
2761 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
2762
2763         Fold USER_TIMING into WEB_TIMING and make it a RuntimeEnabledFeature
2764         https://bugs.webkit.org/show_bug.cgi?id=167394
2765
2766         Reviewed by Ryosuke Niwa.
2767
2768         All of the Performance Timing specifications are highly coupled.
2769         So let make WEB_TIMING encompass them all:
2770
2771             - High Resolution Time (window.performance)
2772             - Performance Timeline (PerformanceEntry, PerformanceObserver)
2773             - Navigation Timing ("navigation" entries)
2774             - Resource Timing ("resource" entries)
2775             - User Timing ("mark" / "measure" entries)
2776
2777         We can then turn on and off individual pieces as runtime features,
2778         such as Resource Timing, User Timing, and Performance Observer.
2779
2780         * DerivedSources.make:
2781         * WebCore.xcodeproj/project.pbxproj:
2782         Add User Timing files that are now included in WEB_TIMING builds.
2783
2784         * page/RuntimeEnabledFeatures.h:
2785         (WebCore::RuntimeEnabledFeatures::setUserTimingEnabled):
2786         (WebCore::RuntimeEnabledFeatures::userTimingEnabled):
2787         Add a runtime feature for user timing. Disabled by default.
2788
2789         * Configurations/FeatureDefines.xcconfig:
2790         * PAL/Configurations/FeatureDefines.xcconfig:
2791         * bindings/js/JSPerformanceEntryCustom.cpp:
2792         (WebCore::toJSNewlyCreated):
2793         * page/Performance.cpp:
2794         (WebCore::Performance::getEntries):
2795         (WebCore::Performance::getEntriesByType):
2796         (WebCore::Performance::getEntriesByName):
2797         (WebCore::Performance::mark):
2798         (WebCore::Performance::clearMarks):
2799         (WebCore::Performance::measure):
2800         (WebCore::Performance::clearMeasures):
2801         (WebCore::Performance::webkitMark): Deleted.
2802         (WebCore::Performance::webkitClearMarks): Deleted.
2803         (WebCore::Performance::webkitMeasure): Deleted.
2804         (WebCore::Performance::webkitClearMeasures): Deleted.
2805         * page/Performance.h:
2806         * page/Performance.idl:
2807         * page/PerformanceMark.h:
2808         * page/PerformanceMark.idl:
2809         * page/PerformanceMeasure.h:
2810         * page/PerformanceMeasure.idl:
2811         * page/PerformanceUserTiming.cpp:
2812         * page/PerformanceUserTiming.h:
2813         Convert USER_TIMING to WEB_TIMING.
2814         Drop webkit prefixed legacy names.
2815
2816 2017-01-24  Antoine Quint  <graouts@apple.com>
2817
2818         LayoutTest media/modern-media-controls/tracks-panel/tracks-panel-hide.html is a flaky timeout
2819         https://bugs.webkit.org/show_bug.cgi?id=167311
2820
2821         Reviewed by Dean Jackson.
2822
2823         Ensure we have a chance to start the transition (on the next frame) before registering for an event
2824         tracking its completion.
2825
2826         * Modules/modern-media-controls/controls/tracks-panel.js:
2827         (TracksPanel.prototype.hide):
2828
2829 2017-01-24  Simon Fraser  <simon.fraser@apple.com>
2830
2831         [iOS WK2] Avoid IOSurface readback for snapshot creation
2832         https://bugs.webkit.org/show_bug.cgi?id=167397
2833         rdar://problem/30174873
2834
2835         Reviewed by Tim Horton.
2836
2837         Export sinkIntoImage().
2838
2839         * platform/graphics/cocoa/IOSurface.h:
2840
2841 2017-01-24  Brent Fulgham  <bfulgham@apple.com>
2842
2843         Bug 167392: REGRESSION(r210531): Relax same-volume display requirement for iOS
2844         https://bugs.webkit.org/show_bug.cgi?id=167392
2845         <rdar://problem/30074665>
2846
2847         Reviewed by Brady Eidson.
2848
2849         * page/SecurityOrigin.cpp:
2850         (WebCore::SecurityOrigin::canDisplay): Exclude the new check when building on iOS.
2851
2852 2017-01-24  Andreas Kling  <akling@apple.com>
2853
2854         Add memory footprint reporting using diagnostic logging.
2855         <https://webkit.org/b/167285>
2856         <rdar://problem/30151767>
2857
2858         Reviewed by Chris Dumez.
2859
2860         Add some basic logging of physical memory footprint post-load and post-backgrounding.
2861         The logging works similarly to the CPU usage logging, though with slightly longer
2862         delays to allow the measurement to stabilize.
2863
2864         * page/DiagnosticLoggingKeys.cpp:
2865         (WebCore::DiagnosticLoggingKeys::memoryUsageKey):
2866         (WebCore::DiagnosticLoggingKeys::memoryUsageToDiagnosticLoggingKey):
2867         * page/DiagnosticLoggingKeys.h:
2868         * page/PerformanceLogging.cpp:
2869         (WebCore::PerformanceLogging::physicalFootprint):
2870         * page/PerformanceLogging.h:
2871         * page/PerformanceMonitor.cpp:
2872         (WebCore::PerformanceMonitor::PerformanceMonitor):
2873         (WebCore::PerformanceMonitor::didFinishLoad):
2874         (WebCore::PerformanceMonitor::activityStateChanged):
2875         (WebCore::PerformanceMonitor::measurePostLoadMemoryUsage):
2876         (WebCore::PerformanceMonitor::measurePostBackgroundingMemoryUsage):
2877         * page/PerformanceMonitor.h:
2878         * page/Settings.h:
2879         (WebCore::Settings::isPostLoadMemoryUsageMeasurementEnabled):
2880         (WebCore::Settings::isPostBackgroundingMemoryUsageMeasurementEnabled):
2881         * page/cocoa/PerformanceLoggingCocoa.mm:
2882         (WebCore::PerformanceLogging::physicalFootprint):
2883
2884 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
2885
2886         Remove always true unsafePluginPastingEnabled setting
2887         https://bugs.webkit.org/show_bug.cgi?id=167360
2888
2889         Reviewed by Andreas Kling.
2890
2891         Setting added by Chromium and never used by other ports.
2892
2893         * dom/ScriptableDocumentParser.cpp:
2894         (WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
2895         * page/Settings.in:
2896
2897 2017-01-24  Anders Carlsson  <andersca@apple.com>
2898
2899         When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)
2900         https://bugs.webkit.org/show_bug.cgi?id=167391
2901         rdar://problem/29857388
2902
2903         Reviewed by Sam Weinig.
2904
2905         * page/Page.cpp:
2906         (WebCore::Page::refreshPlugins):
2907         Remove an unused variable.
2908
2909         * plugins/PluginInfoProvider.cpp:
2910         (WebCore::PluginInfoProvider::refresh):
2911         Make sure to call refreshPlugins(). Instead of reloading subframes, just reload all the main frames with
2912         subframes that contain plug-ins.
2913
2914 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
2915
2916         Clean up Performance IDL interfaces so they are easier to read
2917         https://bugs.webkit.org/show_bug.cgi?id=167378
2918
2919         Reviewed by Sam Weinig.
2920
2921         * page/Performance.idl:
2922         * page/PerformanceEntry.idl:
2923         * page/PerformanceMark.idl:
2924         * page/PerformanceMeasure.idl:
2925         Update spec links and use a typedef to match specs.
2926
2927         * page/PerformanceResourceTiming.cpp:
2928         (WebCore::PerformanceResourceTiming::workerStart):
2929         * page/PerformanceResourceTiming.h:
2930         * page/PerformanceResourceTiming.idl:
2931         Add the workerStart property which always returns 0 for non-workers.
2932
2933 2017-01-24  Zalan Bujtas  <zalan@apple.com>
2934
2935         Simple line layout: Add support for hyphen: auto.
2936         https://bugs.webkit.org/show_bug.cgi?id=167297
2937         <rdar://problem/30119463>
2938
2939         Reviewed by Antti Koivisto.
2940
2941         Implement hyphen: auto for simple line layout. 
2942
2943         Tests: fast/text/simple-line-hyphens-with-text-align.html
2944                fast/text/simple-line-hyphens-with-word-letter-spacing.html
2945
2946         * platform/text/Hyphenation.h:
2947         (WebCore::enoughWidthForHyphenation):
2948         * rendering/RenderTreeAsText.cpp:
2949         (WebCore::writeSimpleLine):
2950         (WebCore::write):
2951         * rendering/SimpleLineLayout.cpp:
2952         (WebCore::SimpleLineLayout::canUseForStyle):
2953         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded): Inherit the hyphen attribute from the
2954         run-to-be-appended. Ensure that we don't append additional runs when the last run has hyphen.
2955         (WebCore::SimpleLineLayout::splitFragmentToFitLine): Before calling into the lastHyphenPosition() we need to
2956         ensure that the hyphen would surely fit (even on the splitting position).
2957         (WebCore::SimpleLineLayout::createLineRuns): Probe hypenation for overhanging non-whitespace runs. 
2958         (WebCore::SimpleLineLayout::printReason):
2959         * rendering/SimpleLineLayout.h:
2960         (WebCore::SimpleLineLayout::Run::Run):
2961         * rendering/SimpleLineLayoutFlowContents.h:
2962         (WebCore::SimpleLineLayout::FlowContents::Segment::toSegmentPosition):
2963         (WebCore::SimpleLineLayout::FlowContents::Segment::toRenderPosition):
2964         * rendering/SimpleLineLayoutResolver.cpp:
2965         (WebCore::SimpleLineLayout::RunResolver::Run::Run):
2966         (WebCore::SimpleLineLayout::RunResolver::Run::constructStringForHyphenIfNeeded):
2967         (WebCore::SimpleLineLayout::RunResolver::Run::text):
2968         * rendering/SimpleLineLayoutResolver.h:
2969         (WebCore::SimpleLineLayout::RunResolver::Run::hasHyphen):
2970         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2971         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
2972         (WebCore::SimpleLineLayout::TextFragmentIterator::nextBreakablePosition):
2973         (WebCore::SimpleLineLayout::TextFragmentIterator::nextNonWhitespacePosition):
2974         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
2975         (WebCore::SimpleLineLayout::TextFragmentIterator::lastHyphenPosition): We only check the actual run for hyphenation ignoring
2976         the neighboring runs. This might need to be changed in the future.
2977         (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
2978         * rendering/SimpleLineLayoutTextFragmentIterator.h:
2979         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
2980         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::hasHyphen):
2981         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
2982         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split):
2983         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen):
2984         * rendering/line/BreakingContext.h:
2985         (WebCore::tryHyphenating):
2986
2987 2017-01-24  Matt Rajca  <mrajca@apple.com>
2988
2989         Pass down website autoplay policies to media elements
2990         https://bugs.webkit.org/show_bug.cgi?id=167355
2991
2992         Reviewed by Alex Christensen.
2993
2994         Autoplay policies can be specified at the global web view preferences level or on a per-page
2995         basis during navigation. This patch ensures that policies specified on a per-page basis hold
2996         precedence over global policies. If no policies are specified during navigation, global
2997         policies are used. A WebsiteAutoplayPolicy::Default option has been added to let clients
2998         explicitly specify web view defaults should be used.
2999
3000         * dom/Document.cpp:
3001         (WebCore::Document::audioPlaybackRequiresUserGesture):
3002         (WebCore::Document::videoPlaybackRequiresUserGesture):
3003         * dom/Document.h:
3004         * html/HTMLMediaElement.cpp:
3005         (WebCore::HTMLMediaElement::HTMLMediaElement):
3006         (WebCore::HTMLMediaElement::playInternal):
3007         * loader/DocumentLoader.h:
3008         (WebCore::DocumentLoader::audioPlaybackRequiresUserGesture):
3009         (WebCore::DocumentLoader::setAudioPlaybackRequiresUserGesture):
3010         (WebCore::DocumentLoader::videoPlaybackRequiresUserGesture):
3011         (WebCore::DocumentLoader::setVideoPlaybackRequiresUserGesture):
3012
3013 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
3014
3015         Remove always true selectionIncludesAltImageText setting
3016         https://bugs.webkit.org/show_bug.cgi?id=167358
3017
3018         Reviewed by Alex Christensen.
3019
3020         * editing/Editor.cpp:
3021         (WebCore::Editor::selectedTextForDataTransfer):
3022         * page/Settings.in:
3023
3024 2017-01-24  Daniel Bates  <dabates@apple.com>
3025
3026         StringView.split() should use an iterator design pattern instead of allocating a Vector
3027         https://bugs.webkit.org/show_bug.cgi?id=163225
3028
3029         Reviewed by Darin Adler.
3030
3031         Update code to use the new iterator-style StringView.split().
3032
3033         * platform/URLParser.cpp:
3034
3035 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
3036
3037         Remove always true openGLMultisamplingEnabled setting
3038         https://bugs.webkit.org/show_bug.cgi?id=167364
3039
3040         Reviewed by Sam Weinig.
3041
3042         * html/canvas/WebGLRenderingContextBase.cpp:
3043         (WebCore::WebGLRenderingContextBase::create):
3044         * page/Settings.in:
3045
3046 2017-01-24  Miguel Gomez  <magomez@igalia.com>
3047
3048         [GTK] Do not paint non composited content into the window when using the threaded compositor
3049         https://bugs.webkit.org/show_bug.cgi?id=167367
3050
3051         Reviewed by Carlos Garcia Campos.
3052
3053         When using the threaded compositor we need to send the non composited content for compositing as well,
3054         not painting it directly into the window.
3055
3056         No new tests.
3057
3058         * rendering/RenderLayerBacking.cpp:
3059         (WebCore::RenderLayerBacking::paintsIntoWindow):
3060
3061 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
3062
3063         Remove always true allowCustomScrollbarInMainFrame setting
3064         https://bugs.webkit.org/show_bug.cgi?id=167362
3065
3066         Reviewed by Andreas Kling.
3067
3068         Setting added by Chromium and never used by other ports.
3069
3070         * page/FrameView.cpp:
3071         (WebCore::FrameView::createScrollbar):
3072         * page/Settings.in:
3073
3074 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
3075
3076         Remove always true syncXHRInDocumentsEnabled setting
3077         https://bugs.webkit.org/show_bug.cgi?id=167359
3078
3079         Reviewed by Alex Christensen.
3080
3081         Setting added by Chromium and never used by other ports.
3082
3083         * page/Settings.in:
3084         * xml/XMLHttpRequest.cpp:
3085         (WebCore::XMLHttpRequest::open):
3086
3087 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
3088
3089         Remove always true antialiased2dCanvasEnabled setting
3090         https://bugs.webkit.org/show_bug.cgi?id=167361
3091
3092         Reviewed by Andreas Kling.
3093
3094         * html/HTMLCanvasElement.cpp:
3095         (WebCore::HTMLCanvasElement::createImageBuffer):
3096         * page/Settings.in:
3097
3098 2017-01-15  Yusuke Suzuki  <utatane.tea@gmail.com>
3099
3100         Add the support for nomodule attribute on script element
3101         https://bugs.webkit.org/show_bug.cgi?id=166987
3102
3103         Reviewed by Sam Weinig.
3104
3105         As discussed on https://github.com/whatwg/html/pull/2261, we should have
3106         the way to suppress classic script execution when our user agent have
3107         modules support. With such a feature, developers can write the code like,
3108
3109             <script type="module" src="./app.js"></script>
3110             <script nomodule src="./bundled-app.js"></script>
3111
3112         In the above code, if the user agent does not support modules, the bundled-app.js
3113         will be executed. On the other hand, if the user agent supports modules, we should
3114         ignore the script tag which has the `nomodule` attribute.
3115         This way allows us to support the legacy browsers while using modules.
3116
3117         In WebKit, we already support modules. Thus, we should ignore the classic script
3118         attributed `nomodule`.
3119
3120         We also rename asyncAttributeValue and deferAttributeValue to hasAsyncAttribute and
3121         hasDeferAttribute.
3122
3123         Tests: js/dom/modules/nomodule-has-no-effect-on-module-inline.html
3124                js/dom/modules/nomodule-has-no-effect-on-module-src.html
3125                js/dom/modules/nomodule-prevents-execution-classic-script-inline.html
3126                js/dom/modules/nomodule-prevents-execution-classic-script-src.html
3127
3128         * dom/ScriptElement.cpp:
3129         (WebCore::ScriptElement::prepareScript):
3130         * dom/ScriptElement.h:
3131         * html/HTMLAttributeNames.in:
3132         * html/HTMLScriptElement.cpp:
3133         (WebCore::HTMLScriptElement::hasAsyncAttribute):
3134         (WebCore::HTMLScriptElement::hasDeferAttribute):
3135         (WebCore::HTMLScriptElement::hasNoModuleAttribute):
3136         (WebCore::HTMLScriptElement::asyncAttributeValue): Deleted.
3137         (WebCore::HTMLScriptElement::deferAttributeValue): Deleted.
3138         * html/HTMLScriptElement.h:
3139         * html/HTMLScriptElement.idl:
3140         * svg/SVGScriptElement.cpp:
3141         (WebCore::SVGScriptElement::hasAsyncAttribute):
3142         (WebCore::SVGScriptElement::hasDeferAttribute):
3143         (WebCore::SVGScriptElement::hasNoModuleAttribute):
3144         (WebCore::SVGScriptElement::asyncAttributeValue): Deleted.
3145         (WebCore::SVGScriptElement::deferAttributeValue): Deleted.
3146         * svg/SVGScriptElement.h:
3147
3148 2017-01-23  Joseph Pecoraro  <pecoraro@apple.com>
3149
3150         Web Inspector: Provide a way to trigger a Garbage Collection
3151         https://bugs.webkit.org/show_bug.cgi?id=167345
3152         <rdar://problem/30102853>
3153
3154         Reviewed by Timothy Hatcher.
3155
3156         * inspector/WorkerInspectorController.cpp:
3157         (WebCore::WorkerInspectorController::WorkerInspectorController):
3158         Include a HeapAgent so we can do Heap.gc on Workers.
3159
3160 2017-01-23  Joseph Pecoraro  <pecoraro@apple.com>
3161
3162         Cleanup WEB_TIMING code
3163         https://bugs.webkit.org/show_bug.cgi?id=167339
3164
3165         Reviewed by Alex Christensen.
3166
3167         Stylistic cleanup to WEB_TIMING related code.
3168
3169         * bindings/js/JSPerformanceEntryCustom.cpp:
3170         * loader/ResourceTimingInformation.cpp:
3171         * loader/ResourceTimingInformation.h:
3172         * loader/SubresourceLoader.cpp:
3173         (WebCore::SubresourceLoader::didFinishLoading):
3174         * page/Performance.cpp:
3175         (WebCore::Performance::getEntries):
3176         (WebCore::Performance::getEntriesByType):
3177         (WebCore::Performance::setResourceTimingBufferSize):
3178         (WebCore::Performance::isResourceTimingBufferFull):
3179         * page/Performance.h:
3180         * page/PerformanceMark.h:
3181         * page/PerformanceMeasure.h:
3182         * page/PerformanceNavigation.h:
3183         * page/PerformanceResourceTiming.cpp:
3184         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
3185         (WebCore::PerformanceResourceTiming::resourceTimeToDocumentMilliseconds):
3186         * page/PerformanceResourceTiming.h:
3187         * page/PerformanceTiming.cpp:
3188         (WebCore::PerformanceTiming::documentLoader):
3189         (WebCore::PerformanceTiming::documentTiming):
3190         (WebCore::PerformanceTiming::loadTiming):
3191         * page/PerformanceTiming.h:
3192         * platform/network/cf/ResourceHandleCFNet.cpp:
3193         (WebCore::ResourceHandle::createCFURLConnection):
3194
3195 2017-01-23  Alex Christensen  <achristensen@webkit.org>
3196
3197         URLParser should fail to parse percent-encoded invalid UTF-8 sequences
3198         https://bugs.webkit.org/show_bug.cgi?id=167330
3199         <rdar://problem/29319962>
3200
3201         Reviewed by Tim Horton.
3202
3203         Covered by new API tests.
3204
3205         * platform/URLParser.cpp:
3206         (WebCore::containsOnlyASCII):
3207         (WebCore::URLParser::parseHostAndPort):
3208         If UTF-8 decoding fails after percent-decoding the host, fail to parse.
3209         This matches Chrome and Firefox, and it was proposed to the spec in https://github.com/whatwg/url/issues/215
3210
3211 2017-01-23  Alex Christensen  <achristensen@webkit.org>
3212
3213         Make URLs with non-special schemes and a query or fragment but no slash after the host more compatible
3214         https://bugs.webkit.org/show_bug.cgi?id=167317
3215         <rdar://problem/29526875>
3216
3217         Reviewed by Sam Weinig.
3218
3219         This is currently being added to the URL spec in https://github.com/whatwg/url/issues/212
3220         Covered by new API tests.
3221
3222         * platform/URLParser.cpp:
3223         (WebCore::URLParser::parse):
3224         Only add a slash if there wasn't one if the URL has a special scheme.
3225         This new behavior matches the old behavior of URL::parse.
3226
3227 2017-01-23  Joseph Pecoraro  <pecoraro@apple.com>
3228
3229         Convert langAttributeAwareFormControlUIEnabled to a Setting
3230         https://bugs.webkit.org/show_bug.cgi?id=167279
3231
3232         Reviewed by Sam Weinig.
3233
3234         * dom/Document.cpp:
3235         (WebCore::Document::getCachedLocale):
3236         * html/HTMLInputElement.cpp:
3237         (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
3238         Convert to use Settings instead of RuntimeEnabledFeatures.
3239
3240         * page/RuntimeEnabledFeatures.h:
3241         (WebCore::RuntimeEnabledFeatures::langAttributeAwareFormControlUIEnabled): Deleted.
3242         (WebCore::RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled): Deleted.
3243         * page/Settings.in:
3244         Move to Settings.
3245
3246         * testing/InternalSettings.cpp:
3247         (WebCore::InternalSettings::Backup::Backup):
3248         (WebCore::InternalSettings::Backup::restoreTo):
3249         (WebCore::InternalSettings::setLangAttributeAwareFormControlUIEnabled): Deleted.
3250         * testing/InternalSettings.h:
3251         * testing/InternalSettings.idl:
3252         Remove the manual interface for the RuntimeEnabledFeature.
3253         An identical interface is generated from Settings.in!
3254
3255 2017-01-20  Anders Carlsson  <andersca@apple.com>
3256
3257         When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)
3258         https://bugs.webkit.org/show_bug.cgi?id=167268
3259         rdar://problem/29857388
3260
3261         Reviewed by Sam Weinig.
3262
3263         * page/Page.cpp:
3264         (WebCore::Page::refreshPlugins):
3265         Call PluginInfoProvider::refresh instead.
3266
3267         (WebCore::Page::clearPluginData):
3268         Add new setter.
3269
3270         * page/Page.h:
3271         Declare new members.
3272
3273         * plugins/PluginInfoProvider.cpp:
3274         (WebCore::PluginInfoProvider::refresh):
3275         Put the logic to clear plug-in data and reload frames here.
3276
3277         * plugins/PluginInfoProvider.h:
3278         Add new members.
3279
3280 2017-01-23  Jer Noble  <jer.noble@apple.com>
3281
3282         REGRESSION (r208149): Video details does not apear and missing scrubber in Control Center
3283         https://bugs.webkit.org/show_bug.cgi?id=167233
3284
3285         Reviewed by Alex Christensen.
3286
3287         Test: In TestWebKitAPI, NowPlayingControlsTests.NowPlayingControlsIOS
3288
3289         In r208149, we introduced a new media type, Video, and renamed the old type to
3290         VideoAudio (to be able to distinguish between video-with-audio and silent-video).
3291         But we missed one place where that type needs to be renamed.
3292
3293         For testing purposes, overload methods from PlatformMediaSessionManager which WebKit2 uses
3294         to report the current now playing session and it's information.
3295
3296         * platform/audio/ios/MediaSessionManagerIOS.h:
3297         * platform/audio/ios/MediaSessionManagerIOS.mm:
3298         (WebCore::MediaSessionManageriOS::nowPlayingEligibleSession):
3299         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
3300
3301 2017-01-23  Chris Dumez  <cdumez@apple.com>
3302
3303         REGRESSION (r211033): ASSERTION FAILED: m_ptr in com.apple.WebCore: WTF::RefPtr<WebCore::Element>::operator* const + 70
3304         https://bugs.webkit.org/show_bug.cgi?id=167308
3305         <rdar://problem/30144964>
3306
3307         Unreviewed, do a partial revert of r211033 to fix assertion.
3308
3309         No new tests, already covered by:
3310         fullscreen/exit-full-screen-iframe.html
3311
3312         * dom/Document.cpp:
3313         (WebCore::Document::webkitExitFullscreen):
3314         * page/ChromeClient.h:
3315
3316 2017-01-23  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
3317
3318         [GTK] asserting on unknown locale for hyphenation is wrong
3319         https://bugs.webkit.org/show_bug.cgi?id=167312
3320
3321         Reviewed by Carlos Garcia Campos.
3322
3323         The fact that we hit the assert on a test called 'hyphenation-unknown-locale' is already
3324         a strong indication we should not have it. In addition to that, Carlos Lopez pointed out
3325         a similar assert was removed from the Mac codepaths when the test was introduced.
3326
3327         * platform/text/hyphen/HyphenationLibHyphen.cpp:
3328         (WebCore::lastHyphenLocation): early return when a locale that is not available is provided
3329         for hyphenation, instead of asserting.
3330
3331 2017-01-23  Chris Dumez  <cdumez@apple.com>
3332
3333         Unreviewed attempt to fix the iOS build after r211033.
3334
3335         * dom/Node.cpp:
3336         (WebCore::Node::defaultEventHandler):
3337
3338 2017-01-23  Joseph Pecoraro  <pecoraro@apple.com>
3339
3340         Remove allowWindowOpenWithoutUserGesture setting
3341         https://bugs.webkit.org/show_bug.cgi?id=167301
3342
3343         Reviewed by Darin Adler.
3344
3345         * page/DOMWindow.cpp:
3346         (WebCore::DOMWindow::allowPopUp):
3347         * page/Settings.in:
3348
3349 2017-01-22  Carlos Garcia Campos  <cgarcia@igalia.com>
3350
3351         Database file not removed for origins after deleting all databases
3352         https://bugs.webkit.org/show_bug.cgi?id=167281
3353
3354         Reviewed by Darin Adler.
3355
3356         When DatabaseTracker::deleteDatabasesModifiedSince() is called with a min time, all databases for every origin
3357         are deleted. For each origin if all databases are removed DatabaseTracker::deleteOrigin() is called to remove
3358         also the origin database file. However, DatabaseTracker::deleteOrigin() returns early if the origin doesn't have
3359         databases and in this particular case it never has databases, because we have just removed them.
3360
3361         This will be covered by GTK+ unit tests.
3362
3363         * Modules/webdatabase/DatabaseTracker.cpp:
3364         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince): Instead of removing the databases while iterating
3365         them, add the ones to be removed to a vector. If after the iteration all databases should be removed call
3366         DatabaseTracker::deleteOrigin() to ensure both the databases and the database file are removed for the origin,
3367         otherwhise call DatabaseTracker::deleteDatabase() for every database to delete.
3368
3369 2017-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
3370
3371         [GTK] Update Safari version in user agent
3372         https://bugs.webkit.org/show_bug.cgi?id=167290
3373
3374         Reviewed by Carlos Garcia Campos.
3375
3376         Update Safari version from 10 to 11.
3377
3378         * platform/gtk/UserAgentGtk.cpp:
3379         (WebCore::buildUserAgentString):
3380
3381 2017-01-20  Darin Adler  <darin@apple.com>
3382
3383         Remove PassRefPtr from "page" directory of WebCore, also deploy references
3384         https://bugs.webkit.org/show_bug.cgi?id=167224
3385
3386         Reviewed by Chris Dumez.
3387
3388         * Modules/fetch/DOMWindowFetch.cpp:
3389         (WebCore::DOMWindowFetch::fetch): Use DOMWindow::document instead of
3390         scriptExecutionContext.
3391
3392         * Modules/webdatabase/DatabaseContext.cpp:
3393         (WebCore::DatabaseContext::databaseExceededQuota): Pass a reference.
3394
3395         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3396         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
3397         Pass a reference.
3398
3399         * bindings/js/JSDOMWindowCustom.cpp:
3400         (WebCore::JSDOMWindow::getOwnPropertySlot): Pass a reference.
3401
3402         * dom/Document.cpp:
3403         (WebCore::Document::childrenChanged): Pass a reference. Also made the
3404         didReceiveDocType code unconditional instead of iOS-only.
3405         (WebCore::Document::platformSuspendOrStopActiveDOMObjects): Ditto.
3406         (WebCore::Document::updateViewportArguments): Ditto.
3407         (WebCore::Document::setFocusedElement): Ditto.
3408         (WebCore::Document::createDOMWindow): Ditto.
3409         (WebCore::Document::takeDOMWindowFrom): Ditto.
3410         (WebCore::Document::requestFullScreenForElement): Ditto.
3411         (WebCore::Document::webkitExitFullscreen): Ditto.
3412         * dom/Element.cpp:
3413         (WebCore::Element::focus): Ditto.
3414         (WebCore::Element::blur): Ditto.
3415         (WebCore::Element::dispatchFocusEvent): Ditto.
3416         (WebCore::Element::dispatchBlurEvent): Ditto.
3417         * dom/Node.cpp:
3418         (WebCore::Node::defaultEventHandler): Ditto.
3419         * editing/EditorCommand.cpp:
3420         (WebCore::executePrint): Ditto.
3421  &n