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