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