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