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