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