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