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