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