Add support for recognizing data interaction gestures in WebKit2
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-01-26  Wenson Hsieh  <wenson_hsieh@apple.com>
2
3         Add support for recognizing data interaction gestures in WebKit2
4         https://bugs.webkit.org/show_bug.cgi?id=167444
5
6         Reviewed by Beth Dakin.
7
8         Minor tweaks to pasteboard code to support data interaction.
9
10         * WebCore.xcodeproj/project.pbxproj:
11         * platform/PlatformPasteboard.h:
12         * platform/ios/PasteboardIOS.mm:
13         (WebCore::Pasteboard::read):
14         * platform/ios/PlatformPasteboardIOS.mm:
15         (WebCore::PlatformPasteboard::PlatformPasteboard):
16
17         If the pasteboard is the special data interaction type, use the shared item provider pasteboard; otherwise,
18         fall back to the general pasteboard.
19
20         (WebCore::PlatformPasteboard::getTypes):
21
22         Actually populate the list of available types using available pasteboardTypes.
23
24         (WebCore::PlatformPasteboard::write):
25
26         Add UTF8 plaintext type (kUTTypeUTF8PlainText) when vending data representations of rich text.
27
28         * platform/ios/WebItemProviderPasteboard.mm:
29         (-[WebItemProviderPasteboard setItems:]):
30         (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
31         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
32
33         Move off of deprecated methods when retrieving and supplying data to the item provider pasteboard.
34
35         * platform/spi/ios/UIKitSPI.h:
36
37 2017-01-26  Matt Rajca  <mrajca@apple.com>
38
39         Notify clients when the user plays media otherwise prevented from autoplaying
40         https://bugs.webkit.org/show_bug.cgi?id=167390
41
42         Reviewed by Alex Christensen.
43
44         The API is tested.
45
46         * html/HTMLMediaElement.cpp:
47         (WebCore::HTMLMediaElement::playInternal):
48         * page/ChromeClient.h:
49
50 2017-01-26  Enrique Ocaña González  <eocanha@igalia.com>
51
52         [GStreamer] ASSERTION FAILED: !g_object_is_floating(ptr) in adoptGRef(GstContext* ptr)
53         https://bugs.webkit.org/show_bug.cgi?id=167458
54
55         Reviewed by Xabier Rodriguez-Calvar.
56
57         GstContext is a mini_object, not a GObject. Therefore it shouldn't (and can't) be checked for floatingness.
58
59         * platform/graphics/gstreamer/GRefPtrGStreamer.cpp:
60         (WTF::adoptGRef): Removed incorrect assertion.
61
62 2017-01-26  Zalan Bujtas  <zalan@apple.com>
63
64         Simple line layout: Add support for -webkit-hyphenate-limit-after and -webkit-hyphenate-limit-before
65         https://bugs.webkit.org/show_bug.cgi?id=167439
66         <rdar://problem/30180184>
67
68         Reviewed by Antti Koivisto.
69
70         Implement pre and post hyphen length constrains for simple line layout.
71
72         Tests: fast/text/simple-line-layout-hyphen-limit-after.html
73                fast/text/simple-line-layout-hyphen-limit-before.html
74
75         * rendering/SimpleLineLayout.cpp:
76         (WebCore::SimpleLineLayout::canUseForStyle):
77         (WebCore::SimpleLineLayout::printReason):
78         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
79         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style): Same as normal line layout default values.
80         (WebCore::SimpleLineLayout::TextFragmentIterator::lastHyphenPosition):
81         * rendering/SimpleLineLayoutTextFragmentIterator.h:
82
83 2017-01-26  Brady Eidson  <beidson@apple.com>
84
85         Gamepad support shows wrong values for PS4 controllers (D-pad is missing).
86         <rdar://problem/29578619> and https://bugs.webkit.org/show_bug.cgi?id=165588
87
88         Reviewed by Alex Christensen.
89
90         No new tests (Currently unable to test HID backend directly)
91
92         DPads report their HID type as "a button", but their HID usage is "Hatswitch".
93         This patch adds a new element type that maps a "hatswitch" value to 4 additional buttons.
94         
95         * platform/gamepad/mac/HIDGamepad.cpp:
96         (WebCore::HIDGamepad::initElements):
97         (WebCore::HIDGamepad::initElementsFromArray):
98         (WebCore::HIDGamepad::maybeAddButton):
99         (WebCore::HIDGamepad::maybeAddDPad):
100         (WebCore::HIDGamepad::maybeAddAxis):
101         (WebCore::fillInButtonValues):
102         (WebCore::HIDGamepad::valueChanged):
103
104         * platform/gamepad/mac/HIDGamepad.h:
105         (WebCore::HIDGamepadElement::isDPad):
106         (WebCore::HIDGamepadDPad::HIDGamepadDPad):
107         (WebCore::HIDGamepadDPad::normalizedValue):
108
109 2017-01-26  Antoine Quint  <graouts@apple.com>
110
111         [Modern Media Controls] Hiding controls, changing their width and showing them again shows an incorrect layout
112         https://bugs.webkit.org/show_bug.cgi?id=167160
113         <rdar://problem/29612318>
114
115         Reviewed by Dean Jackson.
116
117         When we toggle visibility of the controls bar, we notify the hosting media controls and in the case of the
118         macOS inline media controls, we update the controls layout which would have failed to run last time it tried
119         due to the controls bar being hidden.
120
121         Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-resize-with-hidden-controls-bar.html
122
123         * Modules/modern-media-controls/controls/controls-bar.js:
124         (ControlsBar.prototype.set visible):
125         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
126         (MacOSInlineMediaControls.prototype.controlsBarVisibilityDidChange):
127         * Modules/modern-media-controls/controls/media-controls.js:
128         (MediaControls.prototype.controlsBarVisibilityDidChange):
129
130 2017-01-26  Csaba Osztrogonác  <ossy@webkit.org>
131
132         [Mac][cmake] Unreviewed speculative buildfix after r211161.
133         https://bugs.webkit.org/show_bug.cgi?id=167294
134
135         * PlatformMac.cmake:
136
137 2017-01-26  Zan Dobersek  <zdobersek@igalia.com>
138
139         ImageBufferCairo: cairo_image_surface should use bmalloc-allocated memory
140         https://bugs.webkit.org/show_bug.cgi?id=165751
141
142         Reviewed by Carlos Garcia Campos.
143
144         Allocate the underlying memory for cairo_image_surface objects through FastMalloc.
145         This way we can steer such large allocations away from the default libc allocator.
146
147         Objects of this class can create Cairo surfaces that need as much as 4MB of memory
148         for the underlying pixel buffer. Allocating such objects through the default
149         libc allocator can lead to increased memory usage because of non-optimal allocation
150         strategy in libc. In contrast, bmalloc performs large allocations by directly using
151         mmap() to reserve the necessary memory.
152
153         The improvements can be significant. On nytimes.com, with the threaded version of
154         the CoordinatedGraphics system, the memory consumption can drop by roughly 20%.
155
156         * platform/graphics/cairo/ImageBufferCairo.cpp:
157         (WebCore::ImageBuffer::ImageBuffer): Zero-allocate the necessary memory via FastMalloc.
158         Tie that memory lifetime to the lifetime of the surface by using
159         cairo_surface_set_user_data() with the specific user data key.
160
161 2017-01-26  Miguel Gomez  <magomez@igalia.com>
162
163         [GTK] WebProcess from WebKitGtk+ 2.15.3 SIGSEVs in WebCore::GraphicsContext3D::drawArrays(unsigned int, int, int) at Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:740
164         https://bugs.webkit.org/show_bug.cgi?id=167296
165
166         Reviewed by Sergio Villar Senin.
167
168         Use a VBO to pass the vertex data when using the stencil for clipping. Passing a custom array without
169         using an VBO is deprecated when using OpenGL >= 3.0 and a Core profile.
170
171         No behaviour change, no new tests.
172
173         * platform/graphics/texmap/TextureMapperGL.cpp:
174         (WebCore::TextureMapperGL::beginClip):
175
176 2017-01-25  Ryosuke Niwa  <rniwa@webkit.org>
177
178         Crash under DOMSelection::deleteFromDocument()
179         https://bugs.webkit.org/show_bug.cgi?id=167232
180
181         Reviewed by Chris Dumez.
182
183         The crash was caused by DOMSelection's deleteFromDocument() mutating contents inside the user-agent
184         shadow tree of an input element when the text field is readonly. Fixed the bug by exiting early
185         whenever the selection is inside a shadow tree since getSelection().getRangeAt(0) always returns
186         a range outside the input element or any shadow tree for that matter.
187
188         New behavior matches that of Gecko. The working draft spec of which I'm the editor states that
189         deleteFromDocument() must invoke Range's deleteContents() on the associated range, which is
190         the collapsed range returned by getSelection().getRangeAt(0) in the spec:
191         https://www.w3.org/TR/2016/WD-selection-api-20160921/#widl-Selection-deleteFromDocument-void
192         And Range's deleteContents() immediately terminates in step 1 when start and end are identical:
193         https://dom.spec.whatwg.org/commit-snapshots/6b7621282c2e3b222ac585650e484abf4c0a416b/
194
195         Note that Range's DOM mutating methods are not available inside an user-agent shadow tree because
196         WebKit never returns a Range whose end boundary points are inside the tree to author scripts.
197         Editing commands (ones executable from document.execCommand) that mutate DOM like this check whether
198         the content is editable or not. Since VisibleSelection's validate() function makes sure the selection
199         is either entirely within or outside of an root editable element (editing host in the W3C spec lingo),
200         editing commands should never mutate a random node inside an user-agent shadow tree.
201
202         Test: editing/selection/deleteFromDocument-shadow-tree-crash.html
203
204         * page/DOMSelection.cpp:
205         (WebCore::DOMSelection::deleteFromDocument):
206
207 2017-01-25  Ryan Haddad  <ryanhaddad@apple.com>
208
209         Unreviewed, rolling out r211193.
210
211         This change broke internal builds.
212
213         Reverted changeset:
214
215         "Notify clients when the user plays media otherwise prevented
216         from autoplaying"
217         https://bugs.webkit.org/show_bug.cgi?id=167390
218         http://trac.webkit.org/changeset/211193
219
220 2017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
221
222         Add infrastructure to support data interaction in WebKit2
223         https://bugs.webkit.org/show_bug.cgi?id=167443
224
225         Reviewed by Simon Fraser.
226
227         Adds support in WebCore to determine whether there is interactive data at a given position. No new tests, since
228         there should be no behavior change yet.
229
230         * page/EventHandler.h:
231         * page/Page.cpp:
232         (WebCore::Page::hasDataInteractionAtPosition):
233         * page/Page.h:
234
235 2017-01-25  Matt Rajca  <mrajca@apple.com>
236
237         Notify clients when the user plays media otherwise prevented from autoplaying
238         https://bugs.webkit.org/show_bug.cgi?id=167390
239
240         Reviewed by Alex Christensen.
241
242         The API is tested.
243
244         * html/HTMLMediaElement.cpp:
245         (WebCore::HTMLMediaElement::playInternal):
246         * page/ChromeClient.h:
247
248 2017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
249
250         Refactor drag and drop implementation on Mac
251         https://bugs.webkit.org/show_bug.cgi?id=167427
252
253         Reviewed by Enrica Casucci.
254
255         Refactors some code around drag and drop on Mac, and cleans up some other related code as needed. This patch
256         should result in no behavior change.
257
258         * dom/DataTransfer.cpp:
259         * page/EventHandler.cpp:
260         * page/ios/EventHandlerIOS.mm:
261         (WebCore::EventHandler::eventLoopHandleMouseDragged):
262         * page/mac/EventHandlerMac.mm:
263         * platform/DragImage.cpp:
264         * platform/Pasteboard.h:
265         * platform/ios/DragImageIOS.mm:
266         * platform/ios/PasteboardIOS.mm:
267         * platform/mac/DragDataMac.mm:
268         (rtfPasteboardType):
269         (rtfdPasteboardType):
270         (stringPasteboardType):
271         (urlPasteboardType):
272         (htmlPasteboardType):
273         (colorPasteboardType):
274         (pdfPasteboardType):
275         (tiffPasteboardType):
276         (WebCore::DragData::DragData):
277         (WebCore::DragData::containsColor):
278         (WebCore::DragData::containsFiles):
279         (WebCore::DragData::numberOfFiles):
280         (WebCore::DragData::asFilenames):
281         (WebCore::DragData::containsPlainText):
282         (WebCore::DragData::containsCompatibleContent):
283         (WebCore::DragData::containsPromise):
284         (WebCore::DragData::asURL):
285         * platform/mac/DragImageMac.mm:
286
287 2017-01-25  Youenn Fablet  <youenn@apple.com>
288
289         [WebRTC] Add support for incoming and outgoing libwebrtc audio tracks
290         https://bugs.webkit.org/show_bug.cgi?id=167438
291
292         Reviewed by Eric Carlson.
293
294         RealtimeIncomingAudioSource consumes audio buffers given by libwebrtc.
295         RealtimeOutgoingAudioSource consumes audio buffers from WebCore tracks (capture typically) and feeds libwebrtc with them.
296         To be covered by Layout/mock tests once LibWebRTC peer connection will be added.
297         These are only skeletons right now, the conversion between WebCore and LibWebRTC data is not yet implemented.
298
299         * WebCore.xcodeproj/project.pbxproj:
300         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp: Added.
301         (WebCore::RealtimeIncomingAudioSource::create):
302         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
303         (WebCore::RealtimeIncomingAudioSource::OnData):
304         (WebCore::RealtimeIncomingAudioSource::startProducingData):
305         (WebCore::RealtimeIncomingAudioSource::stopProducingData):
306         (WebCore::RealtimeIncomingAudioSource::capabilities):
307         (WebCore::RealtimeIncomingAudioSource::settings):
308         (WebCore::RealtimeIncomingAudioSource::supportedConstraints):
309         (WebCore::RealtimeIncomingAudioSource::addObserver):
310         (WebCore::RealtimeIncomingAudioSource::removeObserver):
311         (WebCore::RealtimeIncomingAudioSource::start):
312         (WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
313         * platform/mediastream/mac/RealtimeIncomingAudioSource.h: Added.
314         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp: Added.
315         (WebCore::RealtimeOutgoingAudioSource::sourceHasMoreMediaData):
316         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h: Added.
317
318 2017-01-25  Youenn Fablet  <youenn@apple.com>
319
320         [WebRTC] Add support for libwebrtc video incoming and outgoing video tracks
321         https://bugs.webkit.org/show_bug.cgi?id=167432
322
323         Reviewed by Eric Carlson.
324
325         Not covered by tests right now, this will be covered by layout/mock tests.
326         RealtimeIncomingVideoSource consumes video frames given by libwebrtc.
327         RealtimeOutgoingVideoSource consumes video frames from WebCore tracks (capture typically) and feeds libwebrtc with them.
328
329         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp: Added.
330         (WebCore::RealtimeIncomingVideoSource::create):
331         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
332         (WebCore::RealtimeIncomingVideoSource::startProducingData):
333         (WebCore::RealtimeIncomingVideoSource::stopProducingData):
334         (WebCore::RealtimeIncomingVideoSource::OnFrame):
335         (WebCore::RealtimeIncomingVideoSource::processNewSample):
336         (WebCore::drawImage):
337         (WebCore::RealtimeIncomingVideoSource::currentFrameImage):
338         (WebCore::RealtimeIncomingVideoSource::paintCurrentFrameInContext):
339         (WebCore::RealtimeIncomingVideoSource::capabilities):
340         (WebCore::RealtimeIncomingVideoSource::settings):
341         (WebCore::RealtimeIncomingVideoSource::supportedConstraints):
342         * platform/mediastream/mac/RealtimeIncomingVideoSource.h: Added.
343         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp: Added.
344         (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource):
345         (WebCore::RealtimeOutgoingVideoSource::GetStats):
346         (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink):
347         (WebCore::RealtimeOutgoingVideoSource::RemoveSink):
348         (WebCore::RealtimeOutgoingVideoSource::sourceHasMoreMediaData):
349         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h: Added.
350
351 2017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
352
353         Introduce an item-provider-based pasteboard wrapper
354         https://bugs.webkit.org/show_bug.cgi?id=167410
355
356         Reviewed by Enrica Casucci.
357
358         Introduces WebItemProviderPasteboard, a pasteboard-like object backed by a number of item providers. No new
359         tests, since there is no behavior change.
360
361         * WebCore.xcodeproj/project.pbxproj:
362         * platform/ios/AbstractPasteboard.h: Copied from Source/WebCore/platform/spi/ios/UIKitSPI.h.
363         * platform/ios/WebItemProviderPasteboard.h: Copied from Source/WebCore/platform/spi/ios/UIKitSPI.h.
364         * platform/ios/WebItemProviderPasteboard.mm: Added.
365         (isRichTextType):
366         (isStringType):
367         (isURLType):
368         (isColorType):
369         (isImageType):
370         (+[WebItemProviderPasteboard sharedInstance]):
371         (-[WebItemProviderPasteboard init]):
372         (-[WebItemProviderPasteboard dealloc]):
373         (-[WebItemProviderPasteboard pasteboardTypes]):
374         (-[WebItemProviderPasteboard setItemProviders:]):
375         (-[WebItemProviderPasteboard numberOfItems]):
376         (-[WebItemProviderPasteboard setItems:]):
377         (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]):
378         (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]):
379         (-[WebItemProviderPasteboard changeCount]):
380         (-[WebItemProviderPasteboard itemProviderAtIndex:]):
381         * platform/spi/ios/UIKitSPI.h:
382
383 2017-01-25  Konstantin Tokarev  <annulen@yandex.ru>
384
385         Removed leftovers of pre-2015 VisualStudio support
386         https://bugs.webkit.org/show_bug.cgi?id=167434
387
388         Reviewed by Alex Christensen.
389
390         No new tests needed.
391
392         * platform/graphics/filters/FEConvolveMatrix.cpp: Replaced MSC_VER
393         usage with COMPILER(MSVC)
394
395 2017-01-25  Youenn Fablet  <youenn@apple.com>
396
397         Fixing typos in r211161
398         https://bugs.webkit.org/show_bug.cgi?id=167433
399
400         Reviewed by Alex Christensen.
401
402         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
403
404 2017-01-25  Simon Fraser  <simon.fraser@apple.com>
405
406         Revert r210882, removing support for background-repeat-x/y
407         https://bugs.webkit.org/show_bug.cgi?id=167223
408
409         Reviewed by Myles C. Maxfield.
410         
411         Followup from r211149; I missed part of the patch when committing.
412
413         * css/parser/CSSParserFastPaths.cpp:
414         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
415
416 2017-01-25  Youenn Fablet  <youennf@gmail.com>
417
418         [WebRTC] Introduce libwebrtc abstraction for WK1/WK2 implementations
419         https://bugs.webkit.org/show_bug.cgi?id=167294
420
421         Reviewed by Alex Christensen.
422
423         Introducing LibWebRTCMacros.h which should be included before any libwebrtc header.
424
425         Introducing LibWebRTCProvider as the abstraction allowing to suport WK1 and WK2 libwebrtc-based WebRTC endpoints.
426         It  will create a libwebrtc peerconnection object differently in WK1 and WK2 as networking will be done differently.
427
428         LibWebRTCUtils contains routines used by WK1 and WK2 RTC providers to create the libwebrtc peerconnection object
429         and implement the necessary functionalities for it.
430
431         Updating PageConfiguration accordingly.
432
433         * WebCore.xcodeproj/project.pbxproj:
434         * page/Page.cpp:
435         (WebCore::Page::Page):
436         * page/Page.h:
437         (WebCore::Page::libWebRTCProvider):
438         * page/PageConfiguration.cpp:
439         (WebCore::PageConfiguration::PageConfiguration):
440         * page/PageConfiguration.h:
441         * platform/mediastream/libwebrtc/LibWebRTCMacros.h: Added.
442         * platform/mediastream/libwebrtc/LibWebRTCProvider.h: Added.
443         * platform/mediastream/libwebrtc/LibWebRTCUtils.cpp: Added.
444         (WebCore::staticFactoryAndThreads):
445         (WebCore::ThreadMessageData::ThreadMessageData):
446         (WebCore::PeerConnectionFactoryAndThreads::OnMessage):
447         (WebCore::callOnWebRTCNetworkThread):
448         (WebCore::initializePeerConnectionFactoryAndThreads):
449         (WebCore::initializeLibWebRTCInternalsWithSocketServer):
450         (WebCore::peerConnectionFactory):
451         (WebCore::createPeerConnection):
452         * platform/mediastream/libwebrtc/LibWebRTCUtils.h: Added.
453         * svg/graphics/SVGImage.cpp:
454         (WebCore::SVGImage::dataChanged):
455
456 2017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
457
458         Add support for named pasteboards, pasteboard strategies and platform pasteboards
459         https://bugs.webkit.org/show_bug.cgi?id=167404
460
461         Reviewed by Enrica Casucci.
462
463         Refactors some pasteboard-related code to plumb the name of the pasteboard across from WebCore to the client
464         layer. No new tests, because there should be no change in behavior.
465
466         * platform/DragData.h:
467         * platform/Pasteboard.h:
468         * platform/PasteboardStrategy.h:
469         * platform/PlatformPasteboard.h:
470         * platform/ios/PasteboardIOS.mm:
471         (WebCore::Pasteboard::Pasteboard):
472         (WebCore::Pasteboard::write):
473         (WebCore::Pasteboard::writePlainText):
474         (WebCore::Pasteboard::read):
475         (WebCore::Pasteboard::hasData):
476         (WebCore::Pasteboard::clear):
477         (WebCore::Pasteboard::readString):
478         (WebCore::Pasteboard::writeString):
479         (WebCore::Pasteboard::types):
480
481 2017-01-25  Antoine Quint  <graouts@apple.com>
482
483         LayoutTest media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-containers-styles.html is flaky
484         https://bugs.webkit.org/show_bug.cgi?id=167253
485
486         Reviewed by Jon Lee.
487
488         An IconButton loads its image asynchronously and waits for its load to obtain metrics. Once that happens,
489         its layout delegate needs to be notified that it needs a new layout. The test was a flaky failure because
490         the images would sometime load prior to layout, and sometime after, which would cause a failure. The test
491         is now robust with a controls layout happening after all buttons had loaded.
492
493         * Modules/modern-media-controls/controls/icon-button.js:
494         (IconButton.prototype._updateImage):
495         (IconButton):
496
497 2017-01-25  Timothy Hatcher  <timothy@hatcher.name>
498
499         Fix the !HAVE(ACCESSIBILITY) build by properly instantiating AXObjectCache member timers.
500
501         * accessibility/AXObjectCache.h:
502         (WebCore::AXObjectCache::AXObjectCache):
503
504 2017-01-25  Chris Dumez  <cdumez@apple.com>
505
506         Measure how common it is for content to deal with WebGL context loss
507         https://bugs.webkit.org/show_bug.cgi?id=166866
508         <rdar://problem/30171195>
509
510         Reviewed by Alex Christensen.
511
512         Add diagnostic logging to measure how common it is for sites to handle
513         WebGL context loss via the webglcontextlost & webglcontextrestored
514         events.
515
516         * html/canvas/WebGLRenderingContextBase.cpp:
517         (WebCore::WebGLRenderingContextBase::WebGLRenderingContextBase):
518         (WebCore::WebGLRenderingContextBase::checkForContextLossHandling):
519         * html/canvas/WebGLRenderingContextBase.h:
520         * page/DiagnosticLoggingKeys.cpp:
521         (WebCore::DiagnosticLoggingKeys::noKey):
522         (WebCore::DiagnosticLoggingKeys::yesKey):
523         (WebCore::DiagnosticLoggingKeys::handlesContextLossKey):
524         * page/DiagnosticLoggingKeys.h:
525
526 2017-01-25  Simon Fraser  <simon.fraser@apple.com>
527
528         Revert r210882, removing support for background-repeat-x/y
529         https://bugs.webkit.org/show_bug.cgi?id=167223
530
531         Reviewed by Myles Maxfield.
532
533         CSSPropertyBackgroundRepeatX and CSSPropertyBackgroundRepeatY only exist to make it easier
534         to parse CSSPropertyBackgroundRepeat as if it were a shorthand; they were never intended to
535         be web-exposed. r210882 mistakenly expose them to the web, so undo that patch, and annotate
536         the properties in CSSProperties.json with a flag which indicates their special status.
537
538         In addition, remove background-repeat-x/y from the list of properties allowed in video cues,
539         since these are not valid properties.
540
541         * css/CSSProperties.json:
542         * css/StyleResolver.cpp:
543         (WebCore::StyleResolver::isValidCueStyleProperty):
544         * css/makeprop.pl:
545         (addProperty):
546         * css/parser/CSSParserFastPaths.cpp:
547         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
548
549 2017-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
550
551         [GTK] UIProcess from WebKitGtk+ 2.15.x SIGSEGVs because of X Error BadDamage in WebKit::AcceleratedBackingStoreX11::update(WebKit::LayerTreeContext const&) () at Source/WebKit2/UIProcess/gtk/AcceleratedBackingStoreX11.cpp:145
552         https://bugs.webkit.org/show_bug.cgi?id=165656
553
554         Reviewed by Michael Catanzaro.
555
556         Also return the base error code from PlatformDisplayX11::supportsXDamage().
557
558         * platform/graphics/x11/PlatformDisplayX11.cpp:
559         (WebCore::PlatformDisplayX11::supportsXDamage):
560         * platform/graphics/x11/PlatformDisplayX11.h:
561
562 2017-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
563
564         Unreviewed. Fix 32 bit build after r211140.
565
566         Include glib-object.h instead of forward declaring GType.
567
568         * platform/network/soup/SoupNetworkSession.h:
569
570 2017-01-25  Miguel Gomez  <magomez@igalia.com>
571
572         [GTK] The inspector is broken when AC support is disabled
573         https://bugs.webkit.org/show_bug.cgi?id=165237
574
575         Reviewed by Carlos Garcia Campos.
576
577         Ensure that PageOverlayController destroys its root GraphicsLayers when leaving AC. They
578         will be recreated if we enter AC again, avoiding a crash because the layers don't belong to
579         the appropriate compositor. Also, don't append the document overlay layers if we are not
580         in compositing mode.
581
582         No new tests added.
583
584         * page/PageOverlayController.cpp:
585         (WebCore::PageOverlayController::willDetachRootLayer):
586         * page/PageOverlayController.h:
587         * rendering/RenderLayerCompositor.cpp:
588         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
589         (WebCore::RenderLayerCompositor::detachRootLayer):
590
591 2017-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
592
593         [SOUP] Custom protocols don't work in private browsing mode
594         https://bugs.webkit.org/show_bug.cgi?id=167236
595
596         Reviewed by Sergio Villar Senin.
597
598         Add static method to set the global custom protocols request type and setup method to add the feature to the session.
599
600         * platform/network/soup/SoupNetworkSession.cpp:
601         (WebCore::SoupNetworkSession::SoupNetworkSession):
602         (WebCore::SoupNetworkSession::setCustomProtocolRequestType):
603         (WebCore::SoupNetworkSession::setupCustomProtocols):
604         * platform/network/soup/SoupNetworkSession.h:
605
606 2017-01-25  Ryosuke Niwa  <rniwa@webkit.org>
607
608         collectMatchingElementsInFlatTree should not find elements inside an user agent shadow tree
609         https://bugs.webkit.org/show_bug.cgi?id=167409
610
611         Reviewed by Antti Koivisto.
612
613         The bug was caused by collectMatchingElementsInFlatTree including elements inside an user agent shadow tree
614         even though it shouldn't. Fixed the bug by checking that condition.
615
616         Also added matchingElementInFlatTree to find the first element matching a selector as opposed to all,
617         again, only exposed in a world which forces all shadow trees to be accessible.
618
619         * page/DOMWindow.cpp:
620         (WebCore::selectorQueryInFrame):
621         (WebCore::DOMWindow::collectMatchingElementsInFlatTree):
622         (WebCore::DOMWindow::matchingElementInFlatTree):
623         * page/DOMWindow.h:
624         * page/DOMWindow.idl:
625
626 2017-01-24  Alex Christensen  <achristensen@webkit.org>
627
628         REGRESSION (r208902): URLWithUserTypedString returns nil with file URLs
629         https://bugs.webkit.org/show_bug.cgi?id=167402
630         <rdar://problem/29896656>
631
632         Reviewed by Ryosuke Niwa.
633
634         Covered by a new API test.
635
636         * platform/mac/WebCoreNSURLExtras.mm:
637         (WebCore::mapHostNameWithRange):
638         uidna_IDNToASCII succeeds when length is 0.
639         uidna_nameToASCII fails when length is 0.
640         This causes bad things to happen with file URLs, which have no host, so their host length is 0.
641         This makes us match behavior before r208902.
642
643 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
644
645         Fold USER_TIMING into WEB_TIMING and make it a RuntimeEnabledFeature
646         https://bugs.webkit.org/show_bug.cgi?id=167394
647
648         Reviewed by Ryosuke Niwa.
649
650         All of the Performance Timing specifications are highly coupled.
651         So let make WEB_TIMING encompass them all:
652
653             - High Resolution Time (window.performance)
654             - Performance Timeline (PerformanceEntry, PerformanceObserver)
655             - Navigation Timing ("navigation" entries)
656             - Resource Timing ("resource" entries)
657             - User Timing ("mark" / "measure" entries)
658
659         We can then turn on and off individual pieces as runtime features,
660         such as Resource Timing, User Timing, and Performance Observer.
661
662         * DerivedSources.make:
663         * WebCore.xcodeproj/project.pbxproj:
664         Add User Timing files that are now included in WEB_TIMING builds.
665
666         * page/RuntimeEnabledFeatures.h:
667         (WebCore::RuntimeEnabledFeatures::setUserTimingEnabled):
668         (WebCore::RuntimeEnabledFeatures::userTimingEnabled):
669         Add a runtime feature for user timing. Disabled by default.
670
671         * Configurations/FeatureDefines.xcconfig:
672         * PAL/Configurations/FeatureDefines.xcconfig:
673         * bindings/js/JSPerformanceEntryCustom.cpp:
674         (WebCore::toJSNewlyCreated):
675         * page/Performance.cpp:
676         (WebCore::Performance::getEntries):
677         (WebCore::Performance::getEntriesByType):
678         (WebCore::Performance::getEntriesByName):
679         (WebCore::Performance::mark):
680         (WebCore::Performance::clearMarks):
681         (WebCore::Performance::measure):
682         (WebCore::Performance::clearMeasures):
683         (WebCore::Performance::webkitMark): Deleted.
684         (WebCore::Performance::webkitClearMarks): Deleted.
685         (WebCore::Performance::webkitMeasure): Deleted.
686         (WebCore::Performance::webkitClearMeasures): Deleted.
687         * page/Performance.h:
688         * page/Performance.idl:
689         * page/PerformanceMark.h:
690         * page/PerformanceMark.idl:
691         * page/PerformanceMeasure.h:
692         * page/PerformanceMeasure.idl:
693         * page/PerformanceUserTiming.cpp:
694         * page/PerformanceUserTiming.h:
695         Convert USER_TIMING to WEB_TIMING.
696         Drop webkit prefixed legacy names.
697
698 2017-01-24  Antoine Quint  <graouts@apple.com>
699
700         LayoutTest media/modern-media-controls/tracks-panel/tracks-panel-hide.html is a flaky timeout
701         https://bugs.webkit.org/show_bug.cgi?id=167311
702
703         Reviewed by Dean Jackson.
704
705         Ensure we have a chance to start the transition (on the next frame) before registering for an event
706         tracking its completion.
707
708         * Modules/modern-media-controls/controls/tracks-panel.js:
709         (TracksPanel.prototype.hide):
710
711 2017-01-24  Simon Fraser  <simon.fraser@apple.com>
712
713         [iOS WK2] Avoid IOSurface readback for snapshot creation
714         https://bugs.webkit.org/show_bug.cgi?id=167397
715         rdar://problem/30174873
716
717         Reviewed by Tim Horton.
718
719         Export sinkIntoImage().
720
721         * platform/graphics/cocoa/IOSurface.h:
722
723 2017-01-24  Brent Fulgham  <bfulgham@apple.com>
724
725         Bug 167392: REGRESSION(r210531): Relax same-volume display requirement for iOS
726         https://bugs.webkit.org/show_bug.cgi?id=167392
727         <rdar://problem/30074665>
728
729         Reviewed by Brady Eidson.
730
731         * page/SecurityOrigin.cpp:
732         (WebCore::SecurityOrigin::canDisplay): Exclude the new check when building on iOS.
733
734 2017-01-24  Andreas Kling  <akling@apple.com>
735
736         Add memory footprint reporting using diagnostic logging.
737         <https://webkit.org/b/167285>
738         <rdar://problem/30151767>
739
740         Reviewed by Chris Dumez.
741
742         Add some basic logging of physical memory footprint post-load and post-backgrounding.
743         The logging works similarly to the CPU usage logging, though with slightly longer
744         delays to allow the measurement to stabilize.
745
746         * page/DiagnosticLoggingKeys.cpp:
747         (WebCore::DiagnosticLoggingKeys::memoryUsageKey):
748         (WebCore::DiagnosticLoggingKeys::memoryUsageToDiagnosticLoggingKey):
749         * page/DiagnosticLoggingKeys.h:
750         * page/PerformanceLogging.cpp:
751         (WebCore::PerformanceLogging::physicalFootprint):
752         * page/PerformanceLogging.h:
753         * page/PerformanceMonitor.cpp:
754         (WebCore::PerformanceMonitor::PerformanceMonitor):
755         (WebCore::PerformanceMonitor::didFinishLoad):
756         (WebCore::PerformanceMonitor::activityStateChanged):
757         (WebCore::PerformanceMonitor::measurePostLoadMemoryUsage):
758         (WebCore::PerformanceMonitor::measurePostBackgroundingMemoryUsage):
759         * page/PerformanceMonitor.h:
760         * page/Settings.h:
761         (WebCore::Settings::isPostLoadMemoryUsageMeasurementEnabled):
762         (WebCore::Settings::isPostBackgroundingMemoryUsageMeasurementEnabled):
763         * page/cocoa/PerformanceLoggingCocoa.mm:
764         (WebCore::PerformanceLogging::physicalFootprint):
765
766 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
767
768         Remove always true unsafePluginPastingEnabled setting
769         https://bugs.webkit.org/show_bug.cgi?id=167360
770
771         Reviewed by Andreas Kling.
772
773         Setting added by Chromium and never used by other ports.
774
775         * dom/ScriptableDocumentParser.cpp:
776         (WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
777         * page/Settings.in:
778
779 2017-01-24  Anders Carlsson  <andersca@apple.com>
780
781         When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)
782         https://bugs.webkit.org/show_bug.cgi?id=167391
783         rdar://problem/29857388
784
785         Reviewed by Sam Weinig.
786
787         * page/Page.cpp:
788         (WebCore::Page::refreshPlugins):
789         Remove an unused variable.
790
791         * plugins/PluginInfoProvider.cpp:
792         (WebCore::PluginInfoProvider::refresh):
793         Make sure to call refreshPlugins(). Instead of reloading subframes, just reload all the main frames with
794         subframes that contain plug-ins.
795
796 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
797
798         Clean up Performance IDL interfaces so they are easier to read
799         https://bugs.webkit.org/show_bug.cgi?id=167378
800
801         Reviewed by Sam Weinig.
802
803         * page/Performance.idl:
804         * page/PerformanceEntry.idl:
805         * page/PerformanceMark.idl:
806         * page/PerformanceMeasure.idl:
807         Update spec links and use a typedef to match specs.
808
809         * page/PerformanceResourceTiming.cpp:
810         (WebCore::PerformanceResourceTiming::workerStart):
811         * page/PerformanceResourceTiming.h:
812         * page/PerformanceResourceTiming.idl:
813         Add the workerStart property which always returns 0 for non-workers.
814
815 2017-01-24  Zalan Bujtas  <zalan@apple.com>
816
817         Simple line layout: Add support for hyphen: auto.
818         https://bugs.webkit.org/show_bug.cgi?id=167297
819         <rdar://problem/30119463>
820
821         Reviewed by Antti Koivisto.
822
823         Implement hyphen: auto for simple line layout. 
824
825         Tests: fast/text/simple-line-hyphens-with-text-align.html
826                fast/text/simple-line-hyphens-with-word-letter-spacing.html
827
828         * platform/text/Hyphenation.h:
829         (WebCore::enoughWidthForHyphenation):
830         * rendering/RenderTreeAsText.cpp:
831         (WebCore::writeSimpleLine):
832         (WebCore::write):
833         * rendering/SimpleLineLayout.cpp:
834         (WebCore::SimpleLineLayout::canUseForStyle):
835         (WebCore::SimpleLineLayout::LineState::appendFragmentAndCreateRunIfNeeded): Inherit the hyphen attribute from the
836         run-to-be-appended. Ensure that we don't append additional runs when the last run has hyphen.
837         (WebCore::SimpleLineLayout::splitFragmentToFitLine): Before calling into the lastHyphenPosition() we need to
838         ensure that the hyphen would surely fit (even on the splitting position).
839         (WebCore::SimpleLineLayout::createLineRuns): Probe hypenation for overhanging non-whitespace runs. 
840         (WebCore::SimpleLineLayout::printReason):
841         * rendering/SimpleLineLayout.h:
842         (WebCore::SimpleLineLayout::Run::Run):
843         * rendering/SimpleLineLayoutFlowContents.h:
844         (WebCore::SimpleLineLayout::FlowContents::Segment::toSegmentPosition):
845         (WebCore::SimpleLineLayout::FlowContents::Segment::toRenderPosition):
846         * rendering/SimpleLineLayoutResolver.cpp:
847         (WebCore::SimpleLineLayout::RunResolver::Run::Run):
848         (WebCore::SimpleLineLayout::RunResolver::Run::constructStringForHyphenIfNeeded):
849         (WebCore::SimpleLineLayout::RunResolver::Run::text):
850         * rendering/SimpleLineLayoutResolver.h:
851         (WebCore::SimpleLineLayout::RunResolver::Run::hasHyphen):
852         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
853         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
854         (WebCore::SimpleLineLayout::TextFragmentIterator::nextBreakablePosition):
855         (WebCore::SimpleLineLayout::TextFragmentIterator::nextNonWhitespacePosition):
856         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
857         (WebCore::SimpleLineLayout::TextFragmentIterator::lastHyphenPosition): We only check the actual run for hyphenation ignoring
858         the neighboring runs. This might need to be changed in the future.
859         (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
860         * rendering/SimpleLineLayoutTextFragmentIterator.h:
861         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::TextFragment):
862         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::hasHyphen):
863         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::operator==):
864         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split):
865         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen):
866         * rendering/line/BreakingContext.h:
867         (WebCore::tryHyphenating):
868
869 2017-01-24  Matt Rajca  <mrajca@apple.com>
870
871         Pass down website autoplay policies to media elements
872         https://bugs.webkit.org/show_bug.cgi?id=167355
873
874         Reviewed by Alex Christensen.
875
876         Autoplay policies can be specified at the global web view preferences level or on a per-page
877         basis during navigation. This patch ensures that policies specified on a per-page basis hold
878         precedence over global policies. If no policies are specified during navigation, global
879         policies are used. A WebsiteAutoplayPolicy::Default option has been added to let clients
880         explicitly specify web view defaults should be used.
881
882         * dom/Document.cpp:
883         (WebCore::Document::audioPlaybackRequiresUserGesture):
884         (WebCore::Document::videoPlaybackRequiresUserGesture):
885         * dom/Document.h:
886         * html/HTMLMediaElement.cpp:
887         (WebCore::HTMLMediaElement::HTMLMediaElement):
888         (WebCore::HTMLMediaElement::playInternal):
889         * loader/DocumentLoader.h:
890         (WebCore::DocumentLoader::audioPlaybackRequiresUserGesture):
891         (WebCore::DocumentLoader::setAudioPlaybackRequiresUserGesture):
892         (WebCore::DocumentLoader::videoPlaybackRequiresUserGesture):
893         (WebCore::DocumentLoader::setVideoPlaybackRequiresUserGesture):
894
895 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
896
897         Remove always true selectionIncludesAltImageText setting
898         https://bugs.webkit.org/show_bug.cgi?id=167358
899
900         Reviewed by Alex Christensen.
901
902         * editing/Editor.cpp:
903         (WebCore::Editor::selectedTextForDataTransfer):
904         * page/Settings.in:
905
906 2017-01-24  Daniel Bates  <dabates@apple.com>
907
908         StringView.split() should use an iterator design pattern instead of allocating a Vector
909         https://bugs.webkit.org/show_bug.cgi?id=163225
910
911         Reviewed by Darin Adler.
912
913         Update code to use the new iterator-style StringView.split().
914
915         * platform/URLParser.cpp:
916
917 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
918
919         Remove always true openGLMultisamplingEnabled setting
920         https://bugs.webkit.org/show_bug.cgi?id=167364
921
922         Reviewed by Sam Weinig.
923
924         * html/canvas/WebGLRenderingContextBase.cpp:
925         (WebCore::WebGLRenderingContextBase::create):
926         * page/Settings.in:
927
928 2017-01-24  Miguel Gomez  <magomez@igalia.com>
929
930         [GTK] Do not paint non composited content into the window when using the threaded compositor
931         https://bugs.webkit.org/show_bug.cgi?id=167367
932
933         Reviewed by Carlos Garcia Campos.
934
935         When using the threaded compositor we need to send the non composited content for compositing as well,
936         not painting it directly into the window.
937
938         No new tests.
939
940         * rendering/RenderLayerBacking.cpp:
941         (WebCore::RenderLayerBacking::paintsIntoWindow):
942
943 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
944
945         Remove always true allowCustomScrollbarInMainFrame setting
946         https://bugs.webkit.org/show_bug.cgi?id=167362
947
948         Reviewed by Andreas Kling.
949
950         Setting added by Chromium and never used by other ports.
951
952         * page/FrameView.cpp:
953         (WebCore::FrameView::createScrollbar):
954         * page/Settings.in:
955
956 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
957
958         Remove always true syncXHRInDocumentsEnabled setting
959         https://bugs.webkit.org/show_bug.cgi?id=167359
960
961         Reviewed by Alex Christensen.
962
963         Setting added by Chromium and never used by other ports.
964
965         * page/Settings.in:
966         * xml/XMLHttpRequest.cpp:
967         (WebCore::XMLHttpRequest::open):
968
969 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
970
971         Remove always true antialiased2dCanvasEnabled setting
972         https://bugs.webkit.org/show_bug.cgi?id=167361
973
974         Reviewed by Andreas Kling.
975
976         * html/HTMLCanvasElement.cpp:
977         (WebCore::HTMLCanvasElement::createImageBuffer):
978         * page/Settings.in:
979
980 2017-01-15  Yusuke Suzuki  <utatane.tea@gmail.com>
981
982         Add the support for nomodule attribute on script element
983         https://bugs.webkit.org/show_bug.cgi?id=166987
984
985         Reviewed by Sam Weinig.
986
987         As discussed on https://github.com/whatwg/html/pull/2261, we should have
988         the way to suppress classic script execution when our user agent have
989         modules support. With such a feature, developers can write the code like,
990
991             <script type="module" src="./app.js"></script>
992             <script nomodule src="./bundled-app.js"></script>
993
994         In the above code, if the user agent does not support modules, the bundled-app.js
995         will be executed. On the other hand, if the user agent supports modules, we should
996         ignore the script tag which has the `nomodule` attribute.
997         This way allows us to support the legacy browsers while using modules.
998
999         In WebKit, we already support modules. Thus, we should ignore the classic script
1000         attributed `nomodule`.
1001
1002         We also rename asyncAttributeValue and deferAttributeValue to hasAsyncAttribute and
1003         hasDeferAttribute.
1004
1005         Tests: js/dom/modules/nomodule-has-no-effect-on-module-inline.html
1006                js/dom/modules/nomodule-has-no-effect-on-module-src.html
1007                js/dom/modules/nomodule-prevents-execution-classic-script-inline.html
1008                js/dom/modules/nomodule-prevents-execution-classic-script-src.html
1009
1010         * dom/ScriptElement.cpp:
1011         (WebCore::ScriptElement::prepareScript):
1012         * dom/ScriptElement.h:
1013         * html/HTMLAttributeNames.in:
1014         * html/HTMLScriptElement.cpp:
1015         (WebCore::HTMLScriptElement::hasAsyncAttribute):
1016         (WebCore::HTMLScriptElement::hasDeferAttribute):
1017         (WebCore::HTMLScriptElement::hasNoModuleAttribute):
1018         (WebCore::HTMLScriptElement::asyncAttributeValue): Deleted.
1019         (WebCore::HTMLScriptElement::deferAttributeValue): Deleted.
1020         * html/HTMLScriptElement.h:
1021         * html/HTMLScriptElement.idl:
1022         * svg/SVGScriptElement.cpp:
1023         (WebCore::SVGScriptElement::hasAsyncAttribute):
1024         (WebCore::SVGScriptElement::hasDeferAttribute):
1025         (WebCore::SVGScriptElement::hasNoModuleAttribute):
1026         (WebCore::SVGScriptElement::asyncAttributeValue): Deleted.
1027         (WebCore::SVGScriptElement::deferAttributeValue): Deleted.
1028         * svg/SVGScriptElement.h:
1029
1030 2017-01-23  Joseph Pecoraro  <pecoraro@apple.com>
1031
1032         Web Inspector: Provide a way to trigger a Garbage Collection
1033         https://bugs.webkit.org/show_bug.cgi?id=167345
1034         <rdar://problem/30102853>
1035
1036         Reviewed by Timothy Hatcher.
1037
1038         * inspector/WorkerInspectorController.cpp:
1039         (WebCore::WorkerInspectorController::WorkerInspectorController):
1040         Include a HeapAgent so we can do Heap.gc on Workers.
1041
1042 2017-01-23  Joseph Pecoraro  <pecoraro@apple.com>
1043
1044         Cleanup WEB_TIMING code
1045         https://bugs.webkit.org/show_bug.cgi?id=167339
1046
1047         Reviewed by Alex Christensen.
1048
1049         Stylistic cleanup to WEB_TIMING related code.
1050
1051         * bindings/js/JSPerformanceEntryCustom.cpp:
1052         * loader/ResourceTimingInformation.cpp:
1053         * loader/ResourceTimingInformation.h:
1054         * loader/SubresourceLoader.cpp:
1055         (WebCore::SubresourceLoader::didFinishLoading):
1056         * page/Performance.cpp:
1057         (WebCore::Performance::getEntries):
1058         (WebCore::Performance::getEntriesByType):
1059         (WebCore::Performance::setResourceTimingBufferSize):
1060         (WebCore::Performance::isResourceTimingBufferFull):
1061         * page/Performance.h:
1062         * page/PerformanceMark.h:
1063         * page/PerformanceMeasure.h:
1064         * page/PerformanceNavigation.h:
1065         * page/PerformanceResourceTiming.cpp:
1066         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
1067         (WebCore::PerformanceResourceTiming::resourceTimeToDocumentMilliseconds):
1068         * page/PerformanceResourceTiming.h:
1069         * page/PerformanceTiming.cpp:
1070         (WebCore::PerformanceTiming::documentLoader):
1071         (WebCore::PerformanceTiming::documentTiming):
1072         (WebCore::PerformanceTiming::loadTiming):
1073         * page/PerformanceTiming.h:
1074         * platform/network/cf/ResourceHandleCFNet.cpp:
1075         (WebCore::ResourceHandle::createCFURLConnection):
1076
1077 2017-01-23  Alex Christensen  <achristensen@webkit.org>
1078
1079         URLParser should fail to parse percent-encoded invalid UTF-8 sequences
1080         https://bugs.webkit.org/show_bug.cgi?id=167330
1081         <rdar://problem/29319962>
1082
1083         Reviewed by Tim Horton.
1084
1085         Covered by new API tests.
1086
1087         * platform/URLParser.cpp:
1088         (WebCore::containsOnlyASCII):
1089         (WebCore::URLParser::parseHostAndPort):
1090         If UTF-8 decoding fails after percent-decoding the host, fail to parse.
1091         This matches Chrome and Firefox, and it was proposed to the spec in https://github.com/whatwg/url/issues/215
1092
1093 2017-01-23  Alex Christensen  <achristensen@webkit.org>
1094
1095         Make URLs with non-special schemes and a query or fragment but no slash after the host more compatible
1096         https://bugs.webkit.org/show_bug.cgi?id=167317
1097         <rdar://problem/29526875>
1098
1099         Reviewed by Sam Weinig.
1100
1101         This is currently being added to the URL spec in https://github.com/whatwg/url/issues/212
1102         Covered by new API tests.
1103
1104         * platform/URLParser.cpp:
1105         (WebCore::URLParser::parse):
1106         Only add a slash if there wasn't one if the URL has a special scheme.
1107         This new behavior matches the old behavior of URL::parse.
1108
1109 2017-01-23  Joseph Pecoraro  <pecoraro@apple.com>
1110
1111         Convert langAttributeAwareFormControlUIEnabled to a Setting
1112         https://bugs.webkit.org/show_bug.cgi?id=167279
1113
1114         Reviewed by Sam Weinig.
1115
1116         * dom/Document.cpp:
1117         (WebCore::Document::getCachedLocale):
1118         * html/HTMLInputElement.cpp:
1119         (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
1120         Convert to use Settings instead of RuntimeEnabledFeatures.
1121
1122         * page/RuntimeEnabledFeatures.h:
1123         (WebCore::RuntimeEnabledFeatures::langAttributeAwareFormControlUIEnabled): Deleted.
1124         (WebCore::RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled): Deleted.
1125         * page/Settings.in:
1126         Move to Settings.
1127
1128         * testing/InternalSettings.cpp:
1129         (WebCore::InternalSettings::Backup::Backup):
1130         (WebCore::InternalSettings::Backup::restoreTo):
1131         (WebCore::InternalSettings::setLangAttributeAwareFormControlUIEnabled): Deleted.
1132         * testing/InternalSettings.h:
1133         * testing/InternalSettings.idl:
1134         Remove the manual interface for the RuntimeEnabledFeature.
1135         An identical interface is generated from Settings.in!
1136
1137 2017-01-20  Anders Carlsson  <andersca@apple.com>
1138
1139         When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)
1140         https://bugs.webkit.org/show_bug.cgi?id=167268
1141         rdar://problem/29857388
1142
1143         Reviewed by Sam Weinig.
1144
1145         * page/Page.cpp:
1146         (WebCore::Page::refreshPlugins):
1147         Call PluginInfoProvider::refresh instead.
1148
1149         (WebCore::Page::clearPluginData):
1150         Add new setter.
1151
1152         * page/Page.h:
1153         Declare new members.
1154
1155         * plugins/PluginInfoProvider.cpp:
1156         (WebCore::PluginInfoProvider::refresh):
1157         Put the logic to clear plug-in data and reload frames here.
1158
1159         * plugins/PluginInfoProvider.h:
1160         Add new members.
1161
1162 2017-01-23  Jer Noble  <jer.noble@apple.com>
1163
1164         REGRESSION (r208149): Video details does not apear and missing scrubber in Control Center
1165         https://bugs.webkit.org/show_bug.cgi?id=167233
1166
1167         Reviewed by Alex Christensen.
1168
1169         Test: In TestWebKitAPI, NowPlayingControlsTests.NowPlayingControlsIOS
1170
1171         In r208149, we introduced a new media type, Video, and renamed the old type to
1172         VideoAudio (to be able to distinguish between video-with-audio and silent-video).
1173         But we missed one place where that type needs to be renamed.
1174
1175         For testing purposes, overload methods from PlatformMediaSessionManager which WebKit2 uses
1176         to report the current now playing session and it's information.
1177
1178         * platform/audio/ios/MediaSessionManagerIOS.h:
1179         * platform/audio/ios/MediaSessionManagerIOS.mm:
1180         (WebCore::MediaSessionManageriOS::nowPlayingEligibleSession):
1181         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
1182
1183 2017-01-23  Chris Dumez  <cdumez@apple.com>
1184
1185         REGRESSION (r211033): ASSERTION FAILED: m_ptr in com.apple.WebCore: WTF::RefPtr<WebCore::Element>::operator* const + 70
1186         https://bugs.webkit.org/show_bug.cgi?id=167308
1187         <rdar://problem/30144964>
1188
1189         Unreviewed, do a partial revert of r211033 to fix assertion.
1190
1191         No new tests, already covered by:
1192         fullscreen/exit-full-screen-iframe.html
1193
1194         * dom/Document.cpp:
1195         (WebCore::Document::webkitExitFullscreen):
1196         * page/ChromeClient.h:
1197
1198 2017-01-23  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1199
1200         [GTK] asserting on unknown locale for hyphenation is wrong
1201         https://bugs.webkit.org/show_bug.cgi?id=167312
1202
1203         Reviewed by Carlos Garcia Campos.
1204
1205         The fact that we hit the assert on a test called 'hyphenation-unknown-locale' is already
1206         a strong indication we should not have it. In addition to that, Carlos Lopez pointed out
1207         a similar assert was removed from the Mac codepaths when the test was introduced.
1208
1209         * platform/text/hyphen/HyphenationLibHyphen.cpp:
1210         (WebCore::lastHyphenLocation): early return when a locale that is not available is provided
1211         for hyphenation, instead of asserting.
1212
1213 2017-01-23  Chris Dumez  <cdumez@apple.com>
1214
1215         Unreviewed attempt to fix the iOS build after r211033.
1216
1217         * dom/Node.cpp:
1218         (WebCore::Node::defaultEventHandler):
1219
1220 2017-01-23  Joseph Pecoraro  <pecoraro@apple.com>
1221
1222         Remove allowWindowOpenWithoutUserGesture setting
1223         https://bugs.webkit.org/show_bug.cgi?id=167301
1224
1225         Reviewed by Darin Adler.
1226
1227         * page/DOMWindow.cpp:
1228         (WebCore::DOMWindow::allowPopUp):
1229         * page/Settings.in:
1230
1231 2017-01-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1232
1233         Database file not removed for origins after deleting all databases
1234         https://bugs.webkit.org/show_bug.cgi?id=167281
1235
1236         Reviewed by Darin Adler.
1237
1238         When DatabaseTracker::deleteDatabasesModifiedSince() is called with a min time, all databases for every origin
1239         are deleted. For each origin if all databases are removed DatabaseTracker::deleteOrigin() is called to remove
1240         also the origin database file. However, DatabaseTracker::deleteOrigin() returns early if the origin doesn't have
1241         databases and in this particular case it never has databases, because we have just removed them.
1242
1243         This will be covered by GTK+ unit tests.
1244
1245         * Modules/webdatabase/DatabaseTracker.cpp:
1246         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince): Instead of removing the databases while iterating
1247         them, add the ones to be removed to a vector. If after the iteration all databases should be removed call
1248         DatabaseTracker::deleteOrigin() to ensure both the databases and the database file are removed for the origin,
1249         otherwhise call DatabaseTracker::deleteDatabase() for every database to delete.
1250
1251 2017-01-22  Michael Catanzaro  <mcatanzaro@igalia.com>
1252
1253         [GTK] Update Safari version in user agent
1254         https://bugs.webkit.org/show_bug.cgi?id=167290
1255
1256         Reviewed by Carlos Garcia Campos.
1257
1258         Update Safari version from 10 to 11.
1259
1260         * platform/gtk/UserAgentGtk.cpp:
1261         (WebCore::buildUserAgentString):
1262
1263 2017-01-20  Darin Adler  <darin@apple.com>
1264
1265         Remove PassRefPtr from "page" directory of WebCore, also deploy references
1266         https://bugs.webkit.org/show_bug.cgi?id=167224
1267
1268         Reviewed by Chris Dumez.
1269
1270         * Modules/fetch/DOMWindowFetch.cpp:
1271         (WebCore::DOMWindowFetch::fetch): Use DOMWindow::document instead of
1272         scriptExecutionContext.
1273
1274         * Modules/webdatabase/DatabaseContext.cpp:
1275         (WebCore::DatabaseContext::databaseExceededQuota): Pass a reference.
1276
1277         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1278         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
1279         Pass a reference.
1280
1281         * bindings/js/JSDOMWindowCustom.cpp:
1282         (WebCore::JSDOMWindow::getOwnPropertySlot): Pass a reference.
1283
1284         * dom/Document.cpp:
1285         (WebCore::Document::childrenChanged): Pass a reference. Also made the
1286         didReceiveDocType code unconditional instead of iOS-only.
1287         (WebCore::Document::platformSuspendOrStopActiveDOMObjects): Ditto.
1288         (WebCore::Document::updateViewportArguments): Ditto.
1289         (WebCore::Document::setFocusedElement): Ditto.
1290         (WebCore::Document::createDOMWindow): Ditto.
1291         (WebCore::Document::takeDOMWindowFrom): Ditto.
1292         (WebCore::Document::requestFullScreenForElement): Ditto.
1293         (WebCore::Document::webkitExitFullscreen): Ditto.
1294         * dom/Element.cpp:
1295         (WebCore::Element::focus): Ditto.
1296         (WebCore::Element::blur): Ditto.
1297         (WebCore::Element::dispatchFocusEvent): Ditto.
1298         (WebCore::Element::dispatchBlurEvent): Ditto.
1299         * dom/Node.cpp:
1300         (WebCore::Node::defaultEventHandler): Ditto.
1301         * editing/EditorCommand.cpp:
1302         (WebCore::executePrint): Ditto.
1303         * editing/FrameSelection.cpp:
1304         (WebCore::FrameSelection::setFocusedElementIfNeeded): Ditto.
1305         * history/CachedFrame.cpp:
1306         (WebCore::CachedFrameBase::restore): Ditto.
1307         (WebCore::CachedFrame::CachedFrame): Ditto.
1308         * html/ColorInputType.cpp:
1309         (WebCore::ColorInputType::handleDOMActivateEvent): Ditto.
1310         * html/HTMLAnchorElement.cpp:
1311         (WebCore::HTMLAnchorElement::isKeyboardFocusable): Ditto.
1312
1313         * html/HTMLFormControlElement.cpp:
1314         (WebCore::HTMLFormControlElement::isKeyboardFocusable): Pass a reference,
1315         and also rewrote to use && for clarity.
1316
1317         * html/HTMLVideoElement.cpp:
1318         (WebCore::HTMLVideoElement::supportsFullscreen): Pass a reference.
1319         * html/shadow/SpinButtonElement.cpp:
1320         (WebCore::SpinButtonElement::defaultEventHandler): Ditto.
1321         (WebCore::SpinButtonElement::releaseCapture): Ditto.
1322         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
1323         (WebCore::ImageControlsButtonElementMac::defaultEventHandler): Ditto.
1324         * inspector/InspectorFrontendHost.cpp:
1325         (WebCore::InspectorFrontendHost::showContextMenu): Ditto.
1326         (WebCore::InspectorFrontendHost::dispatchEventAsContextMenuEvent): Ditto.
1327
1328         * loader/EmptyClients.cpp:
1329         (WebCore::EmptyChromeClient::createPopupMenu): Updated to take reference.
1330         (WebCore::EmptyChromeClient::createSearchPopupMenu): Ditto.
1331         (WebCore::EmptyChromeClient::createColorChooser): Ditto.
1332         * loader/EmptyClients.h: Ditto.
1333
1334         * loader/FrameLoader.cpp:
1335         (WebCore::FrameLoader::submitForm): Pass a reference.
1336         (WebCore::FrameLoader::commitProvisionalLoad): Ditto.
1337         (WebCore::FrameLoader::closeAndRemoveChild): Take a reference.
1338         (WebCore::FrameLoader::detachFromParent): Pass a reference.
1339         (WebCore::FrameLoader::dispatchBeforeUnloadEvent): Ditto.
1340         (WebCore::createWindow): Ditto.
1341         * loader/FrameLoader.h: Updated for the above.
1342
1343         * loader/PolicyChecker.cpp:
1344         (WebCore::PolicyChecker::checkNewWindowPolicy): Pass a reference.
1345         * loader/appcache/ApplicationCacheGroup.cpp:
1346         (WebCore::ApplicationCacheGroup::recalculateAvailableSpaceInQuota): Ditto.
1347
1348         * loader/appcache/ApplicationCacheGroup.h: Return a reference from origin.
1349
1350         * loader/appcache/ApplicationCacheStorage.cpp:
1351         (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin): Take a reference.
1352         (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
1353         Ditto.
1354         (WebCore::ApplicationCacheStorage::store): Pass a reference.
1355         (WebCore::ApplicationCacheStorage::checkOriginQuota): Updated since origin
1356         now returns areference.
1357         * loader/appcache/ApplicationCacheStorage.h: Updated for the above.
1358
1359         * loader/archive/mhtml/MHTMLArchive.cpp:
1360         (WebCore::MHTMLArchive::generateMHTMLData): Pass a reference.
1361         * mathml/MathMLElement.cpp:
1362         (WebCore::MathMLElement::isKeyboardFocusable): Ditto.
1363
1364         * page/Chrome.cpp:
1365         (WebCore::Chrome::Chrome): Moved initialization of data members to the
1366         class definition.
1367         (WebCore::Chrome::contentsSizeChanged): Take a reference.
1368         (WebCore::Chrome::createWindow): Ditto.
1369         (WebCore::Chrome::runBeforeUnloadConfirmPanel): Ditto.
1370         (WebCore::Chrome::runJavaScriptAlert): Ditto.
1371         (WebCore::Chrome::runJavaScriptConfirm): Ditto.
1372         (WebCore::Chrome::runJavaScriptPrompt): Ditto.
1373         (WebCore::Chrome::setStatusbarText): Ditto.
1374         (WebCore::Chrome::print): Ditto.
1375         (WebCore::Chrome::createColorChooser): Ditto.
1376         (WebCore::Chrome::createPopupMenu): Ditto.
1377         (WebCore::Chrome::createSearchPopupMenu): Ditto.
1378         (WebCore::Chrome::didReceiveDocType): Ditto. Also made unconditional, but
1379         empty for non-iOS platforms.
1380         (WebCore::Chrome::registerPopupOpeningObserver): Take a reference.
1381         (WebCore::Chrome::unregisterPopupOpeningObserver): Ditto.
1382         * page/Chrome.h: Updated for the above.
1383
1384         * page/ChromeClient.h: Take references. Also updated some arguments from
1385         Node to Element.
1386
1387         * page/ContextMenuController.cpp:
1388         (WebCore::ContextMenuController::handleContextMenuEvent): Take a reference.
1389         (WebCore::ContextMenuController::showContextMenu): Ditto.
1390         (WebCore::ContextMenuController::maybeCreateContextMenu): Ditto. Also use
1391         make_unique instead of unique_ptr plus new.
1392         (WebCore::openNewWindow): Ditto.
1393         (WebCore::insertUnicodeCharacter): Ditto.
1394         (WebCore::ContextMenuController::contextMenuItemSelected): Ditto.
1395         (WebCore::ContextMenuController::showContextMenuAt): Ditto.
1396         (WebCore::ContextMenuController::showImageControlsMenu): Ditto.
1397         * page/ContextMenuController.h: Updated for the above.
1398
1399         * page/DOMTimer.cpp:
1400         (WebCore::DOMTimer::fired): Pass a reference.
1401
1402         * page/DOMWindow.cpp:
1403         (WebCore::PostMessageTimer::PostMessageTimer): Take Ref&& instead of
1404         PassRefPtr.
1405         (WebCore::DOMWindow::adjustWindowRect): Use a reference.
1406         (WebCore::DOMWindow::allowPopUp): Ditto. Also rewrite to use || instead
1407         of successive if statements.
1408         (WebCore::DOMWindow::canShowModalDialog): Ditto.
1409         (WebCore::DOMWindow::DOMWindow): Ditto.
1410         (WebCore::DOMWindow::didSecureTransitionTo): Ditto.
1411         (WebCore::DOMWindow::registerProperty): Ditto.
1412         (WebCore::DOMWindow::unregisterProperty): Ditto.
1413         (WebCore::DOMWindow::postMessageTimerFired): Merge with the function
1414         immediately followed, called only from here.
1415         (WebCore::DOMWindow::dispatchMessageEventWithOriginCheck): Deleted.
1416         (WebCore::DOMWindow::print): Pass a reference.
1417         (WebCore::DOMWindow::alert): Ditto.
1418         (WebCore::DOMWindow::confirm): Ditto.
1419         (WebCore::DOMWindow::prompt): Ditto.
1420         (WebCore::DOMWindow::setStatus): Ditto.
1421         (WebCore::DOMWindow::setDefaultStatus): Ditto.
1422         (WebCore::DOMWindow::moveBy): Ditto.
1423         (WebCore::DOMWindow::moveTo): Ditto.
1424         (WebCore::DOMWindow::resizeBy): Ditto.
1425         (WebCore::DOMWindow::resizeTo): Ditto.
1426         (WebCore::DOMWindow::clearTimeout): Ditto.
1427         (WebCore::DOMWindow::incrementScrollEventListenersCount): Ditto.
1428         (WebCore::DOMWindow::decrementScrollEventListenersCount): Ditto.
1429         (WebCore::DOMWindow::showModalDialog): Ditto.
1430         * page/DOMWindow.h: Updated for the above. ALso made functions private
1431         and final.
1432
1433         * page/DOMWindowProperty.cpp:
1434         (WebCore::DOMWindowProperty::DOMWindowProperty): Pass a reference.
1435         (WebCore::DOMWindowProperty::~DOMWindowProperty): Ditto.
1436         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame): Ditto.
1437         (WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame): Ditto.
1438
1439         * page/DebugPageOverlays.cpp:
1440         (WebCore::RegionOverlay::create): Return RefPtr instead of PassRefPtr.
1441         (WebCore::RegionOverlay::~RegionOverlay): Pass a reference.
1442         (WebCore::DebugPageOverlays::showRegionOverlay): Ditto.
1443         (WebCore::DebugPageOverlays::hideRegionOverlay): Ditto.
1444
1445         * page/DragController.cpp:
1446         (WebCore::DragController::dragExited): Pass a reference.
1447         (WebCore::DragController::performDragOperation): Ditto.
1448         (WebCore::DragController::concludeEditDrag): Ditto.
1449         (WebCore::DragController::tryDHTMLDrag): Ditto.
1450
1451         * page/EventHandler.cpp: Replaced OptionalCursor with std::optional<Cursor>.
1452         (WebCore::EventHandler::updateCursor): Refactor into two functions so we
1453         can share more code with selectCursor.
1454         (WebCore::EventHandler::selectCursor): Updated to use std::optional.
1455         (WebCore::EventHandler::handleMouseMoveEvent): Use the new updateCursor.
1456         (WebCore::EventHandler::startPanScrolling): Use a reference.
1457         (WebCore::EventHandler::updateDragAndDrop): Ditto.
1458         (WebCore::EventHandler::cancelDragAndDrop): Ditto.
1459         (WebCore::EventHandler::performDragAndDrop): Ditto.
1460         (WebCore::EventHandler::setCapturingMouseEventsElement): Take a raw pointer
1461         instead of a PassRefPtr.
1462         (WebCore::EventHandler::dispatchMouseEvent): Use a reference.
1463         (WebCore::EventHandler::updateDragStateAfterEditDragIfNeeded): Ditto.
1464         (WebCore::EventHandler::isKeyboardOptionTab): Ditto.
1465         (WebCore::EventHandler::eventInvertsTabsToLinksClientCallResult): Ditto.
1466         (WebCore::EventHandler::tabsToLinks): Ditto.
1467         * page/EventHandler.h: Updated for the above.
1468
1469         * page/FocusController.cpp:
1470         (WebCore::FocusController::setFocusedFrame): Take pointer instead
1471         of PassRefPtr.
1472         (WebCore::FocusController::setFocusedElement): Take reference instead of
1473         PassRefPtr.
1474         * page/FocusController.h: Updated for the above changes.
1475
1476         * page/FrameTree.cpp:
1477         (WebCore::FrameTree::transferChild): Deleted. Unused function.
1478         (WebCore::FrameTree::appendChild): Merged with the following function
1479         since it's now only used here. Take reference instead of PassRefPtr.
1480         (WebCore::FrameTree::actuallyAppendChild): Deleted.
1481         (WebCore::FrameTree::removeChild): Take reference instead of pointer.
1482         Use move instead of trickier swap.
1483         * page/FrameTree.h: Updated for the above.
1484
1485         * page/FrameView.cpp:
1486         (WebCore::FrameView::setContentsSize): Use a reference.
1487         * page/MainFrame.cpp:
1488         (WebCore::MainFrame::dropChildren): Ditto.
1489         * page/Page.cpp:
1490         (WebCore::Page::scrollingCoordinator): Ditto.
1491         * page/PageOverlay.cpp:
1492         (WebCore::PageOverlay::fadeAnimationTimerFired): Ditto.
1493
1494         * page/PageOverlayController.cpp:
1495         (WebCore::PageOverlayController::installPageOverlay): Take reference
1496         instead of PassRefPtr.
1497         (WebCore::PageOverlayController::uninstallPageOverlay): Take reference
1498         intead of pointer.
1499         * page/PageOverlayController.h: Updated for the above.
1500
1501         * page/PageSerializer.cpp:
1502         (WebCore::PageSerializer::PageSerializer): Moved most initialization to the
1503         class definition.
1504         (WebCore::PageSerializer::serialize): Use reference.
1505         (WebCore::PageSerializer::serializeFrame): Use initializer list instead of
1506         constructor for resource.
1507         (WebCore::PageSerializer::serializeCSSStyleSheet): Ditto.
1508         (WebCore::PageSerializer::addImageToResources): Ditto.
1509         * page/PageSerializer.h: Removed constructors from PageSerializer::Resource
1510         struct since structures don't really need them. Updated for the above.
1511         Changed SerializerMarkupAccumulator into a nested class.
1512
1513         * page/PerformanceEntry.h:
1514         (WebCore::PerformanceEntry::startTimeCompareLessThan): Use const RefPtr&
1515         instead of PassRefPtr to compare RefPtr in place.
1516
1517         * page/PerformanceUserTiming.cpp:
1518         (WebCore::insertPerformanceEntry): Take Ref&& instead of PassRefPtr.
1519
1520         * page/ResourceUsageOverlay.cpp:
1521         (WebCore::ResourceUsageOverlay::~ResourceUsageOverlay): Use refrence.
1522         (WebCore::ResourceUsageOverlay::initialize): Ditto.
1523
1524         * page/animation/AnimationBase.h: Removed unneeded include.
1525
1526         * page/animation/AnimationController.cpp:
1527         (WebCore::AnimationControllerPrivate::clear): Use reference.
1528         (WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle): Ditto.
1529         (WebCore::AnimationControllerPrivate::addEventToDispatch): Use the
1530         append function instead of a hand-written alternative.
1531         (WebCore::AnimationControllerPrivate::addElementChangeToDispatch):
1532         Take a reference rather than a Ref&& since no caller is passing ownership.
1533         * page/animation/AnimationControllerPrivate.h: Updated for the above.
1534
1535         * page/animation/CSSPropertyAnimation.cpp:
1536         (WebCore::blendFunc): Return RefPtr instead of PassRefPtr.
1537         (WebCore::blendFilter): Ditto.
1538         (WebCore::crossfadeBlend): Ditto.
1539
1540         * page/animation/CompositeAnimation.cpp:
1541         (WebCore::CompositeAnimation::updateTransitions): Updated to use
1542         animationForProperty, which returns a raw pointer.
1543         (WebCore::CompositeAnimation::animationForProperty): Renamed from
1544         getAnimationForProperty and changed to return raw pointer instead
1545         of PassRefPtr.
1546         * page/animation/CompositeAnimation.h: Updated for the above.
1547
1548         * page/animation/ImplicitAnimation.cpp:
1549         (WebCore::ImplicitAnimation::onAnimationEnd): Use animationForProperty.
1550         (WebCore::ImplicitAnimation::sendTransitionEvent): Pass reference.
1551         * page/animation/KeyframeAnimation.cpp:
1552         (WebCore::KeyframeAnimation::sendAnimationEvent): Ditto.
1553
1554         * page/efl/EventHandlerEfl.cpp:
1555         (WebCore::EventHandler::tabsToAllFormControls): Take reference.
1556         (WebCore::EventHandler::createDraggingDataTransfer): Return Ref.
1557         * page/gtk/EventHandlerGtk.cpp:
1558         (WebCore::EventHandler::tabsToAllFormControls): Ditto.
1559         (WebCore::EventHandler::createDraggingDataTransfer): Ditto.
1560         * page/ios/EventHandlerIOS.mm:
1561         (WebCore::EventHandler::tabsToAllFormControls): Ditto.
1562         * page/mac/EventHandlerMac.mm:
1563         (WebCore::EventHandler::createDraggingDataTransfer): Ditto.
1564         (WebCore::EventHandler::tabsToAllFormControls): Ditto.
1565         (WebCore::EventHandler::platformPrepareForWheelEvents): Ditto.
1566
1567         * page/mac/ServicesOverlayController.h: Take Ref&& for ranges instead
1568         of PassRefPtr. Use references.
1569         * page/mac/ServicesOverlayController.mm:
1570         (WebCore::ServicesOverlayController::Highlight::createForSelection): Ditto.
1571         (WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber): Ditto.
1572         (WebCore::ServicesOverlayController::Highlight::Highlight): Ditto.
1573         (WebCore::ServicesOverlayController::buildPotentialHighlightsIfNeeded): Ditto.
1574         (WebCore::ServicesOverlayController::buildPhoneNumberHighlights): Ditto.
1575         (WebCore::ServicesOverlayController::buildSelectionHighlight): Ditto.
1576         (WebCore::ServicesOverlayController::highlightsAreEquivalent): Ditto.
1577         (WebCore::ServicesOverlayController::findTelephoneNumberHighlightContainingSelectionHighlight): Ditto.
1578         (WebCore::ServicesOverlayController::handleClick): Ditto.
1579
1580         * page/mac/TextIndicatorWindow.mm:
1581         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
1582         Take a reference instead of PassRefPtr.
1583         (WebCore::TextIndicatorWindow::setTextIndicator): Updated for the above.
1584
1585         * page/scrolling/AsyncScrollingCoordinator.h: Use Ref&& and RefPtr intead
1586         of PsasRefPtr.
1587
1588         * page/scrolling/ScrollLatchingState.cpp:
1589         (WebCore::ScrollLatchingState::ScrollLatchingState): Initialize data members
1590         in class definition.
1591         (WebCore::ScrollLatchingState::setWheelEventElement): Use raw pointer instead
1592         of PassRefPtr.
1593         (WebCore::ScrollLatchingState::setPreviousWheelScrolledElement): Use raw
1594         pointer instead of RefPtr&&.
1595         (WebCore::ScrollLatchingState::setScrollableContainer): Use raw pointer instead
1596         of PassRefPtr.
1597         * page/scrolling/ScrollLatchingState.h: Updated for the above.
1598
1599         * page/scrolling/ScrollingStateNode.cpp:
1600         (WebCore::ScrollingStateNode::cloneAndReset): Use Ref instead of PassRefPtr.
1601         (WebCore::ScrollingStateNode::appendChild): Use Ref&& instead of PassRefPtr.
1602         * page/scrolling/ScrollingStateNode.h: Updated for the above.
1603
1604         * page/scrolling/ScrollingStateTree.cpp:
1605         (WebCore::ScrollingStateTree::createNode): Use Ref instead of PassRefPtr.
1606         (WebCore::ScrollingStateTree::attachNode): Updated for the abve.
1607         (WebCore::ScrollingStateTree::commit): Ditto.
1608         * page/scrolling/ScrollingStateTree.h: Ditto.
1609
1610         * page/scrolling/ScrollingTree.cpp:
1611         (WebCore::ScrollingTree::updateTreeFromStateNode): Use reference.
1612         * page/scrolling/ScrollingTree.h: Return Ref instead of PassRefPtr.
1613
1614         * page/scrolling/ScrollingTreeNode.cpp:
1615         (WebCore::ScrollingTreeNode::appendChild): Take Ref&& instead of PassRefPtr.
1616         (WebCore::ScrollingTreeNode::removeChild): Take reference instead of pointer.
1617         * page/scrolling/ScrollingTreeNode.h: Updated for the above.
1618
1619         * page/scrolling/ThreadedScrollingTree.cpp:
1620         (WebCore::ThreadedScrollingTree::ThreadedScrollingTree): Take reference
1621         instead of pointer.
1622         * page/scrolling/ThreadedScrollingTree.h: Updated for the above.
1623
1624         * page/scrolling/ios/ScrollingCoordinatorIOS.mm:
1625         (WebCore::ScrollingCoordinatorIOS::ScrollingCoordinatorIOS): Pass reference.
1626
1627         * page/scrolling/ios/ScrollingTreeIOS.cpp:
1628         (WebCore::ScrollingTreeIOS::create): Take a reference.
1629         (WebCore::ScrollingTreeIOS::ScrollingTreeIOS): Ditto.
1630         (WebCore::ScrollingTreeIOS::createScrollingTreeNode): Return Ref instead of
1631         PassRefPtr.
1632         * page/scrolling/ios/ScrollingTreeIOS.h: Updated for the above.
1633
1634         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
1635         (WebCore::ScrollingCoordinatorMac::ScrollingCoordinatorMac): Use reference.
1636
1637         * page/scrolling/mac/ScrollingTreeMac.cpp:
1638         (ScrollingTreeMac::create): Take a reference.
1639         (ScrollingTreeMac::ScrollingTreeMac): Ditto.
1640         (ScrollingTreeMac::createScrollingTreeNode): Return a Ref instead of a
1641         PassRefPtr.
1642         * page/scrolling/mac/ScrollingTreeMac.h: Updated for the above.
1643
1644         * page/win/EventHandlerWin.cpp:
1645         (WebCore::EventHandler::tabsToAllFormControls): Take reference.
1646         (WebCore::EventHandler::createDraggingDataTransfer): Return Ref.
1647
1648         * platform/Cursor.h: Rearranged the header a bit. Got rid of the explicit
1649         copy constructor, assignment operator, and destructor. Using the ones
1650         that the compiler automatically generates will work for all platforms and
1651         we then also get move constructor and move assignment operator.
1652
1653         * platform/efl/CursorEfl.cpp:
1654         (WebCore::Cursor::Cursor): Deleted.
1655         (WebCore::Cursor::~Cursor): Deleted.
1656         (WebCore::Cursor::operator=): Deleted.
1657         * platform/gtk/CursorGtk.cpp:
1658         (WebCore::Cursor::Cursor): Deleted.
1659         (WebCore::Cursor::operator=): Deleted.
1660         (WebCore::Cursor::~Cursor): Deleted.
1661         * platform/mac/CursorMac.mm:
1662         (WebCore::Cursor::Cursor): Deleted.
1663         (WebCore::Cursor::operator=): Deleted.
1664         (WebCore::Cursor::~Cursor): Deleted.
1665         * platform/win/CursorWin.cpp:
1666         (WebCore::SharedCursor::SharedCursor): Moved this here from the header
1667         since it is only used within this file.
1668         (WebCore::SharedCursor::create): Ditto.
1669         (WebCore::Cursor::Cursor): Deleted.
1670         (WebCore::Cursor::operator=): Deleted.
1671         (WebCore::Cursor::~Cursor): Deleted.
1672
1673         * rendering/RenderEmbeddedObject.cpp:
1674         (WebCore::RenderEmbeddedObject::handleUnavailablePluginIndicatorEvent):
1675         Pass reference.
1676
1677         * rendering/RenderLayerBacking.cpp:
1678         (WebCore::RenderLayerBacking::RenderLayerBacking): Get to FrameView
1679         through the render tree itself, rather than through the frame.
1680
1681         * rendering/RenderLayerCompositor.cpp:
1682         (WebCore::RenderLayerCompositor::updateLayerForHeader): Use reference.
1683         (WebCore::RenderLayerCompositor::updateLayerForFooter): Ditto.
1684         (WebCore::RenderLayerCompositor::attachRootLayer): Ditto.
1685         (WebCore::RenderLayerCompositor::detachRootLayer): Ditto.
1686         * rendering/RenderMenuList.cpp:
1687         (RenderMenuList::showPopup): Ditto.
1688         * rendering/RenderSearchField.cpp:
1689         (WebCore::RenderSearchField::addSearchResult): Ditto.
1690         (WebCore::RenderSearchField::showPopup): Ditto.
1691         (WebCore::RenderSearchField::valueChanged): Ditto.
1692         * svg/SVGAElement.cpp:
1693         (WebCore::SVGAElement::isKeyboardFocusable): Ditto.
1694         * testing/MockPageOverlayClient.cpp:
1695         (WebCore::MockPageOverlayClient::installOverlay): Ditto.
1696         (WebCore::MockPageOverlayClient::uninstallAllOverlays): Ditto.
1697
1698 2017-01-22  Myles C. Maxfield  <mmaxfield@apple.com>
1699
1700         [Cocoa] Unify FontPlatformData's hashing and equality operators
1701         https://bugs.webkit.org/show_bug.cgi?id=167061
1702
1703         Reviewed by Darin Adler.
1704
1705         On iOS, we were using CFEqual() and CFHash(), while on macOS
1706         we were using pointer hashing and pointer equality. Instead,
1707         we should be consistent about these operators.
1708
1709         Right now, FontPlatformData holds two internal CTFontRefs, and
1710         switching to these higher-level CFEqual() and CFHash()
1711         functions is required for eliminating one of these two
1712         internal font objects.
1713
1714         No new tests because there is no behavior change.
1715
1716         * platform/graphics/FontPlatformData.h:
1717         (WebCore::FontPlatformData::hash): Deleted.
1718         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1719         (WebCore::FontPlatformData::hash):
1720         (WebCore::FontPlatformData::platformIsEqual):
1721         (WebCore::cascadeToLastResortAttributesDictionary):
1722         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1723         (WebCore::FontPlatformData::hash):
1724         * platform/graphics/win/FontPlatformDataCGWin.cpp:
1725         (WebCore::FontPlatformData::hash):
1726         * platform/graphics/win/FontPlatformDataCairoWin.cpp:
1727         (WebCore::FontPlatformData::hash):
1728         * platform/graphics/win/FontPlatformDataDirect2D.cpp:
1729         (WebCore::FontPlatformData::hash):
1730
1731 2017-01-20  Dean Jackson  <dino@apple.com>
1732
1733         [WebGL] Do not allow GPU muxing on some old Mac hardware
1734         https://bugs.webkit.org/show_bug.cgi?id=167259
1735         <rdar://problem/30060378>
1736
1737         Reviewed by Simon Fraser and Darin Adler.
1738
1739         Some old Macbook Pro models should never use the
1740         integrated GPU for WebGL, because they are unstable
1741         when swapping between that and the discrete GPU.
1742
1743         Unfortunately this hardware configuration isn't in our
1744         testing infrastructure, so it was confirmed manually.
1745         Meanwhile, our existing tests make sure this patch
1746         doesn't break anything elsewhere.
1747
1748         * platform/graphics/mac/GraphicsContext3DMac.mm:
1749         (WebCore::attachToAppleGraphicsControl): Helper function
1750         to get a mach port that talks to Apple's Graphics Control
1751         system.
1752         (WebCore::hasMuxCapability): Decides whether a system
1753         can do live GPU switching, based on whether or not it
1754         has a muxable GPU, and if that GPU is not the old hardware
1755         we know is problematic.
1756         (WebCore::hasMuxableGPU): Helper to return the static hasMuxCapability value.
1757         (WebCore::setPixelFormat): Only request the integrated card when the
1758         GPU is muxable.
1759
1760 2017-01-22  Don Olmstead <don.olmstead@am.sony.com> and Myles C. Maxfield <mmaxfield@apple.com>
1761
1762         Introducing the Platform Abstraction Layer (PAL)
1763         https://bugs.webkit.org/show_bug.cgi?id=143358
1764
1765         Reviewed by Alex Christensen.
1766
1767         In order to enforce layering and promote testability, WebCore/platform files
1768         should be compiled in their own project. This new project can enforce layering
1769         and can be tested with unit tests in addition to layout tests.
1770
1771         The name of this new project is the Platform Abstraction Layer, or "PAL."
1772         This comprises of a new directory in WebCore which will be the destination
1773         for files migrated from WebCore/platform. This new folder, and its associated
1774         project, will maintain layering invariants. These invariants are enforced at
1775         build-time by setting the #include path for PAL to not include the rest of
1776         WebCore (which is the same layering enforcement mechanism for WTF). Files will
1777         be migrated into this new target/directory piece-by-piece, and the migration
1778         of a file will be performed as soon as it can be migrated without violating
1779         layering.
1780
1781         Within WebCore, files should include PAL files using the convention
1782         #include <pal/foo.h>. Symbols within PAL are placed within a new top-level
1783         namespace, "PAL," and therefore when used should be referred to as PAL::Foo.
1784
1785         The first set of files to move into the new platform is the crypto/ subdirectory
1786         because it is both simple but also includes platform-dependent files.
1787
1788         No new tests because there is no behavior change.
1789
1790         * CMakeLists.txt:
1791         * Configurations/WebCore.xcconfig: Add PAL to the include path
1792         * PAL/Configurations/Base.xcconfig: Added.
1793         * PAL/Configurations/DebugRelease.xcconfig: Added.
1794         * PAL/Configurations/PAL.xcconfig: Added. Sets up some PAL-specific
1795         variables.
1796         * PAL/Configurations/FeatureDefines.xcconfig: Added.
1797         * PAL/Configurations/Version.xcconfig: Added.
1798         * PAL/PAL.xcodeproj/project.pbxproj: Added. New project file.
1799         * PAL/config.h: Added. Simplified from WebCore/config.h.
1800         * PAL/pal/CMakeLists.txt: Added.
1801         * PAL/pal/PlatformEfl.cmake: Added.
1802         * PAL/pal/PlatformGTK.cmake: Added.
1803         * PAL/pal/PlatformMac.cmake: Added.
1804         * PAL/pal/PlatformWin.cmake: Added.
1805         * PAL/pal/crypto/CryptoDigest.h: Renamed from Source/WebCore/platform/crypto/CryptoDigest.h.
1806         * PAL/pal/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp: Renamed from Source/WebCore/platform/crypto/commoncrypto/CryptoDigestCommonCrypto.cpp.
1807         * PAL/pal/crypto/gcrypt/CryptoDigestGCrypt.cpp: Renamed from Source/WebCore/platform/crypto/gcrypt/CryptoDigestGCrypt.cpp.
1808         * PAL/pal/crypto/gnutls/CryptoDigestGnuTLS.cpp: Renamed from Source/WebCore/platform/crypto/gnutls/CryptoDigestGnuTLS.cpp.
1809         * PAL/pal/crypto/win/CryptoDigestWin.cpp: Renamed from Source/WebCore/platform/crypto/win/CryptoDigestWin.cpp.
1810         * PlatformEfl.cmake:
1811         * PlatformGTK.cmake:
1812         * PlatformMac.cmake:
1813         * PlatformWin.cmake:
1814         * WebCore.xcodeproj/project.pbxproj: Create a project link so WebCore
1815         knows that it needs to build PAL as a dependency.
1816         * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
1817         (WebCore::CryptoAlgorithmSHA1::digest): Update #include and namespace.
1818         * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
1819         (WebCore::CryptoAlgorithmSHA224::digest): Ditto.
1820         * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
1821         (WebCore::CryptoAlgorithmSHA256::digest): Ditto.
1822         * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
1823         (WebCore::CryptoAlgorithmSHA384::digest): Ditto.
1824         * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
1825         (WebCore::CryptoAlgorithmSHA512::digest): Ditto.
1826         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
1827         (WebCore::cryptoDigestAlgorithm): Ditto.
1828         (WebCore::signRSASSA_PKCS1_v1_5): Ditto.
1829         (WebCore::verifyRSASSA_PKCS1_v1_5): Ditto.
1830         * inspector/InspectorDOMAgent.cpp:
1831         (WebCore::computeContentSecurityPolicySHA256Hash): Ditto.
1832         * page/csp/ContentSecurityPolicy.cpp:
1833         (WebCore::toCryptoDigestAlgorithm): Ditto.
1834         (WebCore::ContentSecurityPolicy::findHashOfContentInPolicies): Ditto.
1835         * platform/network/soup/SoupNetworkSession.cpp:
1836         (WebCore::HostTLSCertificateSet::computeCertificateHash): Ditto.
1837
1838 2017-01-22  Zan Dobersek  <zdobersek@igalia.com>
1839
1840         [GStreamer] Clear out m_appsinkCaps in AppendPipeline::appsinkCapsChanged() before using outPtr()
1841         https://bugs.webkit.org/show_bug.cgi?id=167165
1842
1843         Reviewed by Carlos Garcia Campos.
1844
1845         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1846         (WebCore::AppendPipeline::appsinkCapsChanged): Replace the gst_caps_replace() call
1847         with a simple comparison and, in case the current appsink caps differ from the caps
1848         on the sink's pad, move the reference to the latter into the m_appsinkCaps member
1849         variable. This removes the use of GRefPtr<>::outPtr() which asserted in debug
1850         configurations in the case of m_appsinkCaps not being null.
1851
1852 2017-01-21  Chris Dumez  <cdumez@apple.com>
1853
1854         JavaScript for-of does not work on a lot of collection types (e.g. HTMLCollection)
1855         https://bugs.webkit.org/show_bug.cgi?id=167091
1856
1857         Reviewed by Darin Adler.
1858
1859         As per the Web IDL specification [1], https://heycam.github.io/webidl/#es-iterator
1860         an interface should get an iterator if it has:
1861         - an indexed property getter and an integer-typed attribute named "length".
1862
1863         We now comply with this part of the Web IDL specification. This adds an iterator
1864         to the following interfaces:
1865         - AudioTrackList, ClientRectList, CSSRuleList, CSSStyleDeclaration, CSSValueList,
1866           MimeTypeArray, WebKitNamedFlowCollection, Plugin, PluginArray, DOMStringList,
1867           FileList, HTMLAllCollection, HTMLCollection, HTMLFormElement, HTMLOptionsCollection,
1868           HTMLSelectElement, MediaList, NamedNodeMap, SourceBufferList, StyleSheetList,
1869           TextTrackCueList, TextTrackList, TouchList, VideoTrackList, VTTRegionList.
1870
1871         As a result, it is now possible to use `for ... of` for those types.
1872
1873         Tests: fast/dom/FileList-iterator.html
1874                fast/dom/collection-iterators.html
1875                fast/dom/document-all-undefined.html
1876                fast/events/touch/ios/touchlist-iterator.html
1877
1878         * bindings/scripts/CodeGeneratorJS.pm:
1879         (GetAttributeWithName):
1880         (InterfaceNeedsIterator):
1881         (GenerateImplementation):
1882         (addIterableProperties):
1883
1884 2017-01-21  Chris Dumez  <cdumez@apple.com>
1885
1886         innerText should replace existing text node
1887         https://bugs.webkit.org/show_bug.cgi?id=167116
1888
1889         Reviewed by Darin Adler.
1890
1891         Update setInnerText() to use ContainerNode::replaceAllChildren()
1892         instead of replaceChildrenWithText(). replaceAllChildren() is
1893         implemented as per specification:
1894         - https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute
1895         - https://dom.spec.whatwg.org/#concept-node-replace-all
1896
1897         As a result, we now correctly remove existing children before
1898         inserting the new one.
1899
1900         No new tests, updated existing one.
1901
1902         * editing/markup.cpp:
1903         (WebCore::replaceChildrenWithText): Deleted.
1904         * editing/markup.h:
1905         * html/HTMLElement.cpp:
1906         (WebCore::HTMLElement::setInnerText):
1907
1908 2017-01-21  Chris Dumez  <cdumez@apple.com>
1909
1910         AccessibilityRenderObject::textChanged() bypasses AXLiveRegionChanged notification coalescing
1911         https://bugs.webkit.org/show_bug.cgi?id=167286
1912         <rdar://problem/30133211>
1913
1914         Reviewed by Ryosuke Niwa.
1915
1916         AccessibilityRenderObject::textChanged() bypasses AXLiveRegionChanged notification
1917         coalescing. This patch fixes the issue.
1918
1919         No new tests, updated existing test.
1920
1921         * accessibility/AccessibilityRenderObject.cpp:
1922         (WebCore::AccessibilityRenderObject::textChanged):
1923
1924 2017-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1925
1926         Unreviewed, rolling out r211012.
1927
1928         It caused a lot of crashes in the network process
1929
1930         Reverted changeset:
1931
1932         "[SOUP] Custom protocols don't work in private browsing mode"
1933         https://bugs.webkit.org/show_bug.cgi?id=167236
1934         http://trac.webkit.org/changeset/211012
1935
1936 2017-01-20  Joseph Pecoraro  <pecoraro@apple.com>
1937
1938         Remove never changing IndexedDB RuntimeEnabledFeature
1939         https://bugs.webkit.org/show_bug.cgi?id=167278
1940
1941         Reviewed by Darin Adler.
1942
1943         This RuntimeEnabledFeature flag is always true and there are
1944         no existing ways to change it. So lets just remove it.
1945
1946         * Modules/indexeddb/DOMWindowIndexedDatabase.idl:
1947         * Modules/indexeddb/IDBCursor.idl:
1948         * Modules/indexeddb/IDBCursorWithValue.idl:
1949         * Modules/indexeddb/IDBDatabase.idl:
1950         * Modules/indexeddb/IDBFactory.idl:
1951         * Modules/indexeddb/IDBIndex.idl:
1952         * Modules/indexeddb/IDBKeyRange.idl:
1953         * Modules/indexeddb/IDBObjectStore.idl:
1954         * Modules/indexeddb/IDBOpenDBRequest.idl:
1955         * Modules/indexeddb/IDBRequest.idl:
1956         * Modules/indexeddb/IDBTransaction.idl:
1957         * Modules/indexeddb/IDBVersionChangeEvent.idl:
1958         * page/RuntimeEnabledFeatures.h:
1959         (WebCore::RuntimeEnabledFeatures::setIndexedDBEnabled): Deleted.
1960         (WebCore::RuntimeEnabledFeatures::indexedDBEnabled): Deleted.
1961
1962 2017-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1963
1964         [SOUP] Custom protocols don't work in private browsing mode
1965         https://bugs.webkit.org/show_bug.cgi?id=167236
1966
1967         Reviewed by Sergio Villar Senin.
1968
1969         Add static method to set the global custom protocols request type and setup method to add the feature to the session.
1970
1971         * platform/network/soup/SoupNetworkSession.cpp:
1972         (WebCore::SoupNetworkSession::SoupNetworkSession):
1973         (WebCore::SoupNetworkSession::setCustomProtocolRequestType):
1974         (WebCore::SoupNetworkSession::setupCustomProtocols):
1975         * platform/network/soup/SoupNetworkSession.h:
1976
1977 2017-01-20  Matt Rajca  <mrajca@apple.com>
1978
1979         Record whether a media element was prevented from playing without user interaction
1980         https://bugs.webkit.org/show_bug.cgi?id=167214
1981
1982         Reviewed by Eric Carlson.
1983
1984         This state will be used to notify clients when a user explicitly starts playback
1985         of a media element that was prevented from autoplaying.
1986
1987         Tests will be added after a WebKit callback API is added.
1988
1989         * WebCore.xcodeproj/project.pbxproj:
1990         * dom/SuccessOr.h: Added.
1991         (WebCore::SuccessOr::SuccessOr):
1992         (WebCore::SuccessOr::operator bool):
1993         * html/HTMLMediaElement.cpp:
1994         (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay):
1995         (WebCore::HTMLMediaElement::setReadyState):
1996         (WebCore::HTMLMediaElement::play):
1997         (WebCore::HTMLMediaElement::playInternal):
1998         * html/HTMLMediaElement.h:
1999         * html/MediaElementSession.cpp:
2000         (WebCore::MediaElementSession::playbackPermitted):
2001         * html/MediaElementSession.h:
2002
2003 2017-01-20  Brady Eidson  <beidson@apple.com>
2004
2005         Require a button press on a gamepad for them to be exposed to the DOM.
2006         <rdar://problem/28620919> and https://bugs.webkit.org/show_bug.cgi?id=167272
2007
2008         Reviewed by Alex Christensen.
2009
2010         Test: gamepad/gamepad-visibility-1.html
2011
2012         * Modules/gamepad/GamepadManager.cpp:
2013         (WebCore::GamepadManager::platformGamepadInputActivity):
2014         * Modules/gamepad/GamepadManager.h:
2015
2016         * platform/gamepad/GamepadProvider.cpp:
2017         (WebCore::GamepadProvider::dispatchPlatformGamepadInputActivity):
2018         * platform/gamepad/GamepadProvider.h:
2019         (WebCore::GamepadProvider::~GamepadProvider): Deleted.
2020         (WebCore::GamepadProvider::isMockGamepadProvider): Deleted.
2021
2022         * platform/gamepad/GamepadProviderClient.h:
2023
2024         * platform/gamepad/cocoa/GameControllerGamepad.h:
2025         * platform/gamepad/cocoa/GameControllerGamepad.mm:
2026         (WebCore::GameControllerGamepad::setupAsExtendedGamepad):
2027         (WebCore::GameControllerGamepad::setupAsGamepad):
2028
2029         * platform/gamepad/cocoa/GameControllerGamepadProvider.h:
2030         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
2031         (WebCore::GameControllerGamepadProvider::gamepadHadInput):
2032         (WebCore::GameControllerGamepadProvider::inputNotificationTimerFired):
2033
2034         * platform/gamepad/mac/HIDGamepad.cpp:
2035         (WebCore::HIDGamepad::valueChanged):
2036         * platform/gamepad/mac/HIDGamepad.h:
2037
2038         * platform/gamepad/mac/HIDGamepadProvider.cpp:
2039         (WebCore::HIDGamepadProvider::valuesChanged):
2040         (WebCore::HIDGamepadProvider::inputNotificationTimerFired):
2041         * platform/gamepad/mac/HIDGamepadProvider.h:
2042
2043         * testing/MockGamepadProvider.cpp:
2044         (WebCore::MockGamepadProvider::setMockGamepadButtonValue):
2045         (WebCore::MockGamepadProvider::gamepadInputActivity):
2046         * testing/MockGamepadProvider.h:
2047
2048 2017-01-20  Joseph Pecoraro  <pecoraro@apple.com>
2049
2050         Cleanup RuntimeEnabledFeatures
2051         https://bugs.webkit.org/show_bug.cgi?id=167228
2052
2053         Reviewed by Simon Fraser.
2054
2055         RuntimeEnabledFeatures::reset() is bad for tests. It was getting called
2056         after the TestRunners had set up all the Settings and RuntimeEnabledFeatures
2057         they expected, so it was clearing the "consistent state" set by TestRunners.
2058
2059         Cleanup within RuntimeEnabledFeatures:
2060
2061           - Initialize all members.
2062           - Remove unused features.
2063           - Remove reset() no longer used.
2064           - Document features that do not change (potentially removable).
2065           - Document features that are not used but have APIs (use or remove later).
2066           - Drop webkit prefix for these internal only apis.
2067           - Move things around a bit to make it more readable.
2068           - Enable the Fetch API by default (WebKit levels all were enabling it).
2069
2070         Cleanup within Internals:
2071
2072           - Move all RuntimeEnabledFeature toggling to InternalSettings
2073           - Save and restore these RuntimeEnabledFeatures in InternalSettings
2074
2075         * Modules/mediastream/MediaStreamEvent.idl:
2076         * Modules/mediastream/NavigatorMediaDevices.idl:
2077         * Modules/mediastream/NavigatorUserMedia.idl:
2078         * Modules/mediastream/RTCDTMFToneChangeEvent.idl:
2079         * Modules/mediastream/RTCIceCandidate.idl:
2080         * Modules/mediastream/RTCPeerConnection.idl:
2081         * Modules/mediastream/RTCRtpReceiver.idl:
2082         * Modules/mediastream/RTCRtpSender.idl:
2083         * Modules/mediastream/RTCRtpTransceiver.idl:
2084         * Modules/mediastream/RTCSessionDescription.idl:
2085         * Modules/mediastream/RTCTrackEvent.idl:
2086         Canonical usage is to start with a capital letter.
2087
2088         * dom/EventNames.in:
2089         No port has API/SPI to disable this feature at runtime and the default is
2090         to have the feature enabled, so this is no different from the runtime flag.
2091
2092         * page/DOMWindow.cpp:
2093         (WebCore::DOMWindow::addEventListener):
2094         These features were always enabled and not toggleable. So drop the runtime
2095         feature check.
2096
2097         * page/csp/ContentSecurityPolicy.h:
2098         * page/csp/ContentSecurityPolicy.cpp:
2099         (WebCore::ContentSecurityPolicy::experimentalFeaturesEnabled): Deleted.
2100         Nobody calls this method. Drop it.
2101
2102         * page/RuntimeEnabledFeatures.cpp:
2103         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
2104         (WebCore::RuntimeEnabledFeatures::reset):
2105         (WebCore::RuntimeEnabledFeatures::javaScriptI18NAPIEnabled): Deleted.
2106         * page/RuntimeEnabledFeatures.h:
2107         (WebCore::RuntimeEnabledFeatures::langAttributeAwareFormControlUIEnabled):
2108         (WebCore::RuntimeEnabledFeatures::setLangAttributeAwareFormControlUIEnabled):
2109         (WebCore::RuntimeEnabledFeatures::setLinkPreloadEnabled):
2110         (WebCore::RuntimeEnabledFeatures::linkPreloadEnabled):
2111         (WebCore::RuntimeEnabledFeatures::setResourceTimingEnabled):
2112         (WebCore::RuntimeEnabledFeatures::resourceTimingEnabled):
2113         (WebCore::RuntimeEnabledFeatures::setShadowDOMEnabled):
2114         (WebCore::RuntimeEnabledFeatures::shadowDOMEnabled):
2115         (WebCore::RuntimeEnabledFeatures::setInputEventsEnabled):
2116         (WebCore::RuntimeEnabledFeatures::inputEventsEnabled):
2117         (WebCore::RuntimeEnabledFeatures::setInteractiveFormValidationEnabled):
2118         (WebCore::RuntimeEnabledFeatures::interactiveFormValidationEnabled):
2119         (WebCore::RuntimeEnabledFeatures::setCustomElementsEnabled):
2120         (WebCore::RuntimeEnabledFeatures::customElementsEnabled):
2121         (WebCore::RuntimeEnabledFeatures::setModernMediaControlsEnabled):
2122         (WebCore::RuntimeEnabledFeatures::modernMediaControlsEnabled):
2123         (WebCore::RuntimeEnabledFeatures::setIndexedDBEnabled):
2124         (WebCore::RuntimeEnabledFeatures::fontLoadEventsEnabled):
2125         (WebCore::RuntimeEnabledFeatures::setMediaStreamEnabled):
2126         (WebCore::RuntimeEnabledFeatures::setPeerConnectionEnabled):
2127         (WebCore::RuntimeEnabledFeatures::setLocalStorageEnabled): Deleted.
2128         (WebCore::RuntimeEnabledFeatures::localStorageEnabled): Deleted.
2129         (WebCore::RuntimeEnabledFeatures::setSessionStorageEnabled): Deleted.
2130         (WebCore::RuntimeEnabledFeatures::sessionStorageEnabled): Deleted.
2131         (WebCore::RuntimeEnabledFeatures::setWebkitNotificationsEnabled): Deleted.
2132         (WebCore::RuntimeEnabledFeatures::webkitNotificationsEnabled): Deleted.
2133         (WebCore::RuntimeEnabledFeatures::setApplicationCacheEnabled): Deleted.
2134         (WebCore::RuntimeEnabledFeatures::applicationCacheEnabled): Deleted.
2135         (WebCore::RuntimeEnabledFeatures::setDataTransferItemsEnabled): Deleted.
2136         (WebCore::RuntimeEnabledFeatures::dataTransferItemsEnabled): Deleted.
2137         (WebCore::RuntimeEnabledFeatures::setWebkitIndexedDBEnabled): Deleted.
2138         (WebCore::RuntimeEnabledFeatures::webkitIndexedDBEnabled): Deleted.
2139         (WebCore::RuntimeEnabledFeatures::touchEnabled): Deleted.
2140         (WebCore::RuntimeEnabledFeatures::setTouchEnabled): Deleted.
2141         (WebCore::RuntimeEnabledFeatures::setDeviceMotionEnabled): Deleted.
2142         (WebCore::RuntimeEnabledFeatures::deviceMotionEnabled): Deleted.
2143         (WebCore::RuntimeEnabledFeatures::deviceMotionEventEnabled): Deleted.
2144         (WebCore::RuntimeEnabledFeatures::ondevicemotionEnabled): Deleted.
2145         (WebCore::RuntimeEnabledFeatures::setDeviceOrientationEnabled): Deleted.
2146         (WebCore::RuntimeEnabledFeatures::deviceOrientationEnabled): Deleted.
2147         (WebCore::RuntimeEnabledFeatures::deviceOrientationEventEnabled): Deleted.
2148         (WebCore::RuntimeEnabledFeatures::ondeviceorientationEnabled): Deleted.
2149         (WebCore::RuntimeEnabledFeatures::setJavaScriptI18NAPIEnabled): Deleted.
2150         (WebCore::RuntimeEnabledFeatures::webkitGetUserMediaEnabled): Deleted.
2151         (WebCore::RuntimeEnabledFeatures::webkitMediaStreamEnabled): Deleted.
2152         (WebCore::RuntimeEnabledFeatures::webkitRTCPeerConnectionEnabled): Deleted.
2153         (WebCore::RuntimeEnabledFeatures::experimentalContentSecurityPolicyFeaturesEnabled): Deleted.
2154         (WebCore::RuntimeEnabledFeatures::setExperimentalContentSecurityPolicyFeaturesEnabled): Deleted.
2155
2156         * testing/InternalSettings.cpp:
2157         (WebCore::InternalSettings::Backup::Backup):
2158         (WebCore::InternalSettings::Backup::restoreTo):
2159         (WebCore::InternalSettings::setLangAttributeAwareFormControlUIEnabled):
2160         (WebCore::InternalSettings::setResourceTimingEnabled):
2161         (WebCore::InternalSettings::setLinkPreloadEnabled):
2162         (WebCore::InternalSettings::setCSSGridLayoutEnabled):
2163         (WebCore::InternalSettings::setWebGL2Enabled):
2164         * testing/InternalSettings.h:
2165         * testing/InternalSettings.idl:
2166         * testing/Internals.cpp:
2167         (WebCore::Internals::Internals):
2168         (WebCore::Internals::setLinkPreloadSupport): Deleted.
2169         (WebCore::Internals::setCSSGridLayoutEnabled): Deleted.
2170         (WebCore::Internals::webGL2Enabled): Deleted.
2171         (WebCore::Internals::setWebGL2Enabled): Deleted.
2172         (WebCore::Internals::setResourceTimingSupport): Deleted.
2173         * testing/Internals.h:
2174         * testing/Internals.idl:
2175         Move toggling of RuntimeEnabledFeatures to InternalSettings and
2176         properly remember to save and restore them in Internals.
2177
2178 2017-01-20  Alex Christensen  <achristensen@webkit.org>
2179
2180         Add debugging code to compare URLParser with URL::parse
2181         https://bugs.webkit.org/show_bug.cgi?id=167267
2182
2183         Reviewed by Brady Eidson.
2184
2185         * platform/URLParser.cpp:
2186         (WebCore::URLParser::URLParser):
2187         (WebCore::URLParser::parse):
2188
2189 2017-01-20  Ryan Haddad  <ryanhaddad@apple.com>
2190
2191         Unreviewed, rolling out r210778.
2192
2193         This change caused multiple LayoutTests to crash.
2194
2195         Reverted changeset:
2196
2197         "[Cocoa] Unify FontPlatformData's hashing and equality
2198         operators"
2199         https://bugs.webkit.org/show_bug.cgi?id=167061
2200         http://trac.webkit.org/changeset/210778
2201
2202 2017-01-20  Joseph Pecoraro  <pecoraro@apple.com>
2203
2204         Remove outdated ENABLE(CSP_NEXT) build flag
2205         https://bugs.webkit.org/show_bug.cgi?id=167252
2206
2207         Reviewed by Brent Fulgham.
2208
2209         * Configurations/FeatureDefines.xcconfig:
2210         * dom/Document.idl:
2211         * page/RuntimeEnabledFeatures.cpp:
2212         (WebCore::RuntimeEnabledFeatures::reset):
2213         * page/RuntimeEnabledFeatures.h:
2214         (WebCore::RuntimeEnabledFeatures::experimentalContentSecurityPolicyFeaturesEnabled): Deleted.
2215         (WebCore::RuntimeEnabledFeatures::setExperimentalContentSecurityPolicyFeaturesEnabled): Deleted.
2216         * page/csp/ContentSecurityPolicy.cpp:
2217         (WebCore::ContentSecurityPolicy::experimentalFeaturesEnabled): Deleted.
2218         * page/csp/ContentSecurityPolicy.h:
2219
2220 2017-01-20  Zalan Bujtas  <zalan@apple.com>
2221
2222         Simple line layout: Add support for non-breaking space character.
2223         https://bugs.webkit.org/show_bug.cgi?id=167250
2224         <rdar://problem/30119638>
2225
2226         Reviewed by Antti Koivisto.
2227
2228         Do not bail out on noBreakSpace character.
2229         The line breaking logic already takes noBreakSpace characters into account.
2230         (except the peculiar "-webkit-nbsp-mode: space" mode)
2231
2232         Covered by existing test cases.
2233
2234         * rendering/SimpleLineLayout.cpp:
2235         (WebCore::SimpleLineLayout::canUseForText):
2236         (WebCore::SimpleLineLayout::canUseForStyle):
2237         (WebCore::SimpleLineLayout::printReason):
2238
2239 2017-01-20  Antoine Quint  <graouts@apple.com>
2240
2241         Web Animations should be off by default and enabled as an experimental feature
2242         https://bugs.webkit.org/show_bug.cgi?id=167115
2243         <rdar://problem/30048963>
2244
2245         Reviewed by Joseph Pecoraro.
2246
2247         Conditionalize the existing parts of the Web Animations API so that they may be
2248         toggled at runtime.
2249
2250         * animation/Animatable.idl:
2251         * animation/AnimationEffect.idl:
2252         * animation/AnimationTimeline.idl:
2253         * animation/DocumentAnimation.idl:
2254         * animation/DocumentTimeline.idl:
2255         * animation/KeyframeEffect.idl:
2256         * animation/WebAnimation.idl:
2257         * page/RuntimeEnabledFeatures.cpp:
2258         (WebCore::RuntimeEnabledFeatures::reset):
2259         * page/RuntimeEnabledFeatures.h:
2260
2261 2017-01-20  Antoine Quint  <graouts@apple.com>
2262
2263         [Modern Media Controls] Turn modern media controls on by default
2264         https://bugs.webkit.org/show_bug.cgi?id=165668
2265
2266         Reviewed by Dean Jackson.
2267
2268         Tests: media/modern-media-controls/fullscreen-support/ipad/fullscreen-support-tap.html
2269                media/modern-media-controls/pip-support/ipad/pip-support-enabled.html
2270                media/modern-media-controls/pip-support/ipad/pip-support-tap.html
2271                media/modern-media-controls/placard-support/ipad/placard-support-pip.html
2272                media/modern-media-controls/scrubber-support/ipad/scrubber-support-drag.html
2273
2274         Fix an error which may be triggered prior to Sierra where we would assume the presentation
2275         mode API was avaiable when it might not be, which caused a few tests to fail.
2276
2277         We also ensure that we always inject the UA styles for legacy media controls as otherwise
2278         toggling from modern media controls to legacy media controls would not inject those styles.
2279         To facilitate this we add a dedicated method for modern media controls styles in RenderTheme
2280         that is only used in the case of modern media controls when the shadow root asks for the styles
2281         to inject in the shadow root.
2282
2283         * Modules/mediacontrols/MediaControlsHost.cpp:
2284         (WebCore::MediaControlsHost::shadowRootCSSText):
2285         * Modules/modern-media-controls/media/pip-support.js:
2286         (PiPSupport.prototype.syncControl):
2287         (PiPSupport):
2288         * css/CSSDefaultStyleSheets.cpp:
2289         (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
2290         * rendering/RenderTheme.h:
2291         (WebCore::RenderTheme::modernMediaControlsStyleSheet):
2292         * rendering/RenderThemeIOS.h:
2293         * rendering/RenderThemeIOS.mm:
2294         (WebCore::RenderThemeIOS::mediaControlsStyleSheet):
2295         (WebCore::RenderThemeIOS::modernMediaControlsStyleSheet):
2296         * rendering/RenderThemeMac.h:
2297         * rendering/RenderThemeMac.mm:
2298         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
2299         (WebCore::RenderThemeMac::modernMediaControlsStyleSheet):
2300
2301 2017-01-19  Said Abou-Hallawa  <sabouhallawa@apple.com>
2302
2303         REGRESSION(r206156): Animated images are repeated one extra iteration than the value which is saved in the image file
2304         https://bugs.webkit.org/show_bug.cgi?id=167174
2305
2306         Reviewed by Simon Fraser.
2307
2308         Before r206156, BitmapImage::repetitionCount() used to return zero for
2309         the case loopCount = 1, -1 for loopCount = Infinity and loopCount for
2310         all other cases. Having repetitionCount() return zero for loopCount = 1
2311         makes the condition if (++m_repetitionsComplete > repetitionCount())
2312         break the animation loop after one iteration. But it was wrong for all
2313         loopCount > 1. It was causing an extra iteration to be played for the
2314         animated image. After r206156, BitmapImage::repetitionCount() returns
2315         loopCount for all cases loopCount != Infinity. Keeping the same condition
2316         causes the extra iteration to be played even for loopCount = 1.
2317
2318         Test: fast/images/animated-image-loop-count.html
2319
2320         * platform/graphics/BitmapImage.cpp:
2321         (WebCore::BitmapImage::internalStartAnimation):
2322
2323 2017-01-19  Chris Dumez  <cdumez@apple.com>
2324
2325         iterable<> should be enabled on WK1
2326         https://bugs.webkit.org/show_bug.cgi?id=167221
2327         <rdar://problem/30108531>
2328
2329         Reviewed by Youenn Fablet.
2330
2331         * Modules/fetch/FetchHeaders.idl:
2332         * bindings/scripts/test/JS/JSTestNode.cpp:
2333         (WebCore::JSTestNodePrototype::finishCreation):
2334         * bindings/scripts/test/JS/JSTestObj.cpp:
2335         (WebCore::JSTestObjPrototype::finishCreation):
2336         * bindings/scripts/test/TestNode.idl:
2337         * bindings/scripts/test/TestObj.idl:
2338         * css/FontFaceSet.idl:
2339         * dom/NodeList.idl:
2340
2341 2017-01-19  Zalan Bujtas  <zalan@apple.com>
2342
2343         Simple line layout: Extend coverage for justified content.
2344         https://bugs.webkit.org/show_bug.cgi?id=167219
2345         <rdar://problem/30108391>
2346
2347         Reviewed by Antti Koivisto.
2348
2349         Add support for general punctuation characters (0x2010, 0x2027) and latin characters including Extended-B.
2350
2351         Test: fast/text/simple-line-layout-with-justified-punctuation.html
2352
2353         * rendering/SimpleLineLayout.cpp:
2354         (WebCore::SimpleLineLayout::canUseForText):
2355         (WebCore::SimpleLineLayout::canUseForFontAndText):
2356
2357 2017-01-19  Alex Christensen  <achristensen@webkit.org>
2358
2359         Construct URLSearchParams from array or object
2360         https://bugs.webkit.org/show_bug.cgi?id=166973
2361
2362         Reviewed by Sam Weinig.
2363
2364         Covered by newly passing web platform tests.
2365
2366         * html/URLSearchParams.cpp:
2367         (WebCore::URLSearchParams::URLSearchParams):
2368         (WebCore::URLSearchParams::create):
2369         (WebCore::URLSearchParams::get):
2370         (WebCore::URLSearchParams::has):
2371         (WebCore::URLSearchParams::sort):
2372         (WebCore::URLSearchParams::set):
2373         (WebCore::URLSearchParams::getAll):
2374         (WebCore::URLSearchParams::remove):
2375         (WebCore::URLSearchParams::Iterator::next):
2376         * html/URLSearchParams.h:
2377         (WebCore::URLSearchParams::create):
2378         (WebCore::URLSearchParams::pairs):
2379         (WebCore::URLSearchParams::operator const Vector<std::pair<String, String>>&): Deleted.
2380         * html/URLSearchParams.idl:
2381         * platform/URLParser.cpp:
2382         (WebCore::URLParser::serialize):
2383         * platform/URLParser.h:
2384
2385 2017-01-19  Jer Noble  <jer.noble@apple.com>
2386
2387         CRASH at WebCore::TrackListBase::remove
2388         https://bugs.webkit.org/show_bug.cgi?id=167217
2389
2390         Reviewed by Brent Fulgham.
2391
2392         Test: media/media-source/media-source-error-crash.html
2393
2394         In very specific conditions, a HTMLMediaElement backed by a MediaSource can try to remove
2395         the same track from its track list twice. If there are two SourceBuffers attached to a
2396         HTMLMediaElement, and one has not yet been initialized, when the second fails to parse an
2397         appended buffer after receiving an initialization segment, the HTMLMediaElement will remove
2398         all its tracks in mediaLoadingFailed(), then MediaSource object itself will attempt remove
2399         the same track in removeSourceBuffer().
2400
2401         Solving this the safest way possible: bail early from TrackListBase if asked to remove a
2402         track which the list does not contain.
2403
2404         * html/track/TrackListBase.cpp:
2405         (TrackListBase::remove):
2406
2407 2017-01-19  Andy Estes  <aestes@apple.com>
2408
2409         [iOS] Move the PDF password view into its own class for reuse
2410         https://bugs.webkit.org/show_bug.cgi?id=167192
2411
2412         Reviewed by Tim Horton.
2413
2414         * English.lproj/Localizable.strings: Updated the failure alert strings to not be specific to PDFs.
2415
2416 2017-01-19  Chris Dumez  <cdumez@apple.com>
2417
2418         Make sure HTML validation bubble gets dismissed when its associated element's frame gets detached
2419         https://bugs.webkit.org/show_bug.cgi?id=167215
2420         <rdar://problem/29885052>
2421
2422         Reviewed by Andreas Kling.
2423
2424         Make sure HTML validation bubble gets dismissed when its associated
2425         element's frame gets detached and that we do not crash.
2426
2427         Tests: fast/forms/validation-message-detached-iframe.html
2428                fast/forms/validation-message-detached-iframe2.html
2429
2430         * dom/Document.cpp:
2431         (WebCore::Document::prepareForDestruction):
2432         * page/ValidationMessageClient.h:
2433
2434 2017-01-19  Chris Dumez  <cdumez@apple.com>
2435
2436         Implement per activity state CPU usage reporting using diagnostic logging
2437         https://bugs.webkit.org/show_bug.cgi?id=167163
2438         <rdar://problem/30058349>
2439
2440         Reviewed by Andreas Kling.
2441
2442         Implement per activity state CPU usage reporting using diagnostic logging.
2443
2444         * WebCore.xcodeproj/project.pbxproj:
2445         * page/ActivityState.h:
2446         * page/ChromeClient.h:
2447         * page/DiagnosticLoggingKeys.cpp:
2448         (WebCore::DiagnosticLoggingKeys::nonVisibleStateKey):
2449         (WebCore::DiagnosticLoggingKeys::visibleNonActiveStateKey):
2450         (WebCore::DiagnosticLoggingKeys::visibleAndActiveStateKey):
2451         (WebCore::DiagnosticLoggingKeys::foregroundCPUUsageToDiagnosticLogginKey):
2452         (WebCore::DiagnosticLoggingKeys::backgroundCPUUsageToDiagnosticLogginKey):
2453         * page/DiagnosticLoggingKeys.h:
2454         * page/Page.cpp:
2455         (WebCore::isUtilityPageChromeClient):
2456         (WebCore::Page::Page):
2457         (WebCore::Page::~Page):
2458         (WebCore::Page::didStartProvisionalLoad):
2459         (WebCore::Page::didFinishLoad):
2460         (WebCore::Page::isUtilityPage):
2461         (WebCore::Page::setActivityState):
2462         (WebCore::Page::setIsVisibleInternal):
2463         * page/Page.h:
2464         (WebCore::Page::activityState):
2465         (WebCore::Page::isUtilityPage):
2466         * page/PerformanceMonitor.cpp: Added.
2467         (WebCore::activityStateForCPUSampling):
2468         (WebCore::PerformanceMonitor::PerformanceMonitor):
2469         (WebCore::PerformanceMonitor::didStartProvisionalLoad):
2470         (WebCore::PerformanceMonitor::didFinishLoad):
2471         (WebCore::PerformanceMonitor::activityStateChanged):
2472         (WebCore::PerformanceMonitor::measurePostLoadCPUUsage):
2473         (WebCore::PerformanceMonitor::measurePostBackgroundingCPUUsage):
2474         (WebCore::PerformanceMonitor::measurePerActivityStateCPUUsage):
2475         (WebCore::stringForCPUSamplingActivityState):
2476         (WebCore::PerformanceMonitor::measureCPUUsageInActivityState):
2477         * page/PerformanceMonitor.h: Copied from Source/WebCore/page/ActivityState.h.
2478         * page/Settings.cpp:
2479         * page/Settings.h:
2480         (WebCore::Settings::isPostLoadCPUUsageMeasurementEnabled):
2481         (WebCore::Settings::isPostBackgroundingCPUUsageMeasurementEnabled):
2482         (WebCore::Settings::isPerActivityStateCPUUsageMeasurementEnabled):
2483
2484 2017-01-19  Myles C. Maxfield  <mmaxfield@apple.com>
2485
2486         [Cocoa] Variation fonts are erroneously disabled on iOS
2487         https://bugs.webkit.org/show_bug.cgi?id=167172
2488
2489         Reviewed by Simon Fraser.
2490
2491         OpenSource builders don't seem to understand sdk=embedded*.
2492
2493         * Configurations/FeatureDefines.xcconfig:
2494
2495 2017-01-19  Ryan Haddad  <ryanhaddad@apple.com>
2496
2497         Rebaseline bindings tests after r210918.
2498
2499         Unreviewed test gardening.
2500
2501         * bindings/scripts/test/JS/JSTestObj.cpp:
2502
2503 2017-01-19  Andreas Kling  <akling@apple.com>
2504
2505         ScriptExecutionContext::topOrigin() should return a reference.
2506         <https://webkit.org/b/167190>
2507
2508         Reviewed by Sam Weinig.
2509
2510         There is always a topOrigin() SecurityOrigin, so make it return a reference
2511         and remove some unnecessary null-checks exposed by this change.
2512
2513         * Modules/applepay/ApplePaySession.cpp:
2514         (WebCore::canCallApplePaySessionAPIs):
2515         * Modules/encryptedmedia/CDM.cpp:
2516         (WebCore::CDM::getSupportedConfiguration):
2517         (WebCore::CDM::getConsentStatus):
2518         * Modules/indexeddb/IDBFactory.cpp:
2519         (WebCore::IDBFactory::openInternal):
2520         (WebCore::IDBFactory::deleteDatabase):
2521         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
2522         (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin):
2523         * Modules/mediastream/UserMediaRequest.cpp:
2524         (WebCore::UserMediaRequest::topLevelDocumentOrigin):
2525         (WebCore::canCallGetUserMedia):
2526         * dom/Document.h:
2527         * dom/ScriptExecutionContext.h:
2528         * html/DOMURL.cpp:
2529         (WebCore::DOMURL::revokeObjectURL):
2530         * inspector/InspectorIndexedDBAgent.cpp:
2531         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
2532         * inspector/InspectorPageAgent.cpp:
2533         (WebCore::InspectorPageAgent::cachedResource):
2534         * loader/appcache/ApplicationCacheGroup.cpp:
2535         (WebCore::ApplicationCacheGroup::selectCache):
2536         (WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL):
2537         (WebCore::ApplicationCacheGroup::update):
2538         * loader/archive/cf/LegacyWebArchive.cpp:
2539         (WebCore::LegacyWebArchive::create):
2540         * loader/cache/CachedResourceRequest.cpp:
2541         (WebCore::CachedResourceRequest::setDomainForCachePartition):
2542         * page/SecurityOrigin.h:
2543         (WebCore::SecurityOrigin::canAccessDatabase):
2544         (WebCore::SecurityOrigin::canAccessSessionStorage):
2545         (WebCore::SecurityOrigin::canAccessPluginStorage):
2546         (WebCore::SecurityOrigin::canAccessApplicationCache):
2547         * storage/StorageNamespaceProvider.cpp:
2548         (WebCore::StorageNamespaceProvider::localStorageArea):
2549         * testing/Internals.cpp:
2550         (WebCore::Internals::isLoadingFromMemoryCache):
2551         * workers/DedicatedWorkerGlobalScope.cpp:
2552         (WebCore::DedicatedWorkerGlobalScope::create):
2553         (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
2554         * workers/DedicatedWorkerGlobalScope.h:
2555         * workers/DedicatedWorkerThread.cpp:
2556         (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
2557         (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
2558         * workers/DedicatedWorkerThread.h:
2559         * workers/WorkerGlobalScope.cpp:
2560         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
2561         * workers/WorkerGlobalScope.h:
2562         * workers/WorkerThread.cpp:
2563         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
2564         (WebCore::WorkerThread::WorkerThread):
2565         * workers/WorkerThread.h:
2566
2567 2017-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2568
2569         [GTK] Provide API to set proxy settings
2570         https://bugs.webkit.org/show_bug.cgi?id=128674
2571
2572         Reviewed by Michael Catanzaro.
2573
2574         Add SoupNetworkProxySettings struct to store proxy settings.
2575
2576         * platform/network/soup/SoupNetworkProxySettings.h: Added.
2577         (WebCore::SoupNetworkProxySettings::SoupNetworkProxySettings):
2578         (WebCore::SoupNetworkProxySettings::operator=):
2579         (WebCore::SoupNetworkProxySettings::isEmpty):
2580         * platform/network/soup/SoupNetworkSession.cpp:
2581         (WebCore::SoupNetworkSession::SoupNetworkSession): Setup the proxy if user provided proxy settings.
2582         (WebCore::SoupNetworkSession::setupProxy): Set the proxy-resolver property of the SoupSession according to the
2583         global SoupNetworkProxySettings.
2584         (WebCore::SoupNetworkSession::setProxySettingsFromEnvironment): Update the global SoupNetworkProxySettings with
2585         values from environment.
2586         (WebCore::SoupNetworkSession::setProxySettings): Set the global SoupNetworkProxySettings.
2587         * platform/network/soup/SoupNetworkSession.h:
2588
2589 2017-01-18  Sam Weinig  <sam@webkit.org>
2590
2591         [WebIDL] Records should preserve javascript object order
2592         https://bugs.webkit.org/show_bug.cgi?id=167189
2593
2594         Reviewed by Alex Christensen.
2595
2596         Instead of modeling IDL records as HashMaps, use a Vector
2597         of KeyValuePairs, to all preserving the iteration order.
2598
2599         * Modules/webdatabase/SQLResultSetRowList.cpp:
2600         (WebCore::SQLResultSetRowList::item):
2601         * Modules/webdatabase/SQLResultSetRowList.h:
2602         Return a Vector rather than a HashMap.
2603
2604         * bindings/IDLTypes.h:
2605         Change underlying type to be a Vector<KeyValuePair<K, V>>.
2606
2607         * bindings/js/JSDOMConvert.h:
2608         Update conversion for new implementation type. For conversion
2609         to JSValue, allow any type that can has an iterator of keyValuePairs.
2610  
2611         * testing/TypeConversions.h:
2612         (WebCore::TypeConversions::testLongRecord):
2613         (WebCore::TypeConversions::setTestLongRecord):
2614         (WebCore::TypeConversions::testNodeRecord):
2615         (WebCore::TypeConversions::setTestNodeRecord):
2616         (WebCore::TypeConversions::testSequenceRecord):
2617         (WebCore::TypeConversions::setTestSequenceRecord):
2618         * testing/TypeConversions.idl:
2619         Update test IDL to use functions, since the spec mandates that
2620         records can't be used with attributes.
2621
2622 2017-01-18  Alex Christensen  <achristensen@webkit.org>
2623
2624         Implement URLSearchParams's sort()
2625         https://bugs.webkit.org/show_bug.cgi?id=167154
2626
2627         Reviewed by Sam Weinig.
2628
2629         Test: imported/w3c/web-platform-tests/url/urlsearchparams-sort.html
2630
2631         * html/URLSearchParams.cpp:
2632         (WebCore::URLSearchParams::sort):
2633         * html/URLSearchParams.h:
2634         * html/URLSearchParams.idl:
2635
2636 2017-01-18  Yoav Weiss  <yoav@yoav.ws>
2637
2638         Add Link header support for preload.
2639         https://bugs.webkit.org/show_bug.cgi?id=165521
2640
2641         Reviewed by Alex Christensen.
2642
2643         This patch adds Link header support for preload, by adding a Link
2644         header parser, and calling it from FrameLoader::receivedFirstData.
2645
2646         Test: http/tests/preload/download_resources_from_header.php
2647
2648         * CMakeLists.txt: Add LinkHeader files.
2649         * WebCore.xcodeproj/project.pbxproj: Add LinkHeader files.
2650         * loader/FrameLoader.cpp:
2651         (WebCore::receivedFirstData): Trigger Link based preloading by calling loadLinksFromHeader.
2652         * loader/LinkHeader.cpp: Added.
2653         (WebCore::isWhitespace):
2654         (WebCore::isValidURLChar):
2655         (WebCore::isValidParameterNameChar):
2656         (WebCore::isValidParameterValueEnd):
2657         (WebCore::isValidParameterValueChar):
2658         (WebCore::isExtensionParameter):
2659         (WebCore::parseURL):
2660         (WebCore::invalidParameterDelimiter):
2661         (WebCore::validFieldEnd):
2662         (WebCore::parseParameterDelimiter):
2663         (WebCore::paramterNameFromString):
2664         (WebCore::parseParameterName):
2665         (WebCore::skipQuotesIfNeeded):
2666         (WebCore::parseParameterValue):
2667         (WebCore::LinkHeader::setValue):
2668         (WebCore::findNextHeader):
2669         (WebCore::LinkHeader::LinkHeader):
2670         (WebCore::LinkHeaderSet::LinkHeaderSet):
2671         (WebCore::LinkHeaderSet::init):
2672         * loader/LinkHeader.h: Added.
2673         (WebCore::LinkHeader::url):
2674         (WebCore::LinkHeader::rel):
2675         (WebCore::LinkHeader::as):
2676         (WebCore::LinkHeader::mimeType):
2677         (WebCore::LinkHeader::media):
2678         (WebCore::LinkHeader::crossOrigin):
2679         (WebCore::LinkHeader::valid):
2680         (WebCore::LinkHeaderSet::begin):
2681         (WebCore::LinkHeaderSet::end):
2682         (WebCore::LinkHeaderSet::operator[]):
2683         (WebCore::LinkHeaderSet::size):
2684         * loader/LinkLoader.cpp:
2685         (WebCore::LinkLoader::loadLinksFromHeader): Loads link preload directives that arrive from Link headers.
2686         (WebCore::LinkLoader::preloadIfNeeded): Add return value.
2687         * loader/LinkLoader.h:
2688         * platform/network/HTTPHeaderNames.in: Add "Link" as a header name.
2689
2690 2017-01-18  Filip Pizlo  <fpizlo@apple.com>
2691
2692         JSSegmentedVariableObject and its subclasses should have a sane destruction story
2693         https://bugs.webkit.org/show_bug.cgi?id=167193
2694
2695         Reviewed by Saam Barati.
2696
2697         No new tests because no new behavior.
2698         
2699         JSSegmentedVariableObjects now get to have a sane destruction story. This means switching
2700         subspace types for the DOM's global object subspace.
2701
2702         * bindings/js/WebCoreJSClientData.cpp:
2703         (WebCore::JSVMClientData::JSVMClientData):
2704         * bindings/js/WebCoreJSClientData.h:
2705         * bindings/scripts/CodeGeneratorJS.pm:
2706         (GenerateHeader):
2707
2708 2017-01-18  Ryan Haddad  <ryanhaddad@apple.com>
2709
2710         Unreviewed, rolling out r210848.
2711
2712         This change introduced media-related LayoutTest failures and
2713         crashes on macOS.
2714
2715         Reverted changeset:
2716
2717         "[Modern Media Controls] Turn modern media controls on by
2718         default"
2719         https://bugs.webkit.org/show_bug.cgi?id=165668
2720         http://trac.webkit.org/changeset/210848
2721
2722 2017-01-18  Alex Christensen  <achristensen@webkit.org>
2723
2724         Fix CFURLConnection build on Mac
2725         https://bugs.webkit.org/show_bug.cgi?id=167168
2726
2727         Reviewed by Andy Estes.
2728
2729         This is old code, and it hurts to do this, but I need this working to compare with Windows
2730         to get the ResourceHandleCFURLConnectionDelegateWithOperationQueue working so we can make
2731         loading asynchronous in WebCore.
2732
2733         * page/mac/PageMac.mm:
2734         (WebCore::Page::platformInitialize):
2735         * platform/network/cf/AuthenticationCF.cpp:
2736         * platform/network/cf/ResourceHandleCFNet.cpp:
2737         (WebCore::ResourceHandle::createCFURLConnection):
2738         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
2739         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::setupRequest):
2740         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::canRespondToProtectionSpace):
2741         * platform/network/cocoa/ResourceRequestCocoa.mm:
2742         (WebCore::ResourceRequest::clearOrUpdateNSURLRequest):
2743         Moved from iOS-specific file.  It's needed on Mac using CFURLConnection, too.
2744         * platform/network/ios/ResourceRequestIOS.mm:
2745         (WebCore::ResourceRequest::clearOrUpdateNSURLRequest): Deleted.
2746
2747 2017-01-18  Michael Catanzaro  <mcatanzaro@igalia.com>
2748
2749         REGRESSION(r210531): Broke local resource loads from custom local protocols
2750         https://bugs.webkit.org/show_bug.cgi?id=167058
2751
2752         Reviewed by Brent Fulgham.
2753
2754         Allow local protocols to access resources on different volumes unless the protocol is
2755         "file".
2756
2757         * page/SecurityOrigin.cpp:
2758         (WebCore::SecurityOrigin::canDisplay):
2759
2760 2017-01-18  Alex Christensen  <achristensen@webkit.org>
2761
2762         Fix CMake build.
2763
2764         * PlatformMac.cmake:
2765         * platform/spi/cocoa/IOSurfaceSPI.h:
2766
2767 2017-01-18  Myles C. Maxfield  <mmaxfield@apple.com>
2768
2769         [Cocoa] Variation fonts without variations specified are not rendered as if the default variations were specified
2770         https://bugs.webkit.org/show_bug.cgi?id=166672
2771         <rdar://problem/29779119>
2772         <rdar://problem/29848883>
2773
2774         Reviewed by Simon Fraser.
2775
2776         CoreText has a bug (<rdar://problem/29859207>) where variation fonts without
2777         a specified variation value are rendered as if the minimum value is specified,
2778         rather than the default value. The solution is to apply default values where
2779         they are omitted.
2780
2781         Test: fast/text/variations/advances.html
2782
2783         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2784         (WebCore::defaultVariationValues):
2785         (WebCore::fontIsSystemFont):
2786         (WebCore::preparePlatformFont):
2787
2788 2017-01-18  Myles C. Maxfield  <mmaxfield@apple.com>
2789
2790         background-repeat-x doesn't work
2791         https://bugs.webkit.org/show_bug.cgi?id=166997
2792
2793         Reviewed by Simon Fraser.
2794
2795         During the creation of the new CSS parser, we accidentally forgot
2796         to hook up background-repeat-x and background-repeat-y.
2797
2798         Tests: fast/backgrounds/background-repeat-x-y-parse.html
2799                fast/backgrounds/background-repeat-x-y.html
2800
2801         * css/parser/CSSParserFastPaths.cpp:
2802         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
2803
2804 2017-01-18  Andy Estes  <aestes@apple.com>
2805
2806         [QuickLook] Support password-protected documents
2807         https://bugs.webkit.org/show_bug.cgi?id=167153
2808         <rdar://problem/28544527>
2809
2810         Reviewed by Alex Christensen.
2811
2812         Added support for previewing password-protected documents. If a document is
2813         password-protected, QLPreviewConverter will call -connection:didFailWithError: with an error
2814         code of kQLReturnPasswordProtected. When this happens, QuickLookHandle will ask the client
2815         for a password, create a new QLPreviewConverter with the password specified in an options
2816         dictionary, and replay the buffered input data into the converter. QLPreviewConverter will
2817         then send the converted document data to its delegate as usual.
2818         
2819         Password entry UI will be added later; this patch implements the necessary QuickLookHandle
2820         logic and adds support for testing.
2821
2822         Test: quicklook/password-protected.html
2823
2824         * PlatformMac.cmake:
2825         * WebCore.xcodeproj/project.pbxproj:
2826         * loader/ios/QuickLook.h: Declared setClientForTesting().
2827         * loader/ios/QuickLook.mm: 
2828         (testingClient): Created a static RefPtr to hold the testing client.
2829         (testingOrEmptyClient): Returns the testing client if it's set, otherwise returns the empty client.
2830         (-[WebPreviewConverter initWithResourceLoader:resourceResponse:quickLookHandle:]):
2831         Initialized _client to testingOrEmptyClient(), stored the ResourceResponse's nsURLResponse()
2832         in _originalResponse, and initialized _bufferedDataArray.
2833         (-[WebPreviewConverter setClient:]): Ignore the new client if there is already a testing client.
2834         (-[WebPreviewConverter appendDataArray:]): Stored the data array in _bufferedDataArray.
2835         (-[WebPreviewConverter _sendDidReceiveResponseIfNecessary]): Cleared _bufferedDataArray.
2836         (-[WebPreviewConverter connection:didReceiveData:lengthReceived:]): Changed the
2837         UNUSED_PARAM() to an ASSERT_UNUSED().
2838         (-[WebPreviewConverter connectionDidFinishLoading:]): Ditto.
2839         (-[WebPreviewConverter connection:didFailWithError:]): If the error code is
2840         kQLReturnPasswordProtected and the domain is QuickLookErrorDomain, request a password from
2841         the client then create a new QLPreviewConverter with the password specified in the options dictionary.
2842         (WebCore::QuickLookHandle::setClientForTesting): Set testingClient() to the specified client.
2843         * platform/ios/QuickLookSoftLink.h: Soft-linked kQLPreviewOptionPasswordKey.
2844         * platform/ios/QuickLookSoftLink.mm: Ditto.
2845         * platform/network/ios/QuickLookHandleClient.h:
2846         (WebCore::QuickLookHandleClient::supportsPasswordEntry): Added. Tells QuickLookHandle
2847         whether the client supports password entry.
2848         (WebCore::QuickLookHandleClient::didRequestPassword): Added. Asks the client to specify a
2849         password in the completionHandler lambda.
2850         * platform/spi/ios/QuickLookSPI.h: Declared kQLReturnPasswordProtected for the public SDK
2851         and asserted that its value is 4.
2852         * testing/Internals.cpp:
2853         (WebCore::Internals::resetToConsistentState): Reset the MockQuickLookHandleClient password
2854         to the empty string and uninstalled the testing client.
2855         (WebCore::Internals::setQuickLookPassword): Installed the testing client and set a password
2856         on the MockQuickLookHandleClient.
2857         * testing/Internals.h: 
2858         * testing/Internals.idl: Defined Internals.setQuickLookPassword().
2859         * testing/MockQuickLookHandleClient.cpp: Added.
2860         (WebCore::MockQuickLookHandleClient::singleton): Returned a shared MockQuickLookHandleClient.
2861         (WebCore::MockQuickLookHandleClient::didRequestPassword): Dispatched a lambda on the
2862         main-or-Web-thread run loop to call the completionHandler with the specified password.
2863         This simulates the delay that would happen when prompting the user for a password.
2864         * testing/MockQuickLookHandleClient.h: Added.
2865
2866 2017-01-18  Youenn Fablet  <youenn@apple.com>
2867
2868         [Streams API] ReadableStream generic reader constructor does not need to call ReadableStream getReader
2869         https://bugs.webkit.org/show_bug.cgi?id=167137
2870
2871         Reviewed by Xabier Rodriguez-Calvar.
2872
2873         Test: streams/shadowing-getReader.html
2874
2875         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
2876         (WebCore::constructJSReadableStreamDefaultReader): Using private constructor instead of getReader.
2877
2878 2017-01-18  Youenn Fablet  <youenn@apple.com>
2879
2880         Reject fetch promise in case of ReadableStream upload
2881         https://bugs.webkit.org/show_bug.cgi?id=167145
2882
2883         Reviewed by Alex Christensen.
2884
2885         Covered by rebased tests.
2886
2887         * Modules/fetch/FetchBody.cpp:
2888         (WebCore::FetchBody::extract): Storing the fact that body data is represented as a ReadableStream.
2889         * Modules/fetch/FetchBody.h:
2890         (WebCore::FetchBody::isReadableStream):
2891         * Modules/fetch/FetchRequest.h:
2892         * Modules/fetch/FetchResponse.cpp:
2893         (WebCore::FetchResponse::fetch): Rejecting if request body data is a ReadableStream.
2894
2895 2017-01-18  Andreas Kling  <akling@apple.com>
2896
2897         Document::securityOrigin() should return a reference.
2898         <https://webkit.org/b/167124>
2899
2900         Reviewed by Sam Weinig.
2901
2902         The security origin is always initialized by the Document constructor
2903         through Document::initSecurityContext(), so it's effectively always present.
2904         Make it return a reference and remove unnecessary null checks exposed by this.
2905
2906         * Modules/applepay/ApplePaySession.cpp:
2907         (WebCore::canCallApplePaySessionAPIs):
2908         * Modules/encryptedmedia/CDM.cpp:
2909         (WebCore::CDM::getSupportedConfiguration):
2910         (WebCore::CDM::getConsentStatus):
2911         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
2912         (WebCore::WebKitMediaKeySession::mediaKeysStorageDirectory):
2913         * Modules/mediastream/UserMediaRequest.cpp:
2914         (WebCore::canCallGetUserMedia):
2915         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
2916         (WebCore::DOMWindowWebDatabase::openDatabase):
2917         * Modules/webdatabase/DatabaseContext.cpp:
2918         (WebCore::DatabaseContext::allowDatabaseAccess):
2919         * Modules/websockets/WebSocketHandshake.cpp:
2920         (WebCore::WebSocketHandshake::clientOrigin):
2921         * bindings/js/JSDOMBinding.cpp:
2922         (WebCore::canAccessDocument):
2923         * bindings/js/ScriptController.cpp:
2924         (WebCore::ScriptController::collectIsolatedContexts):
2925         * css/CSSStyleSheet.cpp:
2926         (WebCore::CSSStyleSheet::canAccessRules):
2927         * css/RuleSet.cpp:
2928         (WebCore::RuleSet::addRulesFromSheet):
2929         * css/StyleRuleImport.cpp:
2930         (WebCore::StyleRuleImport::setCSSStyleSheet):
2931         * dom/Document.cpp:
2932         (WebCore::canAccessAncestor):
2933         (WebCore::Document::findUnsafeParentScrollPropagationBoundary):
2934         (WebCore::Document::cookie):
2935         (WebCore::Document::setCookie):
2936         (WebCore::Document::origin):
2937         (WebCore::Document::domain):
2938         (WebCore::Document::setDomain):
2939         (WebCore::Document::storageBlockingStateDidChange):
2940         (WebCore::Document::initSecurityContext):
2941         (WebCore::Document::initDNSPrefetch):
2942         (WebCore::Document::topOrigin):
2943         * dom/Document.h:
2944         (WebCore::Document::securityOrigin):
2945         * dom/SecurityContext.cpp:
2946         (WebCore::SecurityContext::isSecureTransitionTo):
2947         * html/HTMLAnchorElement.cpp:
2948         (WebCore::HTMLAnchorElement::handleClick):
2949         * html/HTMLAppletElement.cpp:
2950         (WebCore::HTMLAppletElement::canEmbedJava):
2951         * html/HTMLCanvasElement.cpp:
2952         (WebCore::HTMLCanvasElement::securityOrigin):
2953         * html/HTMLLinkElement.cpp:
2954         (WebCore::HTMLLinkElement::setCSSStyleSheet):
2955         * html/HTMLMediaElement.cpp:
2956         (WebCore::HTMLMediaElement::isSafeToLoadURL):
2957         (WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory):
2958         * html/HTMLPlugInImageElement.cpp:
2959         (WebCore::HTMLPlugInImageElement::allowedToLoadFrameURL):
2960         * inspector/InspectorDOMStorageAgent.cpp:
2961         (WebCore::InspectorDOMStorageAgent::storageId):
2962         (WebCore::InspectorDOMStorageAgent::findStorageArea):
2963         * inspector/InspectorIndexedDBAgent.cpp:
2964         (WebCore::InspectorIndexedDBAgent::requestDatabaseNames):
2965         (WebCore::InspectorIndexedDBAgent::requestDatabase):
2966         (WebCore::InspectorIndexedDBAgent::requestData):
2967         (WebCore::InspectorIndexedDBAgent::clearObjectStore):
2968         * inspector/InspectorPageAgent.cpp:
2969         (WebCore::InspectorPageAgent::findFrameWithSecurityOrigin):
2970         (WebCore::InspectorPageAgent::buildObjectForFrame):
2971         * loader/DocumentLoader.cpp:
2972         (WebCore::DocumentLoader::commitData):
2973         * loader/DocumentThreadableLoader.cpp:
2974         (WebCore::DocumentThreadableLoader::loadRequest):
2975         (WebCore::DocumentThreadableLoader::securityOrigin):
2976         * loader/DocumentWriter.cpp:
2977         (WebCore::canReferToParentFrameEncoding):
2978         * loader/EmptyClients.cpp:
2979         * loader/FrameLoadRequest.cpp:
2980         (WebCore::FrameLoadRequest::FrameLoadRequest):
2981         * loader/FrameLoadRequest.h:
2982         (WebCore::FrameLoadRequest::FrameLoadRequest):
2983         * loader/FrameLoader.cpp:
2984         (WebCore::shouldClearWindowName):
2985         (WebCore::FrameLoader::outgoingOrigin):
2986         (WebCore::FrameLoader::loadURL):
2987         (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
2988         * loader/FrameLoaderClient.h:
2989         * loader/MixedContentChecker.cpp:
2990         (WebCore::MixedContentChecker::isMixedContent):
2991         (WebCore::MixedContentChecker::canDisplayInsecureContent):
2992         (WebCore::MixedContentChecker::canRunInsecureContent):
2993         (WebCore::MixedContentChecker::checkFormForMixedContent):
2994         * loader/MixedContentChecker.h:
2995         * loader/NavigationScheduler.cpp:
2996         (WebCore::NavigationScheduler::scheduleRedirect):
2997         (WebCore::NavigationScheduler::scheduleLocationChange):
2998         (WebCore::NavigationScheduler::scheduleRefresh):
2999         * loader/NavigationScheduler.h:
3000         * loader/PingLoader.cpp:
3001         (WebCore::PingLoader::loadImage):
3002         (WebCore::PingLoader::sendPing):
3003         (WebCore::PingLoader::sendViolationReport):
3004         * loader/ResourceLoadInfo.cpp:
3005         (WebCore::ResourceLoadInfo::isThirdParty):
3006         * loader/ResourceLoader.cpp:
3007         (WebCore::ResourceLoader::init):
3008         (WebCore::ResourceLoader::isAllowedToAskUserForCredentials):
3009         * loader/SubframeLoader.cpp:
3010         (WebCore::SubframeLoader::pluginIsLoadable):
3011         (WebCore::SubframeLoader::createJavaAppletWidget):
3012         (WebCore::SubframeLoader::loadSubframe):
3013         * loader/appcache/ApplicationCacheGroup.cpp:
3014         (WebCore::ApplicationCacheGroup::selectCache):
3015         (WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL):
3016         (WebCore::ApplicationCacheGroup::update):
3017         * loader/cache/CachedResourceLoader.cpp:
3018         (WebCore::CachedResourceLoader::canRequest):
3019         (WebCore::CachedResourceLoader::canRequestAfterRedirection):
3020         (WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox):
3021         * loader/cache/CachedResourceRequest.cpp:
3022         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
3023         (WebCore::CachedResourceRequest::updateForAccessControl):
3024         * loader/cache/CachedResourceRequest.h:
3025         (WebCore::CachedResourceRequest::setOrigin):
3026         * page/DOMWindow.cpp:
3027         (WebCore::DOMWindow::sessionStorage):
3028         (WebCore::DOMWindow::localStorage):
3029         (WebCore::DOMWindow::postMessage):
3030         (WebCore::DOMWindow::dispatchMessageEventWithOriginCheck):
3031         (WebCore::DOMWindow::isSameSecurityOriginAsMainFrame):
3032         (WebCore::DOMWindow::crossDomainAccessErrorMessage):
3033         (WebCore::DOMWindow::isInsecureScriptAccess):
3034         * page/DragController.cpp:
3035         (WebCore::DragController::dragExited):
3036         (WebCore::DragController::tryDocumentDrag):
3037         (WebCore::DragController::tryDHTMLDrag):
3038         (WebCore::DragController::startDrag):
3039         * page/History.cpp:
3040         (WebCore::History::stateObjectAdded):
3041         * page/Location.cpp:
3042         (WebCore::Location::ancestorOrigins):
3043         (WebCore::Location::reload):
3044         * page/Navigator.cpp:
3045         (WebCore::Navigator::javaEnabled):
3046         * page/Page.cpp:
3047         (WebCore::Page::showAllPlugins):
3048         * page/PerformanceResourceTiming.cpp:
3049         (WebCore::passesTimingAllowCheck):
3050         * page/SecurityOrigin.cpp:
3051         (WebCore::SecurityOrigin::canAccess):
3052         (WebCore::SecurityOrigin::canRequest):
3053         (WebCore::SecurityOrigin::canReceiveDragData):
3054         (WebCore::SecurityOrigin::canAccessStorage):
3055         (WebCore::SecurityOrigin::isSameOriginAs):
3056         (WebCore::SecurityOrigin::equal):
3057         (WebCore::SecurityOrigin::isSameSchemeHostPort):
3058         * page/SecurityOrigin.h:
3059         * page/SecurityOriginData.cpp:
3060         (WebCore::SecurityOriginData::fromFrame):
3061         * page/SecurityOriginHash.h:
3062         (WebCore::SecurityOriginHash::equal):
3063         * page/csp/ContentSecurityPolicy.cpp:
3064         (WebCore::stripURLForUseInReport):
3065         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3066         (WebCore::MediaPlayerPrivateAVFoundationCF::hasSingleSecurityOrigin):
3067         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3068         (WebCore::MediaPlayerPrivateAVFoundationObjC::hasSingleSecurityOrigin):
3069         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3070         (WebCore::MediaPlayerPrivateQTKit::hasSingleSecurityOrigin):
3071         * rendering/shapes/ShapeOutsideInfo.cpp:
3072         (WebCore::checkShapeImageOrigin):
3073         * replay/ReplayInputCreationMethods.cpp:
3074         (WebCore::InitialNavigation::createFromPage):
3075         * replay/ReplayInputDispatchMethods.cpp:
3076         (WebCore::InitialNavigation::dispatch):
3077         * storage/Storage.cpp:
3078         (WebCore::Storage::isDisabledByPrivateBrowsing):
3079         * storage/StorageEventDispatcher.cpp:
3080         (WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
3081         (WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
3082         * storage/StorageNamespaceProvider.cpp:
3083         (WebCore::StorageNamespaceProvider::localStorageArea):
3084         * testing/Internals.cpp:
3085         (WebCore::Internals::setApplicationCacheOriginQuota):
3086         * xml/XSLTProcessorLibxslt.cpp:
3087         (WebCore::docLoaderFunc):
3088         * xml/parser/XMLDocumentParserLibxml2.cpp:
3089         (WebCore::shouldAllowExternalLoad):
3090
3091 2017-01-18  Ryan Haddad  <ryanhaddad@apple.com>
3092
3093         Remove WEBCORE_EXPORT from newly inlined functions after r210845.
3094
3095         Unreviewed build fix.
3096
3097         * loader/DocumentLoader.h:
3098
3099 2017-01-18  Per Arne Vollan  <pvollan@apple.com>
3100
3101         Crash when changing video subtitles.
3102         https://bugs.webkit.org/show_bug.cgi?id=167159
3103
3104         Reviewed by Xabier Rodriguez-Calvar.
3105
3106         Add null pointer check.
3107
3108         * html/track/VTTCue.cpp:
3109         (WebCore::VTTCue::removeDisplayTree):
3110
3111 2017-01-18  Youenn Fablet  <youenn@apple.com>
3112
3113         [Fetch API] Update content-type in case of form data
3114         https://bugs.webkit.org/show_bug.cgi?id=167143
3115
3116         Reviewed by Alex Christensen.
3117
3118         Covered by rebased test.
3119
3120         * Modules/fetch/FetchBody.cpp:
3121         (WebCore::FetchBody::extract): Adding a space to the content-type in case of form data.
3122
3123 2017-01-18  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
3124
3125         [GStreamer] media source tests crashing
3126         https://bugs.webkit.org/show_bug.cgi?id=167158
3127
3128         Reviewed by Carlos Garcia Campos.
3129
3130         This fixes several media source tests which are asserting on debug builds,
3131         such as:
3132
3133         - fast/history/page-cache-removed-source-buffer.html
3134         - imported/w3c/web-platform-tests/media-source/
3135
3136         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3137         (WebCore::AppendPipeline::AppendPipeline): do not adopt the GStPipeline
3138         upon creation. A regular assignment will do the right thing, sinking the
3139         floating ref.
3140
3141 2017-01-18  Antoine Quint  <graouts@apple.com>
3142
3143         [Modern Media Controls] Turn modern media controls on by default
3144         https://bugs.webkit.org/show_bug.cgi?id=165668
3145
3146         Reviewed by Dean Jackson.
3147
3148         Tests: media/modern-media-controls/fullscreen-support/ipad/fullscreen-support-tap.html
3149                media/modern-media-controls/pip-support/ipad/pip-support-enabled.html
3150                media/modern-media-controls/pip-support/ipad/pip-support-tap.html
3151                media/modern-media-controls/placard-support/ipad/placard-support-pip.html
3152                media/modern-media-controls/scrubber-support/ipad/scrubber-support-drag.html
3153
3154         Fix an error which may be triggered prior to Sierra where we would assume the presentation
3155         mode API was avaiable when it might not be, which caused a few tests to fail.
3156
3157         * Modules/modern-media-controls/media/pip-support.js:
3158         (PiPSupport.prototype.syncControl):
3159         (PiPSupport):
3160
3161 2017-01-18  Miguel Gomez  <magomez@igalia.com>
3162
3163         [GTK] [TextureMapper] [GLES2] Draw repeated patterns for NPOT textures manually
3164         https://bugs.webkit.org/show_bug.cgi?id=167118
3165
3166         Reviewed by Žan Doberšek.
3167
3168         When using GLES2 without the GL_OES_texture_npot extension, some implementations fail to properly
3169         draw repeated patters from a texture (using GL_REPEAT). For those cases, perform the repetition
3170         manually using the shader.
3171
3172         Covered by existent tests.
3173
3174         * platform/graphics/texmap/TextureMapperGL.cpp:
3175         (WebCore::driverSupportsNPOTTextures):
3176         (WebCore::TextureMapperGL::drawTexture):
3177         (WebCore::TextureMapperGL::drawTexturedQuadWithProgram):
3178         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
3179         (WebCore::TextureMapperShaderProgram::create):
3180         * platform/graphics/texmap/TextureMapperShaderProgram.h:
3181
3182 2017-01-15  Darin Adler  <darin@apple.com>
3183
3184         Remove PassRefPtr from "loader" directory of WebCore
3185         https://bugs.webkit.org/show_bug.cgi?id=167055
3186
3187         Reviewed by Alex Christensen.
3188
3189         * dom/Document.cpp:
3190         (WebCore::Document::processHttpEquiv): Pass a reference.
3191         * editing/CompositeEditCommand.cpp:
3192         (WebCore::EditCommandComposition::unapply): Ditto.
3193         (WebCore::EditCommandComposition::reapply): Ditto.
3194         (WebCore::CompositeEditCommand::ensureComposition): Return a reference.
3195         (WebCore::CompositeEditCommand::applyCommandToComposite): Use a reference.
3196         * editing/CompositeEditCommand.h: Updated for above changes.
3197
3198         * editing/Editor.cpp:
3199         (WebCore::Editor::unappliedEditing): Take a reference instead of a PassRefPtr.
3200         (WebCore::Editor::reappliedEditing): Ditto.
3201         * editing/Editor.h: Updated for above changes. Also changed the
3202         FragmentAndResources resources vector to hold Ref instead of RefPtr.
3203
3204         * editing/cocoa/EditorCocoa.mm:
3205         (WebCore::Editor::createFragmentAndAddResources): Updated for change to
3206         FragmentAndResources.
3207
3208         * editing/ios/EditorIOS.mm:
3209         (WebCore::Editor::WebContentReader::readWebArchive): Pass a reference.
3210
3211         * editing/mac/EditorMac.mm:
3212         (WebCore::Editor::WebContentReader::readWebArchive): Pass a reference.
3213
3214         * history/PageCache.cpp:
3215         (WebCore::canCacheFrame): Use a reference.
3216
3217         * html/FileInputType.cpp:
3218         (WebCore::FileInputType::handleDOMActivateEvent): Pass references.
3219
3220         * html/HTMLFormControlElement.cpp:
3221         (WebCore::HTMLFormControlElement::formMethod): Use auto.
3222
3223         * html/HTMLFormElement.cpp:
3224         (WebCore::HTMLFormElement::prepareForSubmission): Updated to use a return
3225         values for textFieldValues intsead of an out argument with getTextFieldValues.
3226         (WebCore::HTMLFormElement::textFieldValues): Renamed from getTextFieldValues
3227         and changed to use a return value instead of an out argument.
3228         (WebCore::HTMLFormElement::submit): Pass a reference.
3229         (WebCore::HTMLFormElement::requestAutocomplete): Pass a Ref&&.
3230         * html/HTMLFormElement.h: Updated for above changes.
3231
3232         * html/HTMLHtmlElement.cpp:
3233         (WebCore::HTMLHtmlElement::insertedByParser): Use a reference.
3234
3235         * html/HTMLLinkElement.cpp:
3236         (WebCore::HTMLLinkElement::process): Pass a reference.
3237         (WebCore::HTMLLinkElement::setCSSStyleSheet): Use auto.
3238
3239         * html/HTMLMediaElement.cpp:
3240         (WebCore::HTMLMediaElement::loadResource): Use a reference.
3241
3242         * inspector/InspectorApplicationCacheAgent.cpp:
3243         (WebCore::InspectorApplicationCacheAgent::updateApplicationCacheStatus): Use a reference,
3244         also update for struct-style member names withou m_ prefix.
3245         (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests): Ditto.
3246         (WebCore::InspectorApplicationCacheAgent::getManifestForFrame): Ditto.
3247         (WebCore::InspectorApplicationCacheAgent::getApplicationCacheForFrame): Ditto.
3248         (WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCache): Ditto.
3249         (WebCore::InspectorApplicationCacheAgent::buildArrayForApplicationCacheResources): Ditto.
3250         (WebCore::InspectorApplicationCacheAgent::buildObjectForApplicationCacheResource): Ditto.
3251         * inspector/InspectorApplicationCacheAgent.h: Updated for above changes.
3252
3253         * inspector/InspectorInstrumentation.cpp:
3254         (WebCore::InspectorInstrumentation::updateApplicationCacheStatusImpl): Take a reference.
3255         * inspector/InspectorInstrumentation.h: Updated for the above.
3256
3257         * loader/DocumentLoader.cpp:
3258         (WebCore::DocumentLoader::DocumentLoader): Move much initialization to class definition.
3259         (WebCore::DocumentLoader::originalRequest): Moved to header to make it inline.
3260         (WebCore::DocumentLoader::originalRequestCopy): Ditto.
3261         (WebCore::DocumentLoader::request): Ditto.
3262         (WebCore::DocumentLoader::url): Ditto.
3263         (WebCore::DocumentLoader::stopLoading): Pass a reference.
3264         (WebCore::DocumentLoader::willSendRequest): Updated to take a raw pointer instead of a
3265         PassRefPtr.
3266         (WebCore::DocumentLoader::commitData): Call shouldUseMainResourceEncoding instead of
3267         special casing WebArchive.
3268         (WebCore::DocumentLoader::maybeCreateArchive): Pass references.
3269         (WebCore::DocumentLoader::setArchive): Take Ref&& instead of PassRefPtr.
3270         (WebCore::DocumentLoader::addAllArchiveResources): Take a reference instead
3271         of a pointer.
3272         (WebCore::DocumentLoader::popArchiveForSubframe): Return RefPtr instead of
3273         PassRefPtr.
3274         (WebCore::DocumentLoader::subresource): Ditto.
3275         (WebCore::DocumentLoader::subresources): Return a Vector<Ref> instead of a
3276         Vector<RefPtr>.
3277         (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired): Use move
3278         instead of swap.
3279         (WebCore::DocumentLoader::scheduleArchiveLoad): Use shouldLoadFromArchiveOnly
3280         instead of a special case for each type of archive.
3281         (WebCore::DocumentLoader::originalURL): Moved to header to make it inline.
3282         (WebCore::DocumentLoader::responseURL): Ditto.
3283         (WebCore::DocumentLoader::documentURL): Call shouldUseMainResourceURL instead of
3284         special casing WebArchive.
3285         (WebCore::DocumentLoader::responseMIMEType): Moved to header to make it inline.
3286         (WebCore::DocumentLoader::currentContentType): Ditto.
3287         (WebCore::DocumentLoader::contentFilter): Ditto.
3288         (WebCore::DocumentLoader::getIconLoadDecisionForIconURL): Pass a reference.
3289         (WebCore::DocumentLoader::getIconDataForIconURL): Ditto.
3290         (WebCore::DocumentLoader::dispatchOnloadEvents): Use a reference.
3291         (WebCore::DocumentLoader::unreachableURL): Moved to header to make it inline.
3292         * loader/DocumentLoader.h: Updated for the above.
3293
3294         * loader/EmptyClients.cpp: Updated for changes to client interfaces.
3295         * loader/EmptyClients.h: Ditto.
3296
3297         * loader/FormState.cpp:
3298         (WebCore::FormState::FormState): Take references instead of PassRefPtr, also
3299         take Vector&& instead of Vector& when we want to take ownership and use move
3300         instead of swap to do that.
3301         (WebCore::FormState::create): Ditto.
3302         * loader/FormState.h: Updated for the above. Also changed return values to be
3303         references instead of pointers and members to be Ref instead of RefPtr.
3304
3305         * loader/FormSubmission.cpp:
3306         (WebCore::FormSubmission::Attributes::parseMethodType): Updated for change
3307         to the Method enumeration.
3308         (WebCore::FormSubmission::Attributes::copyFrom): Deleted.
3309         (WebCore::FormSubmission::FormSubmission): Use Ref&& instead of PassRefPtr.
3310         (WebCore::FormSubmission::create): Use reference instead of pointer and
3311         raw pointer instead of PassRefPtr. Also copy attributes using copy constructor
3312         instead of an explicit copyFrom function.
3313         (WebCore::FormSubmission::requestURL): Updated for change to the Method
3314         enumeration.
3315         (WebCore::FormSubmission::populateFrameLoadRequest): Ditto.
3316         * loader/FormSubmission.h: Updated for the above changes. Made the Attributes
3317         class copyable, since we copy it. Changed some functions to return references
3318         instead of pointers and use Ref instead of RefPtr for data members.
3319
3320         * loader/FrameLoader.cpp:
3321         (WebCore::FrameLoader::submitForm): Updated for changes to FormSubmission
3322         and FormState.
3323         (WebCore::FrameLoader::receivedFirstData): Ditto.
3324         (WebCore::FrameLoader::loadFrameRequest): Ditto.
3325         (WebCore::FrameLoader::loadResourceSynchronously): Ditto.
3326         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): Ditto.
3327
3328         * loader/FrameLoaderClient.h: Use references, pointers, RefPtr, and Ref
3329         instead of PassRefPtr. Removed unused empty dispatchDidFailToStartPlugin.
3330
3331         * loader/HistoryController.cpp:
3332         (WebCore::HistoryController::pushState): Take RefPtr&& instead of PassRefPtr.
3333         (WebCore::HistoryController::replaceState): Ditto.
3334         * loader/HistoryController.h: Updated for the above.
3335
3336         * loader/ImageLoader.cpp:
3337         (WebCore::ImageLoader::updateFromElement): Pass a reference.
3338
3339         * loader/NavigationScheduler.cpp: Use refernces and Ref&& instead of
3340         pointers and PassRefPtr.
3341         (WebCore::ScheduledNavigation::ScheduledNavigation): Added an overload
3342         that sests m_shouldOpenExternalURLsPolicy.
3343         * loader/NavigationScheduler.h: Updated for the above.
3344
3345         * loader/ResourceLoader.cpp:
3346         (WebCore::ResourceLoader::start): Use and pass references.
3347         (WebCore::ResourceLoader::willSendRequest): Ditto.
3348         (WebCore::ResourceLoader::didReceiveResponse): Ditto.
3349         (WebCore::ResourceLoader::didFail): Ditto.
3350
3351         * loader/SubframeLoader.cpp:
3352         (WebCore::SubframeLoader::createJavaAppletWidget): Return RefPtr instead
3353         of PassRefPtr. Pass references instead of pointers.
3354         (WebCore::SubframeLoader::loadOrRedirectSubframe): Ditto.
3355         (WebCore::SubframeLoader::loadSubframe): Ditto.
3356         (WebCore::SubframeLoader::document): Deleted. This was never really the
3357         correct idiom for getting the appropriate document; hiding the dependency
3358         on m_frame wasn't paing off.
3359         (WebCore::SubframeLoader::loadPlugin): Pass reference instead of pointer.
3360         (WebCore::SubframeLoader::shouldConvertInvalidURLsToBlank): Eliminated
3361         unneeded null checking and complexity due to going through the document
3362         instead of the frame for this check.
3363         * loader/SubframeLoader.h: Updated for the above.
3364
3365         * loader/appcache/ApplicationCache.cpp:
3366         (WebCore::ApplicationCache::ApplicationCache): Moved data member
3367         initialization to the class definition.
3368         (WebCore::ApplicationCache::~ApplicationCache): Pass a reference instead
3369         of a pointer.
3370         (WebCore::ApplicationCache::isComplete): Ditto.
3371         (WebCore::ApplicationCache::setManifestResource): Take Ref&& instead of
3372         PassRefPtr.
3373         (WebCore::ApplicationCache::addResource): Ditto.
3374         (WebCore::ApplicationCache::removeResource): Deleted. Was unused.
3375         * loader/appcache/ApplicationCache.h: Updated for above changes.
3376
3377         * loader/appcache/ApplicationCacheGroup.cpp:
3378         (WebCore::ApplicationCacheGroup::ApplicationCacheGroup): Moved most
3379         member initialization to the class definition.
3380         (WebCore::ApplicationCacheGroup::~ApplicationCacheGroup): Pass a reference.
3381         (WebCore::ApplicationCacheGroup::cacheForMainRequest): Removed
3382         unnecessary preflight for removeFragmentIdentifier, which efficiently
3383         does nothing if there is no identifier. Use early return.
3384         (WebCore::ApplicationCacheGroup::fallbackCacheForMainRequest): More of
3385         the same.
3386         (WebCore::ApplicationCacheGroup::selectCache): Ditto, also take a reference,
3387         and use event names instead of a special enumeration to poast events.
3388         (WebCore::ApplicationCacheGroup::selectCacheWithoutManifestURL): Ditto.
3389         (WebCore::ApplicationCacheGroup::finishedLoadingMainResource): Ditto.
3390         (WebCore::ApplicationCacheGroup::failedLoadingMainResource): Ditto.
3391         (WebCore::ApplicationCacheGroup::disassociateDocumentLoader): Ditto.
3392         (WebCore::ApplicationCacheGroup::cacheDestroyed): Ditto.
3393         (WebCore::ApplicationCacheGroup::stopLoadingInFrame): Ditto.
3394         (WebCore::ApplicationCacheGroup::setNewestCache): Use Ref&& instead of
3395         PassRefPtr.
3396         (WebCore::ApplicationCacheGroup::makeObsolete): More of the same.
3397         (WebCore::ApplicationCacheGroup::update): Ditto.
3398         (WebCore::ApplicationCacheGroup::abort): Ditto.
3399         (WebCore::ApplicationCacheGroup::didReceiveResponse): Ditto.
3400         (WebCore::ApplicationCacheGroup::didFinishLoading): Ditto.
3401         (WebCore::ApplicationCacheGroup::didFail): Ditto.
3402         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): Ditto.
3403         (WebCore::ApplicationCacheGroup::manifestNotFound): Ditto.
3404         (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete): Ditto.
3405         (WebCore::ApplicationCacheGroup::startLoadingEntry): Ditto.
3406         (WebCore::ApplicationCacheGroup::deliverDelayedMainResources): Use a modern
3407         for loop.
3408         (WebCore::ApplicationCacheGroup::addEntry): Use auto and simplify logic
3409         for adding.
3410         (WebCore::ApplicationCacheGroup::associateDocumentLoaderWithCache): Update since
3411         function result is a reference.
3412         (WebCore::ApplicationCacheGroup::scheduleReachedMaxAppCacheSizeCallback):
3413         Use auto.
3414         (WebCore::ApplicationCacheGroup::postListenerTask): Take event type instead of
3415         taking a special enumeration.
3416         * loader/appcache/ApplicationCacheGroup.h: Updated for the above.
3417
3418         * loader/appcache/ApplicationCacheHost.cpp:
3419         (WebCore::ApplicationCacheHost::ApplicationCacheHost): Move most member
3420         initialization to the class definition.
3421         (WebCore::ApplicationCacheHost::~ApplicationCacheHost): Use reference.
3422         (WebCore::ApplicationCacheHost::selectCacheWithoutManifest): Ditto.
3423         (WebCore::ApplicationCacheHost::selectCacheWithManifest): Ditto.
3424         (WebCore::ApplicationCacheHost::mainResourceDataReceived): Ditto.
3425         (WebCore::ApplicationCacheHost::failedLoadingMainResource): Ditto.
3426         (WebCore::ApplicationCacheHost::finishedLoadingMainResource): Ditto.
3427         (WebCore::ApplicationCacheHost::maybeLoadFallbackForRedirect): Ditto.
3428         (WebCore::ApplicationCacheHost::maybeLoadFallbackForResponse): Ditto.
3429         (WebCore::ApplicationCacheHost::createFileURL): Ditto.
3430         (WebCore::ApplicationCacheHost::maybeLoadSynchronously): Ditto.
3431         (WebCore::ApplicationCacheHost::notifyDOMApplicationCache): Take event
3432         type instead of special enumeration.
3433         (WebCore::ApplicationCacheHost::stopLoadingInFrame): Use reference.
3434         (WebCore::ApplicationCacheHost::stopDeferringEvents): Updated to use
3435         event types instead of special enumeration and also repaired possible
3436         edge case where code in event handler somehow triggers additional events.
3437         (WebCore::ApplicationCacheHost::resourceList): Renamed from fillResourceList
3438         and changed to return a vector instead of populating one.
3439         (WebCore::ApplicationCacheHost::applicationCacheInfo): Tweak coding style a bit.