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