Add plumbing to the UI process for TextIndicatorData when computing the drag image
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         Add plumbing to the UI process for TextIndicatorData when computing the drag image
4         https://bugs.webkit.org/show_bug.cgi?id=168583
5         Work towards <rdar://problem/30313681>
6
7         Reviewed by Tim Horton.
8
9         Adds some additional arguments to drag image creation functions to allow platforms to specify TextIndicatorData
10         for a link or selection-based DragImage. This TextIndicatorData is an optional member of the DragImage, and is
11         propagated to the UI process via SetDragImage in the WebDragClient.
12
13         Additionally renames hasDataInteractionAtPosition to hasSelectionAtPosition to better reflect its purpose.
14
15         No new tests, since there is no behavior change.
16
17         * page/DragController.cpp:
18         (WebCore::DragController::startDrag):
19         * page/Page.cpp:
20         (WebCore::Page::hasSelectionAtPosition):
21         (WebCore::Page::hasDataInteractionAtPosition): Deleted.
22         * page/Page.h:
23         * platform/DragImage.cpp:
24         (WebCore::createDragImageForSelection):
25         (WebCore::createDragImageForLink):
26         (WebCore::DragImage::operator=):
27         * platform/DragImage.h:
28         * platform/gtk/DragImageGtk.cpp:
29         (WebCore::createDragImageForLink):
30         * platform/mac/DragImageMac.mm:
31         (WebCore::createDragImageForLink):
32         * platform/win/DragImageWin.cpp:
33         (WebCore::createDragImageForLink):
34
35 2017-02-20  Brent Fulgham  <bfulgham@apple.com>
36
37         Nullptr dereferences when stopping a load
38         https://bugs.webkit.org/show_bug.cgi?id=168608
39         <rdar://problem/29852056>
40
41         Reviewed by Ryosuke Niwa.
42
43         Don't attempt to notify a detached frame's load client that the load is
44         stopped.
45
46         * loader/DocumentLoader.cpp:
47         (WebCore::DocumentLoader::stopLoading): Check for null frame loader and
48         bypass dereferencing it. 
49
50 2017-02-17  Anders Carlsson  <andersca@apple.com>
51
52         Add a new drag code path and use it for dragging plain text
53         https://bugs.webkit.org/show_bug.cgi?id=168534
54
55         Reviewed by Geoffrey Garen.
56
57         The new code path is currently only used for plain text selection dragging.
58
59         * WebCore.xcodeproj/project.pbxproj:
60         * page/DragClient.h:
61         (WebCore::DragClient::useLegacyDragClient):
62         Add a new member function. This currently returns true everywhere except legacy WebKit on Mac.
63
64         (WebCore::DragClient::beginDrag):
65         Add new empty member function.
66
67         * page/DragController.cpp:
68         (WebCore::dragImageAnchorPointForSelectionDrag):
69         Helper function that returns the anchor point for a selection drag image.
70
71         (WebCore::DragController::startDrag):
72         If we can use the new code path, set up a drag item with an image and pasteboard data.
73
74         (WebCore::DragController::beginDrag):
75         New function that calls out to the client.
76
77         * page/DragController.h:
78         Add new members.
79
80         * platform/DragItem.h:
81         Add a new class - it's essentially a tuple of a drag image, an anchor point and the pasteboard data the item represents.
82
83         * platform/mac/PasteboardWriter.h:
84         Rename createPasteboardWriting to createPasteboardWriter.
85
86         * platform/mac/PasteboardWriter.mm:
87         (WebCore::createPasteboardWriter):
88         Use the UTI pasteboard type.
89
90 2017-02-20  Alex Christensen  <achristensen@webkit.org>
91
92         Fix libwebrtc build after r212644.
93         https://bugs.webkit.org/show_bug.cgi?id=168596
94
95         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
96         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
97         m_endpoint changed from a c++ reference to a WTF::Ref, so we need to use operator -> instead of .
98
99 2017-02-20  Romain Bellessort  <romain.bellessort@crf.canon.fr>
100
101         [Readable Streams API] Add ReadableByteStreamController byobRequest attribute
102         https://bugs.webkit.org/show_bug.cgi?id=168319
103
104         Reviewed by Youenn Fablet.
105
106         Added ReadableByteStreamController byobRequest attribute.
107
108         Added tests related to ReadableStreamBYOBRequest as a dedicated object
109         and also as an attribute of ReadableByteStreamController.
110
111         * CMakeLists.txt: Added new files.
112         * DerivedSources.cpp: Added new files.
113         * DerivedSources.make: Added new files.
114         * Modules/streams/ReadableByteStreamController.idl: Added byobRequest support.
115         * Modules/streams/ReadableByteStreamController.js: Added byobRequest support.
116         * Modules/streams/ReadableByteStreamInternals.js:
117         (privateInitializeReadableStreamBYOBRequest): Added constructor.
118         * Modules/streams/ReadableStreamBYOBRequest.idl: Added.
119         * Modules/streams/ReadableStreamBYOBRequest.js: Added.
120         (respond): Not implemented yet.
121         (respondWithNewView): Not implemented yet.
122         (view): Not implemented yet.
123         * WebCore.xcodeproj/project.pbxproj: Added new files.
124         * bindings/js/JSDOMGlobalObject.cpp: Added ReadableStreamBYOBRequest support.
125         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
126         (WebCore::JSDOMGlobalObject::finishCreation):
127         (WebCore::JSDOMGlobalObject::visitChildren):
128         * bindings/js/JSReadableStreamPrivateConstructors.cpp: Added ReadableStreamBYOBRequest support.
129         (WebCore::constructJSReadableByteStreamController):
130         (WebCore::constructJSReadableStreamBYOBRequest):
131         (WebCore::JSBuiltinReadableStreamBYOBRequestPrivateConstructor::initializeExecutable):
132         (WebCore::createReadableStreamBYOBRequestPrivateConstructor):
133         * bindings/js/JSReadableStreamPrivateConstructors.h: Added ReadableStreamBYOBRequest support.
134         * bindings/js/WebCoreBuiltinNames.h: Added ReadableStreamBYOBRequest support.
135
136 2017-02-20  Per Arne Vollan  <pvollan@apple.com>
137
138         [Win] Custom scale factor is not applied in all cases.
139         https://bugs.webkit.org/show_bug.cgi?id=168117
140
141         Reviewed by Brent Fulgham.
142
143         We should not call the function deviceScaleFactorForWindow directly, since this
144         will return the system scale factor, and ignore the custom scale factor.
145
146         * platform/graphics/ca/win/CACFLayerTreeHost.h:
147         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
148         (WebCore::WKCACFViewLayerTreeHost::initializeContext):
149         (WebCore::WKCACFViewLayerTreeHost::resize):
150         (WebCore::WKCACFViewLayerTreeHost::setScaleFactor):
151         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
152         * platform/win/GDIUtilities.h:
153         (WebCore::makeScaledPoint):
154         * platform/win/PlatformMouseEventWin.cpp:
155         (WebCore::positionForEvent):
156         * platform/win/PopupMenuWin.cpp:
157         (WebCore::PopupMenuWin::show):
158         (WebCore::PopupMenuWin::wndProc):
159         * platform/win/PopupMenuWin.h:
160
161 2017-02-20  Jon Lee  <jonlee@apple.com>
162
163         Fix build error for iOS. Unreviewed.
164
165         * platform/graphics/GraphicsContext3D.cpp: Move stub function into !PLATFORM(COCOA) instead of !PLATFORM(MAC).
166
167 2017-02-20  Jon Lee  <jonlee@apple.com>
168
169         Unreviewed, rolling out r212639.
170
171         Have a fix for the linker error on iOS.
172
173         Reverted changeset:
174
175         "Unreviewed, rolling out r212637."
176         https://bugs.webkit.org/show_bug.cgi?id=168595
177         http://trac.webkit.org/changeset/212639
178
179 2017-02-20  Youenn Fablet  <youenn@apple.com>
180
181         [WebRTC] Fix some memory leaks in libwebrtc binding code
182         https://bugs.webkit.org/show_bug.cgi?id=168596
183
184         Reviewed by Eric Carlson.
185
186         Covered by manual testing.
187
188         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
189         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::StatsCollector): Using the libwebrtc way of creating such objects.
190         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
191         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::create):
192         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
193         (WebCore::PeerConnectionFactoryAndThreads::OnMessage):
194
195 2017-02-20  Alexey Proskuryakov  <ap@apple.com>
196
197         Clean up how WebKit exports _WebCreateFragment
198         https://bugs.webkit.org/show_bug.cgi?id=168579
199
200         Reviewed by Dan Bernstein.
201
202         * editing/Editor.h: Removed the declaration of _WebCreateFragment, SOFT_LINK doesn't need it.
203         * editing/cocoa/EditorCocoa.mm: Moved a FIXME comment here.
204
205 2017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
206
207         Unreviewed, rolling out r212637.
208
209         This change broke iOS builds.
210
211         Reverted changeset:
212
213         "Add 'webglcontextchanged' WebGLContextEvent"
214         https://bugs.webkit.org/show_bug.cgi?id=168595
215         http://trac.webkit.org/changeset/212637
216
217 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
218
219         Remove code under USE(GRAPHICS_SURFACE)
220         https://bugs.webkit.org/show_bug.cgi?id=168592
221
222         Reviewed by Michael Catanzaro.
223
224         This was only used by EFL port.
225
226         * platform/TextureMapper.cmake:
227         * platform/graphics/opengl/GLPlatformSurface.cpp: Removed.
228         * platform/graphics/surfaces/GLTransportSurface.cpp: Removed.
229         * platform/graphics/surfaces/GLTransportSurface.h: Removed.
230         * platform/graphics/surfaces/GraphicsSurface.cpp: Removed.
231         * platform/graphics/surfaces/GraphicsSurface.h: Removed.
232         * platform/graphics/surfaces/GraphicsSurfaceToken.h: Removed.
233         * platform/graphics/surfaces/egl/EGLConfigSelector.cpp: Removed.
234         * platform/graphics/surfaces/egl/EGLConfigSelector.h: Removed.
235         * platform/graphics/surfaces/egl/EGLContext.cpp: Removed.
236         * platform/graphics/surfaces/egl/EGLContext.h: Removed.
237         * platform/graphics/surfaces/egl/EGLHelper.cpp: Removed.
238         * platform/graphics/surfaces/egl/EGLHelper.h: Removed.
239         * platform/graphics/surfaces/egl/EGLSurface.cpp: Removed.
240         * platform/graphics/surfaces/egl/EGLSurface.h: Removed.
241         * platform/graphics/surfaces/egl/EGLXSurface.cpp: Removed.
242         * platform/graphics/surfaces/egl/EGLXSurface.h: Removed.
243         * platform/graphics/surfaces/glx/GLXConfigSelector.h: Removed.
244         * platform/graphics/surfaces/glx/GLXContext.cpp: Removed.
245         * platform/graphics/surfaces/glx/GLXContext.h: Removed.
246         * platform/graphics/surfaces/glx/GLXSurface.cpp: Removed.
247         * platform/graphics/surfaces/glx/GLXSurface.h: Removed.
248         * platform/graphics/surfaces/glx/X11Helper.cpp: Removed.
249         * platform/graphics/surfaces/glx/X11Helper.h: Removed.
250         * platform/graphics/texmap/TextureMapperBackingStore.cpp:
251         * platform/graphics/texmap/TextureMapperBackingStore.h:
252         * platform/graphics/texmap/TextureMapperPlatformLayer.h:
253         (WebCore::TextureMapperPlatformLayer::setClient):
254         * platform/graphics/texmap/TextureMapperSurfaceBackingStore.cpp: Removed.
255         * platform/graphics/texmap/TextureMapperSurfaceBackingStore.h: Removed.
256         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
257         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
258         (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
259         (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
260         (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer):
261         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
262         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
263         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
264
265 2017-02-20  Dean Jackson  <dino@apple.com>
266
267         Add 'webglcontextchanged' WebGLContextEvent
268         https://bugs.webkit.org/show_bug.cgi?id=168595
269         <rdar://problem/30604254>
270
271         Reviewed by Antoine Quint.
272
273         Add a new event that is dispatched when the GraphicsContext3D
274         notices that the active GPU has changed.
275
276         Test: fast/canvas/webgl/webglcontextchangedevent.html
277
278         * dom/EventNames.h: Add 'webglcontextchanged'.
279         * html/canvas/WebGLRenderingContextBase.cpp:
280         (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent): Dispatch the new event.
281         (WebCore::WebGLRenderingContextBase::simulateContextChanged): Tell the GraphicsContext3D to
282         pretend there was a GPU switch. This is called from Internals for testing.
283         * html/canvas/WebGLRenderingContextBase.h:
284         * html/canvas/WebGLRenderingContextBase.idl: Export the interface so Internals can see it.
285
286         * platform/graphics/GraphicsContext3D.cpp:
287         (WebCore::GraphicsContext3D::simulateContextChanged): Tell the GraphicsContext3DManager
288         that it should pretend a GPU change has happened, which causes it to notify all the
289         active contexts.
290         * platform/graphics/GraphicsContext3D.h:
291
292         * platform/graphics/mac/GraphicsContext3DMac.mm:
293         (WebCore::GraphicsContext3DManager::updateAllContexts): Tell the GraphicsContext3Ds
294         to tell their WebGLRenderingContexts to dispatch an event.
295         (WebCore::GraphicsContext3D::simulateContextChanged): Fake the display change.
296         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
297         (WebCore::GraphicsContext3D::dispatchContextChangedNotification): Tell the WebGLRenderingContext
298         that a change has occurred, and that it should dispatch an event. This is a layering
299         violation which will need to be fixed (although with other communication from GC3D back
300         to WebGL).
301         * testing/Internals.cpp:
302         (WebCore::Internals::simulateWebGLContextChanged):
303         * testing/Internals.h:
304         * testing/Internals.idl:
305
306 2017-02-19  Dean Jackson  <dino@apple.com>
307
308         Activate/deactivate high performance GPU when requested
309         https://bugs.webkit.org/show_bug.cgi?id=168559
310         <rdar://problem/30592266>
311
312         Reviewed by Jon Lee.
313
314         Respect the high-performance powerPreference for WebGL, by managing an
315         object that enables the high-performance GPU. If a WebGL context wants
316         high-performance, and it is visible, then a manager class in GraphicsContext3D
317         creates and retains the object, causing all the WebGL contexts to move GPUs.
318         If all the high-performance contexts are not visible, such as in a background tab,
319         then the manager will release the object, allowing the GPU to power down.
320
321         The swapping back from the high-performance GPU happens on a timer, to make
322         sure we don't churn between GPUs if the user is swapping between a lot of tabs,
323         or windows.
324
325         Unfortunately testing this change properly requires hardware with
326         multiple GPUs. I plan to write an API test that fakes most of the
327         system interaction, such as occluding the page. An API test might
328         also be able to verify if the system has more than one GPU. Otherwise
329         I'll have to plumb everything through Internals.
330
331         * html/canvas/WebGLRenderingContextBase.cpp:
332         (WebCore::isHighPerformanceContext): Helper to detect if the GraphicsContext3D actually
333         used high-performance mode.
334         (WebCore::WebGLRenderingContextBase::create): Add logging if we are
335         actually overriding a high-performance request.
336         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase): If we are high-performance,
337         then register for activity state changes.
338         (WebCore::WebGLRenderingContextBase::addActivityStateChangeObserverIfNecessary):
339         (WebCore::WebGLRenderingContextBase::removeActivityStateChangeObserver):
340         (WebCore::WebGLRenderingContextBase::destroyGraphicsContext3D): Call removeActivityStateChangeObserver
341         as the GC3D is destroyed.
342         (WebCore::WebGLRenderingContextBase::maybeRestoreContext): If the context was
343         restored successfully, and came back in high-performance, then we need
344         to listen for activity state changes as usual.
345         (WebCore::WebGLRenderingContextBase::activityStateDidChange): If we changed visibility,
346         tell the GC3D.
347         * html/canvas/WebGLRenderingContextBase.h: Class inherits ActivityStateChangeObserver.
348
349         * page/Settings.in: No longer force low-power everywhere.
350
351         * platform/graphics/GraphicsContext3D.cpp:
352         (WebCore::GraphicsContext3D::setContextVisibility): Empty implementation for non-Mac.
353         * platform/graphics/GraphicsContext3D.h:
354         (WebCore::GraphicsContext3D::powerPreferenceUsedForCreation): Tells clients what power preference
355         was actually used during creation (e.g. a single GPU system will use default, even if
356         they requested high-performance).
357
358         * platform/graphics/mac/GraphicsContext3DMac.mm:
359         (WebCore::GraphicsContext3DManager::GraphicsContext3DManager): Helper class to
360         look after all GraphicsContext3Ds.
361         (WebCore::GraphicsContext3DManager::hasTooManyContexts): We have a limit on the
362         number of contexts we can keep alive at any one time.
363         (WebCore::manager): Helper to return the static instance.
364         (WebCore::displayWasReconfigured): Send a message to all the contexts.
365         (WebCore::GraphicsContext3DManager::addContext):
366         (WebCore::GraphicsContext3DManager::removeContext):
367         (WebCore::GraphicsContext3DManager::addContextRequiringHighPerformance):
368         (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance):
369         (WebCore::GraphicsContext3DManager::updateHighPerformanceState): Check if the number
370         of contexts requiring high-performance means we need to enable/disable that GPU.
371         (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired): Releases our
372         object that keeps the high-performance GPU on.
373         (WebCore::GraphicsContext3DManager::recycleContextIfNecessary): Get rid of the first (oldest)
374         context. This code was in GC3D proper, but it made more sense here in the helper.
375         (WebCore::setPixelFormat): All contexts are created muxable now.
376         (WebCore::GraphicsContext3D::create): Use the manager.
377         (WebCore::GraphicsContext3D::GraphicsContext3D): Ditto.
378         (WebCore::GraphicsContext3D::~GraphicsContext3D): Add logging.
379         (WebCore::GraphicsContext3D::checkGPUStatusIfNecessary): Better logging.
380         (WebCore::GraphicsContext3D::updateCGLContext):
381         (WebCore::GraphicsContext3D::setContextVisibility): This is the responder to the
382         ActivityStateChanges in the WebGLRenderingContext.
383         (WebCore::activeContexts): Deleted.
384         (WebCore::addActiveContext): Deleted.
385         (WebCore::removeActiveContext): Deleted.
386
387 2017-02-20  Manuel Rego Casasnovas  <rego@igalia.com>
388
389         [css-grid] Remove compilation flag ENABLE_CSS_GRID_LAYOUT
390         https://bugs.webkit.org/show_bug.cgi?id=167693
391
392         Reviewed by Sergio Villar Senin.
393
394         * Configurations/FeatureDefines.xcconfig:
395         * css/CSSComputedStyleDeclaration.cpp:
396         (WebCore::valueForGridPosition):
397         (WebCore::isLayoutDependent):
398         (WebCore::resolveJustifySelfAuto):
399         (WebCore::isImplicitlyInheritedGridOrFlexProperty):
400         (WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
401         (WebCore::ComputedStyleExtractor::propertyValue):
402         * css/CSSGridAutoRepeatValue.cpp:
403         * css/CSSGridAutoRepeatValue.h:
404         * css/CSSGridLineNamesValue.cpp:
405         * css/CSSGridLineNamesValue.h:
406         * css/CSSGridTemplateAreasValue.cpp:
407         * css/CSSGridTemplateAreasValue.h:
408         * css/CSSPrimitiveValueMappings.h:
409         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
410         * css/CSSProperties.json:
411         * css/CSSValue.cpp:
412         (WebCore::CSSValue::equals):
413         (WebCore::CSSValue::cssText):
414         (WebCore::CSSValue::destroy):
415         * css/CSSValue.h:
416         (WebCore::CSSValue::isContentDistributionValue):
417         (WebCore::CSSValue::isGridLineNamesValue):
418         * css/CSSValueKeywords.in:
419         * css/StyleBuilderConverter.h:
420         (WebCore::StyleBuilderConverter::convertGridAutoFlow):
421         (WebCore::StyleBuilderConverter::convertContentAlignmentData):
422         * css/StyleBuilderCustom.h:
423         (WebCore::StyleBuilderCustom::applyValueGridTemplateRows):
424         * css/StyleProperties.cpp:
425         (WebCore::StyleProperties::getPropertyValue):
426         * css/StyleResolver.cpp:
427         (WebCore::equivalentBlockDisplay):
428         * css/StyleResolver.h:
429         * css/parser/CSSParser.cpp:
430         (WebCore::CSSParserContext::CSSParserContext):
431         (WebCore::operator==):
432         * css/parser/CSSParserFastPaths.cpp:
433         (WebCore::isSimpleLengthPropertyID):
434         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
435         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
436         * css/parser/CSSParserMode.h:
437         (WebCore::CSSParserContextHash::hash):
438         * css/parser/CSSPropertyParser.cpp:
439         (WebCore::consumeGridAutoFlow):
440         (WebCore::consumeGridTemplateAreas):
441         (WebCore::CSSPropertyParser::parseSingleValue):
442         (WebCore::CSSPropertyParser::consumeGridShorthand):
443         (WebCore::CSSPropertyParser::parseShorthand):
444         * dom/Document.cpp:
445         * dom/Document.h:
446         * dom/Position.cpp:
447         (WebCore::Position::isCandidate):
448         * page/RuntimeEnabledFeatures.h:
449         (WebCore::RuntimeEnabledFeatures::isCSSGridLayoutEnabled):
450         * rendering/Grid.cpp:
451         * rendering/Grid.h:
452         * rendering/RenderBlock.cpp:
453         (WebCore::RenderBlock::getFirstLetter):
454         * rendering/RenderBox.cpp:
455         (WebCore::RenderBox::~RenderBox):
456         (WebCore::RenderBox::styleDidChange):
457         (WebCore::RenderBox::clearExtraInlineAndBlockOffests):
458         (WebCore::RenderBox::containingBlockLogicalWidthForContent):
459         (WebCore::RenderBox::containingBlockLogicalHeightForContent):
460         (WebCore::RenderBox::perpendicularContainingBlockLogicalHeight):
461         (WebCore::RenderBox::computeLogicalWidthInRegion):
462         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
463         (WebCore::RenderBox::computeLogicalHeight):
464         (WebCore::RenderBox::computePercentageLogicalHeight):
465         (WebCore::RenderBox::containingBlockLogicalWidthForPositioned):
466         (WebCore::RenderBox::containingBlockLogicalHeightForPositioned):
467         (WebCore::RenderBox::computePositionedLogicalWidth):
468         (WebCore::RenderBox::computePositionedLogicalHeight):
469         (WebCore::RenderBox::createsNewFormattingContext):
470         (WebCore::logicalWidthIsResolvable):
471         (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
472         (WebCore::RenderBox::hasDefiniteLogicalHeight):
473         * rendering/RenderBox.h:
474         (WebCore::RenderBox::isGridItem):
475         * rendering/RenderElement.cpp:
476         (WebCore::RenderElement::createFor):
477         * rendering/RenderFlexibleBox.cpp:
478         (WebCore::RenderFlexibleBox::alignChildren):
479         * rendering/RenderGrid.cpp:
480         * rendering/RenderGrid.h:
481         * rendering/RenderObject.h:
482         (WebCore::RenderObject::isRenderGrid):
483         * rendering/style/GridArea.h:
484         * rendering/style/GridLength.h:
485         * rendering/style/GridPosition.h:
486         * rendering/style/GridPositionsResolver.cpp:
487         * rendering/style/GridPositionsResolver.h:
488         * rendering/style/GridTrackSize.h:
489         * rendering/style/RenderStyle.cpp:
490         (WebCore::RenderStyle::isCSSGridLayoutEnabled):
491         (WebCore::RenderStyle::changeRequiresLayout):
492         * rendering/style/RenderStyle.h:
493         (WebCore::RenderStyle::gridItemRowEnd):
494         (WebCore::RenderStyle::setGridRowGap):
495         (WebCore::RenderStyle::initialGridItemRowEnd):
496         (WebCore::RenderStyle::isDisplayReplacedType):
497         (WebCore::RenderStyle::isDisplayGridBox):
498         * rendering/style/RenderStyleConstants.h:
499         * rendering/style/StyleGridData.cpp:
500         * rendering/style/StyleGridData.h:
501         * rendering/style/StyleGridItemData.cpp:
502         * rendering/style/StyleGridItemData.h:
503         * rendering/style/StyleRareNonInheritedData.cpp:
504         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
505         (WebCore::StyleRareNonInheritedData::operator==):
506         * rendering/style/StyleRareNonInheritedData.h:
507         * testing/InternalSettings.cpp:
508         (WebCore::InternalSettings::Backup::Backup):
509         (WebCore::InternalSettings::Backup::restoreTo):
510         (WebCore::InternalSettings::setCSSGridLayoutEnabled):
511
512 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
513
514         REGRESSION(r212345): [GTK] ASSERT(cookieChangeCallbackMap().contains(jar)) failed in WebCore::stopObservingCookieChanges:54
515         https://bugs.webkit.org/show_bug.cgi?id=168375
516
517         Reviewed by Alex Christensen.
518
519         Simplify the way cookie storage is handled in NetworkStorageSessionSoup. Now we always keep a reference to the
520         cookie jar, no matter if we have a session or not, that is always kept in sync with the one actually used by the
521         session. We always connect to the changed signal of the current cookie jar and notify the observer if it has been
522         set.
523
524         * platform/network/NetworkStorageSession.h:
525         * platform/network/soup/CookieStorageSoup.cpp:
526         (WebCore::startObservingCookieChanges): Remove this implementation and add an ASSERT to ensure we don't use this anymore.
527         (WebCore::stopObservingCookieChanges): Ditto.
528         (WebCore::cookieChangeCallbackMap): Deleted.
529         (WebCore::soupCookiesChanged): Deleted.
530         * platform/network/soup/NetworkStorageSessionSoup.cpp:
531         (WebCore::NetworkStorageSession::NetworkStorageSession): Initialize the cookie storage.
532         (WebCore::NetworkStorageSession::~NetworkStorageSession): Disconnect the changed signal.
533         (WebCore::NetworkStorageSession::getOrCreateSoupNetworkSession): Always pass the current cookie storage.
534         (WebCore::NetworkStorageSession::cookiesDidChange): Notify the observer.
535         (WebCore::NetworkStorageSession::cookieStorage): Return the current cookie storage.
536         (WebCore::NetworkStorageSession::setCookieStorage): Update the current cookie storage and update the session if
537         needed too. We always have a valid cookie storage so if nullptr is given we create a new one.
538         (WebCore::NetworkStorageSession::setCookieObserverHandler): Set a cookie observer handler.
539
540 2017-02-19  Chris Dumez  <cdumez@apple.com>
541
542         onbeforeunload event return value coercion is not per-spec
543         https://bugs.webkit.org/show_bug.cgi?id=168382
544
545         Reviewed by Darin Adler.
546
547         Update handling of value returned by onbeforeunload event listeners
548         to match Firefox and the specification:
549         - https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (step 4)
550
551         Namely, the following changes were made:
552         - Only set the event's returnValue attribute to the returned value if the attribute
553           value is the empty string (so as to not override the attribute value if it has
554           explicitly been set by JS).
555         - Cancel the event when the return value is not null by calling preventDefault().
556
557         Additionally, the following changes were made:
558         - Ask the user to confirm the navigation if the event was canceled, not just if the
559           returnValue attribute was set to a non-empty string.
560         as per:
561         - https://html.spec.whatwg.org/#prompt-to-unload-a-document (step 8)
562
563         Tests: fast/events/before-unload-return-string-conversion.html
564                imported/w3c/web-platform-tests/html/browsers/browsing-the-web/unloading-documents/beforeunload-canceling.html
565
566         * bindings/js/JSEventListener.cpp:
567         (WebCore::handleBeforeUnloadEventReturnValue):
568         (WebCore::JSEventListener::handleEvent):
569         * loader/FrameLoader.cpp:
570         (WebCore::shouldAskForNavigationConfirmation):
571         (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
572
573 2017-02-19  Carlos Garcia Campos  <cgarcia@igalia.com>
574
575         [SOUP] Call SoupNetworkSession::setShouldIgnoreTLSErrors when testRunner.setAllowsAnySSLCertificate() is called
576         https://bugs.webkit.org/show_bug.cgi?id=168571
577
578         Reviewed by Michael Catanzaro.
579
580         Fixes: http/tests/ssl/upgrade-origin-usage.html
581
582         * testing/InternalSettings.cpp:
583         (WebCore::InternalSettings::setAllowsAnySSLCertificate):
584
585 2017-02-18  Ryosuke Niwa  <rniwa@webkit.org>
586
587         REGRESSION(r212218): Assertion failures in and after parserRemoveChild
588         https://bugs.webkit.org/show_bug.cgi?id=168458
589
590         Reviewed by Antti Koivisto.
591
592         The bug was caused by parserRemoveChild not preceeding to remove oldChild even when
593         oldChild had been inserted elsewhere during unload evnets of the disconnected frames.
594         Fixed the bug by checking this condition and exiting early.
595
596         Also fixed various callers of parserRemoveChild to not call parserAppendChild when
597         the removed node had already been inserted elsewhere by scripts.
598
599         Tests: fast/parser/adoption-agency-unload-iframe-3.html
600                fast/parser/adoption-agency-unload-iframe-4.html
601                fast/parser/xml-error-unload-iframe.html
602
603         * dom/ContainerNode.cpp:
604         (WebCore::ContainerNode::parserRemoveChild): Exit early when the node had been
605         inserted elsewhere while firing unload events. Also moved the call to
606         notifyRemovePendingSheetIfNeeded outside NoEventDispatchAssertion since it can
607         synchrnously fire a focus event.
608         (WebCore::ContainerNode::parserAppendChild): Moved adoptNode call to inside
609         NoEventDispatchAssertion since adoptNode call here should never mutate DOM.
610         * html/parser/HTMLConstructionSite.cpp:
611         (WebCore::executeReparentTask): Added an early exit when the node had already been
612         inserted elsewhere.
613         (WebCore::executeInsertAlreadyParsedChildTask): Ditto.
614         * xml/XMLErrors.cpp:
615         (WebCore::XMLErrors::insertErrorMessageBlock): Ditto.
616         * xml/parser/XMLDocumentParser.cpp:
617         (WebCore::XMLDocumentParser::end): Fixed a crash unveiled by one of the test cases.
618         Exit early when insertErrorMessageBlock detached the parser (by author scripts).
619         (WebCore::XMLDocumentParser::finish): Keep the parser alive until we exit.
620
621 2017-02-19  Chris Dumez  <cdumez@apple.com>
622
623         <input type=color readonly> doesn't act per spec
624         https://bugs.webkit.org/show_bug.cgi?id=168421
625         <rdar://problem/30593185>
626
627         Reviewed by Ryosuke Niwa.
628
629         The 'readonly' attribute should not apply to <input type=color> as per the
630         HTML specification:
631         - https://html.spec.whatwg.org/#the-input-element:attr-input-readonly-3
632
633         Chrome / Firefox and Edge already behave as per the specification.
634
635         Tests: fast/forms/color/input-color-disabled.html
636                fast/forms/color/input-color-readonly.html
637
638         * html/ColorInputType.cpp:
639         (WebCore::ColorInputType::handleDOMActivateEvent):
640         (WebCore::ColorInputType::didChooseColor):
641
642 2017-02-19  Commit Queue  <commit-queue@webkit.org>
643
644         Unreviewed, rolling out r212466.
645         https://bugs.webkit.org/show_bug.cgi?id=168577
646
647         causes crashes on AArch64 on linux, maybe it's causing crashes
648         on iOS too (Requested by pizlo on #webkit).
649
650         Reverted changeset:
651
652         "The collector thread should only start when the mutator
653         doesn't have heap access"
654         https://bugs.webkit.org/show_bug.cgi?id=167737
655         http://trac.webkit.org/changeset/212466
656
657 2017-02-19  Zalan Bujtas  <zalan@apple.com>
658
659         Simple line layout: Implement positionForPoint.
660         https://bugs.webkit.org/show_bug.cgi?id=168565
661         <rdar://problem/30593370>
662
663         Reviewed by Antti Koivisto.
664
665         With this patch, now we don't need to switch over to line box tree anymore when positionForPoint()
666         is called on a single RenderText content (which is the majority of the simple line content).
667         This patch also adds a new positionForPoint method which returns a Position object instead of VisiblePosition.
668         Some of the positionForPoint() callsites are only interested in the Position object so constructing a VisiblePosition
669         (which could potentially kick off a layout) is a waste. At this point the non-simple line layout codepath still constructs
670         a VisiblePosition and that should be addresses as part of webkit.org/b/168566.
671
672         Covered by existing tests.
673
674         * dom/Document.cpp:
675         (WebCore::Document::caretRangeFromPoint):
676         * rendering/RenderBlockFlow.cpp:
677         (WebCore::RenderBlockFlow::positionForPoint):
678         * rendering/RenderBlockFlow.h:
679         * rendering/RenderObject.cpp:
680         (WebCore::RenderObject::positionForPoint):
681         * rendering/RenderObject.h:
682         * rendering/RenderText.cpp:
683         (WebCore::RenderText::positionForPoint):
684         * rendering/RenderText.h:
685         * rendering/SimpleLineLayoutFunctions.cpp:
686         (WebCore::SimpleLineLayout::positionForPoint):
687         * rendering/SimpleLineLayoutFunctions.h:
688         * rendering/SimpleLineLayoutResolver.cpp:
689         (WebCore::SimpleLineLayout::RunResolver::runForPoint):
690         * rendering/SimpleLineLayoutResolver.h:
691         (WebCore::SimpleLineLayout::RunResolver::Run::logicalLeft):
692         (WebCore::SimpleLineLayout::RunResolver::Run::logicalRight):
693
694 2017-02-19  Antti Koivisto  <antti@apple.com>
695
696         Execute pending scripts asynchronously after stylesheet loads complete
697         https://bugs.webkit.org/show_bug.cgi?id=168367
698         rdar://problem/30561379
699
700         Reviewed by Andreas Kling.
701
702         The current synchronous execution is fragile and creates various problems.
703
704         * css/StyleSheetContents.cpp:
705         (WebCore::StyleSheetContents::checkLoaded):
706         * dom/ContainerNode.cpp:
707         (WebCore::ContainerNode::takeAllChildrenFrom):
708         (WebCore::ContainerNode::notifyChildInserted):
709         (WebCore::ContainerNode::removeChild):
710         (WebCore::ContainerNode::parserRemoveChild):
711         (WebCore::ContainerNode::removeChildren):
712
713             Remove various places where we would trigger delayed synchronous execution.
714
715         * dom/Document.cpp:
716         (WebCore::Document::Document):
717         (WebCore::Document::recalcStyle):
718
719             Trigger scroll to anchor at the end of style resolution instead of when style sheet load completes.
720
721         (WebCore::Document::didRemoveAllPendingStylesheet):
722
723             Call asynchronous script execution function.
724
725         * dom/Document.h:
726         (WebCore::Document::setNeedsNotifyRemoveAllPendingStylesheet): Deleted.
727         (WebCore::Document::notifyRemovePendingSheetIfNeeded): Deleted.
728         * dom/ScriptableDocumentParser.cpp:
729         (WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
730         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheetsSoon):
731         (WebCore::ScriptableDocumentParser::scriptsWaitingForStylesheetsExecutionTimerFired):
732
733             Add a timer for executing pending scripts.
734
735         (WebCore::ScriptableDocumentParser::detach):
736         * dom/ScriptableDocumentParser.h:
737         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheets):
738         * html/HTMLLinkElement.cpp:
739         (WebCore::HTMLLinkElement::removedFrom):
740         (WebCore::HTMLLinkElement::removePendingSheet):
741         * html/HTMLLinkElement.h:
742         * html/parser/HTMLDocumentParser.cpp:
743         (WebCore::HTMLDocumentParser::detach):
744         * loader/DocumentLoader.cpp:
745         (WebCore::DocumentLoader::isLoadingInAPISense):
746
747             Stay in loading state if we have a pending script. This matches existing behavior.
748
749         * style/StyleScope.cpp:
750         (WebCore::Style::Scope::removePendingSheet):
751         * style/StyleScope.h:
752
753 2017-02-18  Chris Dumez  <cdumez@apple.com>
754
755         <input type=range readonly> doesn't act per spec
756         https://bugs.webkit.org/show_bug.cgi?id=168422
757         <rdar://problem/30593189>
758
759         Reviewed by Ryosuke Niwa.
760
761         'readonly' attribute should not apply to <input type=range> as per the HTML
762         specification:
763         - https://html.spec.whatwg.org/#the-input-element:attr-input-readonly-3
764
765         Firefox and Edge already behave as per the specification.
766
767         No new tests, updated existing tests.
768
769         * html/RangeInputType.cpp:
770         (WebCore::RangeInputType::handleMouseDownEvent):
771         (WebCore::RangeInputType::handleTouchEvent):
772         (WebCore::RangeInputType::handleKeydownEvent):
773         * html/shadow/SliderThumbElement.cpp:
774         (WebCore::SliderThumbElement::defaultEventHandler):
775         (WebCore::SliderThumbElement::willRespondToMouseMoveEvents):
776         (WebCore::SliderThumbElement::willRespondToMouseClickEvents):
777
778 2017-02-18  Chris Dumez  <cdumez@apple.com>
779
780         Recursive MessagePort.postMessage() calls causes tab to become unresponsive
781         https://bugs.webkit.org/show_bug.cgi?id=168548
782         <rdar://problem/29808005>
783
784         Reviewed by Darin Adler.
785
786         MessagePort::dispatchMessages() was getting messages one by one of the
787         channel's MessageQueue and firing the MessageEvent for each of them.
788         The issue is that we can get stuck in an infinite loop if the
789         MessageEvent handler posts a message on the same post.
790
791         To address the issue, we now takes all messages from the queue before
792         iterating over them to fire the event. This way, if new messages are
793         added to the queue in one of the MessageEvent handlers, they will not
794         be processed until the next event loop iteration, as is expected.
795
796         Test: fast/events/message-port-postMessage-recursive.html
797
798         * dom/MessagePort.cpp:
799         (WebCore::MessagePort::dispatchMessages):
800         * dom/MessagePortChannel.h:
801         (WebCore::MessagePortChannel::EventData::EventData):
802         * dom/default/PlatformMessagePortChannel.cpp:
803         (WebCore::MessagePortChannel::postMessageToRemote):
804         * dom/default/PlatformMessagePortChannel.h:
805         (WebCore::PlatformMessagePortChannel::MessagePortQueue::takeMessage):
806         (WebCore::PlatformMessagePortChannel::MessagePortQueue::takeAllMessages):
807         (WebCore::PlatformMessagePortChannel::MessagePortQueue::appendAndCheckEmpty):
808
809 2017-02-18  Michael Catanzaro  <mcatanzaro@igalia.com>
810
811         Remove COORDINATED_GRAPHICS_MULTIPROCESS
812         https://bugs.webkit.org/show_bug.cgi?id=168514
813
814         Reviewed by Darin Adler.
815
816         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
817         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
818
819 2017-02-17  Simon Fraser  <simon.fraser@apple.com>
820
821         Allow properties in CSSProperties.json that don't trigger code generation
822         https://bugs.webkit.org/show_bug.cgi?id=168535
823
824         Reviewed by Sam Weinig.
825         
826         In order to track the development of CSS properties that we have not yet implemented,
827         support '"skip-codegen" : true' in "codegen-properties".
828
829         Test by adding a few fill-related properties with this attribute.
830
831         * css/CSSProperties.json:
832         * css/makeprop.pl:
833         (isPropertyEnabled):
834         (addProperty):
835
836 2017-02-17  Brian Burg  <bburg@apple.com>
837
838         Web Inspector: RTL: Inspector window should dock to the left when using RTL layout direction
839         https://bugs.webkit.org/show_bug.cgi?id=168273
840         <rdar://problem/29949325>
841
842         Reviewed by Matt Baker.
843
844         Add the ability to dock Web Inspector to the left of the inspected view.
845         The frontend decides whether the Dock to Side button docks left or right
846         based on the current layout direction.
847
848         * inspector/InspectorFrontendClient.h:
849         * inspector/InspectorFrontendClientLocal.cpp:
850         (WebCore::InspectorFrontendClientLocal::setAttachedWindow):
851         * inspector/InspectorFrontendHost.cpp:
852         (WebCore::InspectorFrontendHost::requestSetDockSide):
853
854 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
855
856         Allow PlatformCALayers to specify that they want deep color backing store
857         https://bugs.webkit.org/show_bug.cgi?id=168495
858
859         Reviewed by Tim Horton.
860         
861         Currently capable iOS devices get deep color backing store by virtue of a supports
862         check in PlatformCALayerCocoa::PlatformCALayerCocoa(), and LegacyTileGridTile.
863
864         Future work will make layer contents format selection more complex, so express the need
865         for deep color on PlatformCALayer, and have the creators of PlatformCALayer (mainly the
866         flavors of GraphicsLayerCA) choose for them to support deep color. A bit of special-casing
867         is needed to propagte the state to TileControllers.
868         
869         The deep-colorness now propagates from PlatformCALayerRemote to RemoteLayerBackingStore,
870         instead of RemoteLayerBackingStore looking at the properties of the screen directly.
871
872         Remove PlatformCALayer::LayerTypeWebTiledLayer which was only used for the old CATiledLayers
873         that we no longer use.
874
875         An iphone7 test verifies that page tiles, normal layers and tiled layers get the deep
876         color state set on them.
877
878         Test: tiled-drawing/ios/iphone7/compositing-layers-deep-color.html
879
880         * platform/graphics/ca/GraphicsLayerCA.cpp:
881         (WebCore::GraphicsLayerCA::createPlatformCALayer):
882         (WebCore::GraphicsLayerCA::dumpAdditionalProperties):
883         * platform/graphics/ca/GraphicsLayerCA.h:
884         * platform/graphics/ca/PlatformCALayer.cpp:
885         (WebCore::PlatformCALayer::canHaveBackingStore):
886         (WebCore::operator<<):
887         * platform/graphics/ca/PlatformCALayer.h:
888         * platform/graphics/ca/TileController.cpp:
889         (WebCore::TileController::setZoomedOutContentsScale):
890         (WebCore::TileController::setAcceleratesDrawing):
891         (WebCore::TileController::setWantsDeepColorBackingStore):
892         (WebCore::TileController::createTileLayer):
893         * platform/graphics/ca/TileController.h:
894         * platform/graphics/ca/TileGrid.cpp:
895         (WebCore::TileGrid::updateTileLayerProperties):
896         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
897         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
898         (PlatformCALayerCocoa::PlatformCALayerCocoa):
899         (PlatformCALayerCocoa::commonInit):
900         (PlatformCALayerCocoa::wantsDeepColorBackingStore):
901         (PlatformCALayerCocoa::setWantsDeepColorBackingStore):
902         (layerContentsFormat):
903         (PlatformCALayerCocoa::updateContentsFormat):
904         * platform/graphics/ca/cocoa/WebTiledBackingLayer.h:
905         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
906         (-[WebTiledBackingLayer setWantsDeepColorBackingStore:]):
907         (-[WebTiledBackingLayer wantsDeepColorBackingStore]):
908         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
909         (PlatformCALayerWin::wantsDeepColorBackingStore):
910         (PlatformCALayerWin::setWantsDeepColorBackingStore):
911         (printLayer):
912         * platform/graphics/ca/win/PlatformCALayerWin.h:
913         * platform/spi/cocoa/QuartzCoreSPI.h:
914
915 2017-02-17  Jer Noble  <jer.noble@apple.com>
916
917         Refactoring: Make sure to unprepare WebAudioSourceProviderAVFObjC when its owner is destroyed.
918         https://bugs.webkit.org/show_bug.cgi?id=168532
919
920         Reviewed by Youenn Fablet.
921
922         Because WebAudioSourceProviderAVFObjC has a back-pointer to the object which creted it, make
923         sure that back-pointer is invalidated once the creating object is destroyed by calling
924         WebAudioSOurceProviderAVFObjC::unprepare().
925
926         Drive-by Fix: In WebAudioSourceProviderAVFObjC::audioSamplesAvailable(), PlatformAudioData will
927         always be of the WebAudioBufferList type. If this ever becomes untrue, an invalid downcast will
928         be caught by downcast<>, so just remove the is<> check.
929
930         * platform/mediastream/mac/AVAudioCaptureSource.mm:
931         (WebCore::AVAudioCaptureSource::~AVAudioCaptureSource):
932         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
933         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
934         (WebCore::MockRealtimeAudioSourceMac::~MockRealtimeAudioSourceMac):
935         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
936         (WebCore::RealtimeIncomingAudioSource::~RealtimeIncomingAudioSource):
937         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
938         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
939         (WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
940         (WebCore::WebAudioSourceProviderAVFObjC::setClient):
941         (WebCore::WebAudioSourceProviderAVFObjC::unprepare):
942         (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
943
944 2017-02-17  Antoine Quint  <graouts@apple.com>
945
946         [Modern Media Controls] Improve handling of <video> with only audio tracks
947         https://bugs.webkit.org/show_bug.cgi?id=167836
948         <rdar://problem/30255812>
949
950         Reviewed by Dean Jackson.
951
952         We now check for the availability of video tracks before considering a <video>
953         element is displaying an actual video file and turning auto-hide on. We also
954         check that we have video tracks before enabling the fullscreen button. This
955         brings the behavior of a <video> pointing to a resource with no video tracks
956         to be the same as an <audio> element.
957
958         Test: media/modern-media-controls/media-controller/media-controller-video-with-only-audio.html
959
960         * Modules/modern-media-controls/media/controls-visibility-support.js:
961         (ControlsVisibilitySupport.prototype.get tracksToMonitor):
962         (ControlsVisibilitySupport.prototype._updateControls):
963         (ControlsVisibilitySupport):
964         * Modules/modern-media-controls/media/fullscreen-support.js:
965         (FullscreenSupport.prototype.syncControl):
966         (FullscreenSupport):
967
968 2017-02-17  Antoine Quint  <graouts@apple.com>
969
970         [Modern Media Controls] Toggle playback when clicking on the video on macOS
971         https://bugs.webkit.org/show_bug.cgi?id=168515
972         <rdar://problem/30577441>
973
974         Reviewed by Dean Jackson.
975
976         Listen to click events on the macOS media controls. Detect any clicks that were on the
977         background instead of the controls widgets themselves, and tell the delegate (MediaController)
978         about them.
979
980         Tests: media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause.html
981                media/modern-media-controls/media-controller/media-controller-click-on-video-background-to-dismiss-tracks-panel-should-not-toggle-playback.html
982                media/modern-media-controls/media-controller/media-controller-click-on-video-controls-should-not-pause.html
983
984         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
985         (MacOSFullscreenMediaControls.prototype._handleMousedown):
986         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
987         (MacOSInlineMediaControls.prototype.handleEvent):
988         * Modules/modern-media-controls/controls/macos-media-controls.js:
989         (MacOSMediaControls.prototype.handleEvent):
990         (MacOSMediaControls):
991         * Modules/modern-media-controls/media/media-controller.js:
992         (MediaController.prototype.togglePlayback):
993         (MediaController.prototype.macOSControlsBackgroundWasClicked):
994         (MediaController.prototype._updateControlsIfNeeded):
995         * Modules/modern-media-controls/media/playback-support.js:
996         (PlaybackSupport.prototype.buttonWasPressed):
997
998 2017-02-17  Jer Noble  <jer.noble@apple.com>
999
1000         Refactoring: Remove AudioSourceObserverObjC and AudioCaptureSourceProviderObjC
1001         https://bugs.webkit.org/show_bug.cgi?id=168520
1002
1003         Reviewed by Youenn Fablet.
1004
1005         Having AudioCaptureSourceProviderObjC as the type provided to WebAudioSourceProviderAVFObjC
1006         (and only ever to WebAudioSourceProviderAVFObjC) makes it impossible for that class to add
1007         an observer on RealtimeMediaSource, of which all classes inheriting from
1008         WebAudioSourceProviderAVFObjC are subclasses. There is no need to treat
1009         WebAudioSourceProviderAVFObjC as an "observer", since the only thing it will ever observe is
1010         the object which created it and hold an explicit reference to it. So replace all instances
1011         of the "observer" pattern with direct calls to the necessary (newly non-virtual) methods.
1012         This allows WebAudioSourceProviderAVFObjC to register as an observer directly on
1013         RealtimeMediaSource, to listen for audioSamplesAvailable() instead of process(), and remove
1014         a lot of unnecessary conversion code and observer duplication.
1015
1016         * WebCore.xcodeproj/project.pbxproj:
1017         * platform/mediastream/RealtimeMediaSource.h:
1018         (WebCore::RealtimeMediaSource::Observer::sourceStopped):
1019         (WebCore::RealtimeMediaSource::Observer::sourceMutedChanged):
1020         (WebCore::RealtimeMediaSource::Observer::sourceEnabledChanged):
1021         (WebCore::RealtimeMediaSource::Observer::sourceSettingsChanged):
1022         (WebCore::RealtimeMediaSource::Observer::preventSourceFromStopping):
1023         * platform/mediastream/mac/AVAudioCaptureSource.h:
1024         * platform/mediastream/mac/AVAudioCaptureSource.mm:
1025         (WebCore::AVAudioCaptureSource::shutdownCaptureSession):
1026         (WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection):
1027         (WebCore::AVAudioCaptureSource::addObserver): Deleted.
1028         (WebCore::AVAudioCaptureSource::removeObserver): Deleted.
1029         (WebCore::AVAudioCaptureSource::start): Deleted.
1030         * platform/mediastream/mac/AudioCaptureSourceProviderObjC.h: Removed.
1031         * platform/mediastream/mac/AudioSourceObserverObjC.h: Removed.
1032         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
1033         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
1034         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
1035         (WebCore::MockRealtimeAudioSourceMac::emitSampleBuffers):
1036         (WebCore::MockRealtimeAudioSourceMac::reconfigure):
1037         (WebCore::MockRealtimeAudioSourceMac::audioSourceProvider):
1038         (WebCore::MockRealtimeAudioSourceMac::addObserver): Deleted.
1039         (WebCore::MockRealtimeAudioSourceMac::removeObserver): Deleted.
1040         (WebCore::MockRealtimeAudioSourceMac::start): Deleted.
1041         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
1042         (WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
1043         (WebCore::RealtimeIncomingAudioSource::addObserver): Deleted.
1044         (WebCore::RealtimeIncomingAudioSource::removeObserver): Deleted.
1045         (WebCore::RealtimeIncomingAudioSource::start): Deleted.
1046         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
1047         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
1048         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
1049         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
1050         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
1051         (WebCore::WebAudioSourceProviderAVFObjC::create):
1052         (WebCore::WebAudioSourceProviderAVFObjC::WebAudioSourceProviderAVFObjC):
1053         (WebCore::WebAudioSourceProviderAVFObjC::setClient):
1054         (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
1055         (WebCore::WebAudioSourceProviderAVFObjC::process): Deleted.
1056
1057 2017-02-17  Antoine Quint  <graouts@apple.com>
1058
1059         REGRESSION: Subtitles menu in media controls allows multiple items to be selected
1060         https://bugs.webkit.org/show_bug.cgi?id=168168
1061         <rdar://problem/30488605>
1062
1063         Reviewed by Dean Jackson.
1064
1065         Ensure that only a single audio track and a single text track can be selected
1066         in the tracks panel at any given point.
1067
1068         * Modules/modern-media-controls/media/tracks-support.js:
1069         (TracksSupport.prototype.tracksPanelSelectionDidChange):
1070         (TracksSupport.prototype._sortedTrackList):
1071         (TracksSupport):
1072
1073 2017-02-17  Jeremy Jones  <jeremyj@apple.com>
1074
1075         Invalidate WebAVSampleBufferStatusChangeListener when MediaPlayerPrivateMediaStreamAVFObjC is deallocated.
1076         https://bugs.webkit.org/show_bug.cgi?id=168488
1077
1078         Reviewed by Jer Noble.
1079
1080         Fixes periodically crashing test: fast/mediastream/MediaStream-video-element-track-stop.html
1081
1082         WebAVSampleBufferStatusChangeListener has an unretained referecne to MediaPlayerPrivateMediaStreamAVFObjC
1083         that must be invaldated when MediaPlayerPrivateMediaStreamAVFObjC is deallocated.
1084
1085         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1086         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC):
1087
1088 2017-02-17  Antoine Quint  <graouts@apple.com>
1089
1090         [Modern Media Controls] Improve handling of live broadcast video
1091         https://bugs.webkit.org/show_bug.cgi?id=168506
1092         <rdar://problem/30432094>
1093
1094         Reviewed by Dean Jackson.
1095
1096         We improve the handling of live broadcast video by:
1097         
1098             - checking that we have a media source before deciding to show the controls
1099               bar and start button
1100             - support a mode where neither the status text nor the scrubber is visible
1101               in case we're still waiting on sufficient data to determine the video
1102               time and we haven't really started loading data yet
1103             - not showing time labels when we have an infinite duration
1104             - ensuring the status label is left-aligned
1105
1106         Test: media/modern-media-controls/status-label/status-label-text-align.html
1107
1108         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
1109         (MacOSInlineMediaControls.prototype.layout):
1110         * Modules/modern-media-controls/controls/status-label.css:
1111         (.status-label):
1112         * Modules/modern-media-controls/controls/status-label.js:
1113         (StatusLabel.prototype.get enabled):
1114         (StatusLabel.prototype.set enabled):
1115         * Modules/modern-media-controls/media/controls-visibility-support.js:
1116         (ControlsVisibilitySupport.prototype._updateControls):
1117         (ControlsVisibilitySupport):
1118         * Modules/modern-media-controls/media/status-support.js:
1119         (StatusSupport.prototype.syncControl):
1120         (StatusSupport):
1121         * Modules/modern-media-controls/media/time-labels-support.js:
1122         (TimeLabelsSupport.prototype.syncControl):
1123         (TimeLabelsSupport):
1124
1125 2017-02-17  Anders Carlsson  <andersca@apple.com>
1126
1127         Begin overhauling the pasteboard implementation
1128         https://bugs.webkit.org/show_bug.cgi?id=168525
1129
1130         Reviewed by Tim Horton.
1131
1132         Add a new PasteboardWriterData object. This object will hold data that is going
1133         to be written to the pasteboard at some point. Currently it only supports plain text.
1134
1135         Also add a Mac-only PasteboardWriter class which can convert a PasteboardWriterDataObject
1136         into an object that conforms to NSPasteboardWriting.
1137
1138         The basic idea is that instead of doing a bunch of pasteboard operations,
1139         we'll just package all the pasteboard data up into an object and ship it over to WebKit.
1140
1141         This code is currently unused but will be adopted by a new drag implementation (in an upcoming patch).
1142
1143         * WebCore.xcodeproj/project.pbxproj:
1144         * platform/PasteboardWriterData.cpp: Added.
1145         (WebCore::PasteboardWriterData::PasteboardWriterData):
1146         (WebCore::PasteboardWriterData::~PasteboardWriterData):
1147         (WebCore::PasteboardWriterData::isEmpty):
1148         (WebCore::PasteboardWriterData::setPlainText):
1149         * platform/PasteboardWriterData.h: Added.
1150         * platform/mac/PasteboardWriter.h: Added.
1151         * platform/mac/PasteboardWriter.mm: Added.
1152         (WebCore::createPasteboardWriting):
1153         * platform/spi/mac/NSPasteboardSPI.h: Added.
1154
1155 2017-02-17  Per Arne Vollan  <pvollan@apple.com>
1156
1157         Apply SVG styles paint-order, stroke-linejoin, and stroke-linecap on DOM text.
1158         https://bugs.webkit.org/show_bug.cgi?id=168044
1159         rdar://problem/30165746
1160
1161         Reviewed by Simon Fraser.
1162
1163         This patch moves these styles out of svg, and sets the properties on video cues.
1164
1165         Tests: fast/css/parsing-paint-order.html
1166                fast/css/parsing-stroke-linecap.html
1167                fast/css/parsing-stroke-linejoin.html
1168                fast/css/parsing-stroke-width.html
1169
1170         * css/CSSComputedStyleDeclaration.cpp:
1171         (WebCore::paintOrder):
1172         (WebCore::ComputedStyleExtractor::propertyValue):
1173         * css/CSSProperties.json:
1174         * css/SVGCSSComputedStyleDeclaration.cpp:
1175         (WebCore::ComputedStyleExtractor::svgPropertyValue):
1176         (WebCore::paintOrder): Deleted.
1177         * css/StyleResolver.cpp:
1178         (WebCore::StyleResolver::isValidCueStyleProperty):
1179         * page/CaptionUserPreferencesMediaAF.cpp:
1180         (WebCore::CaptionUserPreferencesMediaAF::cssPropertyWithTextEdgeColor):
1181         * rendering/style/RenderStyle.cpp:
1182         (WebCore::RenderStyle::diff):
1183         (WebCore::RenderStyle::paintTypesForPaintOrder):
1184         * rendering/style/RenderStyle.h:
1185         (WebCore::RenderStyle::setPaintOrder):
1186         (WebCore::RenderStyle::paintOrder):
1187         (WebCore::RenderStyle::initialPaintOrder):
1188         (WebCore::RenderStyle::setCapStyle):
1189         (WebCore::RenderStyle::capStyle):
1190         (WebCore::RenderStyle::initialCapStyle):
1191         (WebCore::RenderStyle::setJoinStyle):
1192         (WebCore::RenderStyle::joinStyle):
1193         (WebCore::RenderStyle::initialJoinStyle):
1194         (WebCore::RenderStyle::strokeWidth):
1195         (WebCore::RenderStyle::setStrokeWidth):
1196         (WebCore::RenderStyle::hasVisibleStroke):
1197         (WebCore::RenderStyle::setStrokeOpacity):
1198         * rendering/style/SVGRenderStyle.cpp:
1199         (WebCore::SVGRenderStyle::diff):
1200         (WebCore::SVGRenderStyle::paintTypesForPaintOrder): Deleted.
1201         * rendering/style/SVGRenderStyle.h:
1202         (WebCore::SVGRenderStyle::initialBufferedRendering):
1203         (WebCore::SVGRenderStyle::initialFillRule):
1204         (WebCore::SVGRenderStyle::initialMaskType):
1205         (WebCore::SVGRenderStyle::setBufferedRendering):
1206         (WebCore::SVGRenderStyle::setFillRule):
1207         (WebCore::SVGRenderStyle::setMaskType):
1208         (WebCore::SVGRenderStyle::bufferedRendering):
1209         (WebCore::SVGRenderStyle::fillRule):
1210         (WebCore::SVGRenderStyle::strokeMiterLimit):
1211         (WebCore::SVGRenderStyle::maskType):
1212         (WebCore::SVGRenderStyle::hasStroke):
1213         (WebCore::SVGRenderStyle::setBitDefaults):
1214         (WebCore::SVGRenderStyle::InheritedFlags::operator==):
1215         (WebCore::SVGRenderStyle::initialCapStyle): Deleted.
1216         (WebCore::SVGRenderStyle::initialJoinStyle): Deleted.
1217         (WebCore::SVGRenderStyle::initialPaintOrder): Deleted.
1218         (WebCore::SVGRenderStyle::setCapStyle): Deleted.
1219         (WebCore::SVGRenderStyle::setJoinStyle): Deleted.
1220         (WebCore::SVGRenderStyle::setPaintOrder): Deleted.
1221         (WebCore::SVGRenderStyle::capStyle): Deleted.
1222         (WebCore::SVGRenderStyle::joinStyle): Deleted.
1223         (WebCore::SVGRenderStyle::strokeWidth): Deleted.
1224         (WebCore::SVGRenderStyle::paintOrder): Deleted.
1225         (WebCore::SVGRenderStyle::hasVisibleStroke): Deleted.
1226         (WebCore::SVGRenderStyle::setStrokeWidth): Deleted.
1227         * rendering/style/SVGRenderStyleDefs.cpp:
1228         (WebCore::StyleStrokeData::StyleStrokeData):
1229         (WebCore::StyleStrokeData::operator==):
1230         * rendering/style/SVGRenderStyleDefs.h:
1231         * rendering/style/StyleRareInheritedData.cpp:
1232         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
1233         (WebCore::StyleRareInheritedData::operator==):
1234         * rendering/style/StyleRareInheritedData.h:
1235         * rendering/svg/RenderSVGEllipse.cpp:
1236         (WebCore::RenderSVGEllipse::strokeShape):
1237         * rendering/svg/RenderSVGPath.cpp:
1238         (WebCore::RenderSVGPath::strokeShape):
1239         (WebCore::RenderSVGPath::shapeDependentStrokeContains):
1240         (WebCore::RenderSVGPath::shouldStrokeZeroLengthSubpath):
1241         (WebCore::RenderSVGPath::zeroLengthLinecapPath):
1242         * rendering/svg/RenderSVGRect.cpp:
1243         (WebCore::RenderSVGRect::strokeShape):
1244         * rendering/svg/RenderSVGShape.cpp:
1245         (WebCore::RenderSVGShape::strokeShape):
1246         (WebCore::RenderSVGShape::fillStrokeMarkers):
1247         (WebCore::RenderSVGShape::strokeWidth):
1248         (WebCore::RenderSVGShape::hasSmoothStroke):
1249         * rendering/svg/RenderSVGText.cpp:
1250         (WebCore::RenderSVGText::strokeBoundingBox):
1251         * rendering/svg/SVGInlineTextBox.cpp:
1252         (WebCore::SVGInlineTextBox::paint):
1253         (WebCore::SVGInlineTextBox::paintDecoration):
1254         * rendering/svg/SVGRenderSupport.cpp:
1255         (WebCore::SVGRenderSupport::applyStrokeStyleToContext):
1256         * rendering/svg/SVGRenderTreeAsText.cpp:
1257         (WebCore::writeStyle):
1258
1259 2017-02-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1260
1261         [SOUP] Handle Settings::allowsAnySSLCertificate() in SSL sockets
1262         https://bugs.webkit.org/show_bug.cgi?id=168521
1263
1264         Reviewed by Michael Catanzaro.
1265
1266         When Settings::allowsAnySSLCertificate() is enabled, connect to accept-certificate signal of the GTlsConnection
1267         to always accept the certificates.
1268
1269         Fixes: http/tests/websocket/tests/hybi/simple-wss.html
1270
1271         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
1272         (WebCore::wssConnectionAcceptCertificateCallback):
1273         (WebCore::wssSocketClientEventCallback):
1274         (WebCore::SocketStreamHandleImpl::create):
1275
1276 2017-02-17  Simon Fraser  <simon.fraser@apple.com>
1277
1278         Fixed elements bounce when rubber-banding at the bottom of the page
1279         https://bugs.webkit.org/show_bug.cgi?id=168493
1280         rdar://problem/30567713
1281
1282         Reviewed by Tim Horton.
1283
1284         FrameView::visibleDocumentRect() was computing a bad visible rect when bottom-rubber-banding,
1285         by adding rubberBandBottom which is negative, rather than subtracting.
1286
1287         Log some more scrolling stuff.
1288
1289         Ironically, the existing test didn't test stick-to-viewport fixed position because
1290         backgroundShouldExtendBeyondPage() is off by default in WTR, so clone it to a test
1291         that sets this, to test both behaviors.
1292
1293         This also revealed that dynamic changes to backgroundShouldExtendBeyondPage() need
1294         to be propagated to the scrolling tree, which is fixed in AsyncScrollingCoordinator::frameViewLayoutUpdated().
1295
1296         Test: fast/visual-viewport/rubberbanding-viewport-rects-extended-background.html
1297
1298         * page/FrameView.cpp:
1299         (WebCore::FrameView::updateLayoutViewport):
1300         (WebCore::FrameView::visibleDocumentRect):
1301         * page/scrolling/AsyncScrollingCoordinator.cpp:
1302         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1303         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1304         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
1305         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1306         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition):
1307         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
1308         (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
1309         (WebCore::ScrollingCoordinatorMac::commitTreeState):
1310
1311 2017-02-17  Simon Fraser  <simon.fraser@apple.com>
1312
1313         REGRESSION (209396): Apple Pay buttons do not render
1314         https://bugs.webkit.org/show_bug.cgi?id=168523
1315         rdar://problem/30451563
1316
1317         Reviewed by Geoffrey Garen.
1318
1319         The new CSS parser mistakenly converted -apple-pay-button values to
1320         -webkit-pay-button, breaking -webkit-appearance: -apple-pay-button.
1321
1322         Fix by excluding "-apple-pay" prefixed values from the conversion.
1323
1324         Test: fast/css/appearance-apple-pay-button.html
1325
1326         * css/parser/CSSPropertyParser.cpp:
1327         (WebCore::isAppleLegacyCssValueKeyword):
1328
1329 2017-02-17  Commit Queue  <commit-queue@webkit.org>
1330
1331         Unreviewed, rolling out r212463.
1332         https://bugs.webkit.org/show_bug.cgi?id=168526
1333
1334         Some crashes with GuardMalloc (Requested by anttik on
1335         #webkit).
1336
1337         Reverted changeset:
1338
1339         "Execute pending scripts asynchronously after stylesheet loads
1340         complete"
1341         https://bugs.webkit.org/show_bug.cgi?id=168367
1342         http://trac.webkit.org/changeset/212463
1343
1344 2017-02-16  Brent Fulgham  <bfulgham@apple.com>
1345
1346         RenderView needs to be updated when FrameView changes
1347         https://bugs.webkit.org/show_bug.cgi?id=168481
1348         <rdar://problem/30339638>
1349
1350         Reviewed by Andreas Kling.
1351
1352         The state of the Document's RenderView can get out of sync with the Frame's FrameView.
1353         We need a notification mechanism so that modifications to the Frame's view are properly
1354         relayed to Document so that it can have a correct RenderView.
1355
1356         * dom/Document.cpp:
1357         (WebCore::Document::didBecomeCurrentDocumentInView): Create an updated render tree (if
1358         one does not already exist).
1359         (WebCore::Document::destroyRenderTree): Remove an incorrect ASSERT. We may enter this
1360         code when the Frame uses 'setView(nullptr)', which happens during certain  updates.
1361         * dom/Document.h:
1362         * page/Frame.cpp:
1363         (WebCore::Frame::setView): Destroy the old render tree (if present) before switching to
1364         the new view. Then notify the document that it is now the current document in the new view.
1365
1366 2017-02-17  Enrique Ocaña González  <eocanha@igalia.com>
1367
1368         [GStreamer] Fast replay on video hide/unhide on platforms with limited video buffer pools
1369         https://bugs.webkit.org/show_bug.cgi?id=168505
1370
1371         Reviewed by Žan Doberšek.
1372
1373         The WebKit code isn't consuming the video samples when the video layer is hidden,
1374         so the buffers aren't being returned to the pool and starve the decoder when the
1375         buffer pool runs out of buffers (on platforms using a buffer pool and a custom
1376         allocator, such as OMX on the Raspberry Pi 2). When the video layer is restored,
1377         the pipeline tries to catch up and the user sees the video "going fast forward".
1378
1379         The added code "consumes" (removes and unrefs) the buffer in that case. However,
1380         the sample isn't completely removed because it still holds important info (eg:
1381         caps) needed for the proper operation of the video element.
1382
1383         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1384         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
1385
1386 2017-02-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1387
1388         [SOUP] Stop removing the fragment identifier from resource requests
1389         https://bugs.webkit.org/show_bug.cgi?id=168509
1390
1391         Reviewed by Sergio Villar Senin.
1392
1393         I don't know why, but have always removed the fragment identifier from the URL when creating the SoupURI that
1394         is passed to libsoup. Maybe it was a bug in a very old version of libsoup, but it doesn't look necessary anymore
1395         and it's causing several layout test failures.
1396
1397         Fixes: http/tests/svg/svg-use-external.html
1398                imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/compile-error-same-origin-with-hash.html
1399                imported/w3c/web-platform-tests/html/webappapis/scripting/processing-model-2/runtime-error-same-origin-with-hash.html
1400
1401         * platform/network/soup/ResourceRequestSoup.cpp:
1402         (WebCore::ResourceRequest::createSoupURI): Do not remove the fragment identifier from the URL.
1403
1404 2017-02-16  Yusuke Suzuki  <utatane.tea@gmail.com>
1405
1406         [JSC] Drop PassRefPtr from ArrayBuffer
1407         https://bugs.webkit.org/show_bug.cgi?id=168455
1408
1409         Reviewed by Geoffrey Garen.
1410
1411         * bindings/js/SerializedScriptValue.cpp:
1412         (WebCore::CloneDeserializer::readArrayBufferView):
1413         * css/FontFace.cpp:
1414         (WebCore::FontFace::create):
1415         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1416         (WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData):
1417         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1418         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
1419         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
1420         (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
1421         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1422         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1423
1424 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
1425
1426         REGRESSION(r212439): Web Inspector Toolbar / Window appears broken
1427         https://bugs.webkit.org/show_bug.cgi?id=168494
1428
1429         Reviewed by Joseph Pecoraro.
1430
1431         Missed one conversion from acceleratesDrawing to drawsAsynchronously, which
1432         caused non-Whippet GrpahicsContext shadow drawing to happen unexpectedly.
1433
1434         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
1435         (-[WebTiledBackingLayer drawsAsynchronously]):
1436         (-[WebTiledBackingLayer acceleratesDrawing]): Deleted.
1437
1438 2017-02-16  Chris Dumez  <cdumez@apple.com>
1439
1440         <input>.labels is empty if type changes from text->hidden->checkbox
1441         https://bugs.webkit.org/show_bug.cgi?id=168358
1442
1443         Reviewed by Ryosuke Niwa.
1444
1445         We were invalidating LabelsNodeLists on 'for' attribute change.
1446         We now also invalidate them of 'type' attribute change since
1447         HTMLInputElements whose type is 'hidden' do not support labels.
1448
1449         No new tests, updated existing test.
1450
1451         * dom/Document.h:
1452         * dom/LiveNodeList.h:
1453         (WebCore::shouldInvalidateTypeOnAttributeChange):
1454         * html/LabelsNodeList.cpp:
1455         (WebCore::LabelsNodeList::LabelsNodeList):
1456
1457 2017-02-16  Michael Catanzaro  <mcatanzaro@igalia.com>
1458
1459         Remove even more EFL from WebCore
1460         https://bugs.webkit.org/show_bug.cgi?id=168485
1461
1462         Reviewed by Alex Christensen.
1463
1464         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1465         (webkitAccessibleGetAttributes):
1466         (atkRole):
1467         * css/StyleRule.cpp:
1468         (WebCore::StyleRuleBase::copy):
1469         * platform/ContextMenuItem.h:
1470         * platform/graphics/OpenGLESShims.h:
1471         * platform/graphics/PlatformDisplay.cpp:
1472         (WebCore::PlatformDisplay::createPlatformDisplay):
1473         * platform/graphics/PlatformDisplay.h:
1474         * platform/graphics/cairo/ImageBufferCairo.cpp:
1475         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
1476         (WebCore::Font::platformInit):
1477         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1478         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
1479         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1480         (WebCore::GraphicsLayerTextureMapper::setContentsToImage):
1481         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
1482         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
1483         * platform/network/soup/ResourceErrorSoup.cpp:
1484         (WebCore::ResourceError::timeoutError):
1485         * platform/network/soup/SoupNetworkSession.cpp:
1486         (WebCore::SoupNetworkSession::setProxySettingsFromEnvironment): Deleted.
1487         * platform/network/soup/SoupNetworkSession.h:
1488
1489 2017-02-16  Daniel Bates  <dabates@apple.com>
1490
1491         Remove Chromium-specific code to call FrameLoaderClient::redirectDataToPlugin(nullptr)
1492         https://bugs.webkit.org/show_bug.cgi?id=168417
1493         <rdar://problem/30541748>
1494
1495         Reviewed by Brent Fulgham.
1496
1497         Remove Chromium-specific code that was added in r125500 to call FrameLoaderClient::redirectDataToPlugin(nullptr)
1498         in PluginDocument::detachFromPluginElement(). Calling redirectDataToPlugin() with nullptr was used by the
1499         Chromium port to signify that the plugin document was being destroyed so that they could tear down their
1500         plugin widget. And PluginDocument::detachFromPluginElement() is the only place that calls redirectDataToPlugin()
1501         passing nullptr. No other port made use of this machinery and the Chromium port has long since been removed
1502         from the Open Source WebKit Project. We should remove this code.
1503
1504         * html/PluginDocument.cpp:
1505         (WebCore::PluginDocumentParser::appendBytes): Pass the plugin widget by reference.
1506         (WebCore::PluginDocument::detachFromPluginElement): Remove call to FrameLoaderClient::redirectDataToPlugin().
1507         This call was only used by the Chromium port as means to be notified when the plugin document was being
1508         destroyed. No other port made use of this notification or needed such a notification.
1509         * loader/EmptyClients.cpp: Change argument of redirectDataToPlugin() from Widget* to Widget& to convey
1510         that this function always takes a valid Widget. Also remove unnecessary argument name as the data type
1511         of the argument and the name of the function sufficiently describes the purpose of the argument.
1512         * loader/FrameLoaderClient.h: Ditto.
1513
1514 2017-02-16  Myles C. Maxfield  <mmaxfield@apple.com>
1515
1516         font-weight in @font-face can cause a font to be downloaded even when it's not used
1517         https://bugs.webkit.org/show_bug.cgi?id=168114
1518         <rdar://problem/30301317>
1519
1520         Reviewed by Darin Adler.
1521
1522         There were two problems with our font loading code.
1523
1524         When we are in the middle of a download, we will use a special interstitial font,
1525         and this special font has a flag set which will cause it to be invisible when it is
1526         drawn. However, when we start using this font during the load, we give it a
1527         unicode-range of U+0-0 which means that it will never be used, and fallback will
1528         happen to other weights immediately. 
1529
1530         The second problem with the font loading code is that this interstital font is just
1531         Times. Times doesn't support every character, which means that if we are trying
1532         to render some exotic character, we fall back to other weights. The solution here
1533         is to use LastResort as the interstitial font, because it supports all characters.
1534         Because its metrics are reasonable and we don't ever actually paint this
1535         interstitial font, this choice is no worse than Times.
1536
1537         Tests: fast/text/font-style-download.html
1538                fast/text/font-weight-download-2.html
1539                fast/text/font-weight-download.html
1540                fast/text/font-weight-fallback.html
1541
1542         * css/CSSFontFace.cpp:
1543         (WebCore::CSSFontFace::font):
1544         * css/CSSSegmentedFontFace.cpp:
1545         (WebCore::appendFont):
1546         (WebCore::CSSSegmentedFontFace::fontRanges):
1547         (WebCore::appendFontWithInvalidUnicodeRangeIfLoading): Deleted.
1548         * platform/graphics/Font.h:
1549         (WebCore::Font::widthForGlyph):
1550         * platform/graphics/FontCache.h:
1551         * platform/graphics/freetype/FontCacheFreeType.cpp:
1552         (WebCore::FontCache::lastResortFallbackFontForEveryCharacter):
1553         * platform/graphics/mac/FontCacheMac.mm:
1554         (WebCore::FontCache::lastResortFallbackFontForEveryCharacter):
1555         * platform/graphics/win/FontCacheWin.cpp:
1556         (WebCore::FontCache::lastResortFallbackFontForEveryCharacter):
1557
1558 2017-02-16  Alex Christensen  <achristensen@webkit.org>
1559
1560         Remove EFL-specific files in Source.
1561
1562         Rubber-stamped by Anders Carlsson.
1563
1564         * editing/efl: Removed.
1565         * page/efl: Removed.
1566         * platform/audio/efl: Removed.
1567         * platform/efl: Removed.
1568         * platform/efl/DefaultTheme: Removed.
1569         * platform/efl/DefaultTheme/widget: Removed.
1570         * platform/efl/DefaultTheme/widget/button: Removed.
1571         * platform/efl/DefaultTheme/widget/check: Removed.
1572         * platform/efl/DefaultTheme/widget/combo: Removed.
1573         * platform/efl/DefaultTheme/widget/entry: Removed.
1574         * platform/efl/DefaultTheme/widget/progressbar: Removed.
1575         * platform/efl/DefaultTheme/widget/radio: Removed.
1576         * platform/efl/DefaultTheme/widget/scrollbar: Removed.
1577         * platform/efl/DefaultTheme/widget/search: Removed.
1578         * platform/efl/DefaultTheme/widget/search/cancel: Removed.
1579         * platform/efl/DefaultTheme/widget/search/decoration: Removed.
1580         * platform/efl/DefaultTheme/widget/search/field: Removed.
1581         * platform/efl/DefaultTheme/widget/slider: Removed.
1582         * platform/efl/DefaultTheme/widget/spinner: Removed.
1583         * platform/gamepad/efl: Removed.
1584         * platform/graphics/efl: Removed.
1585         * platform/graphics/surfaces/efl: Removed.
1586         * platform/network/efl: Removed.
1587
1588 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
1589
1590         Add WebUSB to features.json as a "Not Considering".
1591
1592         * features.json:
1593
1594 2017-02-16  Alex Christensen  <achristensen@webkit.org>
1595
1596         Remove old URL parser
1597         https://bugs.webkit.org/show_bug.cgi?id=168483
1598
1599         Reviewed by Tim Horton.
1600
1601         * platform/URL.cpp:
1602         (WebCore::isSchemeFirstChar):
1603         (WebCore::isSchemeChar):
1604         (WebCore::URL::URL):
1605         (WebCore::URL::setProtocol):
1606         (WebCore::URL::setHost):
1607         (WebCore::URL::removePort):
1608         (WebCore::URL::setPort):
1609         (WebCore::URL::setHostAndPort):
1610         (WebCore::URL::setUser):
1611         (WebCore::URL::setPass):
1612         (WebCore::URL::setFragmentIdentifier):
1613         (WebCore::URL::setQuery):
1614         (WebCore::URL::setPath):
1615         (WebCore::URL::serialize):
1616         (WebCore::isUserInfoChar): Deleted.
1617         (WebCore::isHostnameChar): Deleted.
1618         (WebCore::isIPv6Char): Deleted.
1619         (WebCore::isPathSegmentEndChar): Deleted.
1620         (WebCore::appendASCII): Deleted.
1621         (WebCore::findFirstOf): Deleted.
1622         (WebCore::checkEncodedString): Deleted.
1623         (WebCore::URL::init): Deleted.
1624         (WebCore::appendEscapingBadChars): Deleted.
1625         (WebCore::escapeAndAppendNonHierarchicalPart): Deleted.
1626         (WebCore::copyPathRemovingDots): Deleted.
1627         (WebCore::hasSlashDotOrDotDot): Deleted.
1628         (WebCore::URL::parse): Deleted.
1629         (WebCore::cannotBeABaseURL): Deleted.
1630         (WebCore::isDefaultPortForScheme): Deleted.
1631         (WebCore::hostPortIsEmptyButCredentialsArePresent): Deleted.
1632         (WebCore::isNonFileHierarchicalScheme): Deleted.
1633         (WebCore::isCanonicalHostnameLowercaseForScheme): Deleted.
1634         (WebCore::findHostnamesInMailToURL): Deleted.
1635         (WebCore::findHostnameInHierarchicalURL): Deleted.
1636         (WebCore::encodeHostnames): Deleted.
1637         (WebCore::encodeRelativeString): Deleted.
1638         (WebCore::substituteBackslashes): Deleted.
1639         * platform/URLParser.cpp:
1640         (WebCore::URLParser::URLParser):
1641         (WebCore::URLParser::setEnabled): Deleted.
1642         (WebCore::URLParser::enabled): Deleted.
1643         * platform/URLParser.h:
1644         * platform/cf/URLCF.cpp:
1645         (WebCore::URL::URL):
1646         * platform/mac/URLMac.mm:
1647         (WebCore::URL::URL):
1648
1649 2017-02-16  Anders Carlsson  <andersca@apple.com>
1650
1651         Build fixes.
1652
1653         * page/gtk/EventHandlerGtk.cpp:
1654         (WebCore::EventHandler::createDraggingDataTransfer):
1655         * page/win/EventHandlerWin.cpp:
1656         (WebCore::EventHandler::createDraggingDataTransfer):
1657
1658 2017-02-16  Anders Carlsson  <andersca@apple.com>
1659
1660         Remove EFL from WebCore
1661         https://bugs.webkit.org/show_bug.cgi?id=168477
1662
1663         Reviewed by Brian Burg.
1664
1665         * accessibility/AccessibilityList.cpp:
1666         (WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers):
1667         * accessibility/AccessibilityNodeObject.cpp:
1668         (WebCore::AccessibilityNodeObject::canSetValueAttribute):
1669         * accessibility/AccessibilityObject.cpp:
1670         (WebCore::AccessibilityObject::AccessibilityObject):
1671         (WebCore::AccessibilityObject::textIteratorBehaviorForTextRange):
1672         * accessibility/AccessibilityObject.h:
1673         * accessibility/AccessibilityRenderObject.cpp:
1674         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
1675         * accessibility/AccessibilityTableColumn.cpp:
1676         (WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored):
1677         * accessibility/AccessibilityTableHeaderContainer.cpp:
1678         (WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored):
1679         * crypto/CryptoKey.cpp:
1680         * crypto/keys/CryptoKeyRSA.h:
1681         * dom/Document.cpp:
1682         (WebCore::Document::implicitClose):
1683         * editing/Editor.cpp:
1684         (WebCore::Editor::performCutOrCopy):
1685         (WebCore::Editor::copyImage):
1686         * editing/Editor.h:
1687         * editing/FrameSelection.h:
1688         * html/HTMLCanvasElement.cpp:
1689         (WebCore::requiresAcceleratedCompositingForWebGL):
1690         * inspector/InspectorFrontendHost.cpp:
1691         (WebCore::InspectorFrontendHost::port):
1692         * loader/HistoryController.cpp:
1693         (WebCore::HistoryController::restoreScrollPositionAndViewState):
1694         * loader/icon/IconDatabase.cpp:
1695         (WebCore::IconDatabase::performURLImport):
1696         * page/ContextMenuController.cpp:
1697         (WebCore::ContextMenuController::contextMenuItemSelected):
1698         (WebCore::ContextMenuController::populate):
1699         (WebCore::ContextMenuController::checkOrEnableIfNeeded):
1700         * page/DragController.cpp:
1701         (WebCore::DragController::startDrag):
1702         * page/EventHandler.cpp:
1703         (WebCore::EventHandler::eventInvertsTabsToLinksClientCallResult):
1704         * page/FrameView.cpp:
1705         (WebCore::FrameView::layout):
1706         * platform/ContextMenuItem.h:
1707         * platform/Cursor.h:
1708         * platform/DragData.h:
1709         * platform/DragImage.h:
1710         * platform/FileSystem.h:
1711         * platform/LocalizedStrings.h:
1712         * platform/MIMETypeRegistry.cpp:
1713         (WebCore::initializeSupportedImageMIMETypesForEncoding):
1714         * platform/NotImplemented.h:
1715         * platform/Pasteboard.h:
1716         * platform/PlatformKeyboardEvent.h:
1717         * platform/PlatformMouseEvent.h:
1718         * platform/PlatformSpeechSynthesizer.h:
1719         * platform/PlatformWheelEvent.h:
1720         * platform/Widget.h:
1721         * platform/graphics/ANGLEWebKitBridge.h:
1722         * platform/graphics/BitmapImage.h:
1723         * platform/graphics/GraphicsContext3D.h:
1724         * platform/graphics/Icon.h:
1725         * platform/graphics/Image.h:
1726         (WebCore::Image::getEvasObject): Deleted.
1727         * platform/graphics/IntPoint.h:
1728         * platform/graphics/IntRect.h:
1729         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
1730         (WebCore::Extensions3DOpenGL::createVertexArrayOES):
1731         (WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
1732         (WebCore::Extensions3DOpenGL::isVertexArrayOES):
1733         (WebCore::Extensions3DOpenGL::bindVertexArrayOES):
1734         (WebCore::Extensions3DOpenGL::supportsExtension):
1735         * platform/graphics/opengl/Extensions3DOpenGL.h:
1736         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1737         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1738         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1739         (WebCore::GraphicsContext3D::createForCurrentGLContext):
1740         (WebCore::GraphicsContext3D::reshape):
1741         (WebCore::GraphicsContext3D::createVertexArray):
1742         (WebCore::GraphicsContext3D::deleteVertexArray):
1743         (WebCore::GraphicsContext3D::isVertexArray):
1744         (WebCore::GraphicsContext3D::bindVertexArray):
1745         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
1746         * platform/network/NetworkStateNotifier.h:
1747         * platform/posix/FileSystemPOSIX.cpp:
1748         * rendering/RenderLayerCompositor.cpp:
1749         (WebCore::RenderLayerCompositor::ensureRootLayer):
1750         * rendering/RenderText.cpp:
1751         (WebCore::RenderText::previousOffsetForBackwardDeletion):
1752         * xml/XSLStyleSheetLibxslt.cpp:
1753         * xml/XSLTExtensions.cpp:
1754         * xml/XSLTProcessorLibxslt.cpp:
1755         * xml/XSLTUnicodeSort.cpp:
1756
1757 2017-02-16  Zalan Bujtas  <zalan@apple.com>
1758
1759         Simple line layout: Add forced line layout info to coverage print.
1760         https://bugs.webkit.org/show_bug.cgi?id=168470
1761
1762         Reviewed by Simon Fraser.
1763
1764         This is about potential vs. actual coverage:
1765
1766         Simple line layout potential coverage: 65.05%
1767         Simple line layout actual coverage: 46.60%
1768         Forced line layout blocks: 4 content length: 57(18.45%)
1769
1770         Not testable.
1771
1772         * rendering/SimpleLineLayout.cpp:
1773         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
1774
1775 2017-02-16  Anders Carlsson  <andersca@apple.com>
1776
1777         Rename DataTransfer functions to indicate whether they are for dragging or dropping
1778         https://bugs.webkit.org/show_bug.cgi?id=168478
1779
1780         Reviewed by Tim Horton.
1781
1782         * dom/DataTransfer.cpp:
1783         (WebCore::DataTransfer::createForDrag):
1784         (WebCore::DataTransfer::createForDrop):
1785         (WebCore::DataTransfer::createForDragAndDrop): Deleted.
1786         * dom/DataTransfer.h:
1787         * page/DragController.cpp:
1788         (WebCore::DragController::dragExited):
1789         (WebCore::DragController::performDragOperation):
1790         (WebCore::DragController::tryDHTMLDrag):
1791         * page/mac/EventHandlerMac.mm:
1792         (WebCore::EventHandler::createDraggingDataTransfer):
1793
1794 2017-02-16  Anders Carlsson  <andersca@apple.com>
1795
1796         Rename EventHandler::freeDataTransfer to invalidateDataTransfer
1797         https://bugs.webkit.org/show_bug.cgi?id=168472
1798
1799         Reviewed by Tim Horton.
1800
1801         The code doesn't necessarily free the data transfer object, so rename the member function
1802         to reflect that. Also, get rid of a goto.
1803
1804         * page/EventHandler.cpp:
1805         (WebCore::EventHandler::invalidateDataTransfer):
1806         (WebCore::EventHandler::dragSourceEndedAt):
1807         (WebCore::EventHandler::handleDrag):
1808         (WebCore::EventHandler::freeDataTransfer): Deleted.
1809         * page/EventHandler.h:
1810
1811 2017-02-16  Alex Christensen  <achristensen@webkit.org>
1812
1813         Special URLs without a host are invalid
1814         https://bugs.webkit.org/show_bug.cgi?id=168461
1815
1816         Reviewed by Tim Horton.
1817
1818         http://? should be invalid.  This matches Chrome and the spec and the intent of my implementation
1819         of URLParser which already fails with urls like http:// and this was just an oversight.
1820         Covered by newly passing web platform tests.  Updated API tests.
1821
1822         * platform/URLParser.cpp:
1823         (WebCore::URLParser::parse):
1824
1825 2017-02-16  Zalan Bujtas  <zalan@apple.com>
1826
1827         Simple line layout: Add support for pagination.
1828         https://bugs.webkit.org/show_bug.cgi?id=168355
1829         <rdar://problem/30119769>
1830
1831         Reviewed by David Hyatt.
1832
1833         This patch adds basic support for paginated content including widows and orphans.
1834
1835         This is based on the normal line layout pagination logic. However there are 2 major
1836         advantages here (and they allow us to have a much simpler logic):
1837         1. all the lines are positioned by the time we start paginating them and
1838         2. lines always have uniform heights. 
1839
1840         This is not enabled yet.
1841
1842         * rendering/RenderBlockFlow.h:
1843         * rendering/SimpleLineLayout.cpp:
1844         (WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow):
1845         (WebCore::SimpleLineLayout::computeLineBreakIndex):
1846         (WebCore::SimpleLineLayout::setPageBreakForLine):
1847         (WebCore::SimpleLineLayout::computeOffsetAfterLineBreak):
1848         (WebCore::SimpleLineLayout::updateMinimumPageHeight):
1849         (WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
1850         (WebCore::SimpleLineLayout::create):
1851         (WebCore::SimpleLineLayout::Layout::create):
1852         (WebCore::SimpleLineLayout::Layout::Layout):
1853         * rendering/SimpleLineLayout.h:
1854         (WebCore::SimpleLineLayout::Layout::isPaginated):
1855         (WebCore::SimpleLineLayout::Layout::struts):
1856         * rendering/SimpleLineLayoutFunctions.h:
1857         (WebCore::SimpleLineLayout::computeFlowHeight):
1858         * rendering/SimpleLineLayoutResolver.h:
1859         (WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition):
1860
1861 2017-02-11  Filip Pizlo  <fpizlo@apple.com>
1862
1863         The collector thread should only start when the mutator doesn't have heap access
1864         https://bugs.webkit.org/show_bug.cgi?id=167737
1865
1866         Reviewed by Keith Miller.
1867
1868         Added new tests in JSTests and LayoutTests.
1869         
1870         The WebCore changes involve:
1871         
1872         - Refactoring around new header discipline.
1873         
1874         - Adding crazy GC APIs to window.internals to enable us to test the GC's runloop discipline.
1875
1876         * ForwardingHeaders/heap/GCFinalizationCallback.h: Added.
1877         * ForwardingHeaders/heap/IncrementalSweeper.h: Added.
1878         * ForwardingHeaders/heap/MachineStackMarker.h: Added.
1879         * ForwardingHeaders/heap/RunningScope.h: Added.
1880         * bindings/js/CommonVM.cpp:
1881         * testing/Internals.cpp:
1882         (WebCore::Internals::parserMetaData):
1883         (WebCore::Internals::isReadableStreamDisturbed):
1884         (WebCore::Internals::isGCRunning):
1885         (WebCore::Internals::addGCFinalizationCallback):
1886         (WebCore::Internals::stopSweeping):
1887         (WebCore::Internals::startSweeping):
1888         * testing/Internals.h:
1889         * testing/Internals.idl:
1890
1891 2017-02-16  Jiewen Tan  <jiewen_tan@apple.com>
1892
1893         [WebCrypto] remove toJSValueFromJsonWebKey from custom SubtleCrypto binding codes
1894         https://bugs.webkit.org/show_bug.cgi?id=167026
1895
1896         Reviewed by Chris Dumez.
1897
1898         Covered by existing tests.
1899
1900         * bindings/js/JSSubtleCryptoCustom.cpp:
1901         (WebCore::jsSubtleCryptoFunctionExportKeyPromise):
1902         (WebCore::jsSubtleCryptoFunctionWrapKeyPromise):
1903         (WebCore::toJSValueFromJsonWebKey): Deleted.
1904         * crypto/JsonWebKey.h:
1905         * crypto/JsonWebKey.idl:
1906         * crypto/RsaOtherPrimesInfo.idl:
1907         Change std::optional<String> to String in order to use toJS<IDLDictionary<JsonWebKey>>.
1908         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
1909         (WebCore::CryptoAlgorithmAES_CBC::importKey):
1910         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
1911         (WebCore::CryptoAlgorithmAES_KW::importKey):
1912         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
1913         (WebCore::CryptoAlgorithmHMAC::importKey):
1914         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
1915         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
1916         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
1917         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
1918         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
1919         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
1920         * crypto/keys/CryptoKeyAES.cpp:
1921         (WebCore::CryptoKeyAES::importJwk):
1922         Only check if key_ops contains all of the specified usages when key_ops field of jwk is present,
1923         as per the specification: https://www.w3.org/TR/WebCryptoAPI/#aes-cbc-operations
1924         * crypto/keys/CryptoKeyAES.h:
1925         * crypto/keys/CryptoKeyHMAC.cpp:
1926         (WebCore::CryptoKeyHMAC::importJwk):
1927         * crypto/keys/CryptoKeyHMAC.h:
1928         * crypto/keys/CryptoKeyRSA.cpp:
1929         (WebCore::CryptoKeyRSA::importJwk):
1930         Accommodate the change from std::optional<String> to String.
1931         * crypto/mac/CryptoKeyRSAMac.cpp:
1932         (WebCore::CryptoKeyRSA::create):
1933         Add a null check for p.
1934
1935 2017-02-16  Antti Koivisto  <antti@apple.com>
1936
1937         Execute pending scripts asynchronously after stylesheet loads complete
1938         https://bugs.webkit.org/show_bug.cgi?id=168367
1939         rdar://problem/30561379
1940
1941         Reviewed by Andreas Kling.
1942
1943         The current synchronous execution is fragile and creates various problems.
1944
1945         * css/StyleSheetContents.cpp:
1946         (WebCore::StyleSheetContents::checkLoaded):
1947         * dom/ContainerNode.cpp:
1948         (WebCore::ContainerNode::takeAllChildrenFrom):
1949         (WebCore::ContainerNode::notifyChildInserted):
1950         (WebCore::ContainerNode::removeChild):
1951         (WebCore::ContainerNode::parserRemoveChild):
1952         (WebCore::ContainerNode::removeChildren):
1953
1954             Remove various places where we would trigger delayed synchronous execution.
1955
1956         * dom/Document.cpp:
1957         (WebCore::Document::Document):
1958         (WebCore::Document::recalcStyle):
1959
1960             Trigger scroll to anchor at the end of style resolution instead of when style sheet load completes.
1961
1962         (WebCore::Document::didRemoveAllPendingStylesheet):
1963
1964             Call asynchronous script execution function.
1965
1966         * dom/Document.h:
1967         (WebCore::Document::setNeedsNotifyRemoveAllPendingStylesheet): Deleted.
1968         (WebCore::Document::notifyRemovePendingSheetIfNeeded): Deleted.
1969         * dom/ScriptableDocumentParser.cpp:
1970         (WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
1971         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheetsSoon):
1972         (WebCore::ScriptableDocumentParser::scriptsWaitingForStylesheetsExecutionTimerFired):
1973
1974             Add a timer for executing pending scripts.
1975
1976         (WebCore::ScriptableDocumentParser::detach):
1977         * dom/ScriptableDocumentParser.h:
1978         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheets):
1979         * html/HTMLLinkElement.cpp:
1980         (WebCore::HTMLLinkElement::removedFrom):
1981         (WebCore::HTMLLinkElement::removePendingSheet):
1982         * html/HTMLLinkElement.h:
1983         * html/parser/HTMLDocumentParser.cpp:
1984         (WebCore::HTMLDocumentParser::detach):
1985         * loader/DocumentLoader.cpp:
1986         (WebCore::DocumentLoader::isLoadingInAPISense):
1987
1988             Stay in loading state if we have a pending script. This matches existing behavior.
1989
1990         * style/StyleScope.cpp:
1991         (WebCore::Style::Scope::removePendingSheet):
1992         * style/StyleScope.h:
1993
1994 2017-02-16  Anders Carlsson  <andersca@apple.com>
1995
1996         Set the DHTML drag image in the DHTML type check
1997         https://bugs.webkit.org/show_bug.cgi?id=168451
1998
1999         Reviewed by Wenson Hsieh.
2000
2001         * page/DragController.cpp:
2002         (WebCore::DragController::startDrag):
2003
2004 2017-02-16  Anders Carlsson  <andersca@apple.com>
2005
2006         Begin removing EFL code from WebCore.
2007
2008         Rubber-stamped by Alex Christensen.
2009
2010         * PlatformEfl.cmake: Removed.
2011         * editing/efl/EditorEfl.cpp: Removed.
2012         * page/efl/DragControllerEfl.cpp: Removed.
2013         * page/efl/EventHandlerEfl.cpp: Removed.
2014         * platform/audio/efl/AudioBusEfl.cpp: Removed.
2015         * platform/efl/CursorEfl.cpp: Removed.
2016         * platform/efl/DefaultTheme/CMakeLists.txt: Removed.
2017         * platform/efl/DefaultTheme/default.edc: Removed.
2018         * platform/efl/DefaultTheme/widget/button/button.edc: Removed.
2019         * platform/efl/DefaultTheme/widget/button/img_button_focus.png: Removed.
2020         * platform/efl/DefaultTheme/widget/button/img_button_hover.png: Removed.
2021         * platform/efl/DefaultTheme/widget/button/img_button_normal.png: Removed.
2022         * platform/efl/DefaultTheme/widget/button/img_button_press.png: Removed.
2023         * platform/efl/DefaultTheme/widget/check/check.edc: Removed.
2024         * platform/efl/DefaultTheme/widget/check/img_check_bg_disabled.png: Removed.
2025         * platform/efl/DefaultTheme/widget/check/img_check_bg_enabled.png: Removed.
2026         * platform/efl/DefaultTheme/widget/check/img_check_off.png: Removed.
2027         * platform/efl/DefaultTheme/widget/check/img_check_off_focus.png: Removed.
2028         * platform/efl/DefaultTheme/widget/check/img_check_off_hover.png: Removed.
2029         * platform/efl/DefaultTheme/widget/check/img_check_on.png: Removed.
2030         * platform/efl/DefaultTheme/widget/check/img_check_on_focus.png: Removed.
2031         * platform/efl/DefaultTheme/widget/check/img_check_on_hover.png: Removed.
2032         * platform/efl/DefaultTheme/widget/combo/combo.edc: Removed.
2033         * platform/efl/DefaultTheme/widget/combo/combo_focus.png: Removed.
2034         * platform/efl/DefaultTheme/widget/combo/combo_focus_button.png: Removed.
2035         * platform/efl/DefaultTheme/widget/combo/combo_focus_button_transparent.png: Removed.
2036         * platform/efl/DefaultTheme/widget/combo/combo_focus_transparent.png: Removed.
2037         * platform/efl/DefaultTheme/widget/combo/combo_hover.png: Removed.
2038         * platform/efl/DefaultTheme/widget/combo/combo_hover_button.png: Removed.
2039         * platform/efl/DefaultTheme/widget/combo/combo_hover_button_transparent.png: Removed.
2040         * platform/efl/DefaultTheme/widget/combo/combo_hover_transparent.png: Removed.
2041         * platform/efl/DefaultTheme/widget/combo/combo_normal.png: Removed.
2042         * platform/efl/DefaultTheme/widget/combo/combo_normal_button.png: Removed.
2043         * platform/efl/DefaultTheme/widget/combo/combo_normal_button_transparent.png: Removed.
2044         * platform/efl/DefaultTheme/widget/combo/combo_normal_transparent.png: Removed.
2045         * platform/efl/DefaultTheme/widget/combo/combo_press.png: Removed.
2046         * platform/efl/DefaultTheme/widget/combo/combo_press_button.png: Removed.
2047         * platform/efl/DefaultTheme/widget/combo/combo_press_button_transparent.png: Removed.
2048         * platform/efl/DefaultTheme/widget/combo/combo_press_transparent.png: Removed.
2049         * platform/efl/DefaultTheme/widget/combo/icon.png: Removed.
2050         * platform/efl/DefaultTheme/widget/entry/entry.edc: Removed.
2051         * platform/efl/DefaultTheme/widget/entry/img_focused.png: Removed.
2052         * platform/efl/DefaultTheme/widget/entry/img_hovered.png: Removed.
2053         * platform/efl/DefaultTheme/widget/entry/img_normal.png: Removed.
2054         * platform/efl/DefaultTheme/widget/progressbar/bt_base.png: Removed.
2055         * platform/efl/DefaultTheme/widget/progressbar/progressbar.edc: Removed.
2056         * platform/efl/DefaultTheme/widget/progressbar/shelf_inset.png: Removed.
2057         * platform/efl/DefaultTheme/widget/radio/img_radio_bg_disabled.png: Removed.
2058         * platform/efl/DefaultTheme/widget/radio/img_radio_bg_enabled.png: Removed.
2059         * platform/efl/DefaultTheme/widget/radio/img_radio_off.png: Removed.
2060         * platform/efl/DefaultTheme/widget/radio/img_radio_off_focus.png: Removed.
2061         * platform/efl/DefaultTheme/widget/radio/img_radio_off_hover.png: Removed.
2062         * platform/efl/DefaultTheme/widget/radio/img_radio_on.png: Removed.
2063         * platform/efl/DefaultTheme/widget/radio/img_radio_on_focus.png: Removed.
2064         * platform/efl/DefaultTheme/widget/radio/img_radio_on_hover.png: Removed.
2065         * platform/efl/DefaultTheme/widget/radio/radio.edc: Removed.
2066         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar.edc: Removed.
2067         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_horizontal.png: Removed.
2068         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_vertical.png: Removed.
2069         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_horizontal.png: Removed.
2070         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_vertical.png: Removed.
2071         * platform/efl/DefaultTheme/widget/search/cancel/cancel_normal_button.png: Removed.
2072         * platform/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.png: Removed.
2073         * platform/efl/DefaultTheme/widget/search/cancel/search_cancel.edc: Removed.
2074         * platform/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.png: Removed.
2075         * platform/efl/DefaultTheme/widget/search/decoration/search_decoration.edc: Removed.
2076         * platform/efl/DefaultTheme/widget/search/field/field_focused.png: Removed.
2077         * platform/efl/DefaultTheme/widget/search/field/field_hovered.png: Removed.
2078         * platform/efl/DefaultTheme/widget/search/field/field_normal.png: Removed.
2079         * platform/efl/DefaultTheme/widget/search/field/search_field.edc: Removed.
2080         * platform/efl/DefaultTheme/widget/slider/slider.edc: Removed.
2081         * platform/efl/DefaultTheme/widget/slider/slider_fill_h.png: Removed.
2082         * platform/efl/DefaultTheme/widget/slider/slider_fill_v.png: Removed.
2083         * platform/efl/DefaultTheme/widget/slider/slider_h.png: Removed.
2084         * platform/efl/DefaultTheme/widget/slider/slider_thumb_h.png: Removed.
2085         * platform/efl/DefaultTheme/widget/slider/slider_thumb_press_h.png: Removed.
2086         * platform/efl/DefaultTheme/widget/slider/slider_thumb_press_v.png: Removed.
2087         * platform/efl/DefaultTheme/widget/slider/slider_thumb_v.png: Removed.
2088         * platform/efl/DefaultTheme/widget/slider/slider_v.png: Removed.
2089         * platform/efl/DefaultTheme/widget/spinner/sp_bg.png: Removed.
2090         * platform/efl/DefaultTheme/widget/spinner/sp_down_default.png: Removed.
2091         * platform/efl/DefaultTheme/widget/spinner/sp_down_hover.png: Removed.
2092         * platform/efl/DefaultTheme/widget/spinner/sp_down_pressed.png: Removed.
2093         * platform/efl/DefaultTheme/widget/spinner/sp_up_default.png: Removed.
2094         * platform/efl/DefaultTheme/widget/spinner/sp_up_hover.png: Removed.
2095         * platform/efl/DefaultTheme/widget/spinner/sp_up_pressed.png: Removed.
2096         * platform/efl/DefaultTheme/widget/spinner/spinner.edc: Removed.
2097         * platform/efl/DragDataEfl.cpp: Removed.
2098         * platform/efl/DragImageEfl.cpp: Removed.
2099         * platform/efl/EflInspectorUtilities.cpp: Removed.
2100         * platform/efl/EflInspectorUtilities.h: Removed.
2101         * platform/efl/EflKeyboardUtilities.cpp: Removed.
2102         * platform/efl/EflKeyboardUtilities.h: Removed.
2103         * platform/efl/EflScreenUtilities.cpp: Removed.
2104         * platform/efl/EflScreenUtilities.h: Removed.
2105         * platform/efl/ErrorsEfl.cpp: Removed.
2106         * platform/efl/ErrorsEfl.h: Removed.
2107         * platform/efl/EventLoopEfl.cpp: Removed.
2108         * platform/efl/FileSystemEfl.cpp: Removed.
2109         * platform/efl/LocalizedStringsEfl.cpp: Removed.
2110         * platform/efl/MIMETypeRegistryEfl.cpp: Removed.
2111         * platform/efl/MainThreadSharedTimerEfl.cpp: Removed.
2112         * platform/efl/PasteboardEfl.cpp: Removed.
2113         * platform/efl/PlatformKeyboardEventEfl.cpp: Removed.
2114         * platform/efl/PlatformMouseEventEfl.cpp: Removed.
2115         * platform/efl/PlatformScreenEfl.cpp: Removed.
2116         * platform/efl/PlatformSpeechSynthesisProviderEfl.cpp: Removed.
2117         * platform/efl/PlatformSpeechSynthesisProviderEfl.h: Removed.
2118         * platform/efl/PlatformSpeechSynthesizerEfl.cpp: Removed.
2119         * platform/efl/PlatformWheelEventEfl.cpp: Removed.
2120         * platform/efl/ScrollbarThemeEfl.cpp: Removed.
2121         * platform/efl/ScrollbarThemeEfl.h: Removed.
2122         * platform/efl/SoundEfl.cpp: Removed.
2123         * platform/efl/TemporaryLinkStubs.cpp: Removed.
2124         * platform/efl/UserAgentEfl.cpp: Removed.
2125         * platform/efl/WidgetEfl.cpp: Removed.
2126         * platform/gamepad/efl/GamepadsEfl.cpp: Removed.
2127         * platform/graphics/efl/CairoUtilitiesEfl.cpp: Removed.
2128         * platform/graphics/efl/CairoUtilitiesEfl.h: Removed.
2129         * platform/graphics/efl/EvasGLContext.cpp: Removed.
2130         * platform/graphics/efl/EvasGLContext.h: Removed.
2131         * platform/graphics/efl/EvasGLSurface.cpp: Removed.
2132         * platform/graphics/efl/EvasGLSurface.h: Removed.
2133         * platform/graphics/efl/GraphicsContext3DEfl.cpp: Removed.
2134         * platform/graphics/efl/GraphicsContext3DPrivate.cpp: Removed.
2135         * platform/graphics/efl/GraphicsContext3DPrivate.h: Removed.
2136         * platform/graphics/efl/IconEfl.cpp: Removed.
2137         * platform/graphics/efl/ImageBufferEfl.cpp: Removed.
2138         * platform/graphics/efl/ImageEfl.cpp: Removed.
2139         * platform/graphics/efl/IntPointEfl.cpp: Removed.
2140         * platform/graphics/efl/IntRectEfl.cpp: Removed.
2141         * platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp: Removed.
2142         * platform/network/efl/NetworkStateNotifierEfl.cpp: Removed.
2143         * rendering/RenderThemeEfl.cpp: Removed.
2144         * rendering/RenderThemeEfl.h: Removed.
2145
2146 2017-02-16  Joseph Pecoraro  <pecoraro@apple.com>
2147
2148         [Resource Timing] Support Resource Timing in Workers
2149         https://bugs.webkit.org/show_bug.cgi?id=168086
2150         <rdar://problem/30430117>
2151
2152         Reviewed by Alex Christensen.
2153
2154         Worker's load resources through the Document that loaded them. However,
2155         their PerformanceResourceTiming entries should be added to the Performance
2156         object inside the Worker context, not the Document's context.
2157
2158         This change adds an InitiatorContext to ResourceLoadOptions so that loaders
2159         can determine if the load was initiated by the Document or a Worker. This
2160         allows loaders to then know if the ResourceTiming data they collect should
2161         be added to the Document's Performance object or forwarded on to the Worker's.
2162
2163         This adds a new ThreadableLoaderClient method intended only for the purpose
2164         of adding the ResourceTiming information to the Worker's Performance object.
2165         Unlike other ThreadableLoaderClient methods that are bridged and forwarded
2166         on to a client inside the worker (e.g. XMLHttpRequest or FetchLoader) this
2167         method never needs to be handled by clients and can be uniformly handled by
2168         the WorkerThreadableLoader itself.
2169
2170         We also add a new ResourceTiming object that encapsulates all of the data
2171         ultimately needed for a PerformanceResourceTimingEntry object. This allows
2172         for all of the information to be gathered while loading on the Document
2173         before serializing across to the Worker. That includes the Timing-Allow-Origin
2174         check which uses the SecurityOrigin of the Worker.
2175
2176         This also modernizes and addresses issues in the Resource Timing implementation.
2177         Better handling cases like loading from the Cache, Synchronous Loads, and
2178         improving initiatorType information.
2179
2180         Tests: imported/w3c/web-platform-tests/resource-timing/rt-cors.html
2181                imported/w3c/web-platform-tests/resource-timing/rt-cors.worker.html
2182                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-css.html
2183                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-element.html
2184                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch.html
2185                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-media.html
2186                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-other.html
2187                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-script-module.html
2188                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.html
2189                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType.worker.html
2190                imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.html
2191                imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.worker.html
2192                imported/w3c/web-platform-tests/resource-timing/rt-resource-errors.html
2193                imported/w3c/web-platform-tests/resource-timing/rt-resource-ignored.html
2194                imported/w3c/web-platform-tests/resource-timing/rt-resources-per-frame.html
2195                imported/w3c/web-platform-tests/resource-timing/rt-resources-per-worker.html
2196                imported/w3c/web-platform-tests/resource-timing/rt-serialization.html
2197                imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-frames.html
2198                imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-workers.html
2199                performance-api/resource-timing-apis.html
2200
2201         * CMakeLists.txt:
2202         * WebCore.xcodeproj/project.pbxproj:
2203         New files.
2204
2205         * platform/network/NetworkLoadTiming.h:
2206         (WebCore::NetworkLoadTiming::reset): Deleted.
2207         We no longer need to reset.
2208
2209         * loader/ResourceTiming.cpp: Added.
2210         (WebCore::passesTimingAllowCheck):
2211         (WebCore::ResourceTiming::fromCache):
2212         (WebCore::ResourceTiming::fromLoad):
2213         (WebCore::ResourceTiming::fromSynchronousLoad):
2214         (WebCore::ResourceTiming::ResourceTiming):
2215         (WebCore::ResourceTiming::isolatedCopy):
2216         * loader/ResourceTiming.h: Added.
2217         (WebCore::ResourceTiming::url):
2218         (WebCore::ResourceTiming::initiator):
2219         (WebCore::ResourceTiming::loadTiming):
2220         (WebCore::ResourceTiming::networkLoadTiming):
2221         (WebCore::ResourceTiming::allowTimingDetails):
2222         (WebCore::ResourceTiming::overrideInitiatorName):
2223         (WebCore::ResourceTiming::ResourceTiming):
2224         Class that encapsulates all of the data needed for a PerformanceResourceTiming entry.
2225         There are three static constructors indicating the different ways this object can
2226         be constructed and the different data available at the time of construction.
2227
2228         * loader/ResourceLoaderOptions.h:
2229         Add the new InitiatorContext, default to Document.
2230
2231         * loader/ThreadableLoaderClient.h:
2232         (WebCore::ThreadableLoaderClient::didFinishTiming):
2233         New client method only used by WorkerThreadableLoader.
2234
2235         * loader/WorkerThreadableLoader.h:
2236         * loader/WorkerThreadableLoader.cpp:
2237         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
2238         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming):
2239         All loads initiated in a WorkerThreadableLoader get identified as InitiatorContext::Worker.
2240         Add timing information to the Performance object when received. No need to inform clients.
2241
2242         * loader/DocumentThreadableLoader.h:
2243         * loader/DocumentThreadableLoader.cpp:
2244         (WebCore::DocumentThreadableLoader::finishedTimingForWorkerLoad):
2245         (WebCore::DocumentThreadableLoader::loadRequest):
2246         Provide APIs to pass timing data on to a WorkerThreadableLoader.
2247         Create ResourceTiming data for synchronous loads.
2248
2249         * loader/LoadTiming.h:
2250         * loader/LoadTiming.cpp:
2251         (WebCore::LoadTiming::isolatedCopy):
2252         Add isolatedCopy to allow this data to be passed across to a Worker.
2253
2254         * loader/ResourceTimingInformation.h:
2255         * loader/ResourceTimingInformation.cpp:
2256         (WebCore::ResourceTimingInformation::shouldAddResourceTiming):
2257         (WebCore::ResourceTimingInformation::addResourceTiming):
2258         (WebCore::ResourceTimingInformation::storeResourceTimingInitiatorInformation):
2259         Refactor to remove unused / unnecessary bits. Extract out some helpful code.
2260         Changed this to match when Blink decides when to add or ignore entries, however
2261         this may change over time.
2262
2263         * loader/SubresourceLoader.cpp:
2264         (WebCore::SubresourceLoader::didFinishLoading):
2265         (WebCore::SubresourceLoader::notifyDone):
2266         (WebCore::SubresourceLoader::reportResourceTiming):
2267         * loader/SubresourceLoader.h:
2268         * loader/cache/CachedRawResource.cpp:
2269         (WebCore::CachedRawResource::finishedTimingForWorkerLoad):
2270         * loader/cache/CachedRawResource.h:
2271         * loader/cache/CachedRawResourceClient.h:
2272         (WebCore::CachedRawResourceClient::finishedTimingForWorkerLoad):
2273         Plumbing to report timing information to Worker if this resource was loaded for a Worker.
2274
2275         * loader/cache/CachedResource.cpp:
2276         (WebCore::CachedResource::CachedResource):
2277         * loader/cache/CachedResource.h:
2278         (WebCore::CachedResource::initiatorName):
2279         Store the initiator name on the CachedResource like other data added to the original
2280         CachedResourceRequest. This is a bit of a hack but follows an existing pattern, and
2281         cleans up other hacks that worked around this later on.
2282
2283         * loader/cache/CachedResourceLoader.h:
2284         * loader/cache/CachedResourceLoader.cpp:
2285         (WebCore::CachedResourceLoader::requestResource):
2286         (WebCore::CachedResourceLoader::revalidateResource):
2287         (WebCore::CachedResourceLoader::loadResource):
2288         Simply the creation of a ResourceTiming object for cache hits.
2289         Report timing information to Worker if this resource was loaded for a Worker.
2290
2291         (WebCore::CachedResourceLoader::loadDone):
2292         Eliminate this redundant point attempting to add a ResourceTiming entry.
2293
2294         * loader/cache/CachedResourceRequest.cpp:
2295         (WebCore::CachedResourceRequest::initiatorName):
2296         Update to match the spec. The fallback is "other".
2297
2298         * page/Performance.h:
2299         * page/Performance.cpp:
2300         (WebCore::Performance::setResourceTimingBufferSize):
2301         (WebCore::Performance::addResourceTiming):
2302         Update to support PerformanceObservers.
2303         Update to match spec (event should bubble).
2304
2305         * page/PerformanceResourceTiming.h:
2306         * page/PerformanceResourceTiming.cpp:
2307         (WebCore::PerformanceResourceTiming::create):
2308         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
2309         (WebCore::PerformanceResourceTiming::fetchStart):
2310         (WebCore::PerformanceResourceTiming::domainLookupStart):
2311         (WebCore::PerformanceResourceTiming::domainLookupEnd):
2312         (WebCore::PerformanceResourceTiming::connectStart):
2313         (WebCore::PerformanceResourceTiming::connectEnd):
2314         (WebCore::PerformanceResourceTiming::secureConnectionStart):
2315         (WebCore::PerformanceResourceTiming::requestStart):
2316         (WebCore::PerformanceResourceTiming::responseStart):
2317         (WebCore::PerformanceResourceTiming::responseEnd):
2318         (WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
2319         Construct with a ResourceTiming object containing all the data we need for the entry.
2320         Update to match spec for what is required, should fallback, should be zero, etc.
2321
2322         (WebCore::passesTimingAllowCheck): Deleted.
2323         Extracted this to ResourceTiming creation time in the loading context,
2324         since this can't be determined on the Worker context without also having
2325         all of the header information from each resource response.
2326
2327         * page/PerformanceResourceTiming.idl:
2328         Expose to Workers!
2329
2330 2017-02-16  Yusuke Suzuki  <utatane.tea@gmail.com>
2331
2332         [JSC] Drop PassRefPtr in inspector/
2333         https://bugs.webkit.org/show_bug.cgi?id=168420
2334
2335         Reviewed by Alex Christensen.
2336
2337         Use Ref<Inspector::ScriptArguments> and Ref<ScriptCallStack> as much as possible.
2338         It drops some unnecessary null checks.
2339
2340         * bindings/scripts/CodeGeneratorJS.pm:
2341         (GenerateCallWith):
2342         * bindings/scripts/test/JS/JSTestObj.cpp:
2343         (WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStackCaller):
2344         * dom/ScriptExecutionContext.cpp:
2345         (WebCore::ScriptExecutionContext::PendingException::PendingException):
2346         * inspector/InspectorInstrumentation.cpp:
2347         (WebCore::InspectorInstrumentation::consoleCountImpl):
2348         (WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
2349         (WebCore::InspectorInstrumentation::consoleTimeStampImpl):
2350         * inspector/InspectorInstrumentation.h:
2351         (WebCore::InspectorInstrumentation::consoleCount):
2352         (WebCore::InspectorInstrumentation::stopConsoleTiming):
2353         (WebCore::InspectorInstrumentation::consoleTimeStamp):
2354         * inspector/InspectorNetworkAgent.cpp:
2355         (WebCore::InspectorNetworkAgent::buildInitiatorObject):
2356         * inspector/TimelineRecordFactory.cpp:
2357         (WebCore::TimelineRecordFactory::createGenericRecord):
2358         * inspector/WebInjectedScriptManager.cpp:
2359         (WebCore::WebInjectedScriptManager::WebInjectedScriptManager):
2360         * inspector/WebInjectedScriptManager.h:
2361         * page/DOMWindow.cpp:
2362         (WebCore::DOMWindow::postMessageTimerFired):
2363         We dispatch appropriate addMessage function according to whether
2364         `timer.stackTrace()` is nullptr.
2365
2366         * page/PageConsoleClient.cpp:
2367         (WebCore::PageConsoleClient::addMessage):
2368         (WebCore::PageConsoleClient::messageWithTypeAndLevel):
2369         (WebCore::PageConsoleClient::count):
2370         (WebCore::PageConsoleClient::timeEnd):
2371         (WebCore::PageConsoleClient::timeStamp):
2372         * page/PageConsoleClient.h:
2373         * workers/WorkerConsoleClient.cpp:
2374         (WebCore::WorkerConsoleClient::messageWithTypeAndLevel):
2375         (WebCore::WorkerConsoleClient::count):
2376         (WebCore::WorkerConsoleClient::timeEnd):
2377         (WebCore::WorkerConsoleClient::timeStamp):
2378         * workers/WorkerConsoleClient.h:
2379         * workers/WorkerGlobalScope.cpp:
2380         (WebCore::WorkerGlobalScope::addMessage):
2381
2382 2017-02-16  Chris Fleizach  <cfleizach@apple.com>
2383
2384         AX: Make form validation accessible on iOS
2385         https://bugs.webkit.org/show_bug.cgi?id=168400
2386
2387         Reviewed by Chris Dumez.
2388
2389         Hide the popover content of form validation from accessibility (since its not interactable)
2390         and instead announce the message.
2391
2392         * platform/ios/ValidationBubbleIOS.mm:
2393         (WebCore::ValidationBubble::show):
2394
2395 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
2396
2397         Clean up use of some CALayer-related SPI
2398         https://bugs.webkit.org/show_bug.cgi?id=168401
2399
2400         Reviewed by Tim Horton.
2401
2402         Use -setDrawsAsynchronously: rather than the old -setAcceleratesDrawing: SPI.
2403
2404         Remove CATiledLayer-related stuff from QuartzCoreSPI.h, since we don't use it any more.
2405
2406         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2407         (PlatformCALayerCocoa::acceleratesDrawing):
2408         (PlatformCALayerCocoa::setAcceleratesDrawing):
2409         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
2410         (-[WebTiledBackingLayer setDrawsAsynchronously:]): This override passes the state
2411         onto the TileController.
2412         (-[WebTiledBackingLayer setAcceleratesDrawing:]): Deleted.
2413         * platform/ios/LegacyTileGridTile.mm:
2414         (WebCore::LegacyTileGridTile::LegacyTileGridTile):
2415         * platform/spi/cocoa/QuartzCoreSPI.h:
2416
2417 2017-02-16  Yusuke Suzuki  <utatane.tea@gmail.com>
2418
2419         Web Inspector: allow import() inside the inspector
2420         https://bugs.webkit.org/show_bug.cgi?id=167457
2421
2422         Reviewed by Ryosuke Niwa.
2423
2424         When evaluating `import("...")`, we need the caller's context to resolve
2425         the module specifier correctly. For example, if `import("./cocoa.js")` is
2426         evaluated in the script "drinks/hot.js", this module name is resolved to
2427         "drinks/cocoa.js". If the same import operator is evaluated in the script
2428         "menu/all.js", the module specifier becomes "menu/cocoa.js".
2429
2430         Previously we reject the import operator if the caller does not have such
2431         a context. These context is SourceOrigin and its ScriptFetcher. While they
2432         are offered in the script tag and other code evaluations, the inspector
2433         console does not offer that. These class are offered in the WebCore side
2434         and we should not touch these classes in the JSC's inspector code.
2435
2436         Now we relax the above restriction. If the above caller information is not
2437         offered, we fallback to the default one. In the web page, we use the page's
2438         URL as the caller's source origin. This allows us to evaluate the import
2439         operator in the inspector console.
2440
2441         And as of r167698, the console recognizes `await import("...")` form. We use
2442         this to test this `import()` in the console functionality.
2443
2444         Test: inspector/controller/runtime-controller-import.html
2445
2446         * bindings/js/ScriptModuleLoader.cpp:
2447         (WebCore::ScriptModuleLoader::importModule):
2448
2449 2017-02-16  Miguel Gomez  <magomez@igalia.com>
2450
2451         [GTK] scroll with transparent background not repainted after scrollY >= 32768
2452         https://bugs.webkit.org/show_bug.cgi?id=154283
2453
2454         Reviewed by Carlos Garcia Campos.
2455
2456         Due to a limitation of the pixman backend, which uses 16 bits to hold signed integers, cairo is
2457         not able to draw anything when using transformation matrices with values bigger than 32768. When
2458         drawing patterns into large pages, the matrices values can overflow those 16 bits, so cairo doesn't
2459         draw anything in, which causes the reported transparent backgrounds.
2460
2461         The patch modifies the transformation matrices both from the current context and the pattern we
2462         are painting, to avoid them to hold values that cannot stored in 16 bits.
2463
2464         There's still the possibility that this happens, but it would require using a pattern with a size
2465         bigger than 32768.
2466
2467         Based on a previous patch by Gwang Yoon Hwang  <yoon@igalia.com>.
2468
2469         Test: fast/backgrounds/background-repeat-long-scroll.html
2470
2471         * platform/graphics/cairo/CairoUtilities.cpp:
2472         (WebCore::drawPatternToCairoContext):
2473
2474 2017-02-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2475
2476         [GTK] Images are never read from the clipboard
2477         https://bugs.webkit.org/show_bug.cgi?id=168419
2478
2479         Reviewed by Sergio Villar Senin.
2480
2481         We write images in the clipboard, but we don't read them.
2482
2483         Fixes: editing/pasteboard/paste-image-using-image-data.html
2484
2485         * editing/Editor.cpp:
2486         (WebCore::Editor::createFragmentForImageAndURL): Moved from EditorMac.mm since it's cross-platform code.
2487         * editing/Editor.h:
2488         * editing/gtk/EditorGtk.cpp:
2489         (WebCore::createFragmentFromPasteboardData): Check if there's an image in the selection, and use
2490         Editor::createFragmentForImageAndURL in that case.
2491         * editing/mac/EditorMac.mm:
2492         (WebCore::Editor::createFragmentForImageAndURL): Deleted.
2493         * platform/gtk/PasteboardHelper.cpp:
2494         (WebCore::PasteboardHelper::getClipboardContents): Check also if there's an image in the clipboard.
2495
2496 2017-02-15  Jer Noble  <jer.noble@apple.com>
2497
2498         REGRESSION (r212311): NULL-dereference in HTMLMediaElement::prepareToPlay()
2499         https://bugs.webkit.org/show_bug.cgi?id=168404
2500         <rdar://problem/30547188>
2501
2502         Reviewed by Brian Weinstein.
2503
2504         Prior to r212311, m_player was always guaranteed to be initialized when calling
2505         prepareToPlay(). r212311 began calling prepareToPlay() on a subsequent run-loop iteration
2506         after creating m_player. So now check whether m_player is NULL before calling methods on it.
2507
2508         * html/HTMLMediaElement.cpp:
2509         (WebCore::HTMLMediaElement::prepareToPlay):
2510
2511 2017-02-15  Eric Carlson  <eric.carlson@apple.com>
2512
2513         [MediaStream] delete CaptureDeviceInfo struct
2514         https://bugs.webkit.org/show_bug.cgi?id=168395
2515
2516         The CaptureDeviceInfo struct and CaptureDevice class were almost identical, so
2517         add an "enabled" field to the later, delete the former, and switch all uses of
2518         CaptureDeviceInfo to CaptureDevice.
2519
2520         Do some minor drive-by cleanup of AVCaptureDeviceManager::refreshCaptureDevices
2521         and CaptureDeviceManager::captureDeviceFromDeviceID.
2522         
2523         Reviewed by Sam Weinig.
2524
2525         No new tests, no behavior change.
2526
2527         * Modules/mediastream/MediaDevicesRequest.cpp:
2528         (WebCore::MediaDevicesRequest::start): SourceKind -> DeviceType
2529         * platform/mediastream/CaptureDevice.h:
2530         (WebCore::CaptureDevice::CaptureDevice):
2531         (WebCore::CaptureDevice::type): Renamed from kind.
2532         (WebCore::CaptureDevice::setType):
2533         (WebCore::CaptureDevice::enabled): Added.
2534         (WebCore::CaptureDevice::setEnabled):
2535         (WebCore::CaptureDevice::kind): Deleted.
2536         (WebCore::CaptureDevice::setKind): Deleted.
2537
2538         * platform/mediastream/CaptureDeviceManager.cpp:
2539         (CaptureDeviceManager::getSourcesInfo):
2540         (CaptureDeviceManager::captureDeviceFromDeviceID): Don't call sourceWithUID.
2541         (CaptureDeviceManager::bestSourcesForTypeAndConstraints):
2542         (CaptureDeviceManager::sourceWithUID):
2543         * platform/mediastream/CaptureDeviceManager.h:
2544         (WebCore::CaptureDeviceManager::refreshCaptureDevices):
2545         (WebCore::CaptureDeviceManager::refreshCaptureDeviceList): Deleted.
2546
2547         * platform/mediastream/mac/AVCaptureDeviceManager.h:
2548         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2549         (WebCore::AVCaptureDeviceManager::captureDevices):
2550         (WebCore::deviceIsAvailable):
2551         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
2552         (WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints):
2553         (WebCore::AVCaptureDeviceManager::deviceConnected):
2554         (WebCore::AVCaptureDeviceManager::deviceDisconnected):
2555         (WebCore::AVCaptureDeviceManager::captureDeviceList): Deleted.
2556         (WebCore::shouldConsiderDeviceInDeviceList): Deleted.
2557         (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList): Deleted.
2558         * platform/mock/MockRealtimeMediaSource.cpp:
2559         (WebCore::MockRealtimeMediaSource::audioDeviceInfo):
2560         (WebCore::MockRealtimeMediaSource::videoDeviceInfo):
2561
2562 2017-02-15  Sam Weinig  <sam@webkit.org>
2563
2564         [WebIDL] Remove custom conversion from FontFace code by using a Variant
2565         https://bugs.webkit.org/show_bug.cgi?id=168384
2566
2567         Reviewed by Alex Christensen.
2568
2569         Match the font face spec and use a union rather than any in the FontFace constructor.
2570
2571         Test: Added additional cases to fast/text/font-face-javascript.html.
2572
2573         * css/FontFace.cpp:
2574         (WebCore::FontFace::create):
2575         * css/FontFace.h:
2576         * css/FontFace.idl:
2577
2578 2017-02-15  Jer Noble  <jer.noble@apple.com>
2579
2580         Disabled Media Sources should render black/silence
2581         https://bugs.webkit.org/show_bug.cgi?id=168281
2582
2583         Reviewed by Eric Carlson.
2584
2585         Test: webrtc/video-disabled-black.html
2586
2587         Pass the enabled flag setting down from the MediaStreamTrackPrivate to its underlying
2588         source, including RealtimeMediaSource and RealtimeOutgoingAudio/VideoSource. When either
2589         enabled is cleared or muted is set, generate empty (black or silent) media, as opposed to
2590         pausing media or (worse) continuing to send generated media.
2591
2592         * platform/mediastream/MediaStreamTrackPrivate.cpp:
2593         (WebCore::MediaStreamTrackPrivate::setEnabled):
2594         (WebCore::MediaStreamTrackPrivate::sourceEnabledChanged):
2595         * platform/mediastream/MediaStreamTrackPrivate.h:
2596         * platform/mediastream/RealtimeMediaSource.cpp:
2597         (WebCore::RealtimeMediaSource::setEnabled):
2598         * platform/mediastream/RealtimeMediaSource.h:
2599         (WebCore::RealtimeMediaSource::enabled):
2600         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
2601         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
2602         (WebCore::MockRealtimeAudioSourceMac::render):
2603         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
2604         (WebCore::RealtimeOutgoingAudioSource::sourceMutedChanged):
2605         (WebCore::RealtimeOutgoingAudioSource::sourceEnabledChanged):
2606         (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
2607         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
2608         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
2609         (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged):
2610         (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged):
2611         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
2612         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
2613         * platform/mock/MockRealtimeVideoSource.cpp:
2614         (WebCore::MockRealtimeVideoSource::generateFrame):
2615
2616 2017-02-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2617
2618         Editing history scripts should not add the contenteditable attribute or override key events
2619         https://bugs.webkit.org/show_bug.cgi?id=168389
2620         <rdar://problem/30529945>
2621
2622         Reviewed by Dan Bernstein.
2623
2624         Clients that hook into editing history tracking should handle setting the contenteditable attribute on the body
2625         rather than have the script add it to the body. Additionally, this script should NOT be overriding any keydown
2626         events. These were initially added for compatibility with a test harness early on, and should have been removed
2627         earlier.
2628
2629         * Scripts/DumpEditingHistory.js:
2630
2631 2017-02-15  Jer Noble  <jer.noble@apple.com>
2632
2633         Pass "RequiresCustomURLLoading" in AVURLAsset options dictionary
2634         https://bugs.webkit.org/show_bug.cgi?id=168381
2635
2636         Reviewed by Eric Carlson.
2637
2638         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2639         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2640
2641 2017-02-15  Anders Carlsson  <andersca@apple.com>
2642
2643         Fix build.
2644
2645         * page/DragController.cpp:
2646         (WebCore::DragController::doSystemDrag):
2647
2648 2017-02-15  Anders Carlsson  <andersca@apple.com>
2649
2650         Modernize DragClient::startDrag somewhat
2651         https://bugs.webkit.org/show_bug.cgi?id=168379
2652
2653         Reviewed by Tim Horton.
2654
2655         Change DragClient::startDrag to take a DragImage instead of a DragImageRef, and to pass along the source action
2656         instead of whether it's a link or not.
2657
2658         * loader/EmptyClients.cpp:
2659         * page/DragClient.h:
2660         * page/DragController.cpp:
2661         (WebCore::DragController::startDrag):
2662         (WebCore::DragController::doImageDrag):
2663         (WebCore::DragController::doSystemDrag):
2664         * page/DragController.h:
2665
2666 2017-02-15  Chris Dumez  <cdumez@apple.com>
2667
2668         Expose Symbol.toPrimitive / valueOf on Location instances
2669         https://bugs.webkit.org/show_bug.cgi?id=168295
2670
2671         Reviewed by Geoffrey Garen, Keith Miller and Mark Lam.
2672
2673         Expose Symbol.toPrimitive / valueOf on Location instances as per:
2674         - https://html.spec.whatwg.org/#the-location-interface
2675
2676         Firefox and Chrome already comply with the specification.
2677
2678         Tests: fast/dom/location-valueOf-after-object-prototype-update.html
2679                fast/dom/location-valueOf-after-object-prototype-update2.html
2680                imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html
2681                imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-valueof.html
2682
2683         * bindings/scripts/CodeGeneratorJS.pm:
2684         (GenerateImplementation):
2685
2686 2017-02-15  Aakash Jain  <aakash_jain@apple.com>
2687
2688         Remove WebIOSEvent interface
2689         https://bugs.webkit.org/show_bug.cgi?id=168368
2690
2691         Reviewed by Tim Horton.
2692
2693         * platform/ios/WebEvent.h: Removed WebIOSEvent.
2694
2695 2017-02-15  Chris Dumez  <cdumez@apple.com>
2696
2697         [iOS] Form Validation Bubble should be sensitive to Dynamic Type
2698         https://bugs.webkit.org/show_bug.cgi?id=168291
2699         <rdar://problem/30508593>
2700
2701         Reviewed by Tim Horton.
2702
2703         Update ValidationBubble implementation on iOS to stop obeying the
2704         minimum font size setting, given that this setting is not exposed
2705         on iOS. Instead, we now rely on
2706         [UIFont preferredFontForTextStyle:UIFontTextStyleCallout], which
2707         will give us a font whose size obeys Dynamic Type [1] setting on iOS.
2708
2709         [1] https://developer.apple.com/ios/human-interface-guidelines/visual-design/typography/
2710
2711         No new tests, no easily testable.
2712
2713         * platform/ios/ValidationBubbleIOS.mm:
2714         (WebCore::ValidationBubble::ValidationBubble):
2715
2716 2017-02-15  Yusuke Suzuki  <utatane.tea@gmail.com>
2717
2718         [JSC] Drop PassRefPtr
2719         https://bugs.webkit.org/show_bug.cgi?id=168320
2720
2721         Reviewed by Saam Barati.
2722
2723         * bindings/js/ScriptSourceCode.h:
2724         (WebCore::ScriptSourceCode::ScriptSourceCode):
2725         Use Ref and pass it to SourceCode.
2726
2727         * replay/ReplayController.cpp:
2728         (WebCore::ReplayController::frameNavigated):
2729         Pass reference.
2730
2731 2017-02-15  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2732
2733         [GStreamer][MSE][EME] Handle protection event also at decryptor level
2734         https://bugs.webkit.org/show_bug.cgi?id=168316
2735
2736         Reviewed by Žan Doberšek.
2737
2738         So far in MSE pipeline we were handling the encryption events
2739         only when they arrived at the demuxer but this won't work in any
2740         kind of key renegotiation as the event will never arrive. Now we
2741         connect to the element messages, check for the drm id and send it
2742         to the private player for processing.
2743
2744         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2745         (WebCore::appendPipelineElementMessageCallback):
2746         (WebCore::AppendPipeline::AppendPipeline):
2747         (WebCore::AppendPipeline::handleElementMessage):
2748         * platform/graphics/gstreamer/mse/AppendPipeline.h:
2749
2750 2017-02-15  Zan Dobersek  <zdobersek@igalia.com>
2751
2752         [EME] MediaKeys::setServerCertificate() must resolve with 'false' when certificates aren't supported
2753         https://bugs.webkit.org/show_bug.cgi?id=168362
2754
2755         Reviewed by Xabier Rodriguez-Calvar.
2756
2757         In MediaKeys::setServerCertificate(), when the CDM implementation
2758         doesn't support server certificates, it should resolve the promise
2759         with the 'false' value, as mandated by the specification, and not
2760         reject it.
2761
2762         A test case in mock-MediaKeys-setServerCertificate.html is updated.
2763
2764         * Modules/encryptedmedia/MediaKeys.cpp:
2765         (WebCore::MediaKeys::setServerCertificate):
2766
2767 2017-02-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2768
2769         REGRESSION (r206014): HTTPHeaderMap does not consistently use comma without space to separate values of header fields
2770         https://bugs.webkit.org/show_bug.cgi?id=168115
2771
2772         Reviewed by Darin Adler.
2773
2774         In r206014 HTTPHeaderMap::add() was updated to combine common headers with ',' instead of ", " to match the
2775         fetch specification, but the uncommon headers are still combined with ", ".
2776
2777         * platform/network/HTTPHeaderMap.cpp:
2778         (WebCore::HTTPHeaderMap::add):
2779
2780 2017-02-14  Ryosuke Niwa  <rniwa@webkit.org>
2781
2782         An assertion failure inside removeChildren
2783         https://bugs.webkit.org/show_bug.cgi?id=168069
2784
2785         Reviewed by Brent Fulgham.
2786
2787         The bug was caused by notifyRemovePendingSheet executing scripts synchronously where it shouldn't.
2788
2789         Removed the call to notifyRemovePendingSheetIfNeeded in notifyChildNodeRemoved. Instead, invoke it
2790         in its call sites when they're safe.
2791
2792         Test: http/tests/security/move-iframe-within-focus-handler-inside-removal.html
2793
2794         * dom/ContainerNode.cpp:
2795         (WebCore::ContainerNode::takeAllChildrenFrom):
2796         (WebCore::ContainerNode::notifyChildInserted):
2797         (WebCore::ContainerNode::removeChild):
2798         (WebCore::ContainerNode::parserRemoveChild):
2799         (WebCore::ContainerNode::replaceAllChildren):
2800         (WebCore::ContainerNode::removeChildren):
2801         * dom/ContainerNodeAlgorithms.cpp:
2802         (WebCore::notifyChildNodeRemoved):
2803
2804 2017-02-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2805
2806         [GStreamer] Several tests are timing out after r212349
2807         https://bugs.webkit.org/show_bug.cgi?id=168359
2808
2809         Reviewed by Žan Doberšek.
2810
2811         This is because they are failing the cross origin check. Those tests are not using WebKitWebSrc, but
2812         GstFileSrc. I didn't consider the case of source not being a WebKitWebSrc.
2813
2814         Fixes several timeout instroduced in r212349.
2815
2816         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2817         (WebCore::MediaPlayerPrivateGStreamer::hasSingleSecurityOrigin): Split the source check in two. First check if
2818         it's nullptr, and return false. Then check if it's a WebKitWebSrc and return true if it isn't.
2819
2820 2017-02-14  Brent Fulgham  <bfulgham@apple.com>
2821
2822         Revalidate URL after events that could trigger navigations
2823         https://bugs.webkit.org/show_bug.cgi?id=168071
2824         <rdar://problem/30450379>
2825
2826         Reviewed by Ryosuke Niwa.
2827
2828         When arbitary javascript runs during a load, we should revalidate
2829         the URLs involved to make sure they are still valid.
2830
2831         Tests: http/tests/plugins/navigation-during-load-embed.html
2832                http/tests/plugins/navigation-during-load.html
2833
2834         * html/HTMLEmbedElement.cpp:
2835         (WebCore::HTMLEmbedElement::updateWidget): Confirm we are still allowed to
2836         load the URL after executing JS callbacks.
2837         * html/HTMLFrameElementBase.cpp:
2838         (WebCore::HTMLFrameElementBase::isURLAllowed): Split existing function into
2839         existing protected method, and a new public method that checks a passed URL
2840         for validity.
2841         * html/HTMLFrameElementBase.h:
2842         * html/HTMLFrameOwnerElement.h:
2843         (WebCore::HTMLFrameOwnerElement::isURLAllowed):
2844         * html/HTMLObjectElement.cpp:
2845         (WebCore::HTMLObjectElement::updateWidget): Confirm we are still allowed to
2846         load the URL after executing JS callbacks.
2847         * loader/SubframeLoader.cpp:
2848         (WebCore::SubframeLoader::requestFrame): Ditto.
2849
2850 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2851
2852         [GStreamer] Implement MediaPlayerPrivate::hasSingleSecurityOrigin()
2853         https://bugs.webkit.org/show_bug.cgi?id=168322
2854
2855         Reviewed by Žan Doberšek.
2856
2857         It currently returns true unconditionally. Add resolved-location property to WebKitWebSourceGStreamer to track
2858         the resolved url returned by the server and use that from MediaPlayerPrivate to check if there was a cross
2859         origin redirection.
2860
2861         Fixes: http/tests/security/canvas-remote-read-remote-video-redirect.html
2862
2863         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2864         (WebCore::MediaPlayerPrivateGStreamer::hasSingleSecurityOrigin):
2865         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2866         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2867         (webKitWebSrcFinalize):
2868         (webKitWebSrcGetProperty):
2869         (webKitWebSrcStart):
2870         (webKitWebSrcQueryWithParent):
2871         (webKitWebSrcGetUri):
2872         (webKitWebSrcSetUri):
2873         (StreamingClient::handleResponseReceived):
2874         (ResourceHandleStreamingClient::wasBlocked):
2875         (ResourceHandleStreamingClient::cannotShowURL):
2876
2877 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2878
2879         Unreviewed, rolling out r211967.
2880
2881         Caused rendering issues in HiDPI
2882
2883         Reverted changeset:
2884
2885         "[GTK] scroll with transparent background not repainted after
2886         scrollY >= 32768"
2887         https://bugs.webkit.org/show_bug.cgi?id=154283
2888         http://trac.webkit.org/changeset/211967
2889
2890 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2891
2892         [GTK] Update cookie manager API to properly work with ephemeral sessions
2893         https://bugs.webkit.org/show_bug.cgi?id=168230
2894
2895         Reviewed by Michael Catanzaro.
2896
2897         Add implementation for deleteAllCookiesModifiedSince. Note that this only works when the timespan is 0, we need
2898         new libsoup API to support removing recently modified cookies.
2899
2900         * platform/network/soup/CookieJarSoup.cpp:
2901         (WebCore::deleteAllCookiesModifiedSince):
2902
2903 2017-02-14  Joseph Pecoraro  <pecoraro@apple.com>
2904
2905         [WebIDL] Improve serializer = { inherit }
2906         https://bugs.webkit.org/show_bug.cgi?id=168293
2907
2908         Reviewed by Youenn Fablet.
2909
2910         * bindings/scripts/CodeGeneratorJS.pm:
2911         (GenerateHeader):
2912         Expose a serialize() method on the interface.
2913
2914         (GenerateSerializerFunction):
2915         (GenerateSerializerAttributesForInterface): Deleted.
2916         Subclasses that have `serializer = { inherit }` can use
2917         their parent's serialize() method to get the initial object.
2918         We can now collapse everything back into a single function
2919         because we only generate code for our own attributes.
2920
2921         * bindings/scripts/test/JS/JSTestNode.cpp:
2922         (WebCore::JSTestNode::serialize):
2923         (WebCore::jsTestNodePrototypeFunctionToJSONCaller):
2924         * bindings/scripts/test/JS/JSTestNode.h:
2925         * bindings/scripts/test/JS/JSTestObj.cpp:
2926         (WebCore::JSTestObj::serialize):
2927         (WebCore::jsTestObjPrototypeFunctionToJSONCaller):
2928         * bindings/scripts/test/JS/JSTestObj.h:
2929         * bindings/scripts/test/JS/JSTestSerialization.cpp:
2930         (WebCore::JSTestSerialization::serialize):
2931         (WebCore::jsTestSerializationPrototypeFunctionToJSONCaller):
2932         * bindings/scripts/test/JS/JSTestSerialization.h:
2933         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
2934         (WebCore::JSTestSerializationInherit::serialize):
2935         (WebCore::jsTestSerializationInheritPrototypeFunctionToJSONCaller):
2936         * bindings/scripts/test/JS/JSTestSerializationInherit.h:
2937         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
2938         (WebCore::JSTestSerializationInheritFinal::serialize):
2939         (WebCore::jsTestSerializationInheritFinalPrototypeFunctionToJSONCaller):
2940         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h:
2941         Updated results.
2942
2943 2017-02-14  Aakash Jain  <aakash_jain@apple.com>
2944
2945         Move methods from WebCoreThread.h to WebCoreThreadInternal.h
2946         https://bugs.webkit.org/show_bug.cgi?id=168326
2947
2948         Reviewed by Alexey Proskuryakov.
2949
2950         * platform/ios/wak/WebCoreThread.h: Move methods WebThreadRunLoop and WebThreadCurrentContext to WebCoreThreadInternal.h
2951         * platform/ios/wak/WebCoreThreadInternal.h: Ditto.
2952         * platform/ios/wak/WebCoreThreadRun.cpp: Removed WebCoreThread.h as it is already included by WebCoreThreadInternal.h
2953         * platform/ios/wak/WKGraphics.mm: Included WebCoreThreadInternal.h, it subsequently includes WebCoreThread.h
2954         * inspector/InspectorTimelineAgent.cpp: Ditto.
2955         * page/mac/PageMac.mm: Ditto.
2956         * platform/cf/MainThreadSharedTimerCF.cpp: Ditto.
2957         * platform/cocoa/MemoryPressureHandlerCocoa.mm: Ditto.
2958         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Ditto.
2959         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: Ditto.
2960         * bindings/js/CommonVM.cpp: included WebCoreThreadInternal.h
2961
2962 2017-02-14  Wenson Hsieh  <wenson_hsieh@apple.com>
2963
2964         [WK2] Support data interaction on links
2965         https://bugs.webkit.org/show_bug.cgi?id=168331
2966         <rdar://problem/30200837>
2967
2968         Reviewed by Tim Horton.
2969
2970         Adds support for data interaction on links at the WebCore layer, refactoring some drag-and-drop code on the Mac
2971         along the way. Also adds two new TestWebKitAPI unit tests in DataInteractionTests.mm: LinkToInput and
2972         BackgroundImageLinkToInput (see Tools/ChangeLog for more information).
2973
2974         * page/DragController.cpp:
2975         (WebCore::DragController::startDrag):
2976         (WebCore::DragController::doImageDrag):
2977         (WebCore::DragController::doSystemDrag):
2978
2979         Introduce platformAdjustDragImageForDeviceScaleFactor, and special-case drag images for links to anchor at the
2980         bottom center.
2981
2982         * platform/DragImage.cpp:
2983         (WebCore::platformAdjustDragImageForDeviceScaleFactor):
2984
2985         Scale the drag image up by the device scale factor. In WebDragClient, we scale the image back down to the
2986         original size. It seems the reason we do this extra dance is because the image sizing heuristic in between
2987         assumes that the image dimensions are for a non-retina device, but this work should really not be necessary if
2988         we tweak the heuristic to account for deviceScaleFactor. We should address this in a separate patch.
2989
2990         * platform/DragImage.h:
2991         * platform/graphics/Path.h:
2992
2993 2017-02-14  Basuke Suzuki  <Basuke.Suzuki@am.sony.com>
2994
2995         [CURL] ResourceError created with error information should have default type Type::General
2996         https://bugs.webkit.org/show_bug.cgi?id=168345
2997
2998         Reviewed by Alex Christensen.
2999
3000         ResourceError has separate implementaion for each platform
3001         so that the interface should be same.
3002         On CURL port, the constructor with error information has
3003         different default value on `type` parameter. It is Type::Null but other implementaitons have Type::General.
3004         This causes some ResourceError is created inconsistent. 
3005
3006         * platform/network/curl/ResourceError.h:
3007         (WebCore::ResourceError::ResourceError):
3008
3009 2017-02-14  Youenn Fablet  <youennf@gmail.com>
3010
3011         [WebRTC] Add support for libwebrtc negotiation needed event
3012         https://bugs.webkit.org/show_bug.cgi?id=168267
3013
3014         Reviewed by Eric Carlson.
3015
3016         Test: webrtc/negotiatedneeded-event-addStream.html
3017
3018         Moving generic code (markAsNeedingNegotiation) from MediaEndpointPeerConnection to PeerConnectionBackend.
3019         This code handles the control of sending or not the negotiationneeded event.
3020
3021         Updating mock to use markAsNeedingNegotiation when streams are changed.
3022         Updating libwebrtc backend to call markAsNeedingNegotiation when required by libwebrtc implementation.
3023
3024         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3025         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
3026         * Modules/mediastream/MediaEndpointPeerConnection.h:
3027         * Modules/mediastream/PeerConnectionBackend.cpp:
3028         (WebCore::PeerConnectionBackend::markAsNeedingNegotiation):
3029         * Modules/mediastream/PeerConnectionBackend.h:
3030         (WebCore::PeerConnectionBackend::isNegotiationNeeded):
3031         (WebCore::PeerConnectionBackend::clearNegotiationNeededState):
3032         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3033         (WebCore::LibWebRTCMediaEndpoint::OnRenegotiationNeeded):
3034         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3035         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
3036         * testing/MockLibWebRTCPeerConnection.cpp:
3037         (WebCore::MockLibWebRTCPeerConnection::AddStream):
3038         (WebCore::MockLibWebRTCPeerConnection::RemoveStream):
3039
3040 2017-02-14  Brady Eidson  <beidson@apple.com>
3041
3042         Unreviewed followup to r212330 to fix Debug builds
3043
3044         * loader/DocumentThreadableLoader.cpp:
3045         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Add call to relaxAdoptionRequirement().
3046
3047 2017-02-14  Matt Rajca  <mrajca@apple.com>
3048
3049         Website policies: iframes should respect the autoplay policy of the top-level document
3050         https://bugs.webkit.org/show_bug.cgi?id=168333
3051
3052         Reviewed by Alex Christensen.
3053
3054         API tests were added.
3055
3056         * html/HTMLMediaElement.cpp:
3057         (WebCore::HTMLMediaElement::HTMLMediaElement):
3058
3059 2017-02-14  Dean Jackson  <dino@apple.com>
3060
3061         Rename preferLowPowerWebGLRendering setting to forceWebGLUsesLowPower
3062         https://bugs.webkit.org/show_bug.cgi?id=168339
3063         <rdar://problem/30522092>
3064
3065         Reviewed by Simon Fraser.
3066
3067         Use a setting name that more clearly reflects what it is doing. It's not
3068         preferring to use the low-power GPU, it's forcing it.
3069
3070         * html/canvas/WebGLRenderingContextBase.cpp:
3071         (WebCore::WebGLRenderingContextBase::create):
3072         * page/Settings.in:
3073
3074 2017-02-14  Brady Eidson  <beidson@apple.com>
3075
3076         Speculative fix for: Crash in DocumentThreadableLoader::redirectReceived.
3077         <rdar://problem/29899473> and https://bugs.webkit.org/show_bug.cgi?id=168337
3078
3079         Reviewed by Geoffrey Garen.
3080
3081         No new tests (Unable to find a reproduction).
3082
3083         * loader/DocumentThreadableLoader.cpp:
3084         (WebCore::DocumentThreadableLoader::loadRequest):
3085
3086 2017-02-14  Youenn Fablet  <youenn@apple.com>
3087
3088         [WebRTC] Remove obsolete WebRTC stats API
3089         https://bugs.webkit.org/show_bug.cgi?id=167910
3090
3091         Reviewed by Alex Christensen.
3092
3093         No change of behavior as removed constructs are not functional.
3094         Removing RTCStatsResponse which no longer exists and made RTCStatsReport an empty container for now.
3095
3096         * CMakeLists.txt:
3097         * DerivedSources.cpp:
3098         * DerivedSources.make:
3099         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3100         (WebCore::MediaEndpointPeerConnection::getStats):
3101         * Modules/mediastream/MediaEndpointPeerConnection.h:
3102         * Modules/mediastream/PeerConnectionBackend.h:
3103         * Modules/mediastream/RTCPeerConnection.cpp:
3104         (WebCore::RTCPeerConnection::getStats):
3105         * Modules/mediastream/RTCStatsReport.cpp:
3106         (WebCore::RTCStatsReport::create): Deleted.
3107         (WebCore::RTCStatsReport::RTCStatsReport): Deleted.
3108         (WebCore::RTCStatsReport::names): Deleted.
3109         (WebCore::RTCStatsReport::local): Deleted.
3110         (WebCore::RTCStatsReport::remote): Deleted.
3111         (WebCore::RTCStatsReport::addStatistic): Deleted.
3112         * Modules/mediastream/RTCStatsReport.h:
3113         (WebCore::RTCStatsReport::create):
3114         (WebCore::RTCStatsReport::timestamp): Deleted.
3115         (WebCore::RTCStatsReport::id): Deleted.
3116         (WebCore::RTCStatsReport::type): Deleted.
3117         (WebCore::RTCStatsReport::stat): Deleted.
3118         * Modules/mediastream/RTCStatsReport.idl:
3119         * Modules/mediastream/RTCStatsResponse.cpp: Removed.
3120         * Modules/mediastream/RTCStatsResponse.h: Removed.
3121         * Modules/mediastream/RTCStatsResponse.idl: Removed.
3122         * WebCore.xcodeproj/project.pbxproj:
3123         * platform/mediastream/MediaEndpoint.h:
3124         (WebCore::MediaEndpoint::getStats):
3125         * platform/mediastream/RTCStatsRequest.h: Removed.
3126         * platform/mediastream/RTCStatsResponseBase.h: Removed.
3127
3128 2017-02-14  Karim H  <karim@karhm.com>
3129
3130         Removed unused methods of WebCore::FileStream
3131         https://bugs.webkit.org/show_bug.cgi?id=168025
3132
3133         Reviewed by Michael Catanzaro.
3134
3135         * fileapi/AsyncFileStream.cpp:
3136         (WebCore::AsyncFileStream::openForWrite): Deleted.
3137         (WebCore::AsyncFileStream::write): Deleted.
3138         (WebCore::AsyncFileStream::truncate): Deleted.
3139         * fileapi/AsyncFileStream.h:
3140         * platform/FileStream.cpp:
3141         (WebCore::FileStream::openForWrite): Deleted.
3142         (WebCore::FileStream::write): Deleted.
3143         (WebCore::FileStream::truncate): Deleted.
3144         * platform/FileStream.h:
3145
3146 2017-02-14  Chris Dumez  <cdumez@apple.com>
3147
3148         HTML Form Validation bubble should take minimum font size setting into consideration
3149         https://bugs.webkit.org/show_bug.cgi?id=168271
3150         <rdar://problem/29869869>
3151
3152         Reviewed by Simon Fraser.
3153
3154         HTML Form Validation bubble should take minimum font size setting into consideration
3155         for better accessibility.
3156
3157         Test: fast/forms/validation-message-minimum-font-size.html
3158
3159         * platform/ValidationBubble.h:
3160         (WebCore::ValidationBubble::create):
3161         (WebCore::ValidationBubble::fontSize):
3162         * platform/ios/ValidationBubbleIOS.mm:
3163         (WebCore::ValidationBubble::ValidationBubble):
3164         * platform/mac/ValidationBubbleMac.mm:
3165         (WebCore::ValidationBubble::ValidationBubble):
3166         Update the ValidationBubble constructor to take in Settings. For now, there is a
3167         single setting that is the minimum font size and that is taken into account when
3168         setting the font size of the validation bubble text.
3169
3170 2017-02-14  Eric Carlson  <eric.carlson@apple.com>
3171
3172         [MediaStream] add navigator.getUserMedia for compatibility with legacy content
3173         https://bugs.webkit.org/show_bug.cgi?id=168324
3174         <rdar://problem/30513125>
3175
3176         Reviewed by Youenn Fablet.
3177
3178         Tests: fast/mediastream/argument-types.html
3179                fast/mediastream/getusermedia.html
3180                fast/mediastream/webkitGetUserMedia-shadowing-then.html
3181
3182         * CMakeLists.txt:
3183         * DerivedSources.cpp:
3184         * DerivedSources.make:
3185         * Modules/mediastream/MediaDevices.idl:
3186         * Modules/mediastream/NavigatorUserMedia.idl: Added.
3187         * Modules/mediastream/NavigatorUserMedia.js: Added.
3188         * WebCore.xcodeproj/project.pbxproj:
3189         * bindings/js/WebCoreBuiltinNames.h:
3190         * page/Navigator.idl:
3191
3192 2017-02-14  Chris Dumez  <cdumez@apple.com>
3193
3194         Fallback to legacy type only when event is trusted
3195         https://bugs.webkit.org/show_bug.cgi?id=168301
3196
3197         Reviewed by Ryosuke Niwa.
3198
3199         Fallback to legacy type only when event is trusted as per a recent
3200         DOM specification change:
3201         - https://github.com/whatwg/dom/issues/404
3202         - https://github.com/whatwg/dom/pull/406
3203
3204         No new tests, rebaselined existing test.
3205
3206         * dom/EventTarget.cpp:
3207         (WebCore::legacyType):
3208         (WebCore::EventTarget::fireEventListeners):
3209
3210 2017-02-13  Dean Jackson  <dino@apple.com>
3211
3212         Rename preferLowPowerToHighPerformance to powerPreference
3213         https://bugs.webkit.org/show_bug.cgi?id=168269
3214         <rdar://problem/30504444>
3215
3216         Reviewed by Chris Dumez.
3217
3218         Based on the discussion in https://github.com/KhronosGroup/WebGL/pull/2283.
3219
3220         Change WebGLContextAttributes's preferLowPowerToHighPerformance boolean
3221         into a powerPreference enum taking three values. The implementation
3222         of the enum is in GraphicsContext3DAttributes.
3223
3224         While the name and values have changed, there should be no change in
3225         behaviour caused by this patch.
3226
3227         * html/canvas/WebGLContextAttributes.h: Use GraphicsContext3DAttributes
3228         enum GraphicsContext3DPowerPreference.
3229         * html/canvas/WebGLContextAttributes.idl: Rename and add the WebIDL enum.
3230         * html/canvas/WebGLRenderingContextBase.cpp: Use the new values.
3231         (WebCore::WebGLRenderingContextBase::create):
3232         (WebCore::WebGLRenderingContextBase::registerWithWebGLStateTracker):
3233         * platform/WebGLStateTracker.cpp:
3234         * platform/WebGLStateTracker.h: Update the state tracker to use the new
3235         values.
3236         * platform/graphics/GraphicsContext3DAttributes.h:
3237         * platform/graphics/mac/GraphicsContext3DMac.mm:
3238         (WebCore::setPixelFormat): Accept GraphicsContext3DPowerPreference as a parameter.
3239         (WebCore::GraphicsContext3D::GraphicsContext3D):
3240
3241 2017-02-14  Youenn Fablet  <youennf@gmail.com>
3242
3243         [WebRTC] Implement description getters for libwebrtc RTCPeerConnection
3244         https://bugs.webkit.org/show_bug.cgi?id=168234
3245
3246         Reviewed by Alex Christensen.
3247
3248         Allows passing W3C webrtc tests.
3249
3250         Implementing localDescription/remoteDescription using libwebrtc backend.
3251         current and pending description getters are made the same as local/remote getters for the moment.
3252         This should be fixed when upgrading to latest libwebrtc revision.
3253
3254         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3255         (WebCore::toSessionDescriptionType):
3256         (WebCore::fromSessionDescriptionType):
3257         (WebCore::fromSessionDescription):
3258         (WebCore::LibWebRTCMediaEndpoint::localDescription):
3259         (WebCore::LibWebRTCMediaEndpoint::remoteDescription):
3260         (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
3261         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
3262         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3263         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3264         (WebCore::LibWebRTCPeerConnectionBackend::localDescription):
3265         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
3266
3267 2017-02-14  Jeremy Jones  <jeremyj@apple.com>
3268
3269         When playing inline after fullscreen, set a flag instead of adding attribute plays inline, and use in requiresFullscreenForVideoPlayback.
3270         https://bugs.webkit.org/show_bug.cgi?id=167815
3271         rdar://problem/27685077
3272
3273         Reviewed by Jer Noble.
3274
3275         Test: media/media-fullscreen-loop-inline.html
3276
3277         When video is allowed to play inline after fullscreen. Looped video causes play state to update, which can send video back to fullscreen when
3278         allowsInline is false. This change will set a new flag when allowsInlineMediaPlaybackAfterFullscreen allows inline playback that can be tested
3279         in requiresFullscreenForVideoPlayback to prevent sending video back into fullscreen when video loops.
3280
3281         * html/HTMLMediaElement.cpp:
3282         (WebCore::HTMLMediaElement::enterFullscreen):
3283         (WebCore::HTMLMediaElement::exitFullscreen):
3284         * html/HTMLMediaElement.h:
3285         (WebCore::HTMLMediaElement::isTemporarilyAllowingInlinePlaybackAfterFullscreen): Added.
3286         * html/MediaElementSession.cpp:
3287         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
3288
3289 2017-02-14  Jer Noble  <jer.noble@apple.com>
3290
3291         Video elements with MediaSource objects set by srcObject are not cleared when srcObject is set to null
3292         https://bugs.webkit.org/show_bug.cgi?id=168268
3293
3294         Reviewed by Eric Carlson.
3295
3296         Test: fast/mediastream/MediaStream-MediaElement-setObject-null.html
3297
3298         Make the setSrcObject() operation compliant with the HTML spec. Since the specification defines
3299         srcObject in terms of either a MediaSource, MediaStream, or Blob object, add the variant typedef
3300         to HTMLMediaElement and move the definition out of the Modules/mediastream extension IDL and into
3301         HTMLMediaElement.idl. Then bring the "media elements load" and "resource selection" algorithms up
3302         to their most recent definitions in the HTML5 spec.
3303
3304         Drive-by fix: Allow the (admittedly weird) single-element-union type in IDL.
3305
3306         * CMakeLists.txt:
3307         * DerivedSources.cpp:
3308         * DerivedSources.make:
3309         * Modules/mediastream/HTMLMediaElementMediaStream.cpp: Removed.
3310         * Modules/mediastream/HTMLMediaElementMediaStream.h: Removed.
3311         * Modules/mediastream/HTMLMediaElementMediaStream.idl: Removed.
3312         * WebCore.xcodeproj/project.pbxproj:
3313         * bindings/scripts/IDLParser.pm:
3314         (parseUnionType):
3315         * html/HTMLAudioElement.cpp:
3316         (WebCore::HTMLAudioElement::createForJSConstructor):
3317         * html/HTMLMediaElement.cpp:
3318         (WebCore::actionName):
3319         (WebCore::HTMLMediaElement::parseAttribute):
3320         (WebCore::HTMLMediaElement::insertedInto):
3321         (WebCore::HTMLMediaElement::scheduleDelayedAction):
3322         (WebCore::HTMLMediaElement::scheduleNextSourceChild):
3323         (WebCore::HTMLMediaElement::pendingActionTimerFired):
3324         (WebCore::HTMLMediaElement::setSrcObject):
3325         (WebCore::HTMLMediaElement::load):
3326         (WebCore::HTMLMediaElement::prepareForLoad):
3327         (WebCore::HTMLMediaElement::selectMediaResource):
3328         (WebCore::HTMLMediaElement::loadResource):
3329         (WebCore::HTMLMediaElement::playInternal):
3330         (WebCore::HTMLMediaElement::pauseInternal):
3331         (WebCore::HTMLMediaElement::sourceWasAdded):
3332         (WebCore::HTMLMediaElement::clearMediaPlayer):
3333         (WebCore::HTMLMediaElement::resume):
3334         (WebCore::HTMLMediaElement::mediaCanStart):
3335         (WebCore::HTMLMediaElement::createMediaPlayer):
3336         (WebCore::HTMLMediaElement::loadInternal): Deleted.
3337         * html/HTMLMediaElement.h:
3338         (WebCore::HTMLMediaElement::srcObject):
3339         * html/HTMLMediaElement.idl:
3340         * platform/ContentType.h:
3341
3342 2017-02-14  Aakash Jain  <aakash_jain@apple.com>
3343
3344         Remove unused WebThreadContextIsCurrent method from WebCoreThread.h
3345         https://bugs.webkit.org/show_bug.cgi?id=168254
3346
3347         Reviewed by Dan Bernstein.
3348
3349         * platform/ios/wak/WebCoreThread.h: Removed unused WebThreadContextIsCurrent.
3350         * platform/ios/wak/WebCoreThread.mm:
3351         (WebThreadContextIsCurrent): Deleted.
3352
3353 2017-02-14  Alexey Proskuryakov  <ap@apple.com>
3354
3355         WebCore shouldn't export SystemMemory.h
3356         https://bugs.webkit.org/show_bug.cgi?id=168285
3357
3358         Reviewed by Alex Christensen.
3359
3360         * WebCore.xcodeproj/project.pbxproj:
3361
3362 2017-02-13  Filip Pizlo  <fpizlo@apple.com>
3363
3364         worker.postMessage should throw a TypeError if a SharedArrayBuffer is in the transfer list
3365         https://bugs.webkit.org/show_bug.cgi?id=168277
3366
3367         Reviewed by Mark Lam.
3368
3369         Test: workers/sab/postMessage-transfer-type-error.html
3370         
3371         This is a simple spec compliance change. The title says it all.
3372
3373         * bindings/js/SerializedScriptValue.cpp:
3374         (WebCore::SerializedScriptValue::create):
3375
3376 2017-02-14  Zan Dobersek  <zdobersek@igalia.com>
3377
3378         HTMLMediaElement: WebKitMediaKeys member name should be prefixed
3379         https://bugs.webkit.org/show_bug.cgi?id=168297
3380
3381         Reviewed by Xabier Rodriguez-Calvar.
3382
3383         Rename the LEGACY_ENCRYPTED_MEDIA m_mediaKeys variable to m_webkitMediaKeys
3384         so that it contains the legacy prefix, just like the API. This will make
3385         room for the MediaKeys member variable that will be implemented under
3386         the ENCRYPTED_MEDIA guards.
3387
3388         * html/HTMLMediaElement.cpp:
3389         (WebCore::HTMLMediaElement::mediaPlayerCachedKeyForKeyId):
3390         (WebCore::HTMLMediaElement::webkitSetMediaKeys):
3391         * html/HTMLMediaElement.h:
3392         (WebCore::HTMLMediaElement::webkitKeys):
3393
3394 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3395
3396         [GTK] Make DragImageRef a RefPtr instead of a plain pointer
3397         https://bugs.webkit.org/show_bug.cgi?id=168296
3398
3399         Reviewed by Sergio Villar Senin.
3400
3401         Use RefPtr<cairo_surface_t> as DragImageRef for GTK+ port to avoid memory leaks.
3402
3403         * platform/DragImage.h:
3404         * platform/gtk/DragImageGtk.cpp:
3405         (WebCore::dragImageSize):
3406         (WebCore::deleteDragImage):
3407         (WebCore::scaleDragImage):
3408         (WebCore::dissolveDragImageToFraction):
3409         (WebCore::createDragImageFromImage):
3410         (WebCore::createDragImageIconForCachedImageFilename):
3411
3412 2017-02-14  Vanessa Chipirrás Navalón  <vchipirras@igalia.com>
3413
3414         [GStreamer][MSE] Some GStreamer log messages are generated with the 'default' category
3415         https://bugs.webkit.org/show_bug.cgi?id=168015
3416
3417         Reviewed by Xabier Rodriguez-Calvar.
3418
3419         The elements AppendPipeline, PlaybackPipeline, MediaSourceClientGstreamerMSE do not have
3420         a defined Gstreamer log category, then the webkitmse category has been added to them.
3421         WebKitMediaSourceGstreamer has its own category but was not declared at the beginning of
3422         the .cpp file.
3423
3424         * platform/graphics/gstreamer/mse/AppendPipeline.cpp: Added webkitmse category.
3425         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
3426         Added webkitmse category and gst header.
3427         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: Added webkitmse category.
3428         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
3429         Added webkitmediasrc category.
3430
3431 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3432
3433         CookieManager only works with the default session
3434         https://bugs.webkit.org/show_bug.cgi?id=168229
3435
3436         Reviewed by Alex Christensen.
3437
3438         Update cookie observer API to use a std::function instead of a function pointer and make it work with multiple
3439         sessions in the backends that support it.
3440
3441         * platform/network/CookieStorage.h:
3442         * platform/network/cf/CookieStorageCFNet.cpp:
3443         (WebCore::cookieChangeCallbackMap):
3444         (WebCore::notifyCookiesChanged):
3445         (WebCore::startObservingCookieChanges):
3446         (WebCore::stopObservingCookieChanges):
3447         * platform/network/mac/CookieStorageMac.mm:
3448         (-[WebCookieStorageObjCAdapter startListeningForCookieChangeNotificationsWithCallback:]):
3449         (-[WebCookieStorageObjCAdapter stopListeningForCookieChangeNotifications]):
3450         (WebCore::startObservingCookieChanges):
3451         (WebCore::stopObservingCookieChanges):
3452         * platform/network/soup/CookieStorageSoup.cpp:
3453         (WebCore::cookieChangeCallbackMap):
3454         (WebCore::soupCookiesChanged):
3455         (WebCore::startObservingCookieChanges):
3456         (WebCore::stopObservingCookieChanges):
3457
3458 2017-02-13  Antoine Quint  <graouts@apple.com>
3459
3460         REGRESSION: Update volume and scrubbing slider to match HI designs
3461         https://bugs.webkit.org/show_bug.cgi?id=168170
3462         <rdar://problem/28095266>
3463
3464         Reviewed by Dean Jackson.
3465
3466         We bring the designs of the control's background materials, scrubber and
3467         volume slider up to spec.
3468
3469         The first important set of changes is that, on macOS, the materials and colors
3470         were incorrect. Buttons and time labels now set a mix-blend-mode to correctly
3471         appear vibrant against the media, and the controls bar, volume container
3472         and tracks menu now use a new BackgroundTint node to correctly apply both
3473         a backdrop-filter and blended tint above it.
3474
3475         The second important set of changes is the rendering of the sliders. Up to now
3476         we would simply style the <input type="range"> track and thumb, applying solid
3477         fills and strokes. We now draw sliders in two ways depending on the platform.
3478         
3479         On macOS, we draw the whole slider with a <canvas> element with "mix-blend-mode"
3480         set to "plus-lighter". On iOS, we draw the track as a <div> with "mix-blend-mode"
3481         set to "plus-darker" and draw the fill (up to the thumb) in the <canvas> with
3482         no blend mode to obtain a pure white color, finally the thumb is rendered by the
3483         <input> element. We couldn't draw the pure white color with the track in the
3484         same <canvas> due to the "plus-darker" blend mode.
3485
3486         Test: media/modern-media-controls/background-tint/background-tint.html
3487
3488         * Modules/modern-media-controls/controls/airplay-button.css:
3489         (button.airplay.on):
3490         * Modules/modern-media-controls/controls/background-tint.css: Added.
3491         (.background-tint):
3492         (.background-tint,):
3493         (.background-tint > .blur):
3494         (.background-tint > .tint):
3495         * Modules/modern-media-controls/controls/background-tint.js: Added.
3496         (BackgroundTint):
3497         * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
3498         (.media-controls.ios.inline .scrubber.slider):
3499         (.media-controls.ios.inline .scrubber.slider > div):
3500         (.media-controls.ios.inline .scrubber.slider > input::-webkit-slider-thumb):
3501         (.media-controls.ios.inline .scrubber.slider > .fill): Deleted.
3502         * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css:
3503         (.media-controls.mac.inline.compact .volume-slider-container):
3504         (.media-controls.mac.inline.compact .volume.slider):
3505         (.media-controls.mac.inline.compact .scrubber.slider > input::-webkit-slider-thumb): Deleted.
3506         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
3507         (.media-controls.mac.fullscreen > .controls-bar):
3508         (.media-controls.mac.fullscreen > .controls-bar > .background-tint > div):
3509         (.media-controls.mac.fullscreen .volume.slider):
3510         (.media-controls.mac.fullscreen button.volume-up):
3511         (.media-controls.mac.fullscreen button.rewind):
3512         (.media-controls.mac.fullscreen button.forward):
3513         (.media-controls.mac.fullscreen .buttons-container.right button):
3514         (.media-controls.mac.fullscreen .scrubber):
3515         (.media-controls.mac.fullscreen > .controls-bar button): Deleted.
3516         (.media-controls.mac.fullscreen button.airplay): Deleted.
3517         (.media-controls.mac.fullscreen button.aspect-ratio): Deleted.
3518         (.media-controls.mac.fullscreen button.pip): Deleted.
3519         (.media-controls.mac.fullscreen button.tracks): Deleted.
3520         (.media-controls.mac.fullscreen button.fullscreen): Deleted.
3521         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
3522         * Modules/modern-media-controls/controls/macos-inline-media-controls.css:
3523         (.media-controls.mac.inline .scrubber.slider):
3524         (.media-controls.mac.inline .volume-slider-container):
3525         (.media-controls.mac.inline .volume-slider-container > .background-tint):
3526         (.media-controls.mac.inline .volume-slider-container > .background-tint > div):
3527         (.media-controls.mac.inline .volume.slider):
3528         (.media-controls.mac.inline button): Deleted.
3529         (.media-controls.mac.inline button:active): Deleted.
3530         (.media-controls.mac.inline > .controls-bar button): Deleted.
3531         (.media-controls.mac.inline > .controls-bar,): Deleted.
3532         (.media-controls.mac.inline .volume-slider-container:before): Deleted.
3533         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
3534         (MacOSInlineMediaControls.prototype.layout):
3535         * Modules/modern-media-controls/controls/macos-media-controls.css: Added.
3536         (.media-controls.mac button:active):
3537         (.media-controls.mac > .controls-bar button):
3538         (.media-controls.mac > .controls-bar .time-label):
3539         (.media-controls.mac > .controls-bar .slider > canvas):
3540         (.media-controls.mac > .controls-bar .slider > input::-webkit-slider-thumb):
3541         * Modules/modern-media-controls/controls/scrubber.css: Removed.
3542         * Modules/modern-media-controls/controls/scrubber.js:
3543         (Scrubber):
3544         (Scrubber.prototype.get buffered):
3545         (Scrubber.prototype.set buffered):
3546         (Scrubber.prototype.draw):
3547         (Scrubber.prototype._drawMacOS):
3548         (Scrubber.prototype._drawiOS):
3549         * Modules/modern-media-controls/controls/slider.css:
3550         (.slider):
3551         (.slider > canvas,):
3552         (.slider > canvas):
3553         (.slider > input):
3554         (.slider > input,): Deleted.
3555         (.slider > .fill): Deleted.
3556         (.slider > input::-webkit-slider-thumb): Deleted.
3557         * Modules/modern-media-controls/controls/slider.js:
3558         (Slider.prototype.set value):
3559         (Slider.prototype.set width):
3560         (Slider.prototype.commitProperty):
3561         (Slider.prototype.layout):
3562         (Slider.prototype.draw):
3563         (Slider.prototype._handleInputEvent):
3564         (Slider.prototype._handleChangeEvent):
3565         (addRoundedRect):
3566         (Slider.prototype._updateFill): Deleted.
3567         * Modules/modern-media-controls/controls/start-button.css:
3568         (button.start):
3569         * Modules/modern-media-controls/controls/time-control.js:
3570         * Modules/modern-media-controls/controls/time-label.css:
3571         (.time-label):
3572         * Modules/modern-media-controls/controls/tracks-panel.css:
3573         (.tracks-panel):
3574         (.tracks-panel > .background-tint > div):
3575         (.tracks-panel > section):
3576         (.tracks-panel > section:first-of-type):
3577         (.tracks-panel > section > h3):
3578         (.tracks-panel > section > ul):
3579         (.tracks-panel > section > ul > li):
3580         (.tracks-panel > section > ul > li:focus):
3581         (.tracks-panel > section > ul > li.selected:before):
3582         (.tracks-panel > section > ul > li.animated):
3583         (.tracks-panel-section): Deleted.
3584         (.tracks-panel-section:first-of-type): Deleted.
3585         (.tracks-panel-section > h3): Deleted.
3586         (.tracks-panel-section > ul): Deleted.
3587         (.tracks-panel-section > ul > li): Deleted.
3588         (.tracks-panel-section > ul > li:focus): Deleted.
3589         (.tracks-panel-section > ul > li.selected:before): Deleted.
3590         (.tracks-panel-section > ul > li.animated): Deleted.
3591         * Modules/modern-media-controls/controls/tracks-panel.js:
3592         (TracksPanel.prototype._childrenFromDataSource):
3593         (TracksPanel.prototype._childrenFromDataSource.): Deleted.
3594         * Modules/modern-media-controls/controls/volume-slider.js:
3595         (VolumeSlider):
3596         (VolumeSlider.prototype.handleEvent):
3597         (VolumeSlider.prototype.draw):
3598         * Modules/modern-media-controls/js-files:
3599         * Modules/modern-media-controls/media/scrubbing-support.js:
3600         (ScrubbingSupport.prototype.get mediaEvents):
3601         (ScrubbingSupport.prototype.syncControl):
3602         (ScrubbingSupport):
3603
3604 2017-02-13  Alex Christensen  <achristensen@webkit.org>
3605
3606         URLs with an invalid IPv4 address should be invalid
3607         https://bugs.webkit.org/show_bug.cgi?id=168260
3608
3609         Reviewed by Tim Horton.
3610
3611         All URL hosts are fed through the IPv4 parser.  https://webkit.org/ doesn't
3612         look enough like an IPv4 address to be considered an invalid IPv4 address, so 
3613         we continue to the String host processing.  http://127.0.0.257 does, though, and
3614         according to https://url.spec.whatwg.org/#concept-ipv4-parser parsing that URL
3615         should fail.
3616
3617         Covered by newly passing web platform tests.
3618
3619         * platform/URLParser.cpp:
3620         (WebCore::URLParser::parseIPv4Host):
3621         (WebCore::URLParser::parseHostAndPort):
3622         * platform/URLParser.h:
3623
3624 2017-02-13  Dan Bernstein  <mitz@apple.com>
3625
3626         Reverted r212275. It still breaks some Apple-internal builds.
3627
3628         * platform/spi/mac/TUCallSPI.h:
3629
3630 2017-02-13  Joseph Pecoraro  <pecoraro@apple.com>
3631
3632         Address ESLint warnings in modern-media-controls
3633         https://bugs.webkit.org/show_bug.cgi?id=168224
3634
3635         Reviewed by Alexey Proskuryakov.
3636
3637         * Modules/modern-media-controls/controls/controls-bar.js:
3638         * Modules/modern-media-controls/controls/fullscreen-button.js:
3639         * Modules/modern-media-controls/controls/layout-node.js:
3640         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
3641         * Modules/modern-media-controls/controls/media-controls.js:
3642         * Modules/modern-media-controls/controls/scheduler.js:
3643         * Modules/modern-media-controls/controls/seek-button.js:
3644         * Modules/modern-media-controls/controls/tracks-panel.js:
3645         * Modules/modern-media-controls/controls/volume-slider.js:
3646         * Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js:
3647         * Modules/modern-media-controls/gesture-recognizers/pinch.js:
3648         * Modules/modern-media-controls/media/fullscreen-support.js:
3649         * Modules/modern-media-controls/media/media-controller.js:
3650         * Modules/modern-media-controls/media/placard-support.js:
3651         * Modules/modern-media-controls/media/status-support.js:
3652         Address pedantic warnings.
3653
3654 2017-02-13  Dan Bernstein  <mitz@apple.com>
3655
3656         Restored changes from r212210 in a way that does not break the build.
3657
3658         * platform/spi/mac/TUCallSPI.h:
3659
3660 2017-02-13  Zalan Bujtas  <zalan@apple.com>
3661
3662         FontCascade::widthForSimpleText should skip applyTransforms() when kerning and ligatures are off.
3663         https://bugs.webkit.org/show_bug.cgi?id=168251
3664         <rdar://problem/30498102>
3665
3666         Reviewed by Antti Koivisto.
3667
3668         Covered by existing (perf)tests.
3669
3670         * platform/graphics/FontCascade.cpp:
3671         (WebCore::FontCascade::widthForSimpleText):
3672
3673 2017-02-12  Brian Burg  <bburg@apple.com>
3674
3675         Web Inspector: expose system user interface layout direction through InspectorFrontendHost
3676         https://bugs.webkit.org/show_bug.cgi?id=168209
3677         <rdar://problem/11573736>
3678
3679         Reviewed by Joseph Pecoraro.
3680
3681         Forward the UserInterfaceLayoutDirection of the inspector page. If the WebKit client has
3682         properly set the UI directionality from system settings in PageClient, this will get inherited
3683         automatically by the Inspector's WebPage instance.
3684
3685         * inspector/InspectorFrontendClient.h:
3686         * inspector/InspectorFrontendClientLocal.cpp:
3687         (WebCore::InspectorFrontendClientLocal::userInterfaceLayoutDirection):
3688         * inspector/InspectorFrontendClientLocal.h:
3689
3690         * inspector/InspectorFrontendHost.h:
3691         * inspector/InspectorFrontendHost.idl:
3692         * inspector/InspectorFrontendHost.cpp:
3693         (WebCore::InspectorFrontendHost::userInterfaceLayoutDirection):
3694         Expose the directionality to the frontend as "ltr" or "rtl" strings.
3695
3696 2017-02-13  Zalan Bujtas  <zalan@apple.com>
3697
3698         Simple line layout: Do not measure runs with trailing whitespace when kerning and ligatures are off.
3699         https://bugs.webkit.org/show_bug.cgi?id=168247
3700         <rdar://problem/30497288>
3701
3702         Reviewed by Antti Koivisto.
3703
3704         The width of the run is supposed to be the same with or without the trailing whitespace.
3705
3706         Covered by performance test.
3707
3708         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
3709         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
3710         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
3711         * rendering/SimpleLineLayoutTextFragmentIterator.h:
3712
3713 2017-02-13  Karim H  <karim@karhm.com>
3714
3715         Added the other missing BSTR roles tag names.
3716         https://bugs.webkit.org/show_bug.cgi?id=165545
3717
3718         Reviewed by Chris Fleizach.
3719
3720         Test: accessibility/win/bstr-elements-role.html
3721
3722         * accessibility/AccessibilityRenderObject.cpp:
3723         (WebCore::shouldReturnTagNameAsRoleForMSAA):
3724
3725 2017-02-13  Youenn Fablet  <youennf@gmail.com>
3726
3727         [WebRTC] Creating RTCPeerConnection with libwebrtc backend is crashing on rwt
3728         https://bugs.webkit.org/show_bug.cgi?id=168250
3729
3730         Reviewed by Alex Christensen.
3731
3732         Covered by webrtc tests in LayoutTests and in web-platform-tests.
3733         Making mock peer connection factory keep a ref of the real libwebrtc peer connection factory.
3734         That way, it can create real libwebrtc backends whenever requested by tests.
3735
3736         Moving LibWebRTCUtils.h routines as static LibWebRTCProvider methods.
3737         In the future, we should make them no longer static.
3738
3739         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3740         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
3741         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
3742         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3743         * WebCore.xcodeproj/project.pbxproj:
3744         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCUtils.cpp.
3745         (WebCore::LibWebRTCProvider::callOnWebRTCNetworkThread):
3746         (WebCore::LibWebRTCProvider::callOnWebRTCSignalingThread):
3747         (WebCore::LibWebRTCProvider::factory):
3748         (WebCore::LibWebRTCProvider::setPeerConnectionFactory):
3749         (WebCore::createActualPeerConnection):
3750         (WebCore::LibWebRTCProvider::createPeerConnection):
3751         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3752         * platform/mediastream/libwebrtc/LibWebRTCUtils.h: Removed.
3753         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
3754         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
3755         * testing/Internals.cpp:
3756         * testing/MockLibWebRTCPeerConnection.cpp:
3757         (WebCore::useMockRTCPeerConnectionFactory):
3758         (WebCore::MockLibWebRTCPeerConnectionForIceCandidates::gotLocalDescription):
3759         (WebCore::releaseInNetworkThread):
3760         (WebCore::MockLibWebRTCPeerConnection::SetLocalDescription):
3761         (WebCore::MockLibWebRTCPeerConnection::SetRemoteDescription):
3762         (WebCore::MockLibWebRTCPeerConnection::CreateOffer):
3763         (WebCore::MockLibWebRTCPeerConnection::CreateAnswer):
3764
3765 2017-02-13  Anders Carlsson  <andersca@apple.com>
3766
3767         Simplify DragController::startDrag
3768         https://bugs.webkit.org/show_bug.cgi?id=168240
3769
3770         Reviewed by Tim Horton.
3771
3772         Use early returns instead of assigning to a variable that's returned at the end of the function.
3773
3774         * page/DragController.cpp:
3775         (WebCore::DragController::startDrag):
3776
3777 2017-02-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
3778
3779         The current frame of an image should not deleted if another frame is asynchronously being decoded
3780         https://bugs.webkit.org/show_bug.cgi?id=167618
3781
3782         Reviewed by Simon Fraser.
3783
3784         Test: fast/images/animated-image-draw-while-decode.html
3785
3786         If the memory cache asks the BitmapImage to destroy all its frames while
3787         the next frame is being decoded, a thread contention may happen. This can
3788         happen when BitmapImage::draw() is called and the next frame is not ready
3789         yet for drawing, so the current frame has to be drawn. This will invoke
3790         a frame decoding in the same image from the drawing committing thread.
3791
3792         We can avoid that by destroying all the frames except the current frame if
3793         the image is asynchronously decoding its frames. This should not add extra
3794         memory overhead because building the image frame cache and then destroying
3795         it, when needed, is an on-going process. The frames will be allocated and
3796         decoded all the time and all of them can be destroyed except the current one.
3797         
3798         * platform/graphics/BitmapImage.cpp:
3799         (WebCore::BitmapImage::destroyDecodedData):
3800         (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
3801         The logic of destroying the ImageFrames was split among BitmapImage, ImageSource
3802         and ImageFrameCache. Move all the logic to BitmapImage and have ImageFrameCache
3803         be responsible only for destroying a range of ImageFrames.
3804
3805         (WebCore::BitmapImage::draw): add an ASSERT_IMPLIES to ensure the current frame
3806         is ready to be rendered if the next frame is being decoded.
3807         
3808         * platform/graphics/BitmapImage.h: Move a const from ImageFrameCache.h to BitmapImage.h.
3809
3810         * platform/graphics/ImageFrameCache.cpp:
3811         (WebCore::ImageFrameCache::destroyDecodedData):
3812         (WebCore::ImageFrameCache::destroyDecodedDataIfNecessary): Deleted.
3813         * platform/graphics/ImageFrameCache.h:
3814         (WebCore::ImageFrameCache::destroyAllDecodedData):
3815         (WebCore::ImageFrameCache::destroyAllDecodedDataExcludeFrame):
3816         (WebCore::ImageFrameCache::destroyDecodedDataBeforeFrame):
3817         Make ImageFrameCache be responsible for destroying a range of ImageFrames.
3818         This range might include all the frames, all the frames but up to a specific
3819         frame, or all the frames but exclude one frame in the middle.
3820         
3821         * platform/graphics/ImageSource.cpp:
3822         (WebCore::ImageSource::clear): No need to call clearFrameBufferCache() from clear().
3823         The decision to call clearFrameBufferCache() or clear() is moved to
3824         BitmapImage::destroyDecodedData().
3825          
3826         (WebCore::ImageSource::destroyDecodedData): Deleted.
3827         (WebCore::ImageSource::destroyDecodedDataIfNecessary): Deleted.
3828         These functions are replaced by another set of functions in ImageSource.h.
3829         
3830         * platform/graphics/ImageSource.h:
3831         (WebCore::ImageSource::destroyAllDecodedData):
3832         (WebCore::ImageSource::destroyAllDecodedDataExcludeFrame):
3833         (WebCore::ImageSource::destroyDecodedDataBeforeFrame):
3834         (WebCore::ImageSource::hasDecodingQueue):
3835         These are new wrappers which call the corresponding ImageFrameCache functions.
3836
3837 2017-02-13  Myles C. Maxfield  <mmaxfield@apple.com>
3838
3839         [Cocoa] Stop soft-linking CTRunGetBaseAdvancesAndOrigins()
3840         https://bugs.webkit.org/show_bug.cgi?id=168256
3841
3842         Reviewed by Alex Christensen.
3843
3844         Use of this function is already behind a platform guard.
3845
3846         No new tests because there is no behavior change.
3847
3848         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
3849         (SOFT_LINK): Deleted.
3850
3851 2017-02-13  Jiewen Tan  <jiewen_tan@apple.com>
3852
3853         [WebCrypto] WebInspector should indicate webkitSubtle is deprecated
3854         https://bugs.webkit.org/show_bug.cgi?id=165913
3855         <rdar://problem/30477222>
3856
3857         Reviewed by Joseph Pecoraro.
3858
3859         Covered by existing tests.
3860
3861         * page/Crypto.cpp:
3862         (WebCore::Crypto::webkitSubtle):
3863
3864 2017-02-13  Simon Fraser  <simon.fraser@apple.com>
3865
3866         Call WKDestroyRenderingResources() on iOS when tabs are backgrounded
3867         https://bugs.webkit.org/show_bug.cgi?id=168261
3868         rdar://problem/30481079
3869
3870         Reviewed by Tim Horton.
3871
3872         Add CABackingStoreCollectBlocking() to QuartzCoreSPI.h, and fix files in WebCore
3873         that do a framework include.
3874
3875         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
3876         * platform/graphics/cocoa/WebActionDisablingCALayerDelegate.h:
3877         * platform/spi/cocoa/QuartzCoreSPI.h:
3878         * platform/spi/mac/NSViewSPI.h:
3879
3880 2017-02-13  Youenn Fablet  <youenn@apple.com>
3881
3882         ASSERTION FAILED: !m_bodyLoader
3883         https://bugs.webkit.org/show_bug.cgi?id=166986
3884
3885         Reviewed by Sam Weinig.
3886
3887         Refactoring to make the unset/set pending activity part of body loader.
3888         This allows ensuring to not forget to do that by simply deleting the body loader.
3889
3890         * Modules/fetch/FetchResponse.cpp:
3891         (WebCore::FetchResponse::fetch):
3892         (WebCore::FetchResponse::BodyLoader::didSucceed):
3893         (WebCore::FetchResponse::BodyLoader::didFail):
3894         (WebCore::FetchResponse::BodyLoader::BodyLoader):
3895         (WebCore::FetchResponse::BodyLoader::~BodyLoader):
3896         (WebCore::FetchResponse::stop):
3897         * Modules/fetch/FetchResponse.h:
3898
3899 2017-02-13  Aakash Jain  <aakash_jain@apple.com>
3900
3901         Remove unused WebCoreThreadSafe.h
3902         https://bugs.webkit.org/show_bug.cgi?id=168236
3903
3904         Reviewed by Dan Bernstein.
3905
3906         * platform/ios/wak/WebCoreThreadSafe.h: Removed.
3907         * WebCore.xcodeproj/project.pbxproj: Removed WebCoreThreadSafe.h
3908         * platform/ios/wak/WebCoreThread.mm: Removed WebCoreThreadSafe.h and included WAKWindow.h directly
3909
3910 2017-02-13  Anders Carlsson  <andersca@apple.com>
3911
3912         Fix iOS build.
3913
3914         * platform/ios/DragImageIOS.mm:
3915         (WebCore::deleteDragImage):
3916
3917 2017-02-13  Sam Weinig  <sam@webkit.org>
3918
3919         Rename MediaQueryExp.h/cpp to MediaQueryExpression.h/cpp
3920         https://bugs.webkit.org/show_bug.cgi?id=168249
3921
3922         Reviewed by Dean Jackson.
3923
3924         Fix a FIXME and rename MediaQueryExp.h/cpp to match the class it contains, MediaQueryExpression.
3925
3926         * CMakeLists.txt:
3927         * WebCore.xcodeproj/project.pbxproj:
3928         * css/CSSAllInOne.cpp:
3929         * css/MediaQuery.h:
3930         * css/MediaQueryEvaluator.h:
3931         * css/MediaQueryExp.cpp: Removed.
3932         * css/MediaQueryExp.h: Removed.
3933         * css/MediaQueryExpression.cpp: Copied from Source/WebCore/css/MediaQueryExp.cpp.
3934         * css/MediaQueryExpression.h: Copied from Source/WebCore/css/MediaQueryExp.h.
3935         * css/parser/MediaQueryParser.h:
3936
3937 2017-02-13  Aakash Jain  <aakash_jain@apple.com>
3938
3939         WAKResponder should be exported from WebCore
3940         https://bugs.webkit.org/show_bug.cgi?id=168245
3941
3942         Reviewed by Dan Bernstein.
3943
3944         * platform/ios/wak/WAKResponder.h:
3945
3946 2017-02-13  Simon Fraser  <simon.fraser@apple.com>
3947
3948         Log to the History Channel in a few more places
3949         https://bugs.webkit.org/show_bug.cgi?id=168252
3950
3951         Reviewed by Brady Eidson.
3952
3953         *** Aliens ***
3954
3955         * loader/HistoryController.cpp:
3956         (WebCore::HistoryController::restoreScrollPositionAndViewState):
3957         (WebCore::HistoryController::updateForReload):
3958         * loader/NavigationScheduler.cpp:
3959         (WebCore::NavigationScheduler::scheduleHistoryNavigation):
3960         (WebCore::NavigationScheduler::timerFired):
3961         (WebCore::NavigationScheduler::cancel):
3962         * page/History.cpp:
3963         (WebCore::History::go):
3964
3965 2017-02-13  Alex Christensen  <achristensen@webkit.org>
3966
3967         Percent should be allowed in non-special URL hosts
3968         https://bugs.webkit.org/show_bug.cgi?id=168255
3969
3970         Reviewed by Tim Horton.
3971
3972         In the last few weeks, the spec has consolidated its sets of code points.
3973         Now forbidden host code points replace the old invalid host code points with
3974         the modification that percents are allowed in non-special hosts because we
3975         percent-encode non-ascii code points in non-special hosts.
3976         See https://url.spec.whatwg.org/#concept-opaque-host-parser