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