bb8f044b99e436b67ee0605446e916b181720cb8
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-07-03  Daewoong Jang  <daewoong.jang@navercorp.com>
2
3         [Curl] Fix compilation errors
4         https://bugs.webkit.org/show_bug.cgi?id=174085
5
6         Reviewed by Alex Christensen.
7
8         * platform/network/curl/CurlContext.cpp:
9         (WebCore::CurlContext::initCookieSession):
10         * platform/network/curl/CurlContext.h:
11
12 2017-07-03  Youenn Fablet  <youenn@apple.com>
13
14         WebAudioSourceProviderAVFObjC should not reconfigure for each data call
15         https://bugs.webkit.org/show_bug.cgi?id=174101
16
17         Reviewed by Eric Carlson.
18
19         Covered by manual testing, in particular
20         https://webrtc.github.io/samples/src/content/peerconnection/webaudio-output/
21         and https://webrtc.github.io/samples/src/content/getusermedia/volume/.
22         Also improved LayoutTests web audio peer connection tests to make them more robust.
23
24         Before the patch, reconfiguration of the web audio provider was happening for every audioSamplesAvailable call.
25         It is now happening only when the format of the audio samples is changing.
26         Changed some member fields from uinque_ptr to optional as a minor improvement.
27
28         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
29         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
30         (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
31         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
32         (WebCore::WebAudioSourceProviderAVFObjC::unprepare):
33         (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
34
35 2017-06-30  Alex Christensen  <achristensen@webkit.org>
36
37         Stop using dispatch_async in ResourceHandleCFURLConnectionDelegateWithOperationQueue
38         https://bugs.webkit.org/show_bug.cgi?id=174059
39
40         Reviewed by Andy Estes.
41
42         Use dispatch_async_f and callOnMainThread instead.
43         No change in behavior.
44         This will allow me to use this code on Windows.
45
46         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
47         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
48         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
49         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
50         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
51         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFail):
52         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
53         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveChallenge):
54         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didSendBodyData):
55         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
56
57 2017-07-03  Andy Estes  <aestes@apple.com>
58
59         [Xcode] Add an experimental setting to build with ccache
60         https://bugs.webkit.org/show_bug.cgi?id=173875
61
62         Reviewed by Tim Horton.
63
64         * Configurations/DebugRelease.xcconfig: Included ccache.xcconfig.
65
66 2017-07-02  Ryosuke Niwa  <rniwa@webkit.org>
67
68         REGRESSION(r218910): Crash inside textMarkerDataForFirstPositionInTextControl
69         https://bugs.webkit.org/show_bug.cgi?id=174077
70         <rdar://problem/33083972>
71
72         Reviewed by Chris Fleizach.
73
74         The bug was caused by textMarkerDataForFirstPositionInTextControl assuming that
75         there is always a root editable element (a.k.a. editing host) in the text control.
76         When the text control is readonly or disabled, this is not the case.
77
78         Fixed the bug by adding an early exit when there is no editing host.
79
80         Test: accessibility/mac/input-type-change-crash.html
81
82         * accessibility/AXObjectCache.cpp:
83         (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
84
85 2017-07-03  Devin Rousso  <drousso@apple.com>
86
87         Web Inspector: Support listing WebGL2 and WebGPU contexts
88         https://bugs.webkit.org/show_bug.cgi?id=173396
89
90         Reviewed by Joseph Pecoraro.
91
92         Tests: inspector/canvas/create-context-2d.html
93                inspector/canvas/create-context-webgl.html
94                inspector/canvas/create-context-webgl2.html
95                inspector/canvas/create-context-webgpu.html
96
97         Split "inspector/canvas/create-canvas-contexts.html" into a test for each context type.
98
99         * html/HTMLCanvasElement.cpp:
100         (WebCore::HTMLCanvasElement::getContextWebGPU):
101         * inspector/InspectorCanvasAgent.cpp:
102         (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
103
104 2017-07-03  Alex Christensen  <achristensen@webkit.org>
105
106         REGRESSION(r215096) Queries of URLs with non-special schemes should not percent-encode single quotes
107         https://bugs.webkit.org/show_bug.cgi?id=174051
108
109         Reviewed by Tim Horton.
110
111         In r215096 I added ' to the set of characters to be percent-encoded in queries,
112         but for interoperability and compatibility we need to do this only for special schemes, like http.
113
114         Covered by new API tests.
115
116         * platform/URLParser.cpp:
117         (WebCore::isC0Control):
118         (WebCore::shouldPercentEncodeQueryByte):
119         (WebCore::URLParser::utf8QueryEncode):
120         (WebCore::URLParser::encodeQuery):
121
122 2017-07-03  Chris Fleizach  <cfleizach@apple.com>
123
124         AX: role="none" (or presentation) does not work on iframes
125         https://bugs.webkit.org/show_bug.cgi?id=173930
126         <rdar://problem/33034347>
127
128         Reviewed by Ryosuke Niwa.
129
130         Support setting a presentational role on an iframe so that the AXWebArea disappears from the hierarchy.
131         Accomplish this by adding children for attachment and scroll view elements the way other children are added.
132         That is, only add the non-ignored children directly (which means move the addChild logic into AccessibilityObject.)
133
134         Test: accessibility/presentation-role-iframe.html
135
136         * accessibility/AccessibilityNodeObject.cpp:
137         (WebCore::AccessibilityNodeObject::AccessibilityNodeObject):
138         (WebCore::AccessibilityNodeObject::insertChild): Deleted.
139         (WebCore::AccessibilityNodeObject::addChild): Deleted.
140         * accessibility/AccessibilityNodeObject.h:
141         * accessibility/AccessibilityObject.cpp:
142         (WebCore::AccessibilityObject::AccessibilityObject):
143         (WebCore::AccessibilityObject::insertChild):
144         (WebCore::AccessibilityObject::addChild):
145         (WebCore::nodeHasPresentationRole):
146         * accessibility/AccessibilityObject.h:
147         (WebCore::AccessibilityObject::addChild): Deleted.
148         (WebCore::AccessibilityObject::insertChild): Deleted.
149         * accessibility/AccessibilityRenderObject.cpp:
150         (WebCore::webAreaIsPresentational):
151         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
152         (WebCore::AccessibilityRenderObject::addAttachmentChildren):
153         * accessibility/AccessibilityScrollView.cpp:
154         (WebCore::AccessibilityScrollView::addChildren):
155
156 2017-07-03  Matt Lewis  <jlewis3@apple.com>
157
158         Unreviewed, rolling out r219024.
159
160         This patch cause 3 didferent test to fail.
161
162         Reverted changeset:
163
164         "REGRESSION(r215096) Queries of URLs with non-special schemes
165         should not percent-encode single quotes"
166         https://bugs.webkit.org/show_bug.cgi?id=174051
167         http://trac.webkit.org/changeset/219024
168
169 2017-07-03  Wenson Hsieh  <wenson_hsieh@apple.com>
170
171         Pasting single words copied to UIPasteboard inserts URLs in editable areas
172         https://bugs.webkit.org/show_bug.cgi?id=174082
173         <rdar://problem/33046992>
174
175         Reviewed by Tim Horton.
176
177         Currently, our heuristics for coercing plain text to URLs when reading URLs off of the UIPasteboard allows URLs
178         to be created as long as -[UIPasteboard valuesForPasteboardType:inItemSet:] returns a non-null NSURL. However,
179         UIPasteboard automatically coerces any NSString into an NSURL if it initializes an NSURL via +URLWithString:.
180         Thus, single-word strings such as "hello" that are written to the pasteboard as "public.utf8-plain-text" can
181         be read back as NSURLs for "public.url". This currently causes bugs in shipping software: e.g. copying and
182         pasting a single word from an editable input or textarea and pasting into a rich contenteditable area using
183         WebKit1 inserts a link. However, when combined with another change in WebKit that attempts to read "public.url"
184         before "public.text" when reading plain text from the pasteboard, this now also affects pasting in plain text
185         areas, where pasted plain-text strings that are not URLs will paste as URL-encoded strings anyways (for
186         instance, replacing "[hello]" with "%5Bhello%5D").
187
188         To fix this, and existing issues with pasting single words in contenteditables, we make
189         PlatformPasteboard::readString and PlatformPasteboard::readURL only accept a coerced NSURL as an URL if it also
190         parses as a valid URL in WebKit (otherwise, we return an empty string).
191
192         Tests:
193             UIPasteboardTests.DoNotPastePlainTextAsURL
194             UIPasteboardTests.PastePlainTextAsURL
195             UIPasteboardTests.PasteURLWithPlainTextAsURL
196
197         * platform/PlatformPasteboard.h:
198         * platform/ios/AbstractPasteboard.h:
199         * platform/ios/PlatformPasteboardIOS.mm:
200         (WebCore::PlatformPasteboard::allowReadingURLAtIndex):
201
202         Allow an URL to be read if either (1) an URL was explicitly specified in the UIPasteboard, or (2) the "proposed"
203         URL returned from -valuesForPasteboardType: is valid.
204
205         (WebCore::PlatformPasteboard::readString):
206         (WebCore::PlatformPasteboard::readURL):
207
208         Consult allowReadingURLAtIndex here (in the case of ::readString, only if the given pasteboard type is
209         "public.url").
210
211         * platform/ios/WebItemProviderPasteboard.h:
212         * platform/ios/WebItemProviderPasteboard.mm:
213         (-[WebItemProviderPasteboard itemProviders]):
214         (-[WebItemProviderPasteboard setItemProviders:]):
215
216 2017-07-03  Zan Dobersek  <zdobersek@igalia.com>
217
218         [GCrypt] Implement CryptoKeyEC SPKI exports
219         https://bugs.webkit.org/show_bug.cgi?id=173646
220
221         Reviewed by Jiewen Tan.
222
223         No new tests -- affected tests are now passing and are unskipped.
224
225         Implement libgcrypt-based support for SPKI exports of EC keys.
226
227         Initially, the ECParameters structure is created so that it will be later embedded
228         into the SubjectPublicKeyInfo structure. First the root element of this structure
229         is written into, specifying namedCurve as the chosen member (even if other choices
230         are not really available). We then write out the object identifier into this
231         namedCurve member that properly represents this key's curve type.
232
233         The SubjectPublicKeyInfo structure is created next. We write out id-ecPublicKey
234         identifier as the chosen algorithm identifier. Web Crypto specification demands
235         that the id-ecDH identifier is used in case of ECDH keys, but no existing test in
236         the W3C test suite expects this, so this should be revisited later. Data of the
237         previously-constructed ECParameters structure is written out into the
238         AlgorithmIdentifier's parameters member.
239
240         The `q` MPI data is then retrieved. Its size is validated, as well as the first
241         byte of data in order to ensure the MPI represents an uncompressed EC point.
242         The data is then written into the subjectPublicKey member.
243
244         Finally the encoded SubjectPublicKeyInfo structure data is extracted and returned
245         from the platformExportSpki() function, completion the export operation.
246
247         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
248         (WebCore::curveIdentifier):
249         (WebCore::CryptoKeyEC::platformExportSpki):
250
251 2017-07-02  Sam Weinig  <sam@webkit.org>
252
253         [WebIDL] Remove special casing for RegExp which is no longer required by the spec
254         https://bugs.webkit.org/show_bug.cgi?id=174025
255
256         Reviewed by Chris Dumez.
257
258         * bindings/scripts/CodeGeneratorJS.pm:
259         (GenerateDictionaryImplementationContent):
260         (GenerateOverloadDispatcher):
261         Remove special casing.
262
263         * bindings/scripts/IDLParser.pm:
264         (parseNonAnyType):
265         Remove parsing of RegExp.
266
267         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
268         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
269         * bindings/scripts/test/JS/JSTestObj.cpp:
270         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
271         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
272         Update test results.
273
274 2017-07-02  Youenn Fablet  <youenn@apple.com>
275
276         RealtimeOutgoingVideoSource should pass frame timestamp
277         https://bugs.webkit.org/show_bug.cgi?id=174055
278
279         Reviewed by Eric Carlson.
280
281         Covered by manual testing since this only affects video encoding quality.
282
283         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
284         (WebCore::RealtimeOutgoingVideoSource::sendFrame):
285
286 2017-07-01  Dan Bernstein  <mitz@apple.com>
287
288         <rdar://problem/33096441> r219055 broke non-iOS builds.
289
290         * platform/graphics/cocoa/FontCacheCoreText.cpp:
291         (WebCore::lookupFallbackFont):
292
293 2017-07-01  Dan Bernstein  <mitz@apple.com>
294
295         [iOS] Remove code only needed when building for iOS 9.x
296         https://bugs.webkit.org/show_bug.cgi?id=174068
297
298         Reviewed by Tim Horton.
299
300         * Configurations/FeatureDefines.xcconfig:
301         * editing/cocoa/DataDetection.mm:
302         (WebCore::DataDetection::isDataDetectorLink):
303         (WebCore::DataDetection::shouldCancelDefaultAction):
304         (WebCore::constructURLStringForResult):
305         (WebCore::DataDetection::detectContentInRange):
306         * page/cocoa/ResourceUsageThreadCocoa.mm:
307         (WebCore::vmPageSize):
308         * platform/cocoa/DataDetectorsCoreSoftLink.h:
309         * platform/cocoa/DataDetectorsCoreSoftLink.mm:
310         * platform/graphics/FontPlatformData.cpp:
311         * platform/graphics/FontPlatformData.h:
312         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
313         (layerContentsFormat):
314         (PlatformCALayerCocoa::updateContentsFormat):
315         (PlatformCALayerCocoa::backingStoreBytesPerPixel):
316         * platform/graphics/cg/GraphicsContextCG.cpp:
317         (WebCore::extendedSRGBColorSpaceRef):
318         * platform/graphics/cg/PDFDocumentImage.cpp:
319         (WebCore::PDFDocumentImage::drawPDFPage):
320         * platform/graphics/cocoa/FontCacheCoreText.cpp:
321         (WebCore::lookupFallbackFont):
322         * platform/graphics/cocoa/FontCocoa.mm:
323         (WebCore::Font::variantCapsSupportsCharacterForSynthesis):
324         (WebCore::Font::platformWidthForGlyph):
325         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
326         (WebCore::FontPlatformData::FontPlatformData):
327         (WebCore::FontPlatformData::ctFont):
328         * platform/graphics/cocoa/IOSurface.mm:
329         (WebCore::IOSurface::sinkIntoImage):
330         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
331         (WebCore::WebCoreDecompressionSession::setTimebase):
332         * platform/graphics/ios/FontCacheIOS.mm:
333         (WebCore::systemFontModificationAttributes):
334         (WebCore::systemFontDescriptor):
335         * platform/graphics/mac/FontCustomPlatformData.cpp:
336         (WebCore::FontCustomPlatformData::supportsFormat):
337         * platform/ios/LegacyTileGridTile.mm:
338         (WebCore::LegacyTileGridTile::LegacyTileGridTile):
339         * platform/ios/PlatformScreenIOS.mm:
340         (WebCore::screenSupportsExtendedColor):
341         * platform/ios/RemoteCommandListenerIOS.mm:
342         (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
343         (WebCore::RemoteCommandListenerIOS::~RemoteCommandListenerIOS):
344         (WebCore::RemoteCommandListenerIOS::updateSupportedCommands):
345         * platform/spi/cf/CFNetworkSPI.h:
346         * platform/spi/cg/CoreGraphicsSPI.h:
347         * platform/spi/cocoa/DataDetectorsCoreSPI.h:
348         * platform/spi/cocoa/QuartzCoreSPI.h:
349         * platform/spi/mac/AVFoundationSPI.h:
350
351 2017-07-01  Myles C. Maxfield  <mmaxfield@apple.com>
352
353         REGRESSION(r218371): Reeder's default font is Times instead of San Francisco
354         https://bugs.webkit.org/show_bug.cgi?id=173617
355         <rdar://problem/32969819>
356
357         Reviewed by Simon Fraser.
358
359         On systems where USE_PLATFORM_SYSTEM_FALLBACK_LIST is set to true, the code in
360         platformFontWithFamilySpecialCase() is still used when @font-face blocks specify
361         src:local(system-ui), which made the assertion erroneously fire.
362
363         Unfortunately, our architecture is such that an @font-face block represents a
364         single entry in the font-family fallback list, which means it would be quite
365         difficult to make local(system-ui) in an @font-face block expand at the level
366         of the font cascade. So, this patch simply reverts to the previous behavior for
367         local(system-ui) (which doesn't include the entire Core Text cascade list).
368         This means that "font-family: system-ui" and "src: local(system-ui)" have
369         different behavior, which is undesirable, but architecturally difficult to
370         solve. I've added some FIXMEs to the code in the relevant places and filed
371         https://bugs.webkit.org/show_bug.cgi?id=174023.
372
373         Test: fast/text/font-face-local-system.html
374
375         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
376         (WebCore::FontCascadeDescription::effectiveFamilyAt):
377         * platform/graphics/ios/FontCacheIOS.mm:
378         (WebCore::systemFontDescriptor):
379         (WebCore::platformFontWithFamilySpecialCase):
380         * platform/graphics/mac/FontCacheMac.mm:
381         (WebCore::platformFontWithFamilySpecialCase):
382
383 2017-07-01  Ryosuke Niwa  <rniwa@webkit.org>
384
385         Frame.h doesn't need to include FrameLoader.h, IntRect.h, and NavigationScheduler.h
386         https://bugs.webkit.org/show_bug.cgi?id=174004
387
388         Reviewed by Simon Fraser.
389
390         Made FrameLoader and NavigationScheduler UniqueRef in Frame so that we can forward declare them,
391         and forward declared IntPoint and IntRect to avoid including FrameLoader.h, IntRect.h,
392         and NavigationScheduler.h in Frame.h
393
394         * Modules/mediastream/MediaStream.cpp:
395         * Modules/webaudio/AudioContext.cpp:
396         * Modules/websockets/WebSocket.cpp:
397         (WebCore::WebSocket::connect): Avoid calling loader().mixedContentChecker().canRunInsecureContent(~)
398         on a nullptr even though this used to work because we weren't de-referencing it.
399         * bindings/js/ScriptController.cpp:
400         * dom/Document.cpp:
401         * dom/EventDispatcher.cpp:
402         * editing/Editor.cpp:
403         * editing/cocoa/EditorCocoa.mm:
404         * editing/ios/EditorIOS.mm:
405         * editing/mac/EditorMac.mm:
406         * history/CachedPage.cpp:
407         * html/HTMLObjectElement.cpp:
408         * html/parser/HTMLDocumentParser.cpp:
409         (WebCore::DocumentLoader::~DocumentLoader): Check !isLoading() before accessing frameLoader to avoid
410         accessing m_frame->loader() inside ~FrameLoader.
411         * html/parser/XSSAuditor.cpp:
412         * html/parser/XSSAuditorDelegate.cpp:
413         * inspector/InspectorInstrumentation.h:
414         * loader/CrossOriginPreflightChecker.cpp:
415         * loader/FrameLoader.cpp:
416         (WebCore::FrameLoader::setOpener): Avoid accessing this FrameLoader via m_opener->loader() when it's
417         this FrameLoader inside ~FrameLoader since UniqueRef<FrameLoader> is clears itself before calling
418         the destructor of FrameLoader.
419         * loader/ImageLoader.cpp:
420         * loader/LinkLoader.cpp:
421         * loader/SubframeLoader.cpp:
422         * loader/appcache/ApplicationCacheGroup.cpp:
423         * loader/appcache/DOMApplicationCache.cpp:
424         * mathml/MathMLElement.cpp:
425         * page/DOMWindow.cpp:
426         * page/Frame.cpp:
427         (WebCore::Frame::Frame):
428         (WebCore::Frame::init): Moved here from Frame.h
429         (WebCore::Frame::setDocument):
430         * page/Frame.h:
431         (WebCore::Frame::loader):
432         (WebCore::Frame::navigationScheduler):
433         * page/History.cpp:
434         * page/Location.cpp:
435         * page/PerformanceLogging.cpp:
436         * page/PerformanceNavigation.cpp:
437         * page/UserContentProvider.cpp:
438         * page/ios/FrameIOS.mm:
439         (WebCore::Frame::initWithSimpleHTMLDocument):
440         * plugins/PluginInfoProvider.cpp:
441         * replay/ReplayInputCreationMethods.cpp:
442         * replay/UserInputBridge.cpp:
443         * xml/XSLTProcessorLibxslt.cpp:
444         * xml/parser/XMLDocumentParserLibxml2.cpp:
445
446 2017-07-01  Dan Bernstein  <mitz@apple.com>
447
448         [macOS] Remove code only needed when building for OS X Yosemite
449         https://bugs.webkit.org/show_bug.cgi?id=174067
450
451         Reviewed by Tim Horton.
452
453         * Configurations/Base.xcconfig:
454         * Configurations/DebugRelease.xcconfig:
455         * Configurations/FeatureDefines.xcconfig:
456         * Configurations/Version.xcconfig:
457         * accessibility/AXObjectCache.cpp:
458         (WebCore::AXObjectCache::setEnhancedUserInterfaceAccessibility):
459         * html/HTMLCanvasElement.cpp:
460         * page/WheelEventDeltaFilter.cpp:
461         (WebCore::WheelEventDeltaFilter::create):
462         * page/mac/WheelEventDeltaFilterMac.h:
463         * page/mac/WheelEventDeltaFilterMac.mm:
464         * page/scrolling/ScrollingMomentumCalculator.cpp:
465         * page/scrolling/mac/ScrollingMomentumCalculatorMac.h:
466         * page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
467         * platform/cocoa/NetworkExtensionContentFilter.mm:
468         (replacementDataFromDecisionInfo):
469         (WebCore::NetworkExtensionContentFilter::initialize):
470         (WebCore::NetworkExtensionContentFilter::willSendRequest):
471         (WebCore::NetworkExtensionContentFilter::responseReceived):
472         (WebCore::NetworkExtensionContentFilter::addData):
473         (WebCore::NetworkExtensionContentFilter::finishedAddingData):
474         (WebCore::NetworkExtensionContentFilter::unblockHandler):
475         * platform/graphics/ComplexTextController.h:
476         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
477         (PlatformCAAnimationCocoa::setTimingFunction):
478         * platform/graphics/cocoa/FontCacheCoreText.cpp:
479         (WebCore::FontCache::platformAlternateFamilyName):
480         * platform/graphics/cocoa/FontCocoa.mm:
481         (WebCore::Font::platformInit):
482         * platform/graphics/cocoa/IOSurface.mm:
483         (WebCore::IOSurface::sinkIntoImage):
484         * platform/graphics/cocoa/WebGPULayer.mm:
485         (-[WebGPULayer initWithGPUDevice:]):
486         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
487         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun):
488         * platform/graphics/mac/WebGLLayer.mm:
489         (-[WebGLLayer initWithGraphicsContext3D:]):
490         * platform/mac/BlacklistUpdater.mm:
491         * platform/mac/PlatformScreenMac.mm:
492         (WebCore::screenSupportsExtendedColor):
493         * platform/mac/ValidationBubbleMac.mm:
494         (WebCore::ValidationBubble::ValidationBubble):
495         * platform/mac/WebGLBlacklist.mm:
496         (WebCore::WebGLBlacklist::create):
497         * platform/network/cocoa/WebCoreNSURLSession.h:
498         * platform/network/cocoa/WebCoreNSURLSession.mm:
499         * platform/network/mac/CertificateInfoMac.mm:
500         (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate):
501         * platform/network/mac/CookieJarMac.mm:
502         (WebCore::setCookiesFromDOM):
503         * platform/spi/cf/CFNetworkSPI.h:
504         * platform/spi/cg/CoreGraphicsSPI.h:
505         * platform/spi/cocoa/NEFilterSourceSPI.h:
506         * platform/spi/cocoa/NSURLConnectionSPI.h:
507         * platform/spi/cocoa/QuartzCoreSPI.h:
508         * platform/spi/mac/NSScrollingInputFilterSPI.h:
509         * platform/spi/mac/NSScrollingMomentumCalculatorSPI.h:
510         * platform/spi/mac/TUCallSPI.h:
511         * rendering/RenderThemeMac.mm:
512         (WebCore::RenderThemeMac::levelIndicatorFor):
513         * svg/SVGToOTFFontConversion.cpp:
514         (WebCore::SVGToOTFFontConverter::appendKERNTable):
515         (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
516
517 2017-06-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
518
519         If an image appears more than once on a page, decoding for painting one instance repaints them all
520         https://bugs.webkit.org/show_bug.cgi?id=169944
521
522         Reviewed by Simon Fraser.
523
524         Make the Image::draw*() and GraphicsContext::draw*() functions return an
525         ImageDrawResult which indicates whether the image is drawn or has requested
526         an asynchronous image decoding.
527
528         If the image requested an asynchronous image decoding, the issuer of the
529         Image::draw(), which is of type CachedImageClient, will add itself to a
530         set of m_pendingImageDrawingClients, which owned by CachedImage.
531
532         When receiving the imageFrameAvailable() notification for a lrage image 
533         from the decoding thread, CachedImage will loop through the clients that
534         are only in m_pendingImageDrawingClients to ask them to repaint their
535         rectangles.
536
537         Test: fast/images/async-image-multiple-clients-repaint.html
538
539         * loader/cache/CachedImage.cpp:
540         (WebCore::CachedImage::didRemoveClient):
541         (WebCore::CachedImage::addPendingImageDrawingClient):
542         (WebCore::CachedImage::allClientsRemoved):
543         (WebCore::CachedImage::clear):
544         (WebCore::CachedImage::imageFrameAvailable):
545         * loader/cache/CachedImage.h:
546         * platform/graphics/BitmapImage.cpp:
547         (WebCore::BitmapImage::draw):
548         * platform/graphics/BitmapImage.h:
549         * platform/graphics/CrossfadeGeneratedImage.cpp:
550         (WebCore::CrossfadeGeneratedImage::draw):
551         * platform/graphics/CrossfadeGeneratedImage.h:
552         * platform/graphics/GeneratedImage.h:
553         * platform/graphics/GradientImage.cpp:
554         (WebCore::GradientImage::draw):
555         * platform/graphics/GradientImage.h:
556         * platform/graphics/GraphicsContext.cpp:
557         (WebCore::GraphicsContext::drawImage):
558         (WebCore::GraphicsContext::drawTiledImage):
559         * platform/graphics/GraphicsContext.h:
560         * platform/graphics/Image.cpp:
561         (WebCore::Image::drawTiled):
562         * platform/graphics/Image.h:
563         * platform/graphics/ImageTypes.h:
564         * platform/graphics/NamedImageGeneratedImage.cpp:
565         (WebCore::NamedImageGeneratedImage::draw):
566         * platform/graphics/NamedImageGeneratedImage.h:
567         * platform/graphics/cg/PDFDocumentImage.cpp:
568         (WebCore::PDFDocumentImage::draw):
569         * platform/graphics/cg/PDFDocumentImage.h:
570         * rendering/RenderBoxModelObject.cpp:
571         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
572         * rendering/RenderImage.cpp:
573         (WebCore::RenderImage::paintIntoRect):
574         * svg/graphics/SVGImage.cpp:
575         (WebCore::SVGImage::drawForContainer):
576         (WebCore::SVGImage::draw):
577         * svg/graphics/SVGImage.h:
578         * svg/graphics/SVGImageForContainer.cpp:
579         (WebCore::SVGImageForContainer::draw):
580         * svg/graphics/SVGImageForContainer.h:
581
582 2017-06-30  Ryosuke Niwa  <rniwa@webkit.org>
583
584         REGRESSION(r214194): Safari leaves a popup window open opened during before unload
585         https://bugs.webkit.org/show_bug.cgi?id=174016
586
587         Reviewed by Chris Dumez.
588
589         Address Dan's review comments.
590
591         * loader/NavigationDisabler.h:
592         (WebCore::NavigationDisabler::NavigationDisabler):
593         (WebCore::NavigationDisabler::~NavigationDisabler):
594
595 2017-06-30  Wenson Hsieh  <wenson_hsieh@apple.com>
596
597         [iOS DnD] Text indicators for dragged links should always be legible if the link is legible
598         https://bugs.webkit.org/show_bug.cgi?id=173860
599         <rdar://problem/32974385>
600
601         Reviewed by Tim Horton.
602
603         Currently, TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges ensures that links backed by a
604         RenderReplaced element don't render blank text indicators by additionally forcing the
605         TextIndicatorOptionPaintAllContent option in order to capture the RenderReplaced content. If estimated
606         background color is requested, this patch adds an additional path for "upgrading" the text indicator to paint
607         all content: if the text color is not legible against the estimated background color, then it is likely that the
608         background color estimate failed or the link itself was not legible in the first place; in the former case, to
609         ensure that the link is still legible, we upgrade the given TextIndicatorOptions to paint all contents in the
610         range.
611
612         There is currently no way to test this, and also no simple way to introduce infrastructure to test text
613         indicators.
614
615         * page/TextIndicator.cpp:
616         (WebCore::estimatedTextColorsForRange):
617
618         Estimates all text colors that appear in a range by iterating over the text node renderers and consulting their
619         render styles.
620
621         (WebCore::adjustTextIndicatorDataOptionsForEstimatedColorsIfNecessary):
622
623         If foreground text color is deemed not legible, force TextIndicatorOptionPaintAllContent instead of
624         TextIndicatorOptionUseBoundingRectAndPaintAllContentForComplexRanges.
625
626         (WebCore::initializeIndicator):
627         * rendering/TextPaintStyle.cpp:
628         (WebCore::textColorIsLegibleAgainstBackgroundColor):
629         (WebCore::adjustColorForVisibilityOnBackground):
630
631         Allow other parts of WebCore to check the legibility of text against a background color.
632
633         * rendering/TextPaintStyle.h:
634
635 2017-06-30  Alex Christensen  <achristensen@webkit.org>
636
637         REGRESSION(r215096) Queries of URLs with non-special schemes should not percent-encode single quotes
638         https://bugs.webkit.org/show_bug.cgi?id=174051
639         <rdar://problem/33002846>
640
641         Reviewed by Tim Horton.
642
643         In r215096 I added ' to the set of characters to be percent-encoded in queries,
644         but for interoperability and compatibility we need to do this only for special schemes, like http.
645
646         Covered by new API tests.
647
648         * platform/URLParser.cpp:
649         (WebCore::isC0Control):
650         (WebCore::shouldPercentEncodeQueryByte):
651         (WebCore::URLParser::utf8QueryEncode):
652         (WebCore::URLParser::encodeQuery):
653
654 2017-06-30  Daniel Bates  <dabates@apple.com>
655
656         Attempt to fix the build following <https://trac.webkit.org/changeset/219019>
657         (https://bugs.webkit.org/show_bug.cgi?id=165160)
658
659         Export the FrameLoadRequest move constructor and move operator so that they
660         can be used from WebKit.
661
662         * loader/FrameLoadRequest.h:
663
664 2017-06-30  Don Olmstead  <don.olmstead@sony.com>
665
666         [WebCore] Update AXObjectCache for !HAVE(ACCESSIBILITY)
667         https://bugs.webkit.org/show_bug.cgi?id=174045
668
669         Reviewed by Konstantin Tokarev.
670
671         No new tests. No change in behavior.
672
673         * accessibility/AXObjectCache.h:
674         (WebCore::AXObjectCache::checkedStateChanged):
675         (WebCore::AXObjectCache::childrenChanged):
676         (WebCore::AXObjectCache::deferRecomputeIsIgnored):
677         (WebCore::AXObjectCache::deferTextChangedIfNeeded):
678         (WebCore::AXObjectCache::focusAriaModalNodeTimerFired):
679         (WebCore::AXObjectCache::handleAriaExpandedChange):
680         (WebCore::AXObjectCache::handleAriaRoleChanged):
681         (WebCore::AXObjectCache::handleAttributeChanged):
682         (WebCore::AXObjectCache::handleScrollbarUpdate):
683         (WebCore::AXObjectCache::liveRegionChangedNotificationPostTimerFired):
684         (WebCore::AXObjectCache::notificationPostTimerFired):
685         (WebCore::AXObjectCache::passwordNotificationPostTimerFired):
686         (WebCore::AXObjectCache::performDeferredCacheUpdate):
687         (WebCore::AXObjectCache::postNotification):
688         (WebCore::AXObjectCache::postPlatformNotification):
689         (WebCore::AXObjectCache::postTextReplacementNotification):
690         (WebCore::AXObjectCache::postTextReplacementNotificationForTextControl):
691         (WebCore::AXObjectCache::postTextStateChangeNotification):
692         (WebCore::AXObjectCache::recomputeIsIgnored):
693         (WebCore::AXObjectCache::textChanged):
694         (WebCore::AXObjectCache::updateCacheAfterNodeIsAttached):
695         (WebCore::AXObjectCache::focusAriaModalNode): Deleted.
696
697 2017-06-30  Daniel Bates  <dabates@apple.com>
698
699         Attempt to fix the Apple Windows build following <https://trac.webkit.org/changeset/219013>
700         (https://bugs.webkit.org/show_bug.cgi?id=165160)
701
702         Make FrameLoadRequest move constructor and move operator out-of-line so that callers
703         do not need to include header SecurityOrigin.h.
704
705         * loader/FrameLoadRequest.cpp:
706         * loader/FrameLoadRequest.h:
707
708 2017-06-30  Alex Christensen  <achristensen@webkit.org>
709
710         Stop soft linking with CFNetwork
711         https://bugs.webkit.org/show_bug.cgi?id=174029
712
713         Reviewed by Jer Noble.
714
715         We link directly with CFNetwork.  There's no reason to soft link, 
716         and it is causing a problem with linking when doing interesting things with CFNetwork.
717
718         * platform/spi/cf/CFNetworkSPI.h:
719
720 2017-06-30  Daniel Bates  <dabates@apple.com>
721
722         API::FrameInfo should know the web page that contains the frame; add API property webView to WKFrameInfo
723         https://bugs.webkit.org/show_bug.cgi?id=165160
724         <rdar://problem/29451999>
725
726         Reviewed by Brady Eidson.
727
728         Pass the document that is requesting the load to the loader.
729
730         * inspector/InspectorFrontendClientLocal.cpp:
731         (WebCore::InspectorFrontendClientLocal::openInNewTab): Pass the document when instantiating the FrameLoadRequest.
732         Also use C++11 brace initialization to instantiate ResourceRequest.
733         * inspector/InspectorPageAgent.cpp:
734         (WebCore::InspectorPageAgent::navigate): Pass the document when instantiating the FrameLoadRequest.
735         * loader/FrameLoadRequest.cpp:
736         (WebCore::FrameLoadRequest::FrameLoadRequest): Moved from FrameLoadRequest.h.
737         (WebCore::FrameLoadRequest::requester): Added.
738         (WebCore::FrameLoadRequest::requesterSecurityOrigin): Added.
739         * loader/FrameLoadRequest.h:
740         (WebCore::FrameLoadRequest::FrameLoadRequest): Marked as WEBCORE_EXPORT and modified to take
741         the document that requested the load.
742         (WebCore::FrameLoadRequest::requester): Deleted; made out-of-line/moved to FrameLoadRequest.cpp.
743         * loader/FrameLoader.cpp:
744         (WebCore::FrameLoader::urlSelected): Pass the document when instantiating the FrameLoadRequest. Also use C++11
745         brace initialization to instantiate ResourceRequest.
746         (WebCore::FrameLoader::loadURLIntoChildFrame): Pass the document when instantiating the FrameLoadRequest.
747         (WebCore::FrameLoader::loadFrameRequest): Substitute FrameLoadRequest::requesterSecurityOrigin() for
748         FrameLoadRequest::requester() as the former replaces the latter.
749         (WebCore::FrameLoader::loadURL): Pass the document when instantiating the NavigationAction.
750         (WebCore::FrameLoader::load): Ditto.
751         (WebCore::FrameLoader::loadWithDocumentLoader): Pass the document when instantiating the NavigationAction.
752         Also use C++11 brace initialization syntax to instantiate the NavigationAction.
753         (WebCore::FrameLoader::reload): Ditto.
754         (WebCore::FrameLoader::loadPostRequest): Ditto.
755         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): Pass the document when instantiating the NavigationAction.
756         (WebCore::FrameLoader::loadDifferentDocumentItem): Pass the document when instantiating the NavigationAction.
757         Also use C++11 brace initialization syntax to instantiate the NavigationAction.
758         (WebCore::createWindow): Pass the document when instantiating the NavigationAction.
759         * loader/NavigationAction.cpp:
760         (WebCore::NavigationAction::NavigationAction): Modified to take the source document.
761         * loader/NavigationAction.h:
762         (WebCore::NavigationAction::isEmpty): Consider a NavigationAction empty if does not have a source document
763         or the associated ResourceRequest has an empty URL.
764         (WebCore::NavigationAction::sourceDocument): Added.
765         (WebCore::NavigationAction::NavigationAction): Deleted; made out-of-line/moved to NavigationAction.cpp to
766         avoid the need to include the header Document.h.
767         * loader/NavigationScheduler.cpp:
768         (WebCore::ScheduledURLNavigation::ScheduledURLNavigation): Store the document that scheduled the navigation.
769         Also use C++11 brace initialization to instantiate in the member initialization list.
770         (WebCore::ScheduledURLNavigation::initiatingDocument): Added. Retrieves the document that scheduled the navigation.
771         (WebCore::NavigationScheduler::scheduleLocationChange): Pass the document when instantiating the FrameLoadRequest.
772         * loader/PolicyChecker.cpp:
773         (WebCore::PolicyChecker::checkNavigationPolicy): Pass the document when instantiating the NavigationAction.
774         Also use C++11 brace initialization syntax to instantiate the NavigationAction.
775         * page/ContextMenuController.cpp:
776         (WebCore::openNewWindow):
777         (WebCore::ContextMenuController::contextMenuItemSelected): Pass the document when instantiating the FrameLoadRequest.
778         Also use C++11 brace initialization syntax to instantiate the FrameLoadRequest.
779         * page/DOMWindow.cpp:
780         (WebCore::DOMWindow::createWindow): Pass the document when instantiating the FrameLoadRequest.
781
782 2017-06-29  Jer Noble  <jer.noble@apple.com>
783
784         Make Legacy EME API controlled by RuntimeEnabled setting.
785         https://bugs.webkit.org/show_bug.cgi?id=173994
786
787         Reviewed by Sam Weinig.
788
789         Add a new RuntimeEnabledFeatures setting to control the availability of the WebKit prefixed EME APIs.
790
791         * Configurations/FeatureDefines.xcconfig:
792         * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.idl:
793         * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.idl:
794         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.idl:
795         * Modules/encryptedmedia/legacy/WebKitMediaKeys.idl:
796         * dom/Element.idl:
797         * html/HTMLMediaElement.cpp:
798         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
799         (WebCore::HTMLMediaElement::webkitSetMediaKeys):
800         (WebCore::HTMLMediaElement::keyAdded):
801         * html/HTMLMediaElement.idl:
802         * html/WebKitMediaKeyError.idl:
803         * page/RuntimeEnabledFeatures.h:
804         (WebCore::RuntimeEnabledFeatures::setLegacyEncryptedMediaAPIEnabled):
805         (WebCore::RuntimeEnabledFeatures::legacyEncryptedMediaAPIEnabled):
806
807 2017-06-30  Chris Dumez  <cdumez@apple.com>
808
809         Move ResourceLoadStatisticsStore to WebKit2/UIProcess
810         https://bugs.webkit.org/show_bug.cgi?id=174033
811
812         Reviewed by Brent Fulgham.
813
814         Move ResourceLoadStatisticsStore to WebKit2/UIProcess since it is only
815         used in the WebKit2 UIProcess.
816
817         * CMakeLists.txt:
818         * WebCore.xcodeproj/project.pbxproj:
819         * loader/ResourceLoadObserver.cpp:
820         (WebCore::primaryDomain):
821         * loader/ResourceLoadStatistics.cpp:
822         (WebCore::ResourceLoadStatistics::primaryDomain):
823         * loader/ResourceLoadStatistics.h:
824
825 2017-06-30  Ryosuke Niwa  <rniwa@webkit.org>
826
827         Ran sort-Xcode-project-file.
828
829         * WebCore.xcodeproj/project.pbxproj:
830
831 2017-06-30  Ryosuke Niwa  <rniwa@webkit.org>
832
833         REGRESSION(r214194): Safari leaves a popup window open opened during before unload
834         https://bugs.webkit.org/show_bug.cgi?id=174016
835
836         Reviewed by Chris Dumez.
837
838         The bug was caused by WebKit allowing the opening of a new window via window.open but disallowing
839         the initial navigation within the newly opened window while a beforeunload event is being dispatched.
840
841         Because some websites which opens a window during a beforeunload event relies on the opened page
842         to communicate back in order to close it. This resulted in a newly opened popup window with about:blank
843         being left out on those websites.
844
845         Fixed the bug by allowing the navigation of a new window as well as an existing another window.
846         More concretely, we disallow navigations within the same frame tree as the one in which a beforeunload
847         event is being dispatched, and allow navigations elsewhere (i.e. different window / page).
848         During the destruction of a frame-less document, disallow all the navigations.
849
850         Tests: fast/events/before-unload-navigate-different-window.html
851                fast/events/before-unload-open-window.html
852                fast/events/before-unload-sibling-frame.html
853
854         * WebCore.xcodeproj/project.pbxproj:
855         * dom/Document.cpp:
856         (WebCore::Document::prepareForDestruction):
857         * loader/FrameLoader.cpp:
858         (WebCore::FrameLoader::isNavigationAllowed):
859         (WebCore::FrameLoader::shouldClose):
860         * loader/NavigationDisabler.h: Added. Extracted from NavigationScheduler.h
861         (WebCore::NavigationDisabler::NavigationDisabler): Increment the newly added counter on MainFrame unless
862         the frame is null (during the destruction of a frameless document) in which case we increment the global
863         disable count.
864         (WebCore::NavigationDisabler::~NavigationDisabler): Ditto for decrementation.
865         (WebCore::NavigationDisabler::isNavigationAllowed): Only allow the navigation when there is no frameless
866         document in destruction, and none of the frame in the same frame tree as the one given is currently in
867         the process of dispatching a beforeunload event.
868         * loader/NavigationScheduler.cpp:
869         (WebCore::NavigationScheduler::shouldScheduleNavigation):
870         * loader/NavigationScheduler.h:
871         (WebCore::NavigationDisabler): Moved to NavigationDisabler.h.
872         * page/MainFrame.h:
873         (WebCore::MainFrame): Added s_globalNavigationDisableCount.
874
875 2017-06-30  Sam Weinig  <sam@webkit.org>
876
877         [WebIDL] Add support for conditionally read-write attributes
878         https://bugs.webkit.org/show_bug.cgi?id=173993
879
880         Reviewed by Alex Christensen.
881
882         The MEDIA_SOURCE feature/conditional requires changing a few readonly
883         attributes into read-write attributes. In the past we handled this with
884         custom bindings. This patch adds a new extended attribute, ConditionallyReadWrite
885         which achieves the same result.
886
887         * WebCore.xcodeproj/project.pbxproj:
888         Move a few custom binding to the "GC / Wrapping Only" group.
889
890         * bindings/js/JSAudioTrackCustom.cpp:
891         (WebCore::JSAudioTrack::setKind): Deleted.
892         (WebCore::JSAudioTrack::setLanguage): Deleted.
893         * bindings/js/JSTextTrackCustom.cpp:
894         (WebCore::JSTextTrack::setLanguage): Deleted.
895         * bindings/js/JSVideoTrackCustom.cpp:
896         (WebCore::JSVideoTrack::setKind): Deleted.
897         (WebCore::JSVideoTrack::setLanguage): Deleted.
898         Remove no longer needed custom bindings.
899
900         * bindings/scripts/CodeGeneratorJS.pm:
901         (GeneratePropertiesHashTable):
902         (GenerateImplementation):
903         (GenerateAttributeSetterDefinition):
904         (GenerateCallbackImplementationContent):
905         (GenerateHashTableValueArray):
906         (GenerateHashTable):
907         Pipe ConditionallyReadWrite through the generator.
908
909         * bindings/scripts/IDLAttributes.json:
910         Add ConditionallyReadWrite.
911
912         * bindings/scripts/test/JS/JSTestObj.cpp:
913         * bindings/scripts/test/TestObj.idl:
914         Add tests for ConditionallyReadWrite.
915
916         * html/track/AudioTrack.idl:
917         * html/track/TextTrack.idl:
918         * html/track/VideoTrack.idl:
919         Replace [Custom] with [ConditionallyReadWrite].
920
921 2017-06-30  Chris Dumez  <cdumez@apple.com>
922
923         ResourceLoadObserver does not need a ResourceLoadStatisticsStore
924         https://bugs.webkit.org/show_bug.cgi?id=174013
925
926         Reviewed by Brent Fulgham.
927
928         ResourceLoadObserver does not need a ResourceLoadStatisticsStore. ResourceLoadStatisticsStore is too complicated for its needs.
929         ResourceLoadStatisticsStore can then be moved to WebKit2/UIProcess in a follow-up.
930
931         * Modules/websockets/WebSocket.cpp:
932         (WebCore::WebSocket::connect):
933         * dom/UserGestureIndicator.cpp:
934         (WebCore::UserGestureIndicator::UserGestureIndicator):
935         * loader/DocumentLoader.cpp:
936         (WebCore::DocumentLoader::willSendRequest):
937         * loader/FrameLoader.cpp:
938         (WebCore::FrameLoader::loadResourceSynchronously):
939         * loader/ResourceLoadObserver.cpp:
940         (WebCore::ResourceLoadObserver::shared):
941         (WebCore::ResourceLoadObserver::setNotificationCallback):
942         (WebCore::ResourceLoadObserver::shouldLog):
943         (WebCore::ResourceLoadObserver::logFrameNavigation):
944         (WebCore::ResourceLoadObserver::logSubresourceLoading):
945         (WebCore::ResourceLoadObserver::logWebSocketLoading):
946         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
947         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForPrimaryDomain):
948         (WebCore::ResourceLoadObserver::takeResourceStatisticsForPrimaryDomain):
949         (WebCore::ResourceLoadObserver::isPrevalentResource):
950         (WebCore::ResourceLoadObserver::statisticsForOrigin):
951         (WebCore::ResourceLoadObserver::takeStatistics):
952         * loader/ResourceLoadObserver.h:
953         * loader/ResourceLoadStatisticsStore.cpp:
954         * loader/ResourceLoadStatisticsStore.h:
955         * loader/SubresourceLoader.cpp:
956         (WebCore::SubresourceLoader::willSendRequestInternal):
957         * testing/Internals.cpp:
958         (WebCore::Internals::resourceLoadStatisticsForOrigin):
959
960 2017-06-30  Fujii Hironori  <Hironori.Fujii@sony.com>
961
962         ASSERTION FAILED: !canAnimate() && !m_currentFrame
963         https://bugs.webkit.org/show_bug.cgi?id=173089
964
965         Reviewed by Said Abou-Hallawa.
966
967         WebCore::BitmapImage::draw() has an assertion which ensures
968         m_currentFrame is zero in case of async decoding. But, this
969         assertion failed if an GIF animation image which have finished its
970         animation was repainted. In that time, m_currentFrame was the last
971         frame index of the image.
972
973         Test: fast/images/animated-gif-paint-after-animation.html
974
975         * platform/graphics/BitmapImage.cpp:
976         (WebCore::BitmapImage::draw): Assert m_currentFrame is zero or the animation finished.
977         Call requestFrameAsyncDecodingAtIndex with m_currentFrame instead of zero.
978
979 2017-06-30  Ross Kirsling  <ross.kirsling@sony.com>
980
981         [PAL] Move Sound into PAL
982         https://bugs.webkit.org/show_bug.cgi?id=173999
983
984         Reviewed by Alex Christensen.
985
986         * Configurations/WebCore.xcconfig:
987         * PlatformGTK.cmake:
988         * PlatformMac.cmake:
989         * PlatformWPE.cmake:
990         * PlatformWin.cmake:
991         * WebCore.xcodeproj/project.pbxproj:
992         * editing/Editor.cpp:
993         (WebCore::Editor::cut):
994         (WebCore::Editor::copy):
995         (WebCore::Editor::performDelete):
996         * editing/EditorCommand.cpp:
997         (WebCore::executeSelectToMark):
998         (WebCore::executeSwapWithMark):
999         * editing/mac/EditorMac.mm:
1000         (WebCore::Editor::takeFindStringFromSelection):
1001         * inspector/InspectorFrontendHost.cpp:
1002         (WebCore::InspectorFrontendHost::beep):
1003         * platform/Sound.h: Removed.
1004
1005 2017-06-30  Wenson Hsieh  <wenson_hsieh@apple.com>
1006
1007         [iOS DnD] Drag caret rect is incorrectly computed when dropping in editable content in iframes
1008         https://bugs.webkit.org/show_bug.cgi?id=174017
1009         <rdar://problem/32959782>
1010
1011         Reviewed by Simon Fraser.
1012
1013         We're currenly computing the drag caret rect (for the purposes of presentation at the client layers)
1014         incorrectly, in per-frame document coordinates instead of root view coordinates in the mainframe. This means
1015         drag caret geometry from embedded iframes in the document will show up in the content view with a rect in the
1016         coordinate space of the iframe.
1017
1018         To fix this, we need to convert the drag caret rect to root view coordinates. This patch teaches
1019         DragCaretController to do this, and tweaks WebKit/WebKit2 to use caretRectInRootViewCoordinates.
1020
1021         Test: DataInteractionTests.ExternalSourcePlainTextToIFrame
1022
1023         * editing/FrameSelection.cpp:
1024         (WebCore::DragCaretController::caretRectInRootViewCoordinates):
1025         * editing/FrameSelection.h:
1026
1027 2017-06-30  Sam Weinig  <sam@webkit.org>
1028
1029         [WebIDL] Replace use of __is_polymorphic with standard std::is_polymorphic<>::value
1030         https://bugs.webkit.org/show_bug.cgi?id=174012
1031
1032         Reviewed by Alex Christensen.
1033
1034         * bindings/scripts/CodeGeneratorJS.pm:
1035         (GenerateImplementation):
1036         Replace __is_polymorphic with standard std::is_polymorphic<>::value. Remove clang
1037         specific guard now that we are using something other compilers support.
1038
1039         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1040         * bindings/scripts/test/JS/JSMapLike.cpp:
1041         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
1042         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1043         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
1044         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
1045         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1046         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1047         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1048         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1049         * bindings/scripts/test/JS/JSTestException.cpp:
1050         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1051         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1052         * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
1053         * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
1054         * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
1055         * bindings/scripts/test/JS/JSTestInterface.cpp:
1056         * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
1057         * bindings/scripts/test/JS/JSTestIterable.cpp:
1058         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1059         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
1060         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
1061         * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
1062         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1063         * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
1064         * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
1065         * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
1066         * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
1067         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
1068         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
1069         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
1070         * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
1071         * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
1072         * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
1073         * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
1074         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
1075         * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
1076         * bindings/scripts/test/JS/JSTestNode.cpp:
1077         * bindings/scripts/test/JS/JSTestObj.cpp:
1078         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1079         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1080         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1081         * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
1082         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1083         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1084         * bindings/scripts/test/JS/JSTestStringifier.cpp:
1085         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
1086         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
1087         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
1088         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
1089         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
1090         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
1091         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1092         Update test results.
1093
1094 2017-06-30  Youenn Fablet  <youenn@apple.com>
1095
1096        Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
1097        https://bugs.webkit.org/show_bug.cgi?id=169389
1098
1099        Reviewed by Alex Christensen.
1100
1101        Covered by manual testing (appr.tc and https://youennf.github.io/webrtc-tests/src/content/peerconnection/trickle-ice/).
1102        Updated test is showing some more failing but this is due to the fact that we are no longer totally lying on the configuration of the
1103         underlying libwebrtc backend.
1104
1105         Previously, we were creating a libwebrtc peer connection and then setting its configuration.
1106         libwebrtc does not like the configuration to be changed and may refuse to set the configuration.
1107         Instead of doing that, we are now creating the libwebrtc peer connection with the provided configuration.
1108
1109         ICE candidate pool size is disabled as it is creating issues with running tests on bots.
1110
1111         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1112         (WebCore::MediaEndpointPeerConnection::setConfiguration):
1113         * Modules/mediastream/MediaEndpointPeerConnection.h:
1114         * Modules/mediastream/PeerConnectionBackend.h:
1115         * Modules/mediastream/RTCPeerConnection.cpp:
1116         (WebCore::RTCPeerConnection::initializeWith):
1117         (WebCore::iceServersFromConfiguration):
1118         (WebCore::RTCPeerConnection::initializeConfiguration):
1119         (WebCore::RTCPeerConnection::setConfiguration):
1120         * Modules/mediastream/RTCPeerConnection.h:
1121         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1122         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
1123         (WebCore::LibWebRTCMediaEndpoint::setConfiguration):
1124         (WebCore::LibWebRTCMediaEndpoint::stop):
1125         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1126         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1127         (WebCore::configurationFromMediaEndpointConfiguration):
1128         (WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
1129         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1130         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1131         (WebCore::createActualPeerConnection):
1132         (WebCore::LibWebRTCProvider::createPeerConnection):
1133         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
1134
1135
1136 2017-06-30  Antoine Quint  <graouts@apple.com>
1137
1138         Top controls bars should invert with right-to-left user interface layout direction locale
1139         https://bugs.webkit.org/show_bug.cgi?id=173989
1140         <rdar://problem/32863552>
1141
1142         Reviewed by Dean Jackson.
1143
1144         When the user interface layout direction is set by the locale to be right-to-left, we now:
1145
1146             - invert the two top controls bars
1147             - invert the layout order for the fullscreen / PiP controls bar
1148             - orient the volume button the opposite direction when presented in a top controls bar
1149
1150         Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-rtl.html
1151
1152         * Modules/modern-media-controls/controls/icon-service.js: Add new RTL variants for the mute and unmute icons.
1153         * Modules/modern-media-controls/controls/inline-media-controls.css: Invert the position of the two top controls
1154         bars when we switch user interface layout direction.
1155         (.media-controls.inline.uses-ltr-user-interface-layout-direction > .controls-bar.top-left,):
1156         (.media-controls.inline.uses-ltr-user-interface-layout-direction > .controls-bar.top-right,):
1157         (.media-controls.inline > .controls-bar.top-left): Deleted.
1158         (.media-controls.inline > .controls-bar.top-right): Deleted.
1159         * Modules/modern-media-controls/controls/inline-media-controls.js:
1160         (InlineMediaControls.prototype.layout): Default to using the LTR variant for the mute button icon since
1161         it should only use the RTL variant in case the locale requires it *and* we display the mute button in a
1162         top controls bar rather than the bottom controls bar (ie. when width becomes constrained).
1163         (InlineMediaControls.prototype._topLeftContainerButtons): Invert the order of the fullscreen and PiP
1164         buttons based on the user interface layout direction.
1165         (InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
1166         (InlineMediaControls):
1167         * Modules/modern-media-controls/controls/media-controls.js:
1168         (MediaControls.prototype.set usesLTRUserInterfaceLayoutDirection): Schedule a layout when the user interface
1169         layout direction changes.
1170         * Modules/modern-media-controls/controls/mute-button.js: Add a new "usesRTLIconVariant" property, false by
1171         default, to indicate we want to use the RTL variant of the button's icon.
1172         (MuteButton):
1173         (MuteButton.prototype.get muted):
1174         (MuteButton.prototype.set muted):
1175         (MuteButton.prototype.set usesRTLIconVariant):
1176         (MuteButton.prototype.layout):
1177         * Modules/modern-media-controls/images/iOS/Mute-RTL.svg: Added.
1178         * Modules/modern-media-controls/images/iOS/VolumeHi-RTL.svg: Added.
1179         * Modules/modern-media-controls/images/macOS/Mute-RTL.svg: Added.
1180         * Modules/modern-media-controls/images/macOS/VolumeHi-RTL.svg: Added.
1181         * Modules/modern-media-controls/media/media-controller.js: Use an ivar to track when it's worth notifying the
1182         media controls that the user interface layout direction has changed. This means we won't need to schedule a
1183         layout in case it's set to the current value.
1184         (MediaController):
1185         (MediaController.prototype.set usesLTRUserInterfaceLayoutDirection):
1186
1187 2017-06-29  Zalan Bujtas  <zalan@apple.com>
1188
1189         BreakingContext::handleReplaced() should use replacedBox instead of m_current.renderer().
1190         https://bugs.webkit.org/show_bug.cgi?id=174011
1191
1192         Reviewed by Simon Fraser.
1193
1194         No change in functionality.
1195
1196         * rendering/line/BreakingContext.h:
1197         (WebCore::BreakingContext::handleReplaced):
1198         * rendering/line/LineWidth.cpp:
1199         (WebCore::LineWidth::applyOverhang):
1200         * rendering/line/LineWidth.h:
1201
1202 2017-06-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1203
1204         [iOS DnD] Web content process crashes when the selection is moved far offscreen in dragstart
1205         https://bugs.webkit.org/show_bug.cgi?id=174010
1206         <rdar://problem/32597802>
1207
1208         Reviewed by Tim Horton.
1209
1210         The TextIndicator snapshot generated in createDragImageForSelection is not guaranteed to succeed; this patch
1211         adds a null check following TextIndicator::createWithSelectionInFrame and bails early if the snapshot was not
1212         successful.
1213
1214         Test: DataInteractionTests.DoNotCrashWhenSelectionMovesOffscreenAfterDragStart
1215
1216         * platform/ios/DragImageIOS.mm:
1217         (WebCore::createDragImageForSelection):
1218
1219 2017-06-29  Chris Fleizach  <cfleizach@apple.com>
1220
1221         AX: Cannot call setValue() on contenteditable or ARIA text controls
1222         https://bugs.webkit.org/show_bug.cgi?id=173520
1223
1224         Reviewed by Ryosuke Niwa.
1225
1226         Add support for changing the value of a contenteditable and any other aria text control in setValue().
1227  
1228         Test: accessibility/mac/set-value-editable-types.html
1229
1230         * accessibility/AccessibilityRenderObject.cpp:
1231         (WebCore::AccessibilityRenderObject::setValue):
1232
1233 2017-06-28  Simon Fraser  <simon.fraser@apple.com>
1234
1235         getBoundingClientRect returns wrong value for combination of page zoom and scroll
1236         https://bugs.webkit.org/show_bug.cgi?id=173841
1237         rdar://problem/32983841
1238
1239         Reviewed by Dean Jackson.
1240
1241         The layout viewport returned by FrameView::layoutViewportRect() is affected by page (Command-+) zooming,
1242         since it's computed using scroll positions, so when we use its origin to convert into client coordinates
1243         (which are zoom-agnostic), we need to account for page zoom, so fix FrameView::documentToClientOffset()
1244         to do this.
1245
1246         Callers of documentToClientOffset() were checked, revealing that event client coordinates were also
1247         wrong with page zoom and are fixed in the same way. It was found that SimulatedClick was using an
1248         entirely wrong rect to compute its location: Element::clientRect() is NOT in client coordinates,
1249         so change this code to use getBoundingClientRect() instead.
1250
1251         Minor refactoring in MouseRelatedEvent to make getting to the FrameView cleaner.
1252
1253         Some geometry types enhanced to have non-mutating scale functions.
1254
1255         Tests: fast/events/simulated-click-zoomed.html
1256                fast/visual-viewport/client-rects-relative-to-layout-viewport-zoomed.html
1257
1258         * dom/MouseRelatedEvent.cpp:
1259         (WebCore::MouseRelatedEvent::init):
1260         (WebCore::MouseRelatedEvent::initCoordinates):
1261         (WebCore::MouseRelatedEvent::frameView):
1262         (WebCore::MouseRelatedEvent::documentToAbsoluteScaleFactor):
1263         (WebCore::MouseRelatedEvent::computePageLocation):
1264         (WebCore::MouseRelatedEvent::computeRelativePosition):
1265         (WebCore::pageZoomFactor): Deleted.
1266         (WebCore::frameScaleFactor): Deleted.
1267         * dom/MouseRelatedEvent.h:
1268         (WebCore::MouseRelatedEvent::absoluteLocation):
1269         (WebCore::MouseRelatedEvent::setAbsoluteLocation): Deleted.
1270         * dom/SimulatedClick.cpp:
1271         * page/FrameView.cpp:
1272         (WebCore::FrameView::layoutViewportRect): baseLayoutViewportSize() is the same as the old code.
1273         (WebCore::FrameView::documentToAbsoluteScaleFactor):
1274         (WebCore::FrameView::absoluteToDocumentScaleFactor):
1275         (WebCore::FrameView::absoluteToDocumentPoint):
1276         (WebCore::FrameView::documentToClientOffset):
1277         * page/FrameView.h:
1278         * platform/graphics/FloatPoint.h:
1279         (WebCore::FloatPoint::scale):
1280         (WebCore::FloatPoint::scaled):
1281         * platform/graphics/FloatSize.h:
1282         (WebCore::FloatSize::scaled):
1283         * platform/graphics/LayoutPoint.h:
1284         (WebCore::LayoutPoint::scaled):
1285
1286 2017-06-29  Megan Gardner  <megan_gardner@apple.com>
1287
1288         Unreviewed, fixing Window's build after r218976
1289
1290         * rendering/ScrollAlignment.cpp:
1291         (WebCore::operator<<):
1292
1293 2017-06-29  Megan Gardner  <megan_gardner@apple.com>
1294
1295         Add TextStream operators for Range, VisiblePosition, VisibleSelection, and ScrollAlignment
1296         https://bugs.webkit.org/show_bug.cgi?id=173997
1297
1298         Reviewed by Simon Fraser.
1299
1300         Adding logging that can be used with TextStream-based LOG_WITH_STREAM.
1301
1302         * dom/Range.cpp:
1303         (WebCore::operator<<):
1304         * dom/Range.h:
1305         * editing/VisiblePosition.h:
1306         * editing/VisibleSelection.cpp:
1307         (WebCore::operator<<):
1308         * editing/VisibleSelection.h:
1309         * rendering/ScrollAlignment.cpp:
1310         (WebCore::operator<<):
1311         * rendering/ScrollAlignment.h:
1312
1313 2017-06-29  Matt Lewis  <jlewis3@apple.com>
1314
1315         Unreviewed, rolling out r218903.
1316
1317         This patch and its fix cause immediate flakiness on all WK2
1318         testers
1319
1320         Reverted changeset:
1321
1322         "Support PeerConnectionStates::BundlePolicy::MaxBundle when
1323         setting rtc configuration"
1324         https://bugs.webkit.org/show_bug.cgi?id=169389
1325         http://trac.webkit.org/changeset/218903
1326
1327 2017-06-29  Matt Lewis  <jlewis3@apple.com>
1328
1329         Unreviewed, rolling out r218963.
1330
1331         This patch and its fix cause immediate flakiness on all WK2
1332         testers
1333
1334         Reverted changeset:
1335
1336         "Support PeerConnectionStates::BundlePolicy::MaxBundle when
1337         setting rtc configuration"
1338         https://bugs.webkit.org/show_bug.cgi?id=169389
1339         http://trac.webkit.org/changeset/218963
1340
1341 2017-06-29  Chris Dumez  <cdumez@apple.com>
1342
1343         Split ResourceLoadObserver into 2 classes: one for WebCore and one for the UIProcess
1344         https://bugs.webkit.org/show_bug.cgi?id=173990
1345
1346         Reviewed by Brent Fulgham.
1347
1348         Split ResourceLoadObserver into 2 classes: one for WebCore and one for the UIProcess.
1349         They really have different API and there is therefore close to no code duplication.
1350
1351         * loader/ResourceLoadObserver.cpp:
1352         (WebCore::primaryDomain):
1353         (WebCore::ResourceLoadObserver::setStatisticsQueue):
1354         (WebCore::ResourceLoadObserver::shouldLog):
1355         * loader/ResourceLoadObserver.h:
1356         * loader/ResourceLoadStatisticsStore.cpp:
1357         (WebCore::ResourceLoadStatisticsStore::primaryDomain):
1358         * loader/ResourceLoadStatisticsStore.h:
1359         * platform/URL.h:
1360
1361 2017-06-29  Sam Weinig  <sam@webkit.org>
1362
1363         [WebIDL] Remove custom binding for UserMessageHandlersNamespace
1364         https://bugs.webkit.org/show_bug.cgi?id=173956
1365
1366         Reviewed by Darin Adler.
1367
1368         * CMakeLists.txt:
1369         * WebCore.xcodeproj/project.pbxproj:
1370         * bindings/js/JSUserMessageHandlersNamespaceCustom.cpp: Removed.
1371         Remove JSUserMessageHandlersNamespaceCustom.cpp
1372
1373         * bindings/scripts/CodeGeneratorJS.pm:
1374         (GenerateNamedGetterLambda):
1375         Add support for calling named getters with additional arguments from [CallWith].
1376
1377         (GenerateAttributeGetterBodyDefinition):
1378         (GenerateAttributeSetterBodyDefinition):
1379         (GenerateCallWithUsingReferences):
1380         (GenerateCallWithUsingPointers):
1381         (GenerateConstructorCallWithUsingPointers):
1382         (GenerateCallWith):
1383         (GenerateParametersCheck):
1384         Update arguments to GenerateCallWith(Using...) to no longer pass an operation,
1385         which was only needed for the no longer used ScriptArguments, pass a thisObject
1386         reference, and optionally pass an indentation.
1387
1388         * bindings/scripts/IDLAttributes.json:
1389         Remove no longer used ScriptArguments and CallStack, add World.
1390
1391         * bindings/scripts/test/JS/JSTestObj.cpp:
1392         (WebCore::jsTestObjWithScriptArgumentsAndCallStackAttributeGetter): Deleted.
1393         (WebCore::jsTestObjWithScriptArgumentsAndCallStackAttribute): Deleted.
1394         (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttributeSetter): Deleted.
1395         (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute): Deleted.
1396         (WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStackBody): Deleted.
1397         (WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack): Deleted.
1398         * bindings/scripts/test/TestObj.idl:
1399         Remove tests of ScriptArguments and CallStack.
1400
1401         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: Added.
1402         * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h: Added.
1403         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: Added.
1404         * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h: Added.
1405         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: Added.
1406         * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h: Added.
1407         * bindings/scripts/test/TestNamedGetterCallWith.idl: Added.
1408         * bindings/scripts/test/TestNamedGetterNoIdentifier.idl: Added.
1409         * bindings/scripts/test/TestNamedGetterWithIdentifier.idl: Added.
1410         Add basic named getter tests and a specific test of named getters using CallWith.
1411
1412         * page/UserMessageHandlersNamespace.cpp:
1413         (WebCore::UserMessageHandlersNamespace::supportedPropertyNames):
1414         (WebCore::UserMessageHandlersNamespace::namedItem):
1415         (WebCore::UserMessageHandlersNamespace::handler): Deleted.
1416         * page/UserMessageHandlersNamespace.h:
1417         Rename handler to namedItem, matching convention and the expectations of the
1418         bindings generator and swap the order of the arguments for the same reason.
1419
1420         * page/UserMessageHandlersNamespace.idl:
1421         Remove CustomGetOwnPropertySlotAndDescriptor, and add the anonymous named getter.
1422
1423 2017-06-29  Chris Dumez  <cdumez@apple.com>
1424
1425         Avoid copying ResourceLoadStatistics objects
1426         https://bugs.webkit.org/show_bug.cgi?id=173972
1427
1428         Reviewed by Brent Fulgham.
1429
1430         Avoid copying ResourceLoadStatistics objects given that they are big. Make the type move-only
1431         to avoid such mistakes in the future.
1432
1433         * loader/ResourceLoadObserver.cpp:
1434         (WebCore::ResourceLoadObserver::logFrameNavigation):
1435         * loader/ResourceLoadStatistics.h:
1436         (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
1437
1438 2017-06-29  John Wilander  <wilander@apple.com>
1439
1440         Fix for intermittent Layout Test fail http/tests/loading/resourceLoadStatistics/telemetry-generation.html
1441         https://bugs.webkit.org/show_bug.cgi?id=173940
1442         <rdar://problem/33018125>
1443
1444         Reviewed by Brent Fulgham.
1445
1446         No new tests. This change enables the exiting test to pass.
1447
1448         * loader/ResourceLoadStatisticsStore.cpp:
1449         (WebCore::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
1450             Added an assert.
1451
1452 2017-06-29  Youenn Fablet  <youenn@apple.com>
1453
1454         Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
1455         https://bugs.webkit.org/show_bug.cgi?id=169389
1456
1457         Unreviewed.
1458
1459         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1460         (WebCore::configurationFromMediaEndpointConfiguration): Reactivating CPU overuse detection as it might be the cause of the bots regressions.
1461
1462 2017-06-29  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1463
1464         [Curl] ResourceHandleManager violate the class responsibility of ResourceHandle
1465         https://bugs.webkit.org/show_bug.cgi?id=173630
1466
1467         Reviewed by Alex Christensen.
1468
1469         * platform/network/ResourceHandle.h:
1470         * platform/network/curl/ResourceHandleCurl.cpp:
1471         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
1472         (WebCore::calculateWebTimingInformations):
1473         (WebCore::handleLocalReceiveResponse):
1474         (WebCore::writeCallback):
1475         (WebCore::isHttpInfo):
1476         (WebCore::isHttpRedirect):
1477         (WebCore::isHttpAuthentication):
1478         (WebCore::isHttpNotModified):
1479         (WebCore::isAppendableHeader):
1480         (WebCore::removeLeadingAndTrailingQuotes):
1481         (WebCore::getProtectionSpace):
1482         (WebCore::headerCallback):
1483         (WebCore::readCallback):
1484         (WebCore::getFormElementsCount):
1485         (WebCore::setupFormData):
1486         (WebCore::ResourceHandle::setupPUT):
1487         (WebCore::ResourceHandle::setupPOST):
1488         (WebCore::ResourceHandle::handleDataURL):
1489         (WebCore::ResourceHandle::dispatchSynchronousJob):
1490         (WebCore::ResourceHandle::applyAuthentication):
1491         (WebCore::ResourceHandle::initialize):
1492         (WebCore::ResourceHandle::handleCurlMsg):
1493         * platform/network/curl/ResourceHandleManager.cpp:
1494         (WebCore::ResourceHandleManager::downloadTimerCallback):
1495         (WebCore::ResourceHandleManager::startJob):
1496         (WebCore::calculateWebTimingInformations): Deleted.
1497         (WebCore::isHttpInfo): Deleted.
1498         (WebCore::isHttpRedirect): Deleted.
1499         (WebCore::isHttpAuthentication): Deleted.
1500         (WebCore::isHttpNotModified): Deleted.
1501         (WebCore::handleLocalReceiveResponse): Deleted.
1502         (WebCore::writeCallback): Deleted.
1503         (WebCore::isAppendableHeader): Deleted.
1504         (WebCore::removeLeadingAndTrailingQuotes): Deleted.
1505         (WebCore::getProtectionSpace): Deleted.
1506         (WebCore::headerCallback): Deleted.
1507         (WebCore::readCallback): Deleted.
1508         (WebCore::getFormElementsCount): Deleted.
1509         (WebCore::setupFormData): Deleted.
1510         (WebCore::ResourceHandleManager::setupPUT): Deleted.
1511         (WebCore::ResourceHandleManager::setupPOST): Deleted.
1512         (WebCore::handleDataURL): Deleted.
1513         (WebCore::ResourceHandleManager::dispatchSynchronousJob): Deleted.
1514         (WebCore::ResourceHandleManager::applyAuthenticationToRequest): Deleted.
1515         (WebCore::ResourceHandleManager::initializeHandle): Deleted.
1516         * platform/network/curl/ResourceHandleManager.h:
1517
1518 2017-06-29  Said Abou-Hallawa  <sabouhallawa@apple.com>
1519
1520         Async image decoding should be disabled for iBooks on tvOS
1521         https://bugs.webkit.org/show_bug.cgi?id=173945
1522
1523         Reviewed by Simon Fraser.
1524
1525         The iBooks on tvOS is an AppStore application. We need to disable async
1526         image decoding for iBooks on tvOS permanently through WebKit.
1527
1528         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
1529         (WebCore::IOSApplication::isIBooks):
1530         * platform/graphics/BitmapImage.cpp:
1531         (WebCore::BitmapImage::updateFromSettings):
1532
1533 2017-06-29  Sam Weinig  <sam@webkit.org>
1534
1535         [WebIDL] Add a new extended attribute to model the forced return value optimization used on Node and Crypto
1536         https://bugs.webkit.org/show_bug.cgi?id=173961
1537
1538         Reviewed by Darin Adler.
1539
1540         Node and Crypto were both using custom bindings to implement an optimization
1541         for operations that always returned one one of the arguments passed in. The
1542         optimization directly returns the JSValue argument, avoiding wrapping and 
1543         unwrapping, and all the cache lookups that might entail. This allows that 
1544         optimization to work without custom bindings by adding a new extended attribute
1545         [ReturnValue] that can annotate an argument. When used, the implementation
1546         function is expected to return either void or ExceptionOr<void>.
1547
1548         * CMakeLists.txt:
1549         * WebCore.xcodeproj/project.pbxproj:
1550         * bindings/js/JSBindingsAllInOne.cpp:
1551         * bindings/js/JSCryptoCustom.cpp: Removed.
1552         Remove JSCryptoCustom.cpp.
1553
1554         * bindings/js/JSNodeCustom.cpp:
1555         (WebCore::JSNode::insertBefore): Deleted.
1556         (WebCore::JSNode::replaceChild): Deleted.
1557         (WebCore::JSNode::removeChild): Deleted.
1558         (WebCore::JSNode::appendChild): Deleted.
1559         Remove custom functions.
1560
1561         * bindings/scripts/CodeGeneratorJS.pm:
1562         (OperationHasForcedReturnValue):
1563         Add helper to determine if an operation has [ReturnValue] on any argument.
1564
1565         (NeedsExplicitPropagateExceptionCall):
1566         We must treat operations with a [ReturnValue] argument like we do operations
1567         returning void, and explicitly check for exceptions.
1568
1569         (GenerateParametersCheck):
1570         Pull out the argument in a variable called 'returnValue' if it is annotated
1571         with [ReturnValue].
1572
1573         (GenerateImplementationFunctionCall):
1574         Special case operations with a [ReturnValue] argument to return the previously
1575         set aside 'returnValue' variable.
1576
1577         * bindings/scripts/IDLAttributes.json:
1578         Add [ReturnValue].
1579
1580         * bindings/scripts/test/JS/JSTestObj.cpp:
1581         (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationBody):
1582         (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimization):
1583         (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationWithExceptionBody):
1584         (WebCore::jsTestObjPrototypeFunctionTestReturnValueOptimizationWithException):
1585         * bindings/scripts/test/TestObj.idl:
1586         Add tests for [ReturnValue].
1587
1588         * dom/Node.idl:
1589         * page/Crypto.idl:
1590         Add [ReturnValue] annotations and remove [Custom] annotations.
1591
1592 2017-06-29  Chris Dumez  <cdumez@apple.com>
1593
1594         Unreviewed, rolling out r218944.
1595
1596         Optimization is incorrect
1597
1598         Reverted changeset:
1599
1600         "Avoid copying ResourceLoadStatistics objects"
1601         https://bugs.webkit.org/show_bug.cgi?id=173972
1602         http://trac.webkit.org/changeset/218944
1603
1604 2017-06-29  Carlos Garcia Campos  <cgarcia@igalia.com>
1605
1606         REGRESSION(r218896): ASSERT in WebPageProxy::dataCallback
1607         https://bugs.webkit.org/show_bug.cgi?id=173968
1608
1609         Reviewed by Michael Catanzaro.
1610
1611         The problem is that WebPageProxy::getLoadDecisionForIcon() sends 0 as callback ID when the decision is to not
1612         load the icon. Since r218896 we always notify the client even when the decision is to not load the icon, in
1613         which case the UI doesn't really expect a callback. When WebPageProxy::dataCallback is called with a 0 callback ID,
1614         CallbackMap::take() crashes in RELEASE_ASSERT(callbackID).
1615
1616         Fixes several GTK+ unit tests that are crashing.
1617
1618         * loader/DocumentLoader.cpp:
1619         (WebCore::DocumentLoader::didGetLoadDecisionForIcon): Return earlier if decision is false or frame is nullptr.
1620         (WebCore::DocumentLoader::finishedLoadingIcon): Move RELEASE_ASSERT to notifyFinishedLoadingIcon().
1621         (WebCore::DocumentLoader::notifyFinishedLoadingIcon): Assert if callbackIdentifier is 0 or m_frame is nullptr,
1622         since it's no longer expected to happen.
1623
1624 2017-06-29  Chris Dumez  <cdumez@apple.com>
1625
1626         statistics.mostRecentUserInteraction should be of type WallTime
1627         https://bugs.webkit.org/show_bug.cgi?id=173974
1628
1629         Reviewed by Brent Fulgham.
1630
1631         statistics.mostRecentUserInteraction should be of type WallTime for clarity.
1632
1633         * loader/ResourceLoadObserver.cpp:
1634         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1635         (WebCore::ResourceLoadObserver::logUserInteraction):
1636         (WebCore::ResourceLoadObserver::clearUserInteraction):
1637         * loader/ResourceLoadStatistics.cpp:
1638         (WebCore::ResourceLoadStatistics::encode):
1639         (WebCore::ResourceLoadStatistics::decode):
1640         (WebCore::ResourceLoadStatistics::toString):
1641         (WebCore::ResourceLoadStatistics::merge):
1642         * loader/ResourceLoadStatistics.h:
1643         (WebCore::ResourceLoadStatistics::mostRecentUserInteractionTime): Deleted.
1644         * loader/ResourceLoadStatisticsStore.cpp:
1645         (WebCore::shouldPartitionCookies):
1646         (WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
1647         (WebCore::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
1648
1649 2017-06-29  JF Bastien  <jfbastien@apple.com>
1650
1651         WebAssembly: disable some APIs under CSP
1652         https://bugs.webkit.org/show_bug.cgi?id=173892
1653         <rdar://problem/32914613>
1654
1655         Reviewed by Daniel Bates.
1656
1657         This does the basic separation of eval-blocked and
1658         WebAssembly-blocked, but currently only blocks neither or both. I
1659         think we'll eventually consider allowing one to be blocked but not
1660         the other, so this separation makes sense and means that when we
1661         want to do the change it'll be tiny. At a minimum we want a
1662         different error message, which this patch provides (a lot of the
1663         code ties blocking to the error message).
1664
1665         Tests: http/tests/security/contentSecurityPolicy/WebAssembly-allowed.html
1666                http/tests/security/contentSecurityPolicy/WebAssembly-blocked-in-about-blank-iframe.html
1667                http/tests/security/contentSecurityPolicy/WebAssembly-blocked-in-external-script.html
1668                http/tests/security/contentSecurityPolicy/WebAssembly-blocked-in-subframe.html
1669                http/tests/security/contentSecurityPolicy/WebAssembly-blocked.html
1670
1671         * bindings/js/ScriptController.cpp:
1672         (WebCore::ScriptController::enableWebAssembly):
1673         (WebCore::ScriptController::disableWebAssembly):
1674         * bindings/js/ScriptController.h:
1675         * bindings/js/WorkerScriptController.cpp:
1676         (WebCore::WorkerScriptController::disableWebAssembly):
1677         * bindings/js/WorkerScriptController.h:
1678         * dom/Document.cpp:
1679         (WebCore::Document::disableWebAssembly):
1680         * dom/Document.h:
1681         * dom/ScriptExecutionContext.h:
1682         * page/csp/ContentSecurityPolicy.cpp:
1683         (WebCore::ContentSecurityPolicy::didCreateWindowProxy):
1684         (WebCore::ContentSecurityPolicy::applyPolicyToScriptExecutionContext):
1685         * page/csp/ContentSecurityPolicy.h:
1686         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
1687         (WebCore::ContentSecurityPolicyDirectiveList::create):
1688         * page/csp/ContentSecurityPolicyDirectiveList.h:
1689         (WebCore::ContentSecurityPolicyDirectiveList::webAssemblyDisabledErrorMessage):
1690         (WebCore::ContentSecurityPolicyDirectiveList::setWebAssemblyDisabledErrorMessage):
1691         * workers/WorkerGlobalScope.cpp:
1692         (WebCore::WorkerGlobalScope::disableWebAssembly):
1693         * workers/WorkerGlobalScope.h:
1694
1695 2017-06-29  Zalan Bujtas  <zalan@apple.com>
1696
1697         Make InlineBox::m_topLeft and m_logicalWidth protected.
1698         https://bugs.webkit.org/show_bug.cgi?id=173973
1699
1700         Reviewed by Simon Fraser.
1701
1702         I don't think this reasoning from 10 years ago is valid anymore -> 
1703           "FIXME: Would like to make this protected, but methods are accessing these members over in the part."
1704         (comment was conveniently removed in a later commit).
1705
1706         No change in functionality.
1707
1708         * rendering/InlineBox.h:
1709         (WebCore::InlineBox::InlineBox):
1710
1711 2017-06-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1712
1713         [iOS DnD] Adopt +objectWithItemProviderData: for serializing NSItemProviderReading-conformant objects
1714         https://bugs.webkit.org/show_bug.cgi?id=173971
1715         <rdar://problem/33006605>
1716
1717         Reviewed by Tim Horton.
1718
1719         Moves off of a very-recently-deprecated API, in favor of its replacement. Guarded by a runtime check and staging
1720         declarations. No change in behavior.
1721
1722         * platform/ios/WebItemProviderPasteboard.mm:
1723         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
1724
1725 2017-06-29  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1726
1727         [Curl] Separate global curl settings from ResourceHandleManager as CurlContext class
1728         https://bugs.webkit.org/show_bug.cgi?id=173629
1729
1730         Reviewed by Alex Christensen.
1731
1732         * PlatformWinCairo.cmake:
1733         * platform/network/curl/CookieJarCurl.cpp:
1734         (WebCore::setCookiesFromDOM):
1735         (WebCore::cookiesForSession):
1736         * platform/network/curl/CurlContext.cpp: Added.
1737         (WebCore::certificatePath):
1738         (WebCore::cookieJarPath):
1739         (WebCore::CurlContext::CurlContext):
1740         (WebCore::CurlContext::~CurlContext):
1741         (WebCore::CurlContext::initCookieSession):
1742         (WebCore::CurlContext::ProxyInfo::url):
1743         (WebCore::CurlContext::setProxyInfo):
1744         (WebCore::CurlContext::getEffectiveURL):
1745         (WebCore::CurlContext::createMultiHandle):
1746         (WebCore::CurlContext::mutexFor):
1747         (WebCore::CurlContext::lock):
1748         (WebCore::CurlContext::unlock):
1749         * platform/network/curl/CurlContext.h: Added.
1750         (WebCore::CurlContext::singleton):
1751         (WebCore::CurlContext::curlShareHandle):
1752         (WebCore::CurlContext::getCookieJarFileName):
1753         (WebCore::CurlContext::setCookieJarFileName):
1754         (WebCore::CurlContext::getCertificatePath):
1755         (WebCore::CurlContext::shouldIgnoreSSLErrors):
1756         (WebCore::CurlContext::proxyInfo):
1757         (WebCore::CurlContext::setProxyInfo):
1758         (WebCore::CurlContext::getLogFile):
1759         (WebCore::CurlContext::isVerbose):
1760         * platform/network/curl/CurlDownload.cpp:
1761         (WebCore::CurlDownload::init):
1762         (WebCore::CurlDownload::start):
1763         (WebCore::CurlDownload::cancel):
1764         (WebCore::CurlDownload::didReceiveHeader):
1765         * platform/network/curl/CurlDownload.h:
1766         * platform/network/curl/CurlJobManager.cpp: Renamed from Source/WebCore/platform/network/curl/CurlManager.cpp.
1767         (WebCore::CurlJobManager::CurlJobManager):
1768         (WebCore::CurlJobManager::~CurlJobManager):
1769         (WebCore::CurlJobManager::add):
1770         (WebCore::CurlJobManager::remove):
1771         (WebCore::CurlJobManager::getActiveCount):
1772         (WebCore::CurlJobManager::getPendingCount):
1773         (WebCore::CurlJobManager::startThreadIfNeeded):
1774         (WebCore::CurlJobManager::stopThread):
1775         (WebCore::CurlJobManager::stopThreadIfIdle):
1776         (WebCore::CurlJobManager::updateHandleList):
1777         (WebCore::CurlJobManager::addToCurl):
1778         (WebCore::CurlJobManager::removeFromCurl):
1779         (WebCore::CurlJobManager::workerThread):
1780         * platform/network/curl/CurlJobManager.h: Renamed from Source/WebCore/platform/network/curl/CurlManager.h.
1781         (WebCore::CurlJobManager::singleton):
1782         * platform/network/curl/ResourceHandleManager.cpp:
1783         (WebCore::ResourceHandleManager::ResourceHandleManager):
1784         (WebCore::ResourceHandleManager::~ResourceHandleManager):
1785         (WebCore::handleLocalReceiveResponse):
1786         (WebCore::getProtectionSpace):
1787         (WebCore::headerCallback):
1788         (WebCore::ResourceHandleManager::downloadTimerCallback):
1789         (WebCore::ResourceHandleManager::initializeHandle):
1790         (WebCore::certificatePath): Deleted.
1791         (WebCore::cookieJarPath): Deleted.
1792         (WebCore::ResourceHandleManager::setCookieJarFileName): Deleted.
1793         (WebCore::ResourceHandleManager::getCookieJarFileName): Deleted.
1794         (WebCore::ResourceHandleManager::setProxyInfo): Deleted.
1795         (WebCore::ResourceHandleManager::initCookieSession): Deleted.
1796         * platform/network/curl/ResourceHandleManager.h:
1797         (): Deleted.
1798
1799 2017-06-29  Chris Dumez  <cdumez@apple.com>
1800
1801         Avoid copying ResourceLoadStatistics objects
1802         https://bugs.webkit.org/show_bug.cgi?id=173972
1803
1804         Reviewed by Geoffrey Garen.
1805
1806         Avoid copying ResourceLoadStatistics objects given that they are big. Make the type move-only
1807         to avoid such mistakes in the future.
1808
1809         * loader/ResourceLoadObserver.cpp:
1810         (WebCore::ResourceLoadObserver::logFrameNavigation):
1811         * loader/ResourceLoadStatistics.h:
1812         (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
1813
1814 2017-06-29  Antoine Quint  <graouts@apple.com>
1815
1816         Full stop shows to the right of the picture-in-picture localised string in Hebrew
1817         https://bugs.webkit.org/show_bug.cgi?id=173966
1818         <rdar://problem/32847376>
1819
1820         Reviewed by Dean Jackson.
1821
1822         We manually set the CSS "direction" property to "rtl" when we're not using an LTR language for a placard.
1823
1824         Test: media/modern-media-controls/placard/placard-ltr.html
1825
1826         * Modules/modern-media-controls/controls/placard.css:
1827         (.media-controls:not(.uses-ltr-user-interface-layout-direction) .placard):
1828
1829 2017-06-29  Brent Fulgham  <bfulgham@apple.com>
1830
1831         Unreviewed Apple CMake build after r218901
1832
1833         I did not add 'cocoa/FileMonitorCocoa.mm' to the PlatformMac.cmake file as part of r218901.):
1834
1835         * PlatformMac.cmake:
1836
1837 2017-06-29  Frederic Wang  <fwang@igalia.com>
1838
1839         Small improvement of calls to RenderLayerBacking members
1840         https://bugs.webkit.org/show_bug.cgi?id=173969
1841
1842         Reviewed by Simon Fraser.
1843
1844         No new tests, behavior unchanged.
1845
1846         * page/FrameView.cpp:
1847         (WebCore::FrameView::tiledBacking): Access the member with RenderLayerBacking::tiledBacking.
1848         (WebCore::FrameView::updateTilesForExtendedBackgroundMode): Ditto.
1849         * rendering/RenderLayer.cpp:
1850         (WebCore::RenderLayer::usesCompositedScrolling): Use RenderLayerBacking::hasScrollingLayer as
1851         it better matches the intention of the check here.
1852
1853 2017-06-29  Romain Bellessort  <romain.bellessort@crf.canon.fr>
1854
1855         [Readable Streams API] Fix ReadableStream "strategy" argument handling
1856         https://bugs.webkit.org/show_bug.cgi?id=172716
1857
1858         Reviewed by Xabier Rodriguez-Calvar.
1859
1860         Aligned default strategy parameter with spec, as defined in [1].
1861         
1862         [1] https://streams.spec.whatwg.org/#rs-constructor
1863
1864         Added new tests and updated some existing ones based on the newly
1865         expected behavior. Also updated expectations for WPT streams tests.
1866
1867         * Modules/streams/ReadableStream.js:
1868         (initializeReadableStream): Fixed initialization of strategy.
1869
1870 2017-06-29  Antti Koivisto  <antti@apple.com>
1871
1872         REGRESSION(r215347): NAS4Free Pop-down menus fail to appear
1873         https://bugs.webkit.org/show_bug.cgi?id=173967
1874         <rdar://problem/32690114>
1875
1876         Reviewed by Andreas Kling.
1877
1878         Menus on this configuration page operate by mutating visibility. We fail to trigger required
1879         compositing updates when visibility changes on non-composited layer. Visibility of a non-composited
1880         descendant may affect geometry of the composited ancestor layer.
1881
1882         Test: compositing/backing/non-composited-visibility-change.html
1883
1884         * rendering/RenderLayerCompositor.cpp:
1885         (WebCore::RenderLayerCompositor::layerStyleChanged):
1886         (WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer): Added.
1887
1888             Trigger compositing update for non-composited layers on visibility change.
1889             Factor tests into function.
1890
1891         * rendering/RenderLayerCompositor.h:
1892
1893 2017-06-28  Frederic Wang  <fwang@igalia.com>
1894
1895         Align Document::canNavigate on the HTM5 specification
1896         https://bugs.webkit.org/show_bug.cgi?id=173162
1897
1898         Reviewed by Chris Dumez.
1899
1900         Currently when a frame A with a sandboxed navigation flag tries and navigates another frame B
1901         then Document::canNavigate verifies the cases where we try to navigate A's top frame (in
1902         that case the allow-top-navigation flag is needed) or not (in that case, B must be a
1903         descendant of A). This patch refines that a bit to check the case where B is a popup (in that
1904         case navigation is permitted if A is the opener of B). This change aligns on the HTML5
1905         specification and allows to pass more W3C Web Platform tests.
1906         See https://html.spec.whatwg.org/multipage/browsers.html#allowed-to-navigate
1907
1908         Tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-3.html
1909                imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html
1910
1911         * dom/Document.cpp:
1912         (WebCore::Document::canNavigate): This refines the case where the document's frame has the
1913         sandbox navigation flag set in order to handle popup navigation. New comments referring to
1914         the HTML5 specification are also added.
1915
1916 2017-06-28  Myles C. Maxfield  <mmaxfield@apple.com>
1917
1918         Only apply font features for the particular type of font they are being applied to
1919         https://bugs.webkit.org/show_bug.cgi?id=172661
1920         <rdar://problem/31534119>
1921         <rdar://problem/32799624>
1922
1923         Reviewed by Simon Fraser.
1924
1925         There are two types of font formats which support features: AAT and OTF. Each of them has
1926         a different idea about what the identity of a feature is. We were specifying both types
1927         of feature identities to Core Text; however, this is causing Core Text to get confused.
1928         Instead, we should only apply AAT features to AAT fonts and OTF features to OTF fonts.
1929
1930         Test: Un-marking these tests as failure on High Sierra:
1931               css3/font-variant-petite-caps-synthesis-coverage.html
1932               css3/font-variant-small-caps-synthesis-coverage.html
1933
1934         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1935         (WebCore::FontType::FontType):
1936         (WebCore::preparePlatformFont):
1937         (WebCore::variationCapabilitiesForFontDescriptor):
1938         (WebCore::isGXVariableFont): Deleted.
1939
1940 2017-06-28  Chris Dumez  <cdumez@apple.com>
1941
1942         [ResourceLoadStatistics] Simplify PrevalentResourceTelemetry struct
1943         https://bugs.webkit.org/show_bug.cgi?id=173953
1944
1945         Reviewed by Sam Weinig.
1946
1947         * loader/ResourceLoadStatisticsStore.cpp:
1948         (WebCore::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
1949         * loader/ResourceLoadStatisticsStore.h:
1950         (WebCore::PrevalentResourceTelemetry::PrevalentResourceTelemetry): Deleted.
1951
1952 2017-06-28  Ryosuke Niwa  <rniwa@webkit.org>
1953
1954         Crash in WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange
1955         https://bugs.webkit.org/show_bug.cgi?id=173958
1956
1957         Reviewed by Simon Fraser.
1958
1959         The crashed is most likely caused by updateLayersAfterAncestorChange calling [CALayer setPosition]
1960         with a CGPoint which contains the x coordinate or the y coordinate of NaN.
1961
1962         Simon and I inpected the code but we couldn't figure out how we get there. Detect this case and bail out.
1963         Also log the relevant values and debug assert when this condition is hit to help identifying the root cause.
1964
1965         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
1966         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
1967
1968 2017-06-28  Chris Dumez  <cdumez@apple.com>
1969
1970         ResourceLoadObserver clean up
1971         https://bugs.webkit.org/show_bug.cgi?id=173955
1972
1973         Reviewed by Sam Weinig and Brent Fulgham.
1974
1975         ResourceLoadObserver clean up: Modernize code a bit and get rid of unused variables.
1976
1977         * loader/ResourceLoadObserver.cpp:
1978         (WebCore::ResourceLoadObserver::clearInMemoryStore):
1979         (WebCore::ResourceLoadObserver::clearInMemoryAndPersistentStore):
1980         (WebCore::ResourceLoadObserver::shouldLog):
1981         (WebCore::ResourceLoadObserver::logFrameNavigation):
1982         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1983         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1984         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1985         (WebCore::ResourceLoadObserver::logUserInteraction):
1986         (WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin):
1987         (WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin):
1988         (WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo):
1989         (WebCore::ResourceLoadObserver::fireDataModificationHandler):
1990         (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler):
1991         (WebCore::ResourceLoadObserver::primaryDomain):
1992         (WebCore::ResourceLoadObserver::statisticsForOrigin):
1993
1994 2017-06-28  Zalan Bujtas  <zalan@apple.com>
1995
1996         Move RenderEmbeddedObject::isReplacementObscured to HTMLPlugInElement
1997         https://bugs.webkit.org/show_bug.cgi?id=173802
1998         <rdar://problem/32884389>
1999
2000         Reviewed by Simon Fraser.
2001
2002         Hittesting could potentially destroy "this" renderer so calling it inside RenderEmbeddedObject
2003         could leave the caller with a stale pointer.
2004         This patch protects the plugin element from getting destroyed and checks if the renderer got
2005         deleted during the hittest to avoid nullptr dereference.
2006
2007         Speculative fix.
2008
2009         * html/HTMLPlugInElement.cpp:
2010         (WebCore::HTMLPlugInElement::isReplacementObscured):
2011         * html/HTMLPlugInElement.h:
2012         * rendering/RenderEmbeddedObject.cpp:
2013         (WebCore::RenderEmbeddedObject::isReplacementObscured): Deleted.
2014         * rendering/RenderEmbeddedObject.h:
2015         * testing/Internals.cpp:
2016         (WebCore::Internals::isPluginUnavailabilityIndicatorObscured):
2017
2018 2017-06-28  Chris Dumez  <cdumez@apple.com>
2019
2020         Avoid copying statistics in ResourceLoadStatisticsStore::readDataFromDecoder()
2021         https://bugs.webkit.org/show_bug.cgi?id=173951
2022
2023         Reviewed by Ryosuke Niwa.
2024
2025         * loader/ResourceLoadStatisticsStore.cpp:
2026         (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
2027
2028 2017-06-28  Ryosuke Niwa  <rniwa@webkit.org>
2029
2030         Safari's Speedometer score massively regresses when accessibility is enabled
2031         https://bugs.webkit.org/show_bug.cgi?id=173912
2032
2033         Reviewed by Chris Fleizach.
2034
2035         The bug was caused by HTMLTextFormControlElement::setInnerTextValue triggering a synchronous layout
2036         via constructing VisiblePosition when the accessibility tree is present.
2037
2038         Added AXObjectCache::postTextReplacementNotificationForTextControl which avoids the construction of
2039         VisiblePosition and other means of triggering a synchronous layout. This patch also fixes a subtle bug
2040         that HTMLTextFormControlElement was creating TextMarkerData with axID set to that of the text control
2041         element instead of the root editable element inside its shadow tree even though the typing command uses
2042         axID of the root editable element. While I couldn't find any user-visible behavioral change from this
2043         code change, new code is more self-consistent.
2044
2045         Also added LayoutDisallowedScope which asserts that no synchronous layout happens in setInnerTextValue
2046         so that we don't introduce a new performance regression like this in the future.
2047
2048         No new tests. Existing tests in accessibility directory covers this.
2049
2050         * CMakeLists.txt: Added LayoutDisallowedScope.cpp.
2051         * WebCore.xcodeproj/project.pbxproj: Ditto.
2052
2053         * accessibility/AXObjectCache.cpp:
2054         (WebCore::AXObjectCache::postTextReplacementNotificationForTextControl): Added.
2055         (WebCore::AXObjectCache::textMarkerDataForVisiblePosition): Modernized. Returns optional<TextMarkerData>
2056         instead of taking TextMarkerData as an out-argument, and returning with axID of 0.
2057         (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl): Added. This specialized version
2058         constructs TextMarkerData for the first position inside the editable region in a text control without
2059         triggering a synchronous layout.
2060
2061         * accessibility/AXObjectCache.h:
2062         (WebCore::TextMarkerData): Initialize each member automatically.
2063         (WebCore::AXObjectCache::postTextReplacementNotificationForTextControl):
2064
2065         * accessibility/ios/AXObjectCacheIOS.mm:
2066         (WebCore::AXObjectCache::postTextReplacementPlatformNotificationForTextControl): Added.
2067
2068         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2069         (+[WebAccessibilityTextMarker textMarkerWithVisiblePosition:cache:]):
2070
2071         * accessibility/mac/AXObjectCacheMac.mm:
2072         (WebCore::addTextMarkerFor): Extracted from textReplacementChangeDictionary. Added a new variant which
2073         takes a text form control instead.
2074         (WebCore::textReplacementChangeDictionary): Templatized this function to either take VisiblePosition
2075         and call textMarkerForVisiblePosition or take HTMLTextFormControlElement and call
2076         textMarkerForFirstPositionInTextControl.
2077         (WebCore::postUserInfoForChanges): Extracted from postTextReplacementPlatformNotification.
2078         (WebCore::AXObjectCache::postTextReplacementPlatformNotification): 
2079         (WebCore::AXObjectCache::postTextReplacementPlatformNotificationForTextControl): Added.
2080
2081         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
2082         * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
2083
2084         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2085         (textMarkerForVisiblePosition):
2086         (-[WebAccessibilityObjectWrapper textMarkerForFirstPositionInTextControl:]): Added.
2087
2088         * dom/Document.cpp:
2089         (WebCore::Document::updateLayout): Assert that LayoutDisallowedScope is not in the stack frame.
2090
2091         * html/HTMLTextFormControlElement.cpp:
2092         (WebCore::HTMLTextFormControlElement::setInnerTextValue): Call postTextReplacementNotificationForTextControl
2093         to avoid triggering a synchronous layout. Also create LayoutDisallowedScope to avoid a similar performance
2094         regression from being introduced in the future in this function. Finally, made innerText a RefPtr for extra
2095         safety since we're using it after updating the DOM tree.
2096
2097         * rendering/LayoutDisallowedScope.cpp: Added.
2098         * rendering/LayoutDisallowedScope.h: Added.
2099         (WebCore::LayoutDisallowedScope::LayoutDisallowedScope):
2100         (WebCore::LayoutDisallowedScope::~LayoutDisallowedScope):
2101         (WebCore::LayoutDisallowedScope::isLayoutAllowed):
2102
2103 2017-06-27  Myles C. Maxfield  <mmaxfield@apple.com>
2104
2105         [iOS] Cannot italicize or bold text rendered with text styles
2106         https://bugs.webkit.org/show_bug.cgi?id=173634
2107
2108         Reviewed by Darin Adler.
2109
2110         r218616 enabled the new cascade list codepath for "system-ui," but didn't do it for the named
2111         text styles (like "font: -apple-system-tall-body;"). This new codepath is better because it
2112         correctly specifies weights and italics (using kCTFontWeightTrait and kCTFontSlantTrait) instead
2113         of using symbolic traits, and because it correctly handles fonts in the Core Text fallback chain.
2114         This patch migrates the named text styles to this new codepath.
2115
2116         Test: fast/text/ipad/bold-tall-body-text-style.html
2117
2118         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
2119         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters):
2120         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue):
2121         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator==):
2122         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash):
2123         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::hash):
2124         (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::equal):
2125         (WebCore::SystemFontDatabase::systemFontCascadeList):
2126         (WebCore::convertArray):
2127         (WebCore::convertArray):
2128         (WebCore::makeNeverDestroyed):
2129         (WebCore::isUIFontTextStyle):
2130         (WebCore::systemFontParameters):
2131         (WebCore::FontCascadeDescription::effectiveFamilyCount):
2132         (WebCore::FontCascadeDescription::effectiveFamilyAt):
2133         (WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::hash): Deleted.
2134         (WebCore::SystemFontDatabase::CoreTextCascadeListParametersHash::equal): Deleted.
2135         * platform/graphics/ios/FontCacheIOS.mm:
2136         (WebCore::platformFontWithFamilySpecialCase):
2137
2138 2017-06-28  Devin Rousso  <drousso@apple.com>
2139
2140         Web Inspector: Instrument active pixel memory used by canvases
2141         https://bugs.webkit.org/show_bug.cgi?id=173087
2142         <rdar://problem/32719261>
2143
2144         Reviewed by Joseph Pecoraro.
2145
2146         Test: inspector/canvas/memory.html
2147
2148         * html/HTMLCanvasElement.cpp:
2149         (WebCore::HTMLCanvasElement::setImageBuffer):
2150         * inspector/InspectorCanvasAgent.h:
2151         * inspector/InspectorCanvasAgent.cpp:
2152         (WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
2153         (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
2154         * inspector/InspectorInstrumentation.h:
2155         * inspector/InspectorInstrumentation.cpp:
2156         (WebCore::InspectorInstrumentation::didChangeCanvasMemory):
2157         (WebCore::InspectorInstrumentation::didChangeCanvasMemoryImpl):
2158
2159 2017-06-28  Alex Christensen  <achristensen@webkit.org>
2160
2161         Prevent displaying URLs with small capital letters
2162         https://bugs.webkit.org/show_bug.cgi?id=173949
2163         <rdar://problem/32952058>
2164
2165         Reviewed by Brent Fulgham.
2166
2167         Covered by new API tests.
2168
2169         * platform/mac/WebCoreNSURLExtras.mm:
2170         (WebCore::isLookalikeCharacter):
2171
2172 2017-06-28  Youenn Fablet  <youenn@apple.com>
2173
2174         Support PeerConnectionStates::BundlePolicy::MaxBundle when setting rtc configuration
2175         https://bugs.webkit.org/show_bug.cgi?id=169389
2176
2177         Reviewed by Alex Christensen.
2178
2179         Covered by manual testing (appr.tc and https://youennf.github.io/webrtc-tests/src/content/peerconnection/trickle-ice/).
2180         Previously, we were creating a libwebrtc peer connection and then setting its configuration.
2181         libwebrtc does not like the configuration to be changed and may refuse to set the configuration.
2182         Instead of doing that, we are now creating the libwebrtc peer connection with the provided configuration.
2183
2184         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2185         (WebCore::MediaEndpointPeerConnection::setConfiguration):
2186         * Modules/mediastream/MediaEndpointPeerConnection.h:
2187         * Modules/mediastream/PeerConnectionBackend.h:
2188         * Modules/mediastream/RTCPeerConnection.cpp:
2189         (WebCore::RTCPeerConnection::initializeWith):
2190         (WebCore::iceServersFromConfiguration):
2191         (WebCore::RTCPeerConnection::initializeConfiguration):
2192         (WebCore::RTCPeerConnection::setConfiguration):
2193         * Modules/mediastream/RTCPeerConnection.h:
2194         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2195         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
2196         (WebCore::LibWebRTCMediaEndpoint::setConfiguration):
2197         (WebCore::LibWebRTCMediaEndpoint::stop):
2198         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2199         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2200         (WebCore::configurationFromMediaEndpointConfiguration):
2201         (WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
2202         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2203         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2204         (WebCore::createActualPeerConnection):
2205         (WebCore::LibWebRTCProvider::createPeerConnection):
2206         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2207
2208 2017-06-28  Brent Fulgham  <bfulgham@apple.com>
2209
2210         Teach ResourceLoadStatistics to recognize changes in the file system
2211         https://bugs.webkit.org/show_bug.cgi?id=173800
2212         <rdar://problem/32937842>
2213
2214         Reviewed by Chris Dumez.
2215
2216         We want to support the case where multiple UI processes choose to share the same
2217         statistics file. To support this, update the ResourceLoadStatistics logic to be aware
2218         that the statistics data file might change underneath it, and to take appropriate
2219         action when it does.
2220
2221         * WebCore.xcodeproj/project.pbxproj: Update for new sources.
2222         * WebCore/CMakeLists.txt: Update for new FileMonitor source file.
2223         * loader/ResourceLoadStatisticsStore.cpp:
2224         (WebCore::ResourceLoadStatisticsStore::clearInMemoryAndPersistent): Use the new deletion
2225         handler for the data file instead of writing out an empty file.
2226         (WebCore::ResourceLoadStatisticsStore::setDeletePersistentStoreCallback): Added.
2227         * loader/ResourceLoadStatisticsStore.h:
2228         * platform/FileMonitor.cpp: Added.
2229         (WebCore::FileMonitor::create):
2230         (WebCore::FileMonitor::FileMonitor): Register handlers and begin monitoring file.
2231         (WebCore::FileMonitor::~FileMonitor): Stop any active file monitoring.
2232         (WebCore::FileMonitor::startMonitoringPath): Stub implementation.
2233         (WebCore::FileMonitor::stopMonitoring): Ditto.
2234         * platform/FileMonitor.h: Added.
2235         * platform/FileSystem.h: Export files needed by WebKit2. Add support for O_EVTONLY
2236         Darwin file handles.
2237         * platform/Logging.h: Add 'ResourceLoadStatistics' category.
2238         * platform/cocoa/FileMonitorCocoa.mm: Added.
2239         (WebCore::FileMonitor::startMonitoringPath): Create a new VNODE type dispatch_source
2240         to receive notifications when the specified file changes.
2241         (WebCore::FileMonitor::stopMonitoring): Cancel the dispatch_source when we are done
2242         monitoring the file.
2243         * platform/posix/FileSystemPOSIX.cpp: Update 'openFile' to understand the O_EVTONLY
2244         mode of file handles (Darwin-only). 
2245
2246 2017-06-28  Brady Eidson  <beidson@apple.com>
2247
2248         DocumentLoader should always notify the client if there are pending icon loads when the load is stopped.
2249         https://bugs.webkit.org/show_bug.cgi?id=173874
2250
2251         Reviewed by Alex Christensen.
2252
2253         Covered by API tests.
2254
2255         Patch started by Carlos Garcia Campos, finished by me.
2256         
2257         * loader/DocumentLoader.cpp:
2258         (WebCore::DocumentLoader::stopLoading): Make all of the callbacks for cancelled IconLoaders.
2259         (WebCore::DocumentLoader::didGetLoadDecisionForIcon): Make the callback even if there's no IconLoader.
2260         (WebCore::DocumentLoader::finishedLoadingIcon):
2261         (WebCore::DocumentLoader::notifyFinishedLoadingIcon):
2262         * loader/DocumentLoader.h:
2263
2264 2017-06-28  Antoine Quint  <graouts@apple.com>
2265
2266         Volume controls should be hidden when AirPlay is active
2267         https://bugs.webkit.org/show_bug.cgi?id=173933
2268         <rdar://problem/33011931>
2269
2270         Reviewed by Dean Jackson.
2271
2272         Ensure we don't show any volume controls during AirPlay. We set the mute button's enabled state to "false"
2273         when AirPlay is active and key off this enabled stated to control the display of all volume-related controls
2274         throughout the UI.
2275
2276         Tests: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-volume-controls-hidden-when-mute-button-disabled.html
2277                media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-top-right-controls-bar-hidden-when-mute-button-disabled.html
2278
2279         * Modules/modern-media-controls/controls/inline-media-controls.js:
2280         (InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
2281         (InlineMediaControls):
2282         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
2283         (MacOSFullscreenMediaControls.prototype.layout):
2284         * Modules/modern-media-controls/media/airplay-support.js:
2285         (AirplaySupport.prototype.syncControl):
2286         (AirplaySupport):
2287
2288 2017-06-28  Konstantin Tokarev  <annulen@yandex.ru>
2289
2290         Remove excessive includes from WebCore/css sources
2291         https://bugs.webkit.org/show_bug.cgi?id=173919
2292
2293         Reviewed by Simon Fraser.
2294
2295         No new tests needed.
2296
2297         * css/CSSCanvasValue.cpp:
2298         * css/CSSComputedStyleDeclaration.cpp:
2299         * css/CSSContentDistributionValue.cpp:
2300         * css/CSSCrossfadeValue.cpp:
2301         * css/CSSCursorImageValue.cpp:
2302         * css/CSSCustomPropertyValue.cpp:
2303         * css/CSSDefaultStyleSheets.cpp:
2304         * css/CSSFilterImageValue.cpp:
2305         * css/CSSFontFace.cpp:
2306         * css/CSSFontFaceSet.cpp:
2307         * css/CSSFontFaceSource.cpp:
2308         * css/CSSFontFaceSrcValue.cpp:
2309         * css/CSSFontFeatureValue.cpp:
2310         * css/CSSFontSelector.cpp:
2311         * css/CSSFontValue.cpp:
2312         * css/CSSImageGeneratorValue.cpp:
2313         * css/CSSImageSetValue.cpp:
2314         * css/CSSImageValue.cpp:
2315         * css/CSSImportRule.cpp:
2316         * css/CSSKeyframesRule.cpp:
2317         * css/CSSMediaRule.cpp:
2318         * css/CSSNamedImageValue.cpp:
2319         * css/CSSPrimitiveValue.cpp:
2320         * css/CSSProperty.cpp:
2321         * css/CSSPropertySourceData.cpp:
2322         * css/CSSReflectValue.cpp:
2323         * css/CSSRuleList.cpp:
2324         * css/CSSSegmentedFontFace.cpp:
2325         * css/CSSSelector.cpp:
2326         * css/CSSStyleRule.cpp:
2327         * css/CSSStyleSheet.cpp:
2328         * css/CSSSupportsRule.cpp:
2329         * css/CSSToStyleMap.cpp:
2330         * css/CSSValueList.cpp:
2331         * css/CSSValuePool.cpp:
2332         * css/CSSVariableData.cpp:
2333         * css/ElementRuleCollector.cpp:
2334         * css/InspectorCSSOMWrappers.cpp:
2335         * css/MediaList.cpp:
2336         * css/MediaQueryEvaluator.cpp:
2337         * css/MediaQueryExpression.cpp:
2338         * css/PropertySetCSSStyleDeclaration.cpp:
2339         * css/RGBColor.cpp:
2340         * css/SelectorChecker.cpp:
2341         * css/StyleProperties.cpp:
2342         * css/StyleResolver.cpp:
2343         * css/StyleRule.cpp:
2344         * css/StyleSheetContents.cpp:
2345         * css/TransformFunctions.cpp:
2346         * css/ViewportStyleResolver.cpp:
2347         * css/WebKitCSSRegionRule.cpp:
2348         * css/parser/CSSParser.cpp:
2349         * css/parser/CSSParserFastPaths.cpp:
2350         * css/parser/CSSParserIdioms.cpp:
2351         * css/parser/CSSParserSelector.cpp:
2352         * css/parser/CSSParserToken.cpp:
2353         * css/parser/CSSPropertyParser.cpp:
2354         * css/parser/CSSSelectorParser.cpp:
2355         * css/parser/MediaQueryParser.cpp:
2356
2357 2017-06-28  Alex Christensen  <achristensen@webkit.org>
2358
2359         Fix CMake build.
2360
2361         * PlatformMac.cmake:
2362
2363 2017-06-28  Antoine Quint  <graouts@apple.com>
2364
2365         Remove unnecessary `const double` method arguments
2366         https://bugs.webkit.org/show_bug.cgi?id=173925
2367
2368         Reviewed by Dean Jackson.
2369
2370         Addressing post-landing feedback from webkit.org/b/173858.
2371
2372         * Modules/mediacontrols/MediaControlsHost.cpp:
2373         (WebCore::MediaControlsHost::formattedStringForDuration):
2374         * Modules/mediacontrols/MediaControlsHost.h:
2375         * rendering/RenderTheme.h:
2376         (WebCore::RenderTheme::mediaControlsFormattedStringForDuration):
2377         * rendering/RenderThemeCocoa.h:
2378
2379 2017-06-28  Zalan Bujtas  <zalan@apple.com>
2380
2381         Unreviewed, rolling out r218373.
2382
2383         Output is not right
2384
2385         Reverted changeset:
2386
2387         "Use WTFLogAlways for debug logging so that it shows up in
2388         device system logs"
2389         https://bugs.webkit.org/show_bug.cgi?id=173450
2390         http://trac.webkit.org/changeset/218373
2391
2392 2017-06-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2393
2394         [GTK] Some web pages disappear immediately after rendering
2395         https://bugs.webkit.org/show_bug.cgi?id=173768
2396
2397         Reviewed by Xabier Rodriguez-Calvar.
2398
2399         This is happening with websites having a "hidden" class in HTML tag when a media element is added. In the GTK+
2400         port the media controls CSS contains the following code:
2401
2402         .hidden {
2403             display: none !important;
2404         }
2405
2406         That causes the whole HTML document to become display: none. That's why we just render a white page, and also
2407         the reason why it only happens with the GTK+ port and only with some specific websites. We should limit the
2408         scope of the hidden class to the media control elements.
2409
2410         * css/mediaControlsGtk.css:
2411         (audio::-webkit-media-controls-panel.hidden,):
2412         (audio::-webkit-media-controls-panel div.mute-box.hidden,):
2413         (audio::-webkit-media-controls-current-time-display.hidden,):
2414         (audio::-webkit-media-controls-timeline.hidden,):
2415         (audio::-webkit-media-controls-toggle-closed-captions-button, video::-webkit-media-controls-toggle-closed-captions-button):
2416         (audio::-webkit-media-controls-toggle-closed-captions-button.hidden,):
2417         (video::-webkit-media-controls-closed-captions-container.hidden):
2418         (audio::-webkit-media-controls-fullscreen-button.hidden,):
2419         (.hidden): Deleted.
2420
2421 2017-06-28  Antoine Quint  <graouts@apple.com>
2422
2423         Media controls volume glyph does not have the correct material
2424         https://bugs.webkit.org/show_bug.cgi?id=173918
2425         <rdar://problem/33012697>
2426
2427         Reviewed by Eric Carlson.
2428
2429         Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-mute-button-in-bottom-or-top-right-controls-bar.html
2430
2431         All buttons were hosted in a ControlsBar save for the MuteButton, so we now host it in a controls bar as well
2432         to ensure compositing is similar to all other buttons.
2433
2434         * Modules/modern-media-controls/controls/inline-media-controls.css:
2435         (.media-controls.inline > .controls-bar.top-right):
2436         (.media-controls.inline > button.mute): Deleted.
2437         * Modules/modern-media-controls/controls/inline-media-controls.js:
2438         (InlineMediaControls):
2439         (InlineMediaControls.prototype.layout):
2440         (InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
2441         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
2442         (MacOSInlineMediaControls.prototype.handleEvent):
2443
2444 2017-06-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2445
2446         REGRESSION(r218799): [GTK][WPE] Critical warning at exit
2447         https://bugs.webkit.org/show_bug.cgi?id=173907
2448
2449         Reviewed by Konstantin Tokarev.
2450
2451         GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
2452
2453         This is now always happening when closing the MeiniBrowser and it's causing a lot of unit tests to fail. In
2454         r218799, GRefPtrGtk.h include was removed from PasteboardHelper.h that contains a GRefPtr<GtkTargetList>. The
2455         targets are destroyed at exit, but now trying to use g_object_unref instead of gtk_target_list_unref(). I've
2456         found two more cases like this in r218799, that removes GUniquePtrSoup.h from ResourceHandleInternal.h and
2457         ResourceRequest.h that have GUniquePtr<SoupBuffer> and GUniquePtr<SoupURI>.
2458
2459         Fixes several GTK+ and WPE unit tests.
2460
2461         * platform/gtk/PasteboardHelper.h: Bring back GRefPtrGtk.h.
2462         * platform/network/ResourceHandleInternal.h: Bring back GUniquePtrSoup.h.
2463         * platform/network/soup/ResourceRequest.h: Ditto.
2464
2465 2017-06-27  Chris Dumez  <cdumez@apple.com>
2466
2467         [ResourceLoadStatistics] Update minimumTimeBetweeenDataRecordsRemoval to 1 hour instead of 1 minute
2468         https://bugs.webkit.org/show_bug.cgi?id=173895
2469         <rdar://problem/32984366>
2470
2471         Reviewed by Brent Fulgham.
2472
2473         Update minimumTimeBetweeenDataRecordsRemoval to 1 hour instead of 1 minute to save battery.
2474         Also port code to modern time types.
2475
2476         * loader/ResourceLoadObserver.cpp:
2477         (WebCore::reduceTimeResolution):
2478         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2479         (WebCore::ResourceLoadObserver::setTimeToLiveUserInteraction):
2480         (WebCore::ResourceLoadObserver::setTimeToLiveCookiePartitionFree):
2481         (WebCore::ResourceLoadObserver::setMinimumTimeBetweeenDataRecordsRemoval):
2482         (WebCore::ResourceLoadObserver::setReducedTimestampResolution):
2483         (WebCore::ResourceLoadObserver::setGrandfatheringTime):
2484         * loader/ResourceLoadObserver.h:
2485         * loader/ResourceLoadStatistics.h:
2486         (WebCore::ResourceLoadStatistics::mostRecentUserInteractionTime):
2487         * loader/ResourceLoadStatisticsStore.cpp:
2488         (WebCore::ResourceLoadStatisticsStore::createEncoderFromData):
2489         (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
2490         (WebCore::shouldPartitionCookies):
2491         (WebCore::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
2492         (WebCore::ResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
2493         (WebCore::ResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval):
2494         (WebCore::ResourceLoadStatisticsStore::setGrandfatheringTime):
2495         (WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
2496         (WebCore::ResourceLoadStatisticsStore::topPrivatelyControlledDomainsToRemoveWebsiteDataFor):
2497         (WebCore::ResourceLoadStatisticsStore::handleFreshStartWithEmptyOrNoStore):
2498         (WebCore::ResourceLoadStatisticsStore::shouldRemoveDataRecords):
2499         (WebCore::ResourceLoadStatisticsStore::dataRecordsBeingRemoved):
2500         * loader/ResourceLoadStatisticsStore.h:
2501
2502 2017-06-27  Chris Dumez  <cdumez@apple.com>
2503
2504         Port HysteresisActivity to Seconds type
2505         https://bugs.webkit.org/show_bug.cgi?id=173902
2506
2507         Reviewed by Simon Fraser.
2508
2509         * platform/HysteresisActivity.h:
2510         (WebCore::HysteresisActivity::HysteresisActivity):
2511         (WebCore::HysteresisActivity::stop):
2512         * platform/ios/WebSQLiteDatabaseTrackerClient.mm:
2513
2514 2017-06-27  Jeremy Jones  <jeremyj@apple.com>
2515
2516         MediaPlayerPrivate m_private may not yet be created when setPrivateBrowsingMode is called.
2517         https://bugs.webkit.org/show_bug.cgi?id=173893
2518         rdar://problem/32986872
2519         
2520         Reviewed by Ryosuke Niwa.
2521
2522         No new tests because no reproducable case.
2523
2524         setPrivateBrowsingMode can be called on MediaPlayer before the MediaPlayerPrivate is created.
2525         The value should only be pushed down the m_private if it has been created.
2526
2527         * platform/graphics/MediaPlayer.cpp:
2528         (WebCore::MediaPlayer::setPrivateBrowsingMode):
2529
2530 2017-06-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2531
2532         [iOS DnD] Support dragging out of contenteditable areas without a prior selection
2533         https://bugs.webkit.org/show_bug.cgi?id=173854
2534         <rdar://problem/32236827>
2535
2536         Reviewed by Ryosuke Niwa and Tim Horton.
2537
2538         Allows elements to be dragged from contenteditable areas for both WebKit1 and WebKit2 iOS. There are two main
2539         changes in WebCore: move the touch point adjustment code into EventHandler::tryToBeginDataInteractionAtPoint, so
2540         that the clientPosition specified will be adjusted to an appropriate clickable node if needed. This is necessary
2541         because UIWebDocumentView and WKContentView no longer send adjusted points to WebCore when requesting drag
2542         start. See <https://bugs.webkit.org/show_bug.cgi?id=173855> for a followup regarding the globalPosition and
2543         clientPositions passed in to the MouseEvents when performing a drag or synthetic click.
2544
2545         Secondly, image elements in Mail's contenteditable area are not draggable unless the heuristic in
2546         DragController::draggableElement is tweaked to not reject image dragging across the board if the
2547         loadsImagesAutomatically setting is turned off. Instead, even if images are not automatically loaded, allow the
2548         image drag to commence if the image renderer already has a cached image.
2549
2550         Test: DataInteractionTests.DragImageFromContentEditable
2551
2552         * page/DragController.cpp:
2553         (WebCore::imageElementIsDraggable):
2554         (WebCore::DragController::draggableElement):
2555         * page/ios/EventHandlerIOS.mm:
2556         (WebCore::EventHandler::tryToBeginDataInteractionAtPoint):
2557
2558 2017-06-27  Antoine Quint  <graouts@apple.com>
2559
2560         [Modern Media Controls] Accessibility labels should be formatted using NSDateComponentsFormatter
2561         https://bugs.webkit.org/show_bug.cgi?id=173858
2562         <rdar://problem/32643171>
2563
2564         Reviewed by Dean Jackson.
2565
2566         We shouldn't be manually trying to create a formatted string for media controls and instead rely
2567         on NSDateComponentsFormatter to perform this task for us. So we remove the ad-hoc code in the JS
2568         media controls code and instead add a new MediaControlsHost method to format durations which calls
2569         into RenderTheme to provide a formatted duration string relevant to the current platform and locale.
2570
2571         * English.lproj/modern-media-controls-localized-strings.js:
2572         * Modules/mediacontrols/MediaControlsHost.cpp:
2573         (WebCore::MediaControlsHost::formattedStringForDuration):
2574         * Modules/mediacontrols/MediaControlsHost.h:
2575         * Modules/mediacontrols/MediaControlsHost.idl:
2576         * Modules/modern-media-controls/controls/slider.js:
2577         (Slider.prototype.set inputAccessibleLabel):
2578         * Modules/modern-media-controls/controls/time-label.js:
2579         (TimeLabel.prototype.commitProperty):
2580         * Modules/modern-media-controls/main.js:
2581         (createControls):
2582         (formattedStringForDuration):
2583         (formatTimeToString): Deleted.
2584         * rendering/RenderTheme.h:
2585         (WebCore::RenderTheme::mediaControlsFormattedStringForDuration):
2586         * rendering/RenderThemeCocoa.h:
2587         * rendering/RenderThemeCocoa.mm:
2588         (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):
2589
2590 2017-06-27  Eric Carlson  <eric.carlson@apple.com>
2591
2592         r218647 causes getUserMedia to fail on some machines
2593         https://bugs.webkit.org/show_bug.cgi?id=173894
2594
2595         Reviewed by Youenn Fablet.
2596
2597         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2598         (WebCore::AVVideoCaptureSource::isFrameRateSupported): Change frame rate epsilon from 0.00001
2599         to 0.001.
2600
2601 2017-06-27  Antoine Quint  <graouts@apple.com>
2602
2603         Placard icons act like buttons (can get keyboard focus and shows up in VoiceOver)
2604         https://bugs.webkit.org/show_bug.cgi?id=173891
2605         <rdar://problem/33011855>
2606
2607         Reviewed by Dean Jackson.
2608
2609         Ensure that we disable buttons inside placards as they're only decorative and should
2610         not be interactive.
2611
2612         * Modules/modern-media-controls/controls/placard.js:
2613         (Placard.):
2614
2615 2017-06-27  Jeremy Jones  <jeremyj@apple.com>
2616
2617         Disable m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause
2618         https://bugs.webkit.org/show_bug.cgi?id=173843
2619         rdar://problem/32982431
2620
2621         Reviewed by Eric Carlson.
2622
2623         Test: media/media-fullscreen-pause-inline.html
2624
2625         Some pages may not have a fullscreen button, so disabled m_temporarilyAllowingInlinePlaybackAfterFullscreen on pause.
2626
2627         * html/HTMLMediaElement.cpp:
2628         (WebCore::HTMLMediaElement::pause):
2629
2630 2017-06-27  Chris Dumez  <cdumez@apple.com>
2631
2632         [iOS] Avoid taking / releasing process assertions too quickly due to database activity
2633         https://bugs.webkit.org/show_bug.cgi?id=173879
2634         <rdar://problem/32412701>
2635
2636         Reviewed by Antti Koivisto.
2637
2638         Add HysteresisActivity to WebSQLiteDatabaseTrackerClient to avoid taking / releasing
2639         process assertion too quickly due to database activity.
2640
2641         * platform/ios/WebSQLiteDatabaseTrackerClient.h:
2642         * platform/ios/WebSQLiteDatabaseTrackerClient.mm:
2643         (WebCore::WebSQLiteDatabaseTrackerClient::WebSQLiteDatabaseTrackerClient):
2644         (WebCore::WebSQLiteDatabaseTrackerClient::willBeginFirstTransaction):
2645         (WebCore::WebSQLiteDatabaseTrackerClient::didFinishLastTransaction):
2646         (WebCore::WebSQLiteDatabaseTrackerClient::hysteresisUpdated):
2647
2648 2017-06-27  Youenn Fablet  <youenn@apple.com>
2649
2650         Using public logging for WebRTC release logging
2651         https://bugs.webkit.org/show_bug.cgi?id=173881
2652
2653         Reviewed by Eric Carlson.
2654
2655         No change of behavior.
2656
2657         * Modules/mediastream/PeerConnectionBackend.cpp:
2658         (WebCore::PeerConnectionBackend::createOfferSucceeded):
2659         (WebCore::PeerConnectionBackend::createOfferFailed):
2660         (WebCore::PeerConnectionBackend::createAnswerSucceeded):
2661         (WebCore::PeerConnectionBackend::createAnswerFailed):
2662         (WebCore::PeerConnectionBackend::setLocalDescriptionFailed):
2663         (WebCore::PeerConnectionBackend::setRemoteDescriptionFailed):
2664         (WebCore::PeerConnectionBackend::addIceCandidateFailed):
2665         (WebCore::PeerConnectionBackend::newICECandidate):
2666         * Modules/mediastream/RTCPeerConnection.cpp:
2667         (WebCore::RTCPeerConnection::queuedSetLocalDescription):
2668         (WebCore::RTCPeerConnection::queuedSetRemoteDescription):
2669         (WebCore::RTCPeerConnection::queuedAddIceCandidate):
2670         (WebCore::RTCPeerConnection::updateIceGatheringState):
2671         (WebCore::RTCPeerConnection::updateIceConnectionState):
2672         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2673         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
2674
2675 2017-06-27  Don Olmstead  <don.olmstead@sony.com>
2676
2677         [PAL] Add symbol export macros for PAL
2678         https://bugs.webkit.org/show_bug.cgi?id=171519
2679
2680         Reviewed by Konstantin Tokarev.
2681
2682         No new tests. No change in behavior.
2683
2684         * CMakeLists.txt:
2685         * config.h:
2686         * platform/PlatformExportMacros.h:
2687
2688 2017-06-27  John Wilander  <wilander@apple.com>
2689
2690         Resource Load Statistics: Add telemetry
2691         https://bugs.webkit.org/show_bug.cgi?id=173499
2692         <rdar://problem/32826094>
2693
2694         Reviewed by Brent Fulgham.
2695
2696         Test: http/tests/loading/resourceLoadStatistics/telemetry-generation.html
2697
2698         * loader/ResourceLoadObserver.cpp:
2699         (WebCore::ResourceLoadObserver::fireTelemetryHandler):
2700             Test infrastructure.
2701         * loader/ResourceLoadObserver.h:
2702         * loader/ResourceLoadStatisticsStore.cpp:
2703         (WebCore::ResourceLoadStatisticsStore::setFireTelemetryCallback):
2704         (WebCore::ResourceLoadStatisticsStore::fireTelemetryHandler):
2705             Test infrastructure.
2706         (WebCore::ResourceLoadStatisticsStore::sortedPrevalentResourceTelemetry):
2707             Convenience function for telemetry.
2708         * loader/ResourceLoadStatisticsStore.h:
2709             Added struct WebCore::PrevalentResourceTelemetry.
2710         * page/DiagnosticLoggingKeys.cpp:
2711         (WebCore::DiagnosticLoggingKeys::resourceLoadStatisticsTelemetryKey):
2712             Added.
2713         * page/DiagnosticLoggingKeys.h:
2714
2715 2017-06-27  Ting-Wei Lan  <lantw44@gmail.com>
2716
2717         Add missing includes to fix compilation error on FreeBSD
2718         https://bugs.webkit.org/show_bug.cgi?id=172919
2719
2720         Reviewed by Mark Lam.
2721
2722         No new tests needed.
2723
2724         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
2725         * platform/audio/ReverbAccumulationBuffer.cpp:
2726
2727 2017-06-27  Zalan Bujtas  <zalan@apple.com>
2728
2729         Add RenderEmbeddedObject::getReplacementTextGeometry helper.
2730         https://bugs.webkit.org/show_bug.cgi?id=173847
2731
2732         Reviewed by Simon Fraser.
2733
2734         ...and remove getReplacementTextGeometry's redundant return value. 
2735
2736         No change in functionality.
2737
2738         * rendering/RenderEmbeddedObject.cpp:
2739         (WebCore::RenderEmbeddedObject::paintReplaced):
2740         (WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
2741         (WebCore::RenderEmbeddedObject::unavailablePluginIndicatorBounds):
2742         (WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
2743         * rendering/RenderEmbeddedObject.h:
2744
2745 2017-06-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2746
2747         Refactor drag start codepaths to plumb a DragItem to client layers
2748         https://bugs.webkit.org/show_bug.cgi?id=173832
2749         Work towards <rdar://problem/32236827>
2750
2751         Reviewed by Ryosuke Niwa and Tim Horton.
2752
2753         Refactor drag start logic in WebCore to set up a DragItem and propagate it to WebDragClient. No change in behavior.
2754
2755         * loader/EmptyClients.cpp:
2756         * page/DragClient.h:
2757         * page/DragController.cpp:
2758         (WebCore::DragController::startDrag):
2759         (WebCore::DragController::doImageDrag):
2760         (WebCore::DragController::doSystemDrag):
2761
2762         Refactor to pass along a DragItem. Also, remove unused drag image anchor computation.
2763
2764         * page/DragController.h:
2765         * platform/DragImage.h:
2766         * platform/DragItem.h:
2767
2768         Add additional information needed to begin a drag on iOS.
2769
2770         (WebCore::DragItem::encode):
2771         (WebCore::DragItem::decode):
2772
2773         Add IPC serialization/deserialization support for DragItem.
2774
2775         * platform/PasteboardWriterData.cpp:
2776         (WebCore::PasteboardWriterData::isEmpty):
2777         * platform/PasteboardWriterData.h:
2778
2779 2017-06-27  Frederic Wang  <fwang@igalia.com>
2780
2781         Some tests to verify forbidden frame navigation time out
2782         https://bugs.webkit.org/show_bug.cgi?id=173657
2783
2784         Reviewed by Chris Dumez.
2785
2786         Currently some tests try and perform a forbidden frame navigation and verify the
2787         corresponding console error. However, WebKit does not raise any exception for such error so
2788         the tests have to wait until the timeout limit to complete, which makes execution slow.
2789         This patch modifies the setters of window.location for which such error may happen in order
2790         to raise an exception so the tests behave as expected.
2791
2792         No new tests, already covered by existing tests.
2793
2794         * page/Location.cpp: Adjust Location::setLocation to return a security exception and pass it
2795         to the callers.
2796         (WebCore::Location::setHref): Adjust function to possibly return an exception.
2797         (WebCore::Location::setProtocol): Ditto.
2798         (WebCore::Location::setHost): Ditto.
2799         (WebCore::Location::setHostname): Ditto.
2800         (WebCore::Location::setPort): Ditto.
2801         (WebCore::Location::setPathname): Ditto.
2802         (WebCore::Location::setSearch): Ditto.
2803         (WebCore::Location::setHash): Ditto.
2804         (WebCore::Location::assign): Ditto.
2805         (WebCore::Location::setLocation): FrameLoader::findFrameForNavigation is really only used
2806         to verify whether navigating m_frame is permitted so it is more simple and clearer to do it
2807         directly. When navigation is not permitted, this function now raises a security exception.
2808         * page/Location.h: Modify some setters to return an ExceptionOr<void>.
2809         * page/Location.idl: Allow some setters to raise an exception.
2810
2811 2017-06-26  Fujii Hironori  <Hironori.Fujii@sony.com>
2812
2813         [GTK] Layout Test webrtc/video.html issues "stack smashing detected"
2814         https://bugs.webkit.org/show_bug.cgi?id=173862
2815
2816         Reviewed by Carlos Garcia Campos.
2817
2818         Tests: webrtc/video.html
2819
2820         Passing a bool variable to g_object_get causes out-of-bound write.
2821         gboolean should be used, which is 4 bytes while bool is one byte.
2822
2823         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2824         (WebCore::MediaPlayerPrivateGStreamerBase::muted): Use gboolean instead of bool.
2825         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
2826         (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded): Ditto.
2827
2828 2017-06-26  Chris Dumez  <cdumez@apple.com>
2829
2830         WebsiteDataStore::fetchDataForTopPrivatelyControlledDomains() is inefficient
2831         https://bugs.webkit.org/show_bug.cgi?id=173850
2832
2833         Reviewed by Ryosuke Niwa.
2834
2835         * loader/ResourceLoadStatisticsStore.cpp:
2836         (WebCore::ResourceLoadStatisticsStore::updateStatisticsForRemovedDataRecords):
2837         * loader/ResourceLoadStatisticsStore.h:
2838
2839 2017-06-26  Antti Koivisto  <antti@apple.com>
2840
2841         REGRESSION (AsyncImageDecoding): A tab with the WWDC keynote paused is killed for using excessive power (Image thrashing)
2842         https://bugs.webkit.org/show_bug.cgi?id=173804
2843         <rdar://problem/32623745>
2844
2845         Reviewed by Simon Fraser.
2846
2847         When under memory pressure MemoryCache::singleton().pruneLiveResources(true) is called inFrameView::didPaintContents()
2848         after top level paint. We end up decoding and pruning bitmaps repeatedly for each tile, which is not great.
2849
2850         Situation gets worse with async decoding. Painting now doesn’t actually decode the image, it just starts the decoding.
2851         When it completes we trigger another paint to get the bits to the tiles. The paint for the first tile then calls
2852         pruneLiveResources and loses the bitmap and the second tile triggers another round of async decoding. We have code
2853         that prevents pruning of visible images but non-visible images in tiling area can hit this bug easily.
2854
2855         Test: fast/images/low-memory-decode.html
2856
2857         * page/FrameView.cpp:
2858         (WebCore::FrameView::willPaintContents):
2859         (WebCore::FrameView::didPaintContents):
2860
2861             Eliminate synchronous pruning during painting. This is an obsolete mechanism from early iOS times.
2862
2863         * platform/graphics/BitmapImage.cpp:
2864         (WebCore::BitmapImage::imageFrameAvailableAtIndex):
2865         (WebCore::BitmapImage::decodeCountForTesting):
2866
2867             Testing support.
2868
2869         * platform/graphics/BitmapImage.h:
2870         * testing/Internals.cpp:
2871         (WebCore::Internals::imageDecodeCount):
2872         * testing/Internals.h:
2873         * testing/Internals.idl:
2874
2875 2017-06-26  Chris Dumez  <cdumez@apple.com>
2876
2877         ImageFrameCache::startAsyncDecodingQueue() unsafely passes Strings across threads
2878         https://bugs.webkit.org/show_bug.cgi?id=173842
2879
2880         Reviewed by Simon Fraser.
2881
2882         The URL string was passed across thread without isolated copy.
2883
2884         * platform/graphics/ImageFrameCache.cpp:
2885         (WebCore::ImageFrameCache::startAsyncDecodingQueue):
2886
2887 2017-06-26  Jonathan Bedard  <jbedard@apple.com>
2888
2889         Unreviewed, rolling out r218783.
2890
2891         Causing accessibility/mac/setting-attributes-is-
2892         asynchronous.html to crash consistently on mac-wk2 Debug
2893
2894         Reverted changeset:
2895
2896         "AX: Cannot call setValue() on contenteditable or ARIA text
2897         controls"
2898         https://bugs.webkit.org/show_bug.cgi?id=173520
2899         http://trac.webkit.org/changeset/218783
2900
2901 2017-06-26  Yusuke Suzuki  <utatane.tea@gmail.com>
2902
2903         [WTF] Drop Thread::create(obsolete things) API since we can use lambda
2904         https://bugs.webkit.org/show_bug.cgi?id=173825
2905
2906         Reviewed by Saam Barati.
2907
2908         No behavior change.
2909
2910         * Modules/indexeddb/server/IDBServer.cpp:
2911         (WebCore::IDBServer::IDBServer::IDBServer):
2912         (WebCore::IDBServer::IDBServer::databaseThreadEntry): Deleted.
2913         * Modules/indexeddb/server/IDBServer.h:
2914         * Modules/webaudio/AsyncAudioDecoder.cpp:
2915         (WebCore::AsyncAudioDecoder::AsyncAudioDecoder):
2916         (WebCore::AsyncAudioDecoder::threadEntry): Deleted.
2917         * Modules/webaudio/AsyncAudioDecoder.h:
2918         * Modules/webaudio/OfflineAudioDestinationNode.cpp:
2919         (WebCore::OfflineAudioDestinationNode::startRendering):
2920         (WebCore::OfflineAudioDestinationNode::offlineRenderEntry): Deleted.
2921         * Modules/webaudio/OfflineAudioDestinationNode.h:
2922         * Modules/webdatabase/DatabaseThread.cpp:
2923         (WebCore::DatabaseThread::start):
2924         (WebCore::DatabaseThread::databaseThreadStart): Deleted.
2925         * Modules/webdatabase/DatabaseThread.h:
2926         * bindings/js/GCController.cpp:
2927         (WebCore::collect):
2928         (WebCore::GCController::gcTimerFired):
2929         (WebCore::GCController::garbageCollectOnAlternateThreadForDebugging):
2930         * loader/icon/IconDatabase.cpp:
2931         (WebCore::IconDatabase::open):
2932         (WebCore::IconDatabase::iconDatabaseSyncThreadStart): Deleted.
2933         * loader/icon/IconDatabase.h:
2934         * page/ResourceUsageThread.cpp:
2935         (WebCore::ResourceUsageThread::createThreadIfNeeded):
2936         (WebCore::ResourceUsageThread::threadCallback): Deleted.
2937         * page/ResourceUsageThread.h:
2938         * page/scrolling/ScrollingThread.cpp:
2939         (WebCore::ScrollingThread::createThreadIfNeeded):
2940         (WebCore::ScrollingThread::threadCallback): Deleted.
2941         (WebCore::ScrollingThread::threadBody): Deleted.
2942         * page/scrolling/ScrollingThread.h:
2943         * platform/audio/HRTFDatabaseLoader.cpp:
2944         (WebCore::HRTFDatabaseLoader::loadAsynchronously):
2945         (WebCore::databaseLoaderEntry): Deleted.
2946         * platform/audio/HRTFDatabaseLoader.h:
2947         * platform/audio/ReverbConvolver.cpp:
2948         (WebCore::ReverbConvolver::ReverbConvolver):
2949         (WebCore::backgroundThreadEntry): Deleted.
2950         * platform/audio/ReverbConvolver.h:
2951         (WebCore::ReverbConvolver::useBackgroundThreads):
2952         * platform/network/cf/LoaderRunLoopCF.cpp:
2953         (WebCore::loaderRunLoop):
2954         (WebCore::runLoaderThread): Deleted.
2955         * platform/network/curl/CurlManager.cpp:
2956         (WebCore::CurlManager::startThreadIfNeeded):
2957         (WebCore::CurlManager::workerThread):
2958         * platform/network/curl/CurlManager.h:
2959         * workers/WorkerThread.cpp:
2960         (WebCore::WorkerThread::start):
2961         (WebCore::WorkerThread::workerThreadStart): Deleted.
2962         * workers/WorkerThread.h:
2963
2964 2017-06-26  Joanmarie Diggs  <jdiggs@igalia.com>
2965
2966         [ATK] Add support for aria-details and aria-errormessage
2967         https://bugs.webkit.org/show_bug.cgi?id=172588
2968
2969         Reviewed by Chris Fleizach.
2970
2971         Add methods to retrieve elements referenced by or referencing the new
2972         aria-details and aria-errormessage attributes. Include aria-details and
2973         aria-errormessage in AccessibilityObject::supportsARIAAttributes() to ensure
2974         elements with these attributes will be included in the accessibility tree.
2975
2976         New test cases added to accessibility/gtk/relation-types.html.
2977
2978         * accessibility/AccessibilityObject.cpp:
2979         (WebCore::AccessibilityObject::supportsARIAAttributes):
2980         (WebCore::AccessibilityObject::ariaDetailsElements):
2981         (WebCore::AccessibilityObject::ariaDetailsReferencingElements):
2982         (WebCore::AccessibilityObject::ariaErrorMessageElements):
2983         (WebCore::AccessibilityObject::ariaErrorMessageReferencingElements):
2984         * accessibility/AccessibilityObject.h:
2985         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2986         (setAtkRelationSetFromCoreObject):
2987         * html/HTMLAttributeNames.in:
2988
2989 2017-06-26  Konstantin Tokarev  <annulen@yandex.ru>
2990
2991         Remove excessive headers from WebCore/{Modules,animation,crypto,domjit}
2992         https://bugs.webkit.org/show_bug.cgi?id=173824
2993
2994         Reviewed by Darin Adler.
2995
2996         No new tests needed.
2997
2998         * Modules/credentials/CredentialCreationOptions.h:
2999         * Modules/credentials/PasswordCredential.h:
3000         * Modules/fetch/FetchBody.h:
3001         * Modules/fetch/FetchBodyOwner.h:
3002         * Modules/gamepad/GamepadManager.h:
3003         * Modules/geolocation/Coordinates.h:
3004         * Modules/geolocation/Geoposition.h:
3005         * Modules/indexeddb/IDBActiveDOMObject.h:
3006         * Modules/indexeddb/IDBCursor.h:
3007         * Modules/indexeddb/IDBDatabase.h:
3008         * Modules/indexeddb/IDBDatabaseIdentifier.h:
3009         * Modules/indexeddb/IDBObjectStore.cpp:
3010         * Modules/indexeddb/IDBObjectStore.h:
3011         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3012         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3013         * Modules/indexeddb/shared/InProcessIDBServer.h:
3014         * Modules/indexeddb/shared/IndexKey.h:
3015         * Modules/mediacontrols/MediaControlsHost.h:
3016         * Modules/mediasession/WebMediaSessionManager.h:
3017         * Modules/mediasource/SourceBufferList.h:
3018         * Modules/mediasource/VideoPlaybackQuality.h:
3019         * Modules/notifications/Notification.h:
3020         * Modules/quota/WorkerNavigatorStorageQuota.h:
3021         * Modules/webaudio/AudioBasicProcessorNode.h:
3022         * Modules/webaudio/AudioContext.h:
3023         * Modules/webaudio/AudioDestinationNode.h:
3024         * Modules/webaudio/AudioParamTimeline.h:
3025         * Modules/webaudio/ConvolverNode.cpp:
3026         * Modules/webaudio/MediaStreamAudioSource.h:
3027         * Modules/webaudio/MediaStreamAudioSourceNode.h:
3028         * Modules/webaudio/PannerNode.h:
3029         * Modules/webaudio/PeriodicWave.h:
3030         * Modules/webaudio/ScriptProcessorNode.h:
3031         * Modules/webdatabase/DatabaseManager.h:
3032         * Modules/webdatabase/DatabaseTask.h:
3033         * Modules/webdatabase/SQLTransaction.h:
3034         * Modules/webdatabase/SQLTransactionBackend.h:
3035         * Modules/webdatabase/SQLTransactionStateMachine.h:
3036         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
3037         * Modules/websockets/WebSocketDeflater.h:
3038         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
3039         * animation/AnimationEffect.h:
3040         * crypto/CryptoKeyPair.h:
3041         * crypto/parameters/CryptoAlgorithmEcdhKeyDeriveParams.h:
3042         * dom/ScriptExecutionContext.h:
3043         * domjit/DOMJITHelpers.h:
3044         * domjit/DOMJITIDLConvert.h:
3045         * domjit/DOMJITIDLType.h:
3046
3047 2017-06-26  Konstantin Tokarev  <annulen@yandex.ru>
3048
3049         [GTK] Unreviewed, added missing includes to fix debug build
3050
3051         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3052
3053 2017-06-25  Konstantin Tokarev  <annulen@yandex.ru>
3054
3055         Remove excessive headers from WebCore/platform
3056         https://bugs.webkit.org/show_bug.cgi?id=173822
3057
3058         Reviewed by Tim Horton.
3059
3060         No new tests needed.
3061
3062         * html/ColorInputType.h:
3063         * html/MediaElementSession.h:
3064         * page/SecurityOriginData.cpp:
3065         * platform/CalculationValue.cpp:
3066         * platform/CalculationValue.h:
3067         * platform/ColorChooserClient.h:
3068         * platform/ContentType.h:
3069         * platform/LogMacros.h:
3070         * platform/PODRedBlackTree.h:
3071         * platform/PasteboardStrategy.h:
3072         * platform/PlatformPasteboard.h:
3073         * platform/PopupMenuStyle.h:
3074         * platform/ScrollAnimator.h:
3075         * platform/Theme.h:
3076         * platform/ThreadGlobalData.h:
3077         * platform/animation/AnimationList.h:
3078         * platform/audio/AudioArray.h:
3079         * platform/audio/AudioChannel.h:
3080         * platform/audio/DynamicsCompressor.h:
3081         * platform/audio/DynamicsCompressorKernel.h:
3082         * platform/audio/FFTFrame.h:
3083         * platform/audio/HRTFDatabaseLoader.cpp:
3084         * platform/audio/HRTFDatabaseLoader.h:
3085         * platform/audio/HRTFElevation.h:
3086         * platform/audio/MultiChannelResampler.h:
3087         * platform/audio/PlatformMediaSession.h:
3088         * platform/audio/ReverbConvolver.h:
3089         * platform/audio/ReverbConvolverStage.cpp:
3090         * platform/graphics/ANGLEWebKitBridge.h:
3091         * platform/graphics/BitmapImage.h:
3092         * platform/graphics/CrossfadeGeneratedImage.h:
3093         * platform/graphics/FloatPolygon.h:
3094         * platform/graphics/FloatSizeHash.h:
3095         * platform/graphics/Font.h:
3096         * platform/graphics/FontMetrics.h:
3097         * platform/graphics/FontPlatformData.h:
3098         * platform/graphics/FontRanges.h:
3099         * platform/graphics/FontTaggedSettings.h:
3100         * platform/graphics/GraphicsContext3D.h:
3101         * platform/graphics/GraphicsContext3DPrivate.h:
3102         * platform/graphics/GraphicsLayerClient.h:
3103         * platform/graphics/Image.cpp:
3104         * platform/graphics/ImageFrame.h:
3105         * platform/graphics/ImageFrameCache.h:
3106         * platform/graphics/ImageSource.h:
3107         * platform/graphics/IntRectHash.h:
3108         * platform/graphics/IntSizeHash.h:
3109         * platform/graphics/MediaPlaybackTargetClient.h:
3110         * platform/graphics/Pattern.h:
3111         * platform/graphics/PlatformTimeRanges.h:
3112         * platform/graphics/TextRun.h:
3113         * platform/graphics/TiledBacking.h:
3114         * platform/graphics/cairo/FontCustomPlatformData.h:
3115         * platform/graphics/filters/FEConvolveMatrix.h:
3116         * platform/graphics/filters/FELighting.h:
3117         * platform/graphics/filters/SourceAlpha.h:
3118         * platform/graphics/gstreamer/GStreamerUtilities.h:
3119         * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
3120         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3121         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3122         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
3123         * platform/graphics/harfbuzz/HarfBuzzShaper.h:
3124         * platform/graphics/opengl/Extensions3DOpenGL.h:
3125         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
3126         * platform/graphics/texmap/TextureMapperBackingStore.h:
3127         * platform/graphics/texmap/TextureMapperGL.cpp:
3128         * platform/graphics/texmap/TextureMapperGL.h:
3129         * platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
3130         * platform/graphics/texmap/TextureMapperTile.h:
3131         * platform/graphics/texmap/coordinated/Tile.h:
3132         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
3133         * platform/graphics/transforms/TransformState.h:
3134         * platform/gtk/PasteboardHelper.h:
3135         * platform/gtk/ScrollbarThemeGtk.h:
3136         * platform/image-decoders/ImageDecoder.h:
3137         * platform/network/BlobData.h:
3138         * platform/network/BlobDataFileReference.h:
3139         * platform/network/ResourceHandle.h:
3140         * platform/network/ResourceHandleInternal.h:
3141         * platform/network/SocketStreamHandleClient.h:
3142         * platform/network/soup/ResourceRequest.h:
3143         * platform/network/soup/SocketStreamHandleImpl.h:
3144         * platform/network/soup/SoupNetworkSession.h:
3145         * platform/sql/SQLiteFileSystem.h:
3146         * platform/text/LocaleICU.h:
3147
3148 2017-06-25  Youenn Fablet  <youenn@apple.com>
3149
3150         Remove use of mock webrtc backend factory at injected bundle reset time
3151         https://bugs.webkit.org/show_bug.cgi?id=173817
3152
3153         Reviewed by Darin Adler.
3154
3155         * testing/Internals.cpp:
3156         (WebCore::Internals::resetToConsistentState): Resetting the peer connection backend.
3157         * testing/MockLibWebRTCPeerConnection.cpp: Doing some clean-up
3158         (WebCore::useRealRTCPeerConnectionFactory):
3159         (WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory):
3160         (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
3161         (WebCore::MockLibWebRTCPeerConnectionFactory::CreateVideoTrack):
3162         (WebCore::MockLibWebRTCPeerConnectionFactory::CreateAudioTrack):
3163         * testing/MockLibWebRTCPeerConnection.h:
3164
3165 2017-06-25  Konstantin Tokarev  <annulen@yandex.ru>
3166
3167         Remove excessive headers from JavaScriptCore
3168         https://bugs.webkit.org/show_bug.cgi?id=173812
3169
3170         Reviewed by Darin Adler.
3171
3172         No new tests needed.
3173
3174         * Modules/indexeddb/IDBObjectStore.cpp:
3175         * bindings/js/JSDOMPromiseDeferred.h:
3176         * bindings/js/JSLazyEventListener.cpp:
3177         * bindings/js/JSMainThreadExecState.h:
3178         * bindings/js/ReadableStreamDefaultController.cpp:
3179         * bindings/js/ScriptGlobalObject.cpp:
3180         * bindings/js/SerializedScriptValue.cpp:
3181         * bridge/NP_jsobject.cpp:
3182         * dom/ScriptExecutionContext.cpp:
3183         * html/HTMLPlugInImageElement.cpp:
3184
3185 2017-06-25  Konstantin Tokarev  <annulen@yandex.ru>
3186
3187         Remove excessive headers from WebCore/{rendering,style,svg}
3188         https://bugs.webkit.org/show_bug.cgi?id=173773
3189
3190         Reviewed by Darin Adler.
3191
3192         No new tests needed.
3193
3194         * css/StyleBuilderConverter.h:
3195         * editing/TextIterator.cpp:
3196         * rendering/CounterNode.h:
3197         * rendering/FlexibleBoxAlgorithm.h:
3198         * rendering/HitTestLocation.h:
3199         * rendering/HitTestResult.h:
3200         * rendering/HitTestingTransformState.h:
3201         * rendering/OrderIterator.h:
3202         * rendering/RenderButton.h:
3203         * rendering/RenderCombineText.h:
3204         * rendering/RenderFlowThread.h:
3205         * rendering/RenderFullScreen.h:
3206         * rendering/RenderGeometryMap.h:
3207         * rendering/RenderListItem.h:
3208         * rendering/RenderMediaControlElements.cpp:
3209         * rendering/RenderMediaControlElements.h:
3210         * rendering/RenderMediaControls.h:
3211         * rendering/RenderMeter.h:
3212         * rendering/RenderMultiColumnSet.cpp:
3213         * rendering/RenderObject.h:
3214         * rendering/RenderRegion.h:
3215         * rendering/RenderRegionSet.cpp:
3216         * rendering/RenderRegionSet.h:
3217         * rendering/RenderTheme.h:
3218         * rendering/RenderVTTCue.cpp:
3219         * rendering/RenderVTTCue.h:
3220         * rendering/SimpleLineLayoutFunctions.h:
3221         * rendering/SimpleLineLayoutResolver.h:
3222         * rendering/line/BreakingContext.h:
3223         * rendering/line/LineBreaker.h:
3224         * rendering/mathml/MathMLStyle.h:
3225         * rendering/mathml/RenderMathMLOperator.h:
3226         * rendering/mathml/RenderMathMLRoot.h:
3227         * rendering/shapes/RectangleShape.h:
3228         * rendering/style/BasicShapes.h:
3229         * rendering/style/BorderData.h:
3230         * rendering/style/CounterDirectives.h:
3231         * rendering/style/GridArea.h:
3232         * rendering/style/KeyframeList.h:
3233         * rendering/style/RenderStyle.h:
3234         * rendering/style/SVGRenderStyle.h:
3235         * rendering/style/ShapeValue.h:
3236         * rendering/style/StyleCachedImage.h:
3237         * rendering/style/StyleMultiColData.h:
3238         * rendering/style/StyleRareNonInheritedData.h:
3239         * rendering/style/WillChangeData.h:
3240         * rendering/svg/RenderSVGBlock.h:
3241         * rendering/svg/RenderSVGRect.h:
3242         * rendering/svg/RenderSVGResource.h:
3243         * rendering/svg/RenderSVGResourceContainer.h:
3244         * rendering/svg/RenderSVGResourceMarker.h:
3245         * rendering/svg/RenderSVGResourceMasker.h:
3246         * rendering/svg/RenderSVGResourcePattern.h:
3247         * rendering/svg/SVGInlineFlowBox.cpp:
3248         * rendering/svg/SVGInlineTextBox.h:
3249         * rendering/svg/SVGRootInlineBox.h:
3250         * rendering/svg/SVGTextChunk.cpp:
3251         * rendering/svg/SVGTextChunk.h:
3252         * rendering/svg/SVGTextChunkBuilder.cpp:
3253         * rendering/svg/SVGTextLayoutEngine.cpp:
3254         * rendering/svg/SVGTextLayoutEngineSpacing.h:
3255         * style/RenderTreePosition.cpp:
3256         * style/RenderTreePosition.h:
3257         * style/RenderTreeUpdater.h:
3258         * style/StyleFontSizeFunctions.h:
3259         * style/StyleInvalidator.h:
3260         * style/StyleResolveForDocument.h:
3261         * style/StyleScope.h:
3262         * style/StyleTreeResolver.cpp:
3263         * style/StyleTreeResolver.h:
3264         * style/StyleUpdate.h:
3265         * svg/SVGAnimationElement.h:
3266         * svg/SVGFEBlendElement.cpp:
3267         * svg/SVGFEBlendElement.h:
3268         * svg/SVGFEComponentTransferElement.h:
3269         * svg/SVGFEFloodElement.cpp:
3270         * svg/SVGFEFloodElement.h:
3271         * svg/SVGFEImageElement.h:
3272         * svg/SVGFEMergeElement.cpp:
3273         * svg/SVGFEMergeElement.h:
3274         * svg/SVGFEOffsetElement.cpp:
3275         * svg/SVGFEOffsetElement.h:
3276         * svg/SVGFETileElement.cpp:
3277         * svg/SVGFETileElement.h:
3278         * svg/SVGParserUtilities.h:
3279         * svg/SVGPathByteStream.h:
3280         * svg/SVGPathElement.cpp:
3281         * svg/SVGPolyElement.cpp:
3282         * svg/SVGSVGElement.cpp:
3283         * svg/SVGTRefElement.cpp:
3284         * svg/SVGTextPathElement.cpp:
3285         * svg/SVGUseElement.cpp:
3286         * svg/animation/SMILTimeContainer.h:
3287         * svg/graphics/SVGImageCache.h:
3288         * svg/graphics/filters/SVGFilter.h:
3289
3290 2017-06-25  Antoine Quint  <graouts@apple.com>
3291
3292         Remove rAf suspension logging
3293         https://bugs.webkit.org/show_bug.cgi?id=173821
3294
3295         Reviewed by Tim Horton.
3296
3297         Now that webkit.org/b/173628 is fixed, we can remove the logging code we added.
3298
3299         * dom/Document.cpp:
3300         (WebCore::Document::requestAnimationFrame):
3301         * dom/ScriptedAnimationController.cpp:
3302         (WebCore::ScriptedAnimationController::suspend):
3303         (WebCore::ScriptedAnimationController::resume):
3304         * page/Page.cpp:
3305         (WebCore::Page::suspendScriptedAnimations):
3306         (WebCore::Page::resumeScriptedAnimations):
3307         (WebCore::Page::setIsVisibleInternal):
3308         * platform/RuntimeApplicationChecks.h:
3309         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
3310         (WebCore::MacApplication::isDumpRenderTree): Deleted.
3311
3312 2017-06-24  Sam Weinig  <sam@webkit.org>
3313
3314         [WebIDL] Add complete support for stringifier
3315         https://bugs.webkit.org/show_bug.cgi?id=173724
3316
3317         Reviewed by Darin Adler.
3318
3319         * bindings/scripts/CodeGeneratorJS.pm:
3320         (AddStringifierOperationIfNeeded):
3321         Update AddStringifierOperationIfNeeded to support stringifier on operations and be more
3322         strict about the allowed types. Also copies over all extended attributes to the synthetic
3323         operation.
3324
3325         * bindings/scripts/IDLParser.pm:
3326         (parseInterfaceMember):
3327         (parseOperationOrReadWriteAttributeOrMaplike):
3328         (parseReadOnlyMember):
3329         (parseStringifier):
3330         (parseStaticMember):
3331         (parseAttributeOrOperationForStringifierOrStatic):
3332         (parseReadWriteAttribute):
3333         (parseAttributeRest):
3334         (parseOperation):
3335         (parseSpecialOperation):
3336         (parseMapLikeProperties):
3337         (parseOperationRest):
3338         (parseAttributeOrOperationOrIterator): Deleted.
3339         (parseQualifier): Deleted.
3340         (parseAttributeOrOperationRest): Deleted.
3341         (parseAttribute): Deleted.
3342         (parseOperationOrIterator): Deleted.
3343         - Update parser to more closely resemble the WebIDL grammar, splitting out parseStringifier and
3344           parseStaticMember into their own subroutines. 
3345         - Move those and parseSerializer, parseStringifier, parseStaticMember, parseIterableRest and a split out
3346           parseReadOnlyMembers up into parseInterfaceMember to make it clearer that they are top level members
3347           and match the grammar.
3348         - Rename parseAttributeOrOperationOrIterator to parseOperationOrReadWriteAttributeOrMaplike to match the
3349           grammar language and make it clear what it does.
3350         - Add parseAttributeOrOperationForStringifierOrStatic which contains most of the logic for parsing stringifiers
3351           and static members, which have almost identical grammars.
3352         - Remove creator special which no longer exists in the spec.
3353
3354         * css/DOMMatrixReadOnly.idl:
3355         * css/WebKitCSSMatrix.idl:
3356         * dom/Range.idl:
3357         * html/URLSearchParams.idl:
3358         Fix FIXMEs by switching to use stringifier.
3359
3360         * bindings/scripts/test/JS/JSTestStringifier.cpp: Added.
3361         * bindings/scripts/test/JS/JSTestStringifier.h: Added.
3362         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: Added.
3363         * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.h: Added.
3364         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: Added.
3365         * bindings/scripts/test/JS/JSTestStringifierNamedOperation.h: Added.
3366         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: Added.
3367         * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.h: Added.
3368         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: Added.
3369         * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.h: Added.
3370         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: Added.
3371         * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.h: Added.
3372         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: Added.
3373         * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.h: Added.
3374         * bindings/scripts/test/TestStringifier.idl: Added.
3375         * bindings/scripts/test/TestStringifierAnonymousOperation.idl: Added.
3376         * bindings/scripts/test/TestStringifierNamedOperation.idl: Added.
3377         * bindings/scripts/test/TestStringifierOperationImplementedAs.idl: Added.
3378         * bindings/scripts/test/TestStringifierOperationNamedToString.idl: Added.
3379         * bindings/scripts/test/TestStringifierReadOnlyAttribute.idl: Added.
3380         * bindings/scripts/test/TestStringifierReadWriteAttribute.idl: Added.
3381         Add new tests.
3382
3383 2017-06-24  Chris Fleizach  <cfleizach@apple.com>
3384
3385         AX: Cannot call setValue() on contenteditable or ARIA text controls
3386         https://bugs.webkit.org/show_bug.cgi?id=173520
3387
3388         Reviewed by Ryosuke Niwa.
3389
3390         Add support for changing the value of a contenteditable and any other aria text control in setValue().
3391  
3392         Test: accessibility/mac/set-value-editable-types.html
3393
3394         * accessibility/AccessibilityRenderObject.cpp:
3395         (WebCore::AccessibilityRenderObject::setValue):
3396
3397 2017-06-23  Simon Fraser  <simon.fraser@apple.com>
3398
3399         Attempt to fix an internal build after r218755.
3400
3401         * bindings/js/JSMainThreadExecStateInstrumentation.h:
3402
3403 2017-06-23  Chris Dumez  <cdumez@apple.com>
3404
3405         Add release assertion to make sure callbackIdentifier is not 0 in DocumentLoader::finishedLoadingIcon()
3406         https://bugs.webkit.org/show_bug.cgi?id=173792
3407
3408         Reviewed by Ryosuke Niwa.
3409
3410         Add release assertion to make sure callbackIdentifier is not 0 in DocumentLoader::finishedLoadingIcon()
3411         as this could cause HashTable corruption on WebPageProxy side.
3412
3413         * loader/DocumentLoader.cpp:
3414         (WebCore::DocumentLoader::finishedLoadingIcon):
3415
3416 2017-06-23  Youenn Fablet  <youenn@apple.com>
3417
3418         webrtc::WebRtcSession is not handling correctly its state when setLocalDescription fails and is called again
3419         https://bugs.webkit.org/show_bug.cgi?id=173783
3420
3421         Reviewed by Alex Christensen.
3422
3423         Test: webrtc/libwebrtc/setLocalDescriptionCrash.html
3424
3425         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3426         (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription): Fail early if there is no pending remote description and description is for an answer.
3427
3428 2017-06-23  Eric Carlson  <eric.carlson@apple.com>
3429
3430         [MediaStream macOS] enumerateDevices should only return valid audio capture devices
3431         https://bugs.webkit.org/show_bug.cgi?id=173790
3432         <rdar://problem/32260334>
3433
3434         Reviewed by Youenn Fablet.
3435
3436         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
3437         (WebCore::isValidCaptureDevice): A valid device has a name and is not an aggregate device
3438         created by VPIO.
3439         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
3440
3441 2017-06-23  Jer Noble  <jer.noble@apple.com>
3442
3443         [WK2] Support -[WebAVPlayerController setMuted:]
3444         https://bugs.webkit.org/show_bug.cgi?id=173777
3445
3446         Reviewed by Eric Carlson.
3447
3448         Have -[WebAVPlayerController setMuted:] pass the request to its delegate (the model)
3449         rather than just storing the value.
3450
3451         * platform/cocoa/WebPlaybackSessionModel.h:
3452         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
3453         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
3454         (WebCore::WebPlaybackSessionModelMediaElement::toggleMuted):
3455         (WebCore::WebPlaybackSessionModelMediaElement::setMuted):
3456         * platform/ios/WebAVPlayerController.h:
3457         * platform/ios/WebAVPlayerController.mm:
3458         (-[WebAVPlayerController isMuted]):
3459         (-[WebAVPlayerController setMuted:]):
3460         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3461         (WebVideoFullscreenControllerContext::setMuted):
3462
3463 2017-06-23  Frederic Wang  <fwang@igalia.com>
3464
3465         Make RenderLayer::handleTouchEvent use usesAcceleratedScrolling()
3466         https://bugs.webkit.org/show_bug.cgi?id=173763
3467
3468         Reviewed by Simon Fraser.
3469
3470         No new tests, behavior is unchanged.
3471
3472         * rendering/RenderLayer.cpp:
3473         (WebCore::RenderLayer::handleTouchEvent): Call usesAcceleratedScrolling() instead of
3474         hasTouchScrollableOverflow() for clarity.
3475
3476 2017-06-23  Konstantin Tokarev  <annulen@yandex.ru>
3477
3478         Remove excessive headers from WebCore/{bindings,css,dom}
3479         https://bugs.webkit.org/show_bug.cgi?id=173766
3480
3481         Reviewed by Simon Fraser.
3482
3483         No new tests needed.
3484
3485         * ForwardingHeaders/runtime/ThrowScope.h: Added.
3486         * Modules/plugins/QuickTimePluginReplacement.mm:
3487         * bindings/js/CachedScriptSourceProvider.h:
3488         * bindings/js/JSCommandLineAPIHostCustom.cpp:
3489         * bindings/js/JSCustomXPathNSResolver.cpp:
3490         * bindings/js/JSDOMConstructorNotConstructable.h:
3491         * bindings/js/JSDOMConvertBase.h:
3492         * bindings/js/JSDOMConvertBufferSource.h:
3493         * bindings/js/JSDOMConvertInterface.h:
3494         * bindings/js/JSDOMConvertStrings.h:
3495         * bindings/js/JSDOMConvertUnion.h:
3496         * bindings/js/JSDOMConvertVariadic.h:
3497         * bindings/js/JSDOMConvertWebGL.h:
3498         * bindings/js/JSDOMExceptionHandling.h:
3499         * bindings/js/JSDOMIterator.h:
3500         * bindings/js/JSDOMMapLike.h:
3501         * bindings/js/JSDOMWindowBase.cpp:
3502         * bindings/js/JSDOMWindowCustom.cpp:
3503         * bindings/js/JSDOMWindowCustom.h:
3504         * bindings/js/JSDOMWindowProperties.h:
3505         * bindings/js/JSDOMWrapperCache.h:
3506         * bindings/js/JSLazyEventListener.cpp:
3507         * bindings/js/JSMainThreadExecStateInstrumentation.h:
3508         * bindings/js/JSMediaListCustom.h:
3509         * bindings/js/JSNodeCustom.h:
3510         * bindings/js/JSNodeListCustom.h:
3511         * bindings/js/JSVideoTrackListCustom.cpp:
3512         * bindings/js/ScheduledAction.h:
3513         * bindings/js/ScriptSourceCode.h:
3514         * bindings/js/SerializedScriptValue.h:
3515         * bindings/js/WebCoreJSClientData.h:
3516         * css/CSSFontFeatureValue.h:
3517         * css/CSSPrimitiveValue.h:
3518         * css/CSSStyleSheet.h:
3519         * css/CSSValue.h:
3520         * css/StyleBuilderCustom.h:
3521         * dom/ContainerNodeAlgorithms.h:
3522         * dom/DataTransfer.h:
3523         * dom/Node.h:
3524         * dom/NodeRareData.h:
3525         * dom/Position.h:
3526         * dom/RenderedDocumentMarker.h:
3527
3528 2017-06-23  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3529
3530         Fix broken WinCairo build
3531
3532         [Curl] Extract CurlDownloadManager as shared background task handler
3533         https://bugs.webkit.org/show_bug.cgi?id=173557
3534
3535         Reviewed by Joseph Pecoraro.
3536
3537         * platform/network/curl/CurlManager.h:
3538
3539 2017-06-23  Chris Dumez  <cdumez@apple.com>
3540
3541         [iOS] Potential crash under WebCore::notifyLowPowerModeChanged(WebCore::LowPowerModeNotifier*, bool)
3542         https://bugs.webkit.org/show_bug.cgi?id=173755
3543         <rdar://problem/32940942>
3544
3545         Reviewed by Mark Lam.
3546
3547         The crash was happening because the WebLowPowerModeObserver would dispatch
3548         a lambda to the main thread but the LowPowerModeNotifier object could be
3549         dead by the time we get to the main thread.
3550
3551         To address the issue, keep a strong ref to the WebLowPowerModeObserver in
3552         the lambda we dispatch to the main thread to make sure it stays alive until
3553         we execute the lambda. In the LowPowerModeNotifier destructor, we now reset
3554         the WebLowPowerModeObserver's notifier pointer to nil and I added a null
3555         check for this notifier in the lambda.
3556
3557         * platform/LowPowerModeNotifier.cpp:
3558         (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
3559         * platform/LowPowerModeNotifier.h:
3560         * platform/ios/LowPowerModeNotifierIOS.mm:
3561         (-[WebLowPowerModeObserver initWithNotifier:]):
3562         (-[WebLowPowerModeObserver _didReceiveLowPowerModeChange]):
3563         (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
3564         (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
3565         (WebCore::notifyLowPowerModeChanged):
3566
3567 2017-06-23  Alex Christensen  <achristensen@webkit.org>
3568
3569         Add SPI to WKURLSchemeTask for redirection
3570         https://bugs.webkit.org/show_bug.cgi?id=173730
3571
3572         Reviewed by Brady Eidson.
3573
3574         * platform/network/CacheValidation.cpp:
3575         (WebCore::computeFreshnessLifetimeForHTTPFamily):
3576         Asserting that redirects are always http/https URLs is no longer valid.
3577         If there's a custom scheme redirect, give it no freshness lifetime in the cache.
3578
3579 2017-06-23  Konstantin Tokarev  <annulen@yandex.ru>
3580
3581         Remove excessive headers from WebCore/{editing,fileapi,history,html,loader,page}
3582         https://bugs.webkit.org/show_bug.cgi?id=173769
3583
3584         Reviewed by Simon Fraser.
3585
3586         No new tests needed.
3587
3588         * css/CSSFontFaceSource.cpp:
3589         * editing/DictationCommand.cpp:
3590         * editing/Editor.h:
3591         * editing/VisiblePosition.h:
3592         * editing/VisibleUnits.h:
3593         * fileapi/BlobBuilder.h:
3594         * history/PageCache.h:
3595         * html/DOMURL.h:
3596         * html/HTMLCollection.h:
3597         * html/HTMLMediaElement.cpp:
3598         * html/HTMLMediaElement.h:
3599         * html/HTMLPlugInImageElement.cpp:
3600         * html/StepRange.h:
3601         * html/canvas/CanvasRenderingContext.h:
3602         * html/canvas/CanvasRenderingContext2D.h:
3603         * html/parser/HTMLDocumentParser.cpp:
3604         * html/parser/HTMLElementStack.h:
3605         * html/parser/HTMLInputStream.h:
3606         * html/shadow/MediaControlElements.cpp:
3607         * html/shadow/MediaControls.cpp:
3608         * html/shadow/MediaControls.h:
3609         * html/track/TrackListBase.h:
3610         * html/track/VTTCue.h:
3611         * html/track/WebVTTParser.cpp:
3612         * html/track/WebVTTParser.h:
3613         * loader/CrossOriginPreflightChecker.cpp:
3614         * loader/DocumentThreadableLoader.cpp:
3615         * loader/FrameLoaderClient.h:
3616         * loader/LinkPreloadResourceClients.h:
3617         * loader/LoadTiming.h:
3618         * loader/ThreadableLoaderClientWrapper.h:
3619         * loader/WorkerThreadableLoader.h:
3620         * loader/cache/CachedResourceLoader.h:
3621         * loader/cache/CachedResourceRequest.h:
3622         * loader/cache/CachedSVGDocument.h:
3623         * loader/cache/CachedTextTrack.h:
3624         * loader/icon/IconLoader.cpp:
3625         * page/AlternativeTextClient.h:
3626         * page/CaptionUserPreferences.cpp:
3627         * page/CaptionUserPreferences.h:
3628         * page/ContextMenuClient.h:
3629         * page/MainFrame.h:
3630         * page/Page.h:
3631         * page/PageGroup.h:
3632         * page/PerformanceEntry.h:
3633         * page/PerformanceResourceTiming.h:
3634         * page/ResourceUsageOverlay.cpp:
3635         * page/ResourceUsageOverlay.h:
3636         * page/UserContentController.h:
3637         * page/UserContentProvider.h:
3638         * page/animation/AnimationBase.h:
3639         * page/animation/CSSPropertyAnimation.h:
3640         * page/animation/CompositeAnimation.h:
3641         * page/scrolling/ScrollingCoordinator.h:
3642         * xml/XSLTProcessorLibxslt.cpp:
3643         * xml/parser/XMLDocumentParserLibxml2.cpp:
3644
3645 2017-06-23  Chris Dumez  <cdumez@apple.com>
3646
3647         [mac-wk1] requestAnimationFrame callbacks may not get serviced
3648         https://bugs.webkit.org/show_bug.cgi?id=173628
3649
3650         Reviewed by Simon Fraser.
3651
3652         Page::setIsVisibleInternal() was firing the 'visibilitychange' event
3653         synchronously while in the middle of updating its visibility/activity
3654         state. This allowed the JavaScript to re-enter the method by calling
3655         testRunner.setPageVisibility() / resetPageVisiblity() and we would
3656         end up in an inconsistent state.
3657
3658         No new tests, extended existing test.
3659
3660         * dom/Document.cpp:
3661         (WebCore::Document::visibilityStateChanged):
3662         Do no fire the visibilitychange event synchronously as we are in the
3663         middle of updating the page's activity state. Instead fire the
3664         event asynchronously.
3665
3666         * page/Page.cpp:
3667         (WebCore::Page::setIsVisibleInternal):
3668         Move the calling of Document::visibilityStateChanged() until after we're
3669         done updating the page's visibility state.
3670
3671         * testing/Internals.cpp:
3672         (WebCore::Internals::scriptedAnimationsAreSuspended):
3673         * testing/Internals.h:
3674         * testing/Internals.idl:
3675         Add test infrastructure to check if scripted animations are suspended.
3676
3677 2017-06-23  Eric Carlson  <eric.carlson@apple.com>
3678
3679         [iOS] Respond to AudioSession interruption and resume
3680         https://bugs.webkit.org/show_bug.cgi?id=173718
3681         <rdar://problem/32925263>
3682
3683         Reviewed by Youenn Fablet.
3684
3685         Tested manually.
3686
3687         * WebCore.xcodeproj/project.pbxproj: Add CoreAudioCaptureSourceIOS.mm/.h
3688
3689         * platform/mediastream/RealtimeMediaSource.h: Make createWeakPtr protected so derived classes
3690         can use it.
3691
3692         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.h: Added.
3693         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: Added.
3694         (-[WebCoreAudioCaptureSourceIOSListener initWithCallback:]):
3695         (-[WebCoreAudioCaptureSourceIOSListener invalidate]):
3696         (-[WebCoreAudioCaptureSourceIOSListener handleInterruption:]):
3697         (-[WebCoreAudioCaptureSourceIOSListener sessionMediaServicesWereReset:]):
3698         (WebCore::CoreAudioCaptureSourceIOS::CoreAudioCaptureSourceIOS):
3699         (WebCore::CoreAudioCaptureSourceIOS::~CoreAudioCaptureSourceIOS):
3700
3701         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3702         (WebCore::CoreAudioSharedUnit::suspended): 
3703         (WebCore::CoreAudioSharedUnit::setupAudioUnit): Clear m_suspended.
3704         (WebCore::CoreAudioSharedUnit::suspend): Don't clear sources or uninitialize the audio unit,
3705         suspend is temporary. Set m_suspended.
3706         (WebCore::CoreAudioSharedUnit::resume): New, restart the audio unit.
3707         (WebCore::CoreAudioCaptureSource::create): Create the correct object.
3708         (WebCore::CoreAudioCaptureSource::scheduleReconfiguration): Dispatch to main thread if necessary.
3709         (WebCore::CoreAudioCaptureSource::beginInterruption): New, suspend from main thread.
3710         (WebCore::CoreAudioCaptureSource::endInterruption): New, resume/reconfigure from main thread.
3711         (WebCore::CoreAudioCaptureSource::interrupted):
3712         * platform/mediastream/mac/CoreAudioCaptureSource.h:
3713
3714 2017-06-23  Zan Dobersek  <zdobersek@igalia.com>
3715
3716         [GCrypt] Drop the AES-CFB support
3717         https://bugs.webkit.org/show_bug.cgi?id=173547
3718
3719         Reviewed by Jiewen Tan.
3720
3721         No new tests -- relevant test baselines are updated.
3722
3723         Stop registering the AES-CFB algorithm as something that's supported by
3724         the libgcrypt implementation. This algorithm was previously included in
3725         the Web Crypto API specification, but has since been dropped from it.
3726
3727         Conveniently, libgcrypt only recently gained support for the CFB8 AES
3728         cipher mode that's required by the specification, meaning we could only
3729         support this algorithm with future releases of the libgcrypt library.
3730
3731         * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
3732         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
3733
3734 2017-06-23  Carlos Garcia Campos  <cgarcia@igalia.com>
3735
3736         [WPE] Enable PUBLIC_SUFFIX_LIST
3737         https://bugs.webkit.org/show_bug.cgi?id=173758
3738
3739         Reviewed by Žan Doberšek.
3740
3741         * PlatformWPE.cmake: Add PublicSuffixSoup.cpp to the build.
3742
3743 2017-06-22  Antti Koivisto  <antti@apple.com>
3744
3745         REGRESSION(r217695): Offscreen/overflowed items not being rendered while translating in-frame
3746         https://bugs.webkit.org/show_bug.cgi?id=173732
3747
3748         Reviewed by Simon Fraser.
3749
3750         If an accelerated animation starts completely outside the view we fail to create backing for it
3751         when it moves into view.
3752
3753         Fix by computing the full extent rect of the animation when it starts and doing the viewport overlap
3754         testing with that.
3755
3756         Test: compositing/backing/transform-transition-from-outside-view.html
3757
3758         * platform/graphics/GraphicsLayer.h:
3759         (WebCore::GraphicsLayer::animationExtent):
3760         (WebCore::GraphicsLayer::setAnimationExtent):
3761         * platform/graphics/ca/GraphicsLayerCA.cpp:
3762         (WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect):
3763
3764             Return the current animation transformation matrix so we can use it elsewhere without recomputing.
3765
3766         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
3767
3768             If we have animation extent use it instead of bounds for visibility testing.
3769
3770         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
3771
3772             Track if theres is a visible ancestor layer with a transition animation.
3773
3774         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
3775         (WebCore::GraphicsLayerCA::updateCoverage):
3776
3777             For simplicity create backing for all sublayers of a visible transform animated layer.
3778
3779         * platform/graphics/ca/GraphicsLayerCA.h:
3780         (WebCore::GraphicsLayerCA::VisibleAndCoverageRects::VisibleAndCoverageRects): Deleted.
3781         * rendering/RenderLayerBacking.cpp:
3782         (WebCore::RenderLayerBacking::updateGeometry):
3783
3784             Pass the animation extent (including descendants) to GraphicsLayer.
3785
3786 2017-06-22  Chris Dumez  <cdumez@apple.com>
3787
3788         ResourceLoadStatisticsStore should be ThreadSafeRefCounted
3789         https://bugs.webkit.org/show_bug.cgi?id=173753
3790         <rdar://problem/32939326>
3791
3792         Reviewed by Andreas Kling.
3793
3794         ResourceLoadStatisticsStore should be ThreadSafeRefCounted as it is ref'd/deref'd
3795         from different threads.
3796
3797         * loader/ResourceLoadStatisticsStore.h:
3798
3799 2017-06-22  Myles C. Maxfield  <mmaxfield@apple.com>
3800
3801         @font-face rules with invalid primary fonts never download their secondary fonts
3802         https://bugs.webkit.org/show_bug.cgi?id=173138
3803         <rdar://problem/32554450>
3804
3805         Reviewed by Simon Fraser.
3806
3807         We have logic in CSSFontAccessor::font() which disallows downloading a CSSFontFace if that CSSFontFace
3808         is already in the Succeeded state. However, it was possible for a succeeded CSSFontFace to still fail
3809         to create a font. In this situation, we wouldn't be able to use the downloaded font, and we wouldn't
3810         try to download the next item in the src: list because the CSSFontFace is succeeded.
3811
3812         This patch strengthens the meaning of the Succeeded state. Previously, it just meant that the bytes
3813         in the file were downloaded successfully. This patch extends this to also mean that the bytes in the
3814         file can be successfully interpreted as a font. This way, the CSSFontFace in the example above won't be
3815         set to the Succeeded state, so we will continue follow the src: list and download the secondary fonts.
3816
3817         This has an added benefit that the CSS Font Loading API's promises will be called more appropriately.
3818         The transition to the Succeeded state will trigger a resolve of the promise. Now, these promises will
3819         only be resolved if the fonts are actually parsed and understood by our text system.
3820
3821         Test: fast/text/font-fallback-invalid-load.html
3822
3823         * css/CSSFontFaceSource.cpp:
3824         (WebCore::CSSFontFaceSource::fontLoaded): Move to the failed state if we can't understand the font
3825         data. This is the crux of this patch.
3826         (WebCore::CSSFontFaceSource::font): This function should only be called if we are in the Succeeded
3827         state, which means now we know we should always be able to understand the bytes of the file. Therefore,
3828         we can change some if statements into ASSERT()s.
3829         * loader/cache/CachedSVGFont.cpp:
3830         (WebCore::CachedSVGFont::createFont): Ditto.
3831         (WebCore::CachedSVGFont::ensureCustomFontData): Similarly to CSSFontFaceSource::fontLoaded(), this
3832         adds another check to our criteria for transitioning into the Succeeded state, which will guarantee that
3833         later we will always be able to create the font object.
3834
3835 2017-06-22  Andreas Kling  <akling@apple.com>
3836
3837         Rename MemoryPressureHandler::setTabCount to setPageCount
3838         https://bugs.webkit.org/show_bug.cgi?id=173750
3839
3840         Reviewed by Daniel Bates.
3841
3842         * page/Page.cpp:
3843         (WebCore::Page::~Page):
3844
3845 2017-06-22  Antoine Quint  <graouts@apple.com>
3846
3847         Modern media controls localised strings are out of sync with used strings in code
3848         https://bugs.webkit.org/show_bug.cgi?id=173752
3849
3850         Reviewed by Dean Jackson.
3851
3852         Remove strings we no longer use and add strings we use but failed to add previously.
3853
3854         * English.lproj/modern-media-controls-localized-strings.js:
3855
3856 2017-06-22  Antoine Quint  <graouts@apple.com>
3857
3858         Log when scripted animations get suspended and resumed
3859         https://bugs.webkit.org/show_bug.cgi?id=173751
3860
3861         Reviewed by Dean Jackson.
3862
3863         More work toward understanding why rAF callbacks are not serviced on bots (webkit.org/b/173628).
3864
3865         * dom/Document.cpp:
3866         (WebCore::Document::requestAnimationFrame):
3867         * dom/ScriptedAnimationController.cpp:
3868         (WebCore::ScriptedAnimationController::suspend):
3869         (WebCore::ScriptedAnimationController::resume):
3870         (WebCore::ScriptedAnimationController::logSuspendCount): Deleted.
3871         * dom/ScriptedAnimationController.h:
3872         * page/Page.cpp:
3873         (WebCore::Page::suspendScriptedAnimations):
3874         (WebCore::Page::resumeScriptedAnimations):
3875         (WebCore::Page::setIsVisibleInternal):
3876
3877 2017-06-22  Zalan Bujtas  <zalan@apple.com>
3878
3879         REGRESSION(r214712): Infinite recursion in RenderTable::layout in paginated mode
3880         https://bugs.webkit.org/show_bug.cgi?id=173731
3881         <rdar://problem/32237775>
3882
3883         Reviewed by Antti Koivisto.
3884
3885         We should just skip bottom captions to check if section is moved, since they don't affect
3886         the section position (bottom <caption> is preceded by <tfoot>).
3887
3888         Test: fast/table/caption-bottom-with-pagination.html
3889
3890         * rendering/RenderTable.cpp:
3891         (WebCore::RenderTable::layout):
3892
3893 2017-06-22  Dean Jackson  <dino@apple.com>
3894
3895         REGRESSION (r215809): 50% regression 14E305 -> 15A293a in MotionMark Suits test
3896         https://bugs.webkit.org/show_bug.cgi?id=173728
3897         <rdar://problem/32526744>
3898
3899         Reviewed by Tim Horton.
3900
3901         It turns out that CGGradientCreateWithColors is much slower than
3902         CGGradientCreateWithColorComponents, even without colorspace variations.
3903         Update the gradient creation code to only use this slower path
3904         when it has extended colors.
3905
3906         * platform/graphics/Color.h: Add a FIXME about renaming some methods.
3907         * platform/graphics/cg/GradientCG.cpp: Use CGGradientCreateWithColorComponents
3908         if we have stops that are not extended colors.
3909         (WebCore::Gradient::platformGradient):
3910
3911 2017-06-22  Youenn Fablet  <youenn@apple.com>
3912
3913         Fix memory leak in LibWebRTCMediaEndpoint
3914         https://bugs.webkit.org/show_bug.cgi?id=173717
3915
3916         Reviewed by Eric Carlson.
3917
3918         No chnage of behavior.
3919         Making sure SessionDescription pointer get properly released.
3920
3921         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3922         (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionSucceeded):
3923         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3924         * testing/MockLibWebRTCPeerConnection.cpp: Allocating description.
3925
3926 2017-06-22  Daniel Bates  <dabates@apple.com>
3927
3928         Make FrameLoadRequest a move-only type
3929         https://bugs.webkit.org/show_bug.cgi?id=173682
3930
3931         Reviewed by Alex Christensen and Darin Adler.
3932
3933         A FrameLoadRequest groups together the information to perform a load into a single object
3934         that is more manageable to pass around than its constituent parts. Code that receives a
3935         FrameLoadRequest is expected to extract out the information it needs to complete its task.
3936         And it does not make sense to re-use the same FrameLoadRequest object for more than one
3937         load. Therefore, it is sufficient to make FrameLoadRequest a move-only type.
3938
3939         * inspector/InspectorFrontendClientLocal.cpp:
3940         (WebCore::InspectorFrontendClientLocal::openInNewTab):
3941         * inspector/InspectorPageAgent.cpp:
3942         (WebCore::InspectorPageAgent::navigate):
3943         * loader/FrameLoadRequest.h:
3944         * loader/FrameLoader.cpp:
3945         (WebCore::FrameLoader::changeLocation):
3946         (WebCore::FrameLoader::urlSelected):
3947         (WebCore::FrameLoader::loadURLIntoChildFrame):
3948         (WebCore::FrameLoader::loadFrameRequest):
3949         (WebCore::FrameLoader::loadURL):
3950         (WebCore::FrameLoader::load):
3951         (WebCore::FrameLoader::loadPostRequest):
3952         (WebCore::createWindow):
3953         * loader/FrameLoader.h:
3954         * loader/NavigationScheduler.cpp:
3955         (WebCore::NavigationScheduler::scheduleLocationChange):
3956         * page/ContextMenuController.cpp:
3957         (WebCore::openNewWindow):
3958         (WebCore::ContextMenuController::contextMenuItemSelected):
3959         * page/DOMWindow.cpp:
3960         (WebCore::DOMWindow::createWindow):
3961         * replay/UserInputBridge.cpp:
3962         (WebCore::UserInputBridge::loadRequest):
3963         * replay/UserInputBridge.h:
3964
3965 2017-06-22  Jer Noble  <jer.noble@apple.com>
3966
3967         REGRESSION (r217223): [iOS] Video keeps playing after application is backgrounded
3968         https://bugs.webkit.org/show_bug.cgi?id=173727
3969
3970         Reviewed by Eric Carlson.
3971
3972         Only override media element visibility if it is in picture-in-picture mode (not fullscreen generally).
3973
3974         * html/HTMLMediaElement.cpp:
3975         (WebCore::HTMLMediaElement::visibilityStateChanged):
3976
3977 2017-06-22  Joseph Pecoraro  <pecoraro@apple.com>
3978
3979         Follow-up to r218662. Only log backtraces for DumpRenderTree.
3980
3981         Rubber-stamped by Antoine Quint.
3982
3983         * dom/ScriptedAnimationController.cpp:
3984         (WebCore::ScriptedAnimationController::logSuspendCount):
3985
3986 2017-06-22  Charlie Turner  <cturner@igalia.com>
3987
3988         [GTK] Spreaker live shows won't play
3989         https://bugs.webkit.org/show_bug.cgi?id=173306
3990
3991         Reviewed by Xabier Rodriguez-Calvar.
3992
3993         This was due to removing the code that negotiated caps for Icecast
3994         streams based on the response headers in r191947. The problem is that
3995         the typefind element can sometimes squint hard enough and see an MP3
3996         stream and attempt to play it, resulting in garbled audio playback. More
3997         commonly typefind fails to recognize the Icecast stream and bails,
3998         resulting in no playback at all.
3999
4000         r191947 also removed the emission of metadata into the pipeline. This
4001         patch also leaves that out since we have no use for it within WebKit.
4002
4003         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
4004         (StreamingClient::handleResponseReceived):
4005
4006 2017-06-22  Matt Lewis  <jlewis3@apple.com>
4007
4008         Unreviewed, rolling out r218633.
4009
4010         The test is failing frequently on Sierra Debug and Windows
4011
4012         Reverted changeset:
4013
4014         "AX: Cannot call setValue() on contenteditable or ARIA text
4015         controls"
4016         https://bugs.webkit.org/show_bug.cgi?id=173520
4017         http://trac.webkit.org/changeset/218633
4018
4019 2017-06-22  Romain Bellessort  <romain.bellessort@crf.canon.fr>
4020
4021         [Readable Streams API] Implement ReadableStreamBYOBReader read()
4022         https://bugs.webkit.org/show_bug.cgi?id=172714
4023
4024         Reviewed by Youenn Fablet.
4025
4026         Implemented read() method of ReadableStreamBYOBReader [1]. Also added code related 
4027         to BYOB features that were previously described as FIXMEs and that now b