[CMake] Clean up Web Crypto build targets
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-07-17  Zan Dobersek  <zdobersek@igalia.com>
2
3         [CMake] Clean up Web Crypto build targets
4         https://bugs.webkit.org/show_bug.cgi?id=174253
5
6         Reviewed by Michael Catanzaro.
7
8         Gather the common WebCrypto source files in CMakeLists.txt, including them
9         in the build unconditionally and instead relying on ENABLE_SUBTLE_CRYPTO
10         build guards to exclude the code from compilation if the feature is disabled.
11
12         PlatformGTK.cmake, PlatformMac.cmake and PlatformWPE.cmake can then remove
13         duplicated build targets. PlatformMac.cmake still lists all the Mac-specific
14         Web Crypto build targets.
15
16         PlatformGTK.cmake and PlatformWPE.cmake now include GCrypt.cmake if the build
17         was configured to enable the use of libgcrypt. The new CMake file adds the
18         libgcrypt-specific Web Crypto build targets to the build if the feature was
19         enabled, and also sets up libgcrypt include directiories and libraries.
20
21         No new tests -- no change in behavior.
22
23         * CMakeLists.txt:
24         * PlatformGTK.cmake:
25         * PlatformMac.cmake:
26         * PlatformWPE.cmake:
27         * platform/GCrypt.cmake: Added.
28
29 2017-07-16  Michael Catanzaro  <mcatanzaro@igalia.com>
30
31         -Wreorder warning caused by GraphicsContext3D cleanup
32         https://bugs.webkit.org/show_bug.cgi?id=174511
33
34         Reviewed by Carlos Garcia Campos.
35
36         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
37         (WebCore::GraphicsContext3D::GraphicsContext3D):
38         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
39         (WebCore::GraphicsContext3D::GraphicsContext3D):
40
41 2017-07-16  Antoine Quint  <graouts@apple.com>
42
43         Dismissing the captions panel using the mouse is too eager to remove the captions panel and media controls
44         https://bugs.webkit.org/show_bug.cgi?id=174571
45         <rdar://problem/33294968>
46
47         Reviewed by Eric Carlson.
48
49         We did several things wrong when dismissing the tracks panel:
50
51             - we did not check whether we were hosted in a shadow root when figuring if a click was on the tracks panel
52             - we did not check whether we clicked over the media when dismissing the tracks panel
53             - we did not check whether auto-hide was on before fading the media controls out when we clicked outside
54               the media controls bounds
55
56         We now correctly account for all of those cases and implement the following behavior when clickng as the tracks
57         panel is presented:
58         
59             - dismiss the panel if the click is outside of the panel
60             - dismiss the panel and the media controls if the click is outside the video and the media controls have
61               auto-hide on (ie. media is playing)
62             - dismiss the panel and the media controls after the track selection animation is finished if a track is selected
63
64         Tests: media/modern-media-controls/tracks-panel/tracks-panel-up-click-outside-media-does-not-dimiss-media-controls-when-media-is-paused.html
65                media/modern-media-controls/tracks-panel/tracks-panel-up-click-over-media-does-not-dimiss-media-controls-when-media-is-playing.html
66
67         * Modules/modern-media-controls/controls/media-controls.js:
68         (MediaControls.prototype.hideTracksPanel): Only hide the media controls if we clicked outside of the media
69         controls bounds and if we have auto-hide on when idle (ie. the media is playing).
70         (MediaControls.prototype.isPointInControls): Add an option to specify whether the container should be
71         considered when checking if a point is contained within the media controls bounds.
72         * Modules/modern-media-controls/controls/tracks-panel.js:
73         (TracksPanel.prototype._handleMousedown):
74         (TracksPanel.prototype._isPointInTracksPanel): Correctly check whether the element that we started pressing
75         on is contained within the tracks panel, accounting for the case where we are presented within a shadow root
76         (ie. always when runing inside a Web page).
77
78 2017-07-16  Ali Juma  <ajuma@chromium.org>
79
80         DisallowUserAgentShadowContent moves out of non-UA shadow roots
81         https://bugs.webkit.org/show_bug.cgi?id=165647
82
83         Reviewed by Ryosuke Niwa.
84
85         Make rect-based hit-testing include nodes in non-UA shadow trees when the
86         HitTestRequest has type DisallowUserAgentShadowContent.
87
88         Test: fast/dom/nodesFromRect/nodesFromRect-shadow.html
89
90         * rendering/HitTestResult.cpp:
91         (WebCore::HitTestResult::addNodeToRectBasedTestResult):
92         * testing/Internals.cpp:
93         (WebCore::Internals::nodesFromRect):
94         * testing/Internals.h:
95
96 2017-07-16  Antoine Quint  <graouts@apple.com>
97
98         Clicking edges of media control buttons changes visual state of button (pressed) but doesn't execute action
99         https://bugs.webkit.org/show_bug.cgi?id=174565
100         <rdar://problem/33294833>
101
102         Reviewed by Dean Jackson.
103
104         WebCore doesn't dispatch a "click" event to a parent element when a child that was the original target when
105         the "mousedown" occured is no longer hit-testing at the location where the mouse pointer is at when the "mouseup"
106         occurs (see webkit.org/b/174564). Since button icons, which are a <picture> element that is a child of the
107         <button> element for media controls buttons, shrink to 89% of their size when the ":active" pseudo-class matches,
108         clicking on the edges of the media controls buttons would not trigger the expected action.
109
110         Test: media/modern-media-controls/button/button-click-on-edges.html
111
112         * Modules/modern-media-controls/controls/button.css:
113         (button > picture):
114
115 2017-07-16  Said Abou-Hallawa  <sabouhallawa@apple.com>
116
117         Make the decision for asynchronously decoding an image be in one place
118         https://bugs.webkit.org/show_bug.cgi?id=174479
119
120         Reviewed by Tim Horton.
121
122         Move all the logic of whether a large image should be asynchronously decoded 
123         or not be in one place: RenderBoxModelObject::decodingModeForImageDraw().
124
125         * loader/cache/CachedImage.cpp:
126         (WebCore::CachedImage::addPendingImageDrawingClient): Fixing unrelated 
127         spelling error.
128         * platform/RuntimeApplicationChecks.h:
129         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
130         (WebCore::IOSApplication::isIBooks):
131         (WebCore::IOSApplication::isIBooksStorytime):
132         * platform/graphics/BitmapImage.cpp:
133         (WebCore::BitmapImage::updateFromSettings): Remove reading the setting
134         largeImageAsyncDecodingEnabled from this function because it will be read
135         by RenderBoxModelObject::decodingModeForImageDraw().
136         (WebCore::BitmapImage::dataChanged):
137         (WebCore::BitmapImage::draw):
138         (WebCore::BitmapImage::shouldAnimate):
139         (WebCore::BitmapImage::canAnimate):
140         (WebCore::BitmapImage::canUseAsyncDecodingForLargeImages):
141         (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages):
142         (WebCore::BitmapImage::canDestroyDecodedData):
143         (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages): Deleted.
144         * platform/graphics/BitmapImage.h:
145         * platform/graphics/ImageSource.cpp:
146         (WebCore::ImageSource::canUseAsyncDecoding): It is okay to keep the 
147         decoded frame if canUseAsyncDecodingForLargeImages() is true by the setting
148         largeImageAsyncDecodingEnabled is false.
149         (WebCore::ImageSource::shouldUseAsyncDecoding): Deleted.
150         * platform/graphics/ImageSource.h:
151         * rendering/RenderBoxModelObject.cpp:
152         (WebCore::RenderBoxModelObject::decodingModeForImageDraw): The plan is to
153         add a new Internal settings to force asynchronous image decoding regardless
154         of the image size and the settings.
155         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
156         * rendering/RenderBoxModelObject.h:
157         * rendering/RenderImage.cpp:
158         (WebCore::RenderImage::paintIntoRect):
159
160 2017-07-16  Michael Catanzaro  <mcatanzaro@igalia.com>
161
162         [CMake] Raise minimum CMake requirement
163         https://bugs.webkit.org/show_bug.cgi?id=174545
164
165         Reviewed by Konstantin Tokarev.
166
167         * WebCoreMacros.cmake:
168
169 2017-07-15  Brady Eidson  <beidson@apple.com>
170
171         Make sure all CFHTTPCookieStorageRefs we create are scheduled.
172         <rdar://problem/33221110> and https://bugs.webkit.org/show_bug.cgi?id=174513
173
174         Reviewed by Tim Horton.
175
176         * platform/spi/cf/CFNetworkSPI.h:
177
178 2017-07-15  Myles C. Maxfield  <mmaxfield@apple.com>
179
180         Rename RenderStyle::fontSize() to RenderStyle::computedFontPixelSize()
181         https://bugs.webkit.org/show_bug.cgi?id=174509
182
183         Reviewed by Simon Fraser.
184
185         We have three font size functions:
186         - computedFontSize(): returns a float
187         - specifiedFontSize(): also returns a float
188         - fontSize(): returns the rounded computedFontSize()
189
190         FontDescription uses the convention of labelling rounded values as "pixel",
191         so a better name font fontSize() is computedFontPixelSize().
192
193         Also, because font sizes can never be negative, switch the type from an int
194         to an unsigned.
195
196         No new tests because there is no behavior change.
197
198         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
199         (getAttributeSetForAccessibilityObject):
200         * css/StyleResolver.cpp:
201         (WebCore::StyleResolver::adjustRenderStyle):
202         * platform/graphics/FontDescription.h:
203         (WebCore::FontDescription::computedPixelSize):
204         (WebCore::FontDescription::fontSelectionRequest):
205         * rendering/RenderBlock.cpp:
206         (WebCore::styleForFirstLetter):
207         * rendering/RenderRubyRun.cpp:
208         (WebCore::shouldOverhang):
209         (WebCore::RenderRubyRun::getOverhang):
210         * rendering/RenderRubyText.cpp:
211         (WebCore::RenderRubyText::adjustInlineDirectionLineBounds):
212         * rendering/RenderThemeGtk.cpp:
213         (WebCore::adjustSearchFieldIconStyle):
214         (WebCore::paintSearchFieldIcon):
215         * rendering/RenderThemeIOS.mm:
216         (WebCore::RenderThemeIOS::adjustCheckboxStyle):
217         (WebCore::RenderThemeIOS::adjustRadioStyle):
218         * rendering/RenderThemeMac.mm:
219         (WebCore::RenderThemeMac::controlSizeForFont):
220         (WebCore::RenderThemeMac::controlSizeForSystemFont):
221         (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
222         (WebCore::RenderThemeMac::popupInternalPaddingBox):
223         (WebCore::RenderThemeMac::adjustMenuListButtonStyle):
224         * rendering/RenderThemeWin.cpp:
225         (WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle):
226         (WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle):
227         (WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle):
228         * rendering/TextDecorationPainter.cpp:
229         (WebCore::TextDecorationPainter::paintTextDecoration):
230         * rendering/mathml/RenderMathMLRow.cpp:
231         (WebCore::RenderMathMLRow::computeLineVerticalStretch):
232         * rendering/style/RenderStyle.cpp:
233         (WebCore::RenderStyle::computedFontPixelSize):
234         (WebCore::RenderStyle::computedLineHeight):
235         (WebCore::RenderStyle::fontSize): Deleted.
236         * rendering/style/RenderStyle.h:
237         * style/InlineTextBoxStyle.cpp:
238         (WebCore::visualOverflowForDecorations):
239         * style/StyleTreeResolver.cpp:
240         (WebCore::Style::TreeResolver::resolveElement):
241         * svg/SVGLengthContext.cpp:
242         (WebCore::SVGLengthContext::convertValueFromUserUnitsToEMS):
243         (WebCore::SVGLengthContext::convertValueFromEMSToUserUnits):
244
245 2017-07-15  Myles C. Maxfield  <mmaxfield@apple.com>
246
247         line-height: <number> gets visually applied twice when text autosizing is in effect
248         https://bugs.webkit.org/show_bug.cgi?id=174536
249         <rdar://problem/33338259>
250
251         Reviewed by Simon Fraser.
252
253         StyleBuilderConverter::convertLineHeight() converts line-height: <number> into a
254         "percentage" length. Then, when layout needs to know what the computed value of
255         line-height is, RenderStyle::computedLineHeight() multiplies this percentage by
256         the computed font size.
257
258         With autosizing, the computed font size already incorporates the autosizing
259         multiplier, so we shouldn't also incorporate this multiplier into the percentage
260         value itself. getComputedStyle()'s lineHeightFromStyle() was compensating for
261         this double application by multiplying the percentage by the font-size's specified
262         value instead of its computed value, which is incorrect.
263
264         Test: fast/text-autosizing/line-height-number.html
265
266         * css/CSSComputedStyleDeclaration.cpp:
267         (WebCore::lineHeightFromStyle):
268         * css/StyleBuilderConverter.h:
269         (WebCore::StyleBuilderConverter::convertLineHeight):
270
271 2017-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>
272
273         [iOS WK2] Presenting an action sheet on an image map prevents selection UI from updating
274         https://bugs.webkit.org/show_bug.cgi?id=174539
275         <rdar://problem/33307395>
276
277         Reviewed by Darin Adler.
278
279         Currently, if TextIndicator fails to take a snapshot in TextIndicator::createWithRange, we will enter an
280         inconsistent state in the web process where Editor will continue to ignore selection changes until the next time
281         Editor::setIgnoreSelectionChanges(false) is called. This causes us to indefinitely defer EditorState updates to
282         the UI process, which leads to selection UI appearing unresponsive.
283
284         To fix this, we introduce a new TemporarySelectionChange object to simplify selection changes and/or
285         EditorState-update-ignoring behaviors within the scope of a single function. The constructor applies these
286         temporary changes, and the destructor reverts them as needed to their prior values.
287
288         This patch only adopts TemporarySelectionChange in order to fix this bug, but future patches will replace the
289         remaining places where we temporarily change selection and/or ignore selection with this helper.
290
291         Test: ActionSheetTests.ImageMapDoesNotDestroySelection.
292
293         * editing/Editor.cpp:
294         (WebCore::TemporarySelectionChange::TemporarySelectionChange):
295         (WebCore::TemporarySelectionChange::~TemporarySelectionChange):
296         * editing/Editor.h:
297         * editing/FrameSelection.h:
298         (WebCore::FrameSelection::isUpdateAppearanceEnabled):
299         * page/TextIndicator.cpp:
300         (WebCore::TextIndicator::createWithRange):
301
302 2017-07-15  Myles C. Maxfield  <mmaxfield@apple.com>
303
304         Clean up line-height and minimumFontSize functions
305         https://bugs.webkit.org/show_bug.cgi?id=174535
306
307         Reviewed by Simon Fraser.
308
309         No behavior change.
310
311         No new tests because there is no behavior change.
312
313         * css/StyleBuilderConverter.h:
314         (WebCore::StyleBuilderConverter::convertLineHeight):
315         * css/StyleResolver.cpp:
316         (WebCore::StyleResolver::styleForKeyframe):
317         (WebCore::StyleResolver::adjustRenderStyle):
318         (WebCore::StyleResolver::pseudoStyleRulesForElement):
319         (WebCore::StyleResolver::applyMatchedProperties):
320         (WebCore::StyleResolver::cascadedPropertiesForRollback):
321         (WebCore::StyleResolver::applyProperty):
322         (WebCore::StyleResolver::checkForZoomChange):
323         (WebCore::StyleResolver::createFilterOperations):
324         (WebCore::StyleResolver::CascadedProperties::set):
325         (WebCore::StyleResolver::applyCascadedProperties):
326         * style/StyleFontSizeFunctions.cpp:
327         (WebCore::Style::computedFontSizeFromSpecifiedSize):
328         (WebCore::Style::computedFontSizeFromSpecifiedSizeForSVGInlineText):
329         (): Deleted.
330
331 2017-07-14  Jonathan Bedard  <jbedard@apple.com>
332
333         Add iOS 11 SPI
334         https://bugs.webkit.org/show_bug.cgi?id=174430
335         <rdar://problem/33269288>
336
337         Reviewed by Tim Horton.
338
339         * WebCore.xcodeproj/project.pbxproj: Add sqlite3SPI.h header.
340         * platform/ios/PlatformPasteboardIOS.mm: Move UIKit SPI to UIKitSPI.h.
341         * platform/ios/WebItemProviderPasteboard.mm: Ditto.
342         * platform/network/cf/FormDataStreamCFNet.cpp: Explicitly define fnfErr and remove
343         MacErrors.h header for iOS.
344         * platform/spi/cocoa/IOSurfaceSPI.h: IOSurface is no longer SPI in iOS 11.
345         * platform/spi/cocoa/PassKitSPI.h: Do not re-define setRequiredShippingContactFields
346         and setRequiredBillingContactFields in iOS 11.
347         * platform/spi/cocoa/QuartzCoreSPI.h: Added QuartzCoreSPI used in iOS 11.
348         * platform/spi/ios/UIKitSPI.h: Add drag-and-drop SPI.
349         * platform/spi/ios/sqlite3SPI.h: Define required sqlite3 macros.
350         * platform/sql/SQLiteFileSystem.cpp: Use sqlite3SPI.h.
351
352 2017-07-14  Zan Dobersek  <zdobersek@igalia.com>
353
354         [GCrypt] Implement CryptoKeyRSA PKCS#8 exports
355         https://bugs.webkit.org/show_bug.cgi?id=173697
356
357         Reviewed by Jiewen Tan.
358
359         Implement the PKCS#8 import operation for RSA keys for platforms that use
360         libgcrypt.
361
362         In CryptoKeyRSA::exportPkcs8(), we bail early with an invalid access exception if
363         this export is not being done for a private key. Otherwise, we start with creating
364         the `RSAPrivateKey` ASN.1 structure, writing out '0' under the `version` element
365         and then retrieving the modulus, public and private exponent and both primes.
366         MPI data for those parameters is written out into corresponding elements in the
367         `RSAPrivateKey` structure. We then manually compute values of both exponents and
368         the coefficient parameters, using the private exponent's and both primes' MPI
369         values. The p and q parameters (i.e. the primes) are switched in libgcrypt,
370         deviating from the standard practice, so we have to operate with those two
371         accordingly. We eliminate the optional `otherPrimeInfos` attribute on the
372         `RSAPrivateKey` structure. Support for this attribute will be added later.
373
374         We then create the `PrivateKeyInfo` ASN.1 structure, and write out '0' under the
375         `version` element. The id-rsaEncryption object identifier is written out under
376         the `algorithm.algorithm` element. In the future, an object identifier that
377         matches this key's algorithm will have to be written out here (id-RSASSA-PSS or
378         id-RSAES-OAEP), along with the appropriate parameters structure, but no test in
379         WebKit or the web-platform-tests suite covers this detail. For now, a null value
380         is written out under the `algorithm.parameters` element.
381
382         Data for the `RSAPrivateKey` structure is retrieved and written out under the
383         `privateKey` element.  The optional `attributes` element on the `PrivateKeyInfo`
384         structure is eliminated.
385
386         Data that was encoded through the `PrivateKeyInfo` structure is then retrieved
387         and returned from the exportPkcs8() method.
388
389         No new tests -- related tests are now passing and are unskipped.
390
391         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
392         (WebCore::CryptoKeyRSA::exportPkcs8):
393
394 2017-07-14  Zan Dobersek  <zdobersek@igalia.com>
395
396         [GCrypt] Implement CryptoKeyRSA PKCS#8 imports
397         https://bugs.webkit.org/show_bug.cgi?id=173696
398
399         Reviewed by Jiewen Tan.
400
401         Implement the PKCS#8 import operation for RSA keys for platforms that use
402         libgcrypt.
403
404         In CryptoKeyRSA::importPkcs8(), the provided key data is decoded against the
405         'PrivateKeyInfo` ASN.1 structure. We then validate the `version` element and
406         check that the `privateKeyAlgorithm.algorithm` element contains a supported
407         object identifier. This check is for now mostly superficial, only ensuring
408         that the object identifier is either id-rsaEncryption, id-RSAES-OAEP or
409         id-RSASSA-PSS. This has to be further extended to also check the
410         id-sha{1,256,384,512}WithRSAEncryption identifiers as well as decoding the
411         `privateKeyAlgorithm.parameters` element against a specific ASN.1 structure, if
412         necessary (RSASSA-PSS-params or RSAES-OAEP-params), and cross-checking the
413         specified digest algorithm with the algorithm that's specified through the main
414         object identifier or the structure contained in `privateKeyAlgorithm.parameters`.
415         This is avoided for now because no test in WebKit or the web-platform-tests
416         suite covers this detail of the specification.
417
418         Data under the `privateKey` element is decoded against the `RSAPrivateKey` ASN.1
419         structure, and the `version` element of that structure is validated. We then
420         retrieve data from that structure for the modulus, public exponent, private
421         exponent, both primes, both exponents and the coefficient parameters, bailing if
422         any of them is missing. Because libgcrypt switches the use of p and q parameters,
423         deviating from the standard use, we have to recompute the u parameter (the
424         coefficient). With that calculated, we're then able to construct the `private-key`
425         s-expression, embedding into it all the necessary parameters, and transferring
426         the ownership of this object to the new CryptoKeyRSA object that's then returned
427         from the importPkcs8() method.
428
429         No new tests -- related tests are now passing and are unskipped.
430
431         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
432         (WebCore::CryptoKeyRSA::importPkcs8):
433
434 2017-07-14  Chris Dumez  <cdumez@apple.com>
435
436         Possible crash in ~UserGestureIndicator() when on non-main thread
437         https://bugs.webkit.org/show_bug.cgi?id=174522
438         <rdar://problem/30283071>
439
440         Reviewed by Sam Weinig.
441
442         UserGestureIndicator objects may be constructed / destructed in worker thread
443         (e.g. in DOMTimer::fired()). The UserGestureIndicator constructor / destructor
444         are supposed to be no-op on non-main threads so that it is safe. However,
445         we were mistakenly initializing m_previousToken data member in the constructor
446         on background thread, which meant that we could crash later on in the
447         UserGestureIndicator destructor when destroying m_previousToken.
448
449         Test: fast/workers/worker-user-gesture.html
450
451         * dom/UserGestureIndicator.cpp:
452         (WebCore::currentToken):
453         (WebCore::UserGestureIndicator::UserGestureIndicator):
454
455 2017-07-14  Matt Lewis  <jlewis3@apple.com>
456
457         Unreviewed, rolling out r219516.
458
459         This caused an API failure on macOS.
460
461         Reverted changeset:
462
463         "Make sure all CFHTTPCookieStorageRefs we create are
464         scheduled."
465         https://bugs.webkit.org/show_bug.cgi?id=174513
466         http://trac.webkit.org/changeset/219516
467
468 2017-07-14  Jer Noble  <jer.noble@apple.com>
469
470         Allow clients to override their own hardware media requirements where no fallback media exists.
471         https://bugs.webkit.org/show_bug.cgi?id=174426
472         <rdar://problem/32537704>
473
474         Reviewed by Eric Carlson.
475
476         Add a new setting which allows clients to specify their own mediaContentTypesRequiringHardwareSupport should be
477         ignared in the case where no fallback exists, such as the case of a single <source> element, or setting the src
478         attribute directly.
479
480         * html/HTMLMediaElement.cpp:
481         (WebCore::HTMLMediaElement::havePotentialSourceChild):
482         (WebCore::HTMLMediaElement::selectNextSourceChild):
483         (WebCore::HTMLMediaElement::sourceWasAdded):
484         (WebCore::HTMLMediaElement::sourceWasRemoved):
485         (WebCore::HTMLMediaElement::mediaPlayerShouldCheckHardwareSupport):
486         * html/HTMLMediaElement.h:
487         * page/Settings.h:
488         * platform/graphics/MediaPlayer.cpp:
489         (WebCore::MediaPlayer::shouldCheckHardwareSupport):
490         * platform/graphics/MediaPlayer.h:
491         (WebCore::MediaPlayerClient::mediaPlayerShouldCheckHardwareSupport):
492         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
493         (WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus):
494         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
495         (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
496
497 2017-07-14  Chris Dumez  <cdumez@apple.com>
498
499         Possible crash under NetworkSocketStream::didFailSocketStream()
500         https://bugs.webkit.org/show_bug.cgi?id=174526
501         <rdar://problem/32831441>
502
503         Reviewed by Brent Fulgham.
504
505         Call m_client.didFailSocketStream() asynchronously in the constructor as our
506         caller (the client) is also being initialized at this point.
507
508         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
509         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
510
511 2017-07-14  Youenn Fablet  <youenn@apple.com>
512
513         WebRTC: silence data not sent for disabled audio track
514         https://bugs.webkit.org/show_bug.cgi?id=174456
515         <rdar://problem/33284623>
516
517         Reviewed by Eric Carlson.
518
519         Test: webrtc/audio-muted-stats.html
520               webrtc/audio-muted-stats2.html
521
522         Adding a timer-based approach to send 10ms of silence every second.
523         This is consistent with how muted video tracks are implemented.
524         In case the audio track is muted at the time it is added, no silence data is sent.
525
526         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
527         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
528         (WebCore::RealtimeOutgoingAudioSource::initializeConverter):
529         (WebCore::RealtimeOutgoingAudioSource::stop):
530         (WebCore::RealtimeOutgoingAudioSource::sourceMutedChanged):
531         (WebCore::RealtimeOutgoingAudioSource::sourceEnabledChanged):
532         (WebCore::RealtimeOutgoingAudioSource::handleMutedIfNeeded):
533         (WebCore::RealtimeOutgoingAudioSource::sendSilence):
534         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
535
536 2017-07-14  Michael Catanzaro  <mcatanzaro@igalia.com>
537
538         [CMake] Unclear distinction between WebKitHelpers and WebKitMacros
539         https://bugs.webkit.org/show_bug.cgi?id=153189
540
541         Reviewed by Antonio Gomes.
542
543         * CMakeLists.txt: Include WebCoreMacros.cmake.
544         * WebCoreMacros.cmake: Added.
545
546 2017-07-14  Jeremy Jones  <jeremyj@apple.com>
547
548         Fix style for name of class alloc function in WebVideoFullscreenInterfaceAVKit.
549         https://bugs.webkit.org/show_bug.cgi?id=174476
550
551         Reviewed by Alex Christensen.
552
553         No new tests because no behavior change.
554
555         This is a rename for per style requirements.
556
557         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
558         (allocWebAVPictureInPicturePlayerLayerViewInstance):
559         (WebAVPlayerLayerView_pictureInPicturePlayerLayerView):
560         (allocWebAVPlayerLayerViewInstance):
561         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
562         (getWebAVPictureInPicturePlayerLayerViewClass): Deleted.
563         (getWebAVPlayerLayerViewClass): Deleted.
564
565 2017-07-14  Jer Noble  <jer.noble@apple.com>
566
567         [MSE] Removing samples when presentation order does not match decode order can cause bad behavior.
568         https://bugs.webkit.org/show_bug.cgi?id=174514
569
570         Reviewed by Sam Weinig.
571
572         Test: media/media-source/media-source-remove-decodeorder-crash.html
573
574         Fix the algorithm in removeCodedFrames() so that it's not possible to have a removePresentationStart >
575         removePresentationEnd (and also removeDecodeStart > removeDecodeEnd).
576
577         * Modules/mediasource/SampleMap.cpp:
578         (WebCore::PresentationOrderSampleMap::findSampleContainingOrAfterPresentationTime):
579         (WebCore::PresentationOrderSampleMap::findSampleStartingAfterPresentationTime):
580         * Modules/mediasource/SampleMap.h:
581         * Modules/mediasource/SourceBuffer.cpp:
582         (WebCore::SourceBuffer::removeCodedFrames):
583
584 2017-07-14  Youenn Fablet  <youenn@apple.com>
585
586         Increase CoreAudio render audio buffer sizes for WebRTC
587         https://bugs.webkit.org/show_bug.cgi?id=174508
588
589         Reviewed by Eric Carlson.
590
591         Covered by manually testing audio rendering through WebRTC sites.
592
593         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
594         (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit): Setting audio buffer size equivalent to 20 ms.
595
596 2017-07-14  Brady Eidson  <beidson@apple.com>
597
598         Make sure all CFHTTPCookieStorageRefs we create are scheduled.
599         <rdar://problem/33221110> and https://bugs.webkit.org/show_bug.cgi?id=174513
600
601         Reviewed by Tim Horton.
602
603         * platform/spi/cf/CFNetworkSPI.h:
604
605 2017-07-14  Youenn Fablet  <youenn@apple.com>
606
607         Remove CoreAudioCaptureSource speaker configuration
608         https://bugs.webkit.org/show_bug.cgi?id=174512
609
610         Reviewed by Eric Carlson.
611
612         Covered by manually testing audio rendering through WebRTC sites.
613
614         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
615         (WebCore::CoreAudioSharedUnit::setupAudioUnit):
616
617 2017-07-14  Eric Carlson  <eric.carlson@apple.com>
618
619         [MediaStream] Limit the number of remote video samples queued
620         https://bugs.webkit.org/show_bug.cgi?id=174505
621         <rdar://problem/33223015>
622
623         Reviewed by Youenn Fablet.
624
625         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
626         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::removeOldSamplesFromPendingQueue): Only
627         enqueue a fixed number of frames with invalid or negative decode times.
628
629 2017-07-14  Youenn Fablet  <youenn@apple.com>
630
631         Report CoreAudioCaptureSource failure in case shared unit stops working properly
632         https://bugs.webkit.org/show_bug.cgi?id=174494
633
634         Reviewed by Eric Carlson.
635
636         Manual test by interrupting an audio capture on Mac.
637
638         This patch adds a timer to CoreAudioSharedUnit.
639         In case the capture callback is not called after one second, the shared unit is said to fail.
640         Each source is notified that capture is failing.
641         This will in turn trigger onend track event so that web pages can remedy capture failure.
642
643         Timer starts with 10 seconds for audio data to start being captured.
644         It is then decreased to 2 seconds.
645
646         * platform/mediastream/RealtimeMediaSource.cpp:
647         (WebCore::RealtimeMediaSource::captureFailed):
648         * platform/mediastream/RealtimeMediaSource.h:
649         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
650         (WebCore::CoreAudioSharedUnit::CoreAudioSharedUnit):
651         (WebCore::CoreAudioSharedUnit::processMicrophoneSamples):
652         (WebCore::CoreAudioSharedUnit::startInternal):
653         (WebCore::CoreAudioSharedUnit::verifyIsCapturing):
654         (WebCore::CoreAudioSharedUnit::stopInternal):
655
656 2017-07-14  Jer Noble  <jer.noble@apple.com>
657
658         Adding the 'autoplay' attribute to a media element during a user gesture should remove user gesture restrictions.
659         https://bugs.webkit.org/show_bug.cgi?id=174373
660
661         Reviewed by Eric Carlson.
662
663         Test: media/video-add-autoplay-user-gesture.html
664
665         * html/HTMLMediaElement.cpp:
666         (WebCore::HTMLMediaElement::parseAttribute):
667
668 2017-07-14  Matt Lewis  <jlewis3@apple.com>
669
670         Unreviewed, rolling out r219500.
671
672         The test is consistently failing on iOS simulator.
673
674         Reverted changeset:
675
676         "AX: VoiceOver silent or skipping over time values on media
677         player."
678         https://bugs.webkit.org/show_bug.cgi?id=174324
679         http://trac.webkit.org/changeset/219500
680
681 2017-07-14  Fujii Hironori  <Hironori.Fujii@sony.com>
682
683         [WinCairo] error 'm_compositorTexture': undeclared identifier since Bug 174345
684         https://bugs.webkit.org/show_bug.cgi?id=174493
685
686         Reviewed by Alex Christensen.
687
688         Compilation errors are reported by the code using a member
689         m_compositorTexture of GraphicsContext3D which exists only if
690         USE(COORDINATED_GRAPHICS_THREADED). WinCairo port doesn't use it.
691
692         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
693         (WebCore::GraphicsContext3D::GraphicsContext3D):
694         Use m_compositorTexture only if USE(COORDINATED_GRAPHICS_THREADED).
695         (WebCore::GraphicsContext3D::~GraphicsContext3D): Ditto.
696         * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp:
697         (WebCore::GraphicsContext3D::reshapeFBOs):
698         Ditto. Fix the wrong indentation level.
699
700 2017-07-14  Fujii Hironori  <Hironori.Fujii@sony.com>
701
702         [HarfBuzz] Decomposed Vietnamese characters are rendered incorrectly
703         https://bugs.webkit.org/show_bug.cgi?id=174418
704
705         Reviewed by Michael Catanzaro.
706
707         HarfBuzzShaper should normalize the input text before collecting
708         HarfBuzzRuns. Actually, HarfBuzzShaper::setNormalizedBuffer does
709         the task. But, this function hasn't been called from anywhere
710         since Bug 108077.
711
712         Test: fast/text/international/vietnamese-nfd.html
713
714         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
715         (WebCore::HarfBuzzShaper::HarfBuzzShaper):
716         Call setNormalizedBuffer instead of normalizeCharacters.
717         (WebCore::normalizeCharacters): Deleted.
718
719 2017-07-14  Fujii Hironori  <Hironori.Fujii@sony.com>
720
721         [WinCairo] Build broken "Cannot open include file: 'GL/glext.h'" since Bug 172104
722         https://bugs.webkit.org/show_bug.cgi?id=174492
723
724         Reviewed by Žan Doberšek.
725
726         WinCairo port uses GLES. OpenGLShims.h shouldn't be included.
727
728         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
729         Include "OpenGLShims.h" only if !USE(OPENGL_ES_2) instead of USE(OPENGL).
730
731 2017-07-14  Chris Dumez  <cdumez@apple.com>
732
733         PageCache::removeAllItemsForPage(Page&) may reenter itself and cause crashes
734         https://bugs.webkit.org/show_bug.cgi?id=174473
735         <rdar://problem/32177485>
736
737         Reviewed by Antti Koivisto.
738
739         This could happen when a Page containing an SVGImage is removed from PageCache and
740         this resulted in the destruction of the SVGImage. Because the SVGImage has an internal
741         utility Page, it will also call PageCache::removeAllItemsForPage(WebCore::Page&) upon
742         destruction, causing us to reenter.
743
744         Address the issue by not calling PageCache::removeAllItemsForPage() for utility pages
745         since those cannot be in PageCache in the first place.
746
747         Also add assertions to make sure:
748         1. We never insert a utility page into PageCache
749         2. PageCache::removeAllItemsForPage() does not reenter
750
751         No new tests, because I was unable to write a test which reproduced the crash. This
752         is in theory testable using an API test which enables PageCache, loads a page
753         containing an SVGImage, navigates away from this page so that it goes into PageCache,
754         and then calls [WebView _close]. However, when I tried writing such test, I could
755         not get the SVGImage to get destroyed while PageCache::removeAllItemsForPage() is
756         called for the top-level page for some reason. Something seems to be keeping the
757         SVGImage alive longer. I tried disabling the MemoryCache but it did not help.
758
759         * history/PageCache.cpp:
760         (WebCore::PageCache::addIfCacheable):
761         (WebCore::PageCache::removeAllItemsForPage):
762         * history/PageCache.h:
763         * page/Page.cpp:
764         (WebCore::Page::~Page):
765
766 2017-07-14  Aaron Chu  <aaron_chu@apple.com>
767
768         AX: VoiceOver silent or skipping over time values on media player.
769         https://bugs.webkit.org/show_bug.cgi?id=174324
770         <rdar://problem/32021784>
771
772         Reviewed by Antoine Quint.
773
774         Added role attribute to modern media controls time lable class so that VoiceOver can access the time label when the media is playing.
775
776         Updated: media/modern-media-controls/time-label/time-label.html
777
778         * Modules/modern-media-controls/controls/time-label.js:
779
780 2017-07-13  Michael Catanzaro  <mcatanzaro@igalia.com>
781
782         Fix compiler warnings when building with GCC 7
783         https://bugs.webkit.org/show_bug.cgi?id=174463
784
785         Reviewed by Darin Adler.
786
787         * testing/InternalSettings.cpp:
788         (WebCore::InternalSettings::setShouldManageAudioSessionCategory):
789
790 2017-07-13  Michael Catanzaro  <mcatanzaro@igalia.com>
791
792         Incorrect call to StyledElement::setInlineStyleProperty in ImageDocument::createDocumentStructure
793         https://bugs.webkit.org/show_bug.cgi?id=174470
794
795         Reviewed by Darin Adler.
796
797         * html/ImageDocument.cpp:
798         (WebCore::ImageDocument::createDocumentStructure):
799
800 2017-07-13  Dean Jackson  <dino@apple.com>
801
802         Fix iOS build.
803
804         * platform/graphics/GraphicsContext3D.h:
805
806 2017-07-12  Dean Jackson  <dino@apple.com>
807
808         Rename GraphicsContext[3D]Mac to Cocoa and move things into graphics/cocoa
809         https://bugs.webkit.org/show_bug.cgi?id=174453
810         <rdar://problem/33281481>
811
812         Reviewed by Simon Fraser.
813
814         Two renames, two moves:
815         graphics/mac/GraphicsContext3DMac.mm -> graphics/cocoa/GraphicsContext3DCocoa.mm
816         graphics/mac/GraphicsContext.mm -> graphics/cocoa/GraphicsContextCocoa.mm
817         graphics/mac/WebGLLayer.h -> graphics/cocoa/WebGLLayer.h
818         graphics/mac/WebGLLayer.mm -> graphics/cocoa/WebGLLayer.mm
819
820         * PlatformMac.cmake:
821         * WebCore.xcodeproj/project.pbxproj:
822         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm: Renamed from Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm.
823         * platform/graphics/cocoa/GraphicsContextCocoa.mm: Renamed from Source/WebCore/platform/graphics/mac/GraphicsContextMac.mm.
824         * platform/graphics/cocoa/WebGLLayer.h: Renamed from Source/WebCore/platform/graphics/mac/WebGLLayer.h.
825         * platform/graphics/cocoa/WebGLLayer.mm: Renamed from Source/WebCore/platform/graphics/mac/WebGLLayer.mm.
826
827 2017-07-12  Dean Jackson  <dino@apple.com>
828
829         Clean-up some things in GraphicsContext3D
830         https://bugs.webkit.org/show_bug.cgi?id=174452
831         <rdar://problem/33281257>
832
833         Reviewed by Simon Fraser.
834
835         General clean-up in GC3D.
836
837         Covered by existing tests.
838
839         * platform/graphics/GraphicsContext3D.h: Use initial values where possible.
840         (WebCore::GraphicsContext3D::GraphicsContext3DState::GraphicsContext3DState): Deleted.
841         * platform/graphics/mac/GraphicsContext3DMac.mm:
842         (WebCore::GraphicsContext3D::GraphicsContext3D): Nearly everything can come from the
843         initial values now.
844         (WebCore::GraphicsContext3D::~GraphicsContext3D): Remove code that won't be enabled
845         on this platform.
846         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
847         (WebCore::GraphicsContext3D::paintRenderingResultsToCanvas): While unlikely to happen,
848         and possibly harmless in this case, add some checked arithmetic to make sure we don't overflow
849         when working out how big a buffer to create.
850         (WebCore::GraphicsContext3D::paintRenderingResultsToImageData): Ditto.
851         (WebCore::GraphicsContext3D::reshape): Do nothing if we are ever given negative
852         width or height. Again unlikely.
853
854 2017-07-13  Dean Jackson  <dino@apple.com>
855
856         Avoid unnecessary copy of framebuffer into WebGL Layer
857         https://bugs.webkit.org/show_bug.cgi?id=174345
858         <rdar://problem/33228950>
859
860         Reviewed by Sam Weinig.
861
862         On macOS, we're unnecessarily copying the framebuffer into another
863         texture before pushing it into the compositing layer. Instead we
864         should simply render the FBO into the CALayer we use to draw on
865         the screen.
866
867         Covered by the existing WebGL tests.
868
869         * platform/graphics/GraphicsContext3D.h:
870         (WebCore::GraphicsContext3D::platformTexture): Return the FBO texture instead.
871         * platform/graphics/mac/GraphicsContext3DMac.mm:
872         (WebCore::GraphicsContext3D::GraphicsContext3D): No need to have a compositing
873         texture.
874         (WebCore::GraphicsContext3D::~GraphicsContext3D):
875         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
876         (WebCore::GraphicsContext3D::reshapeFBOs):
877         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
878         (WebCore::GraphicsContext3D::prepareTexture): Don't copy the pixels from
879         the FBO into the compositing texture
880
881 2017-07-13  Mark Lam  <mark.lam@apple.com>
882
883         Implementors of memoryCost() need to be thread-safe.
884         https://bugs.webkit.org/show_bug.cgi?id=172738
885         <rdar://problem/32474881>
886
887         Reviewed by Keith Miller.
888
889         No new tests. This patch fixes a race condition bug that can result in random
890         crashes (and other unpredictable behavior), and is very difficult to test for.
891
892         * Modules/webaudio/AudioBuffer.cpp:
893         (WebCore::AudioBuffer::releaseMemory):
894         (WebCore::AudioBuffer::memoryCost):
895         * Modules/webaudio/AudioBuffer.h:
896         * dom/ChildNodeList.h:
897         * dom/CollectionIndexCache.h:
898         (WebCore::CollectionIndexCache::memoryCost):
899         * dom/LiveNodeList.h:
900         * html/CachedHTMLCollection.h:
901         * html/HTMLCanvasElement.cpp:
902         (WebCore::HTMLCanvasElement::memoryCost):
903         (WebCore::HTMLCanvasElement::externalMemoryCost):
904         (WebCore::HTMLCanvasElement::setImageBuffer):
905         * html/HTMLCanvasElement.h:
906         * html/HTMLCollection.cpp:
907         (WebCore::HTMLCollection::invalidateNamedElementCache):
908         * html/HTMLCollection.h:
909         (WebCore::CollectionNamedElementCache::memoryCost):
910         (WebCore::HTMLCollection::memoryCost):
911         (WebCore::HTMLCollection::setNamedItemCache):
912         * platform/graphics/ImageBuffer.cpp:
913         (WebCore::ImageBuffer::memoryCost):
914         * platform/graphics/cg/ImageBufferCG.cpp:
915         (WebCore::ImageBuffer::memoryCost):
916         (WebCore::ImageBuffer::externalMemoryCost):
917
918 2017-07-13  Jeremy Jones  <jeremyj@apple.com>
919
920         Fix style. Use #pragma once in VideoFullscreen and PlaybackSession headers.
921         https://bugs.webkit.org/show_bug.cgi?id=174448
922
923         Reviewed by Eric Carlson.
924
925         No behavior change.
926
927         * platform/cocoa/WebPlaybackSessionInterface.h:
928         * platform/cocoa/WebVideoFullscreenChangeObserver.h:
929         * platform/cocoa/WebVideoFullscreenModel.h:
930         * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
931         * platform/ios/WebPlaybackSessionInterfaceAVKit.h:
932         * platform/ios/WebVideoFullscreenControllerAVKit.h:
933         * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
934         * platform/mac/WebVideoFullscreenInterfaceMac.h:
935
936 2017-07-13  Alex Christensen  <achristensen@webkit.org>
937
938         Deleting last URLSearchParams key should remove trailing ? in associated URL
939         https://bugs.webkit.org/show_bug.cgi?id=174465
940
941         Reviewed by Chris Dumez.
942
943         This makes us match the behavior of Chrome and Firefox, and the spec after https://github.com/whatwg/url/issues/332 is approved.
944         This will be covered by an upcoming web platform test, and I updated fast/dom/DOMURL/searchparams.html to cover it now.
945
946         * platform/URLParser.cpp:
947         (WebCore::URLParser::serialize):
948         If there are no tuples, serialize to the null string instead of a non-null empty string.
949         This makes it so URL::setQuery removes the ?
950
951 2017-07-13  Jeremy Jones  <jeremyj@apple.com>
952
953         Style fix. Replace strongThis with protectedThis.
954         https://bugs.webkit.org/show_bug.cgi?id=174444
955
956         Reviewed by Eric Carlson.
957
958         Rename, no behavior change.
959
960         * Modules/webaudio/AudioScheduledSourceNode.cpp:
961         (WebCore::AudioScheduledSourceNode::finish):
962         * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
963         (WebCore::WebCoreDecompressionSession::maybeBecomeReadyForMoreMediaData):
964         (WebCore::WebCoreDecompressionSession::enqueueSample):
965         (WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
966         (WebCore::WebCoreDecompressionSession::enqueueDecodedSample):
967         (WebCore::WebCoreDecompressionSession::requestMediaDataWhenReady):
968         (WebCore::WebCoreDecompressionSession::flush):
969
970 2017-07-13  Jeremy Jones  <jeremyj@apple.com>
971
972         Fix block style in WebVideoFullscreen classes.
973         https://bugs.webkit.org/show_bug.cgi?id=174446
974
975         Reviewed by Eric Carlson.
976
977         No behavior change.
978
979         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
980         (WebVideoFullscreenControllerContext::setVideoLayerFrame):
981         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
982         (-[WebAVPlayerLayer layoutSublayers]):
983         (getWebAVPictureInPicturePlayerLayerViewClass):
984         (getWebAVPlayerLayerViewClass):
985
986 2017-07-13  Joseph Pecoraro  <pecoraro@apple.com>
987
988         Web Inspector: Remove unused and untested Page domain commands
989         https://bugs.webkit.org/show_bug.cgi?id=174429
990
991         Reviewed by Timothy Hatcher.
992
993         * inspector/InspectorPageAgent.cpp:
994         (WebCore::InspectorPageAgent::disable):
995         (WebCore::InspectorPageAgent::didClearWindowObjectInWorld):
996         (WebCore::InspectorPageAgent::addScriptToEvaluateOnLoad): Deleted.
997         (WebCore::InspectorPageAgent::removeScriptToEvaluateOnLoad): Deleted.
998         * inspector/InspectorPageAgent.h:
999
1000 2017-07-13  Zan Dobersek  <zdobersek@igalia.com>
1001
1002         [GCrypt] Implement CryptoKeyRSA SPKI exports
1003         https://bugs.webkit.org/show_bug.cgi?id=173695
1004
1005         Reviewed by Jiewen Tan.
1006
1007         Implement the SPKI export operation for RSA keys for platforms that use
1008         libgcrypt.
1009
1010         In CryptoKeyRSA::exportSpki(), we bail early with an invalid access exception if
1011         this export is not being done for a public key. Otherwise, we start with creating
1012         the `RSAPublicKey` ASN.1 structure, filling in the modulus and public exponent
1013         data that's retrieved from the `public-key` s-expression in the signed MPI format.
1014
1015         We then create the `SubjectPublicKeyInfo` ASN.1 structure and fill it out with
1016         the necessary data. The id-rsaEncryption object identifier is written out under
1017         the `algorithm.algorithm` element, and a null value is written out under the
1018         `algorithm.parameters` element. This doesn't follow the specification at the
1019         moment, since id-RSASSA-PSS would have to be written for the RSA-PSS algorithm,
1020         and id-RSAES-OAEP for the RSA-OAEP algorithm, along with specific parameter
1021         structures. But no test in WebKit or the web-platform-tests suite covers this,
1022         so this deviation should be addressed later.
1023
1024         Data of the previously-constructed `RSAPublicKey` structure is retrieved and
1025         written out under the `subjectPublicKey` element, before finally retrieving
1026         data of the `SubjectPublicKeyInfo` structure and returning that to the caller.
1027
1028         A helper mpiSignedData() function is added, providing overloads for gcry_mpi_t
1029         and gcry_sexp_t parameters. MPI data for that parameter is retrieved and the
1030         first byte of that data is tested, inserting an additional 0x00 byte at the
1031         beginning of the Vector if that first byte has the first bit set, avoiding this
1032         data accidentally being interpreted as a signed integer.
1033
1034         No new tests -- related tests are now passing and are unskipped.
1035
1036         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
1037         (WebCore::CryptoKeyRSA::exportSpki):
1038         * crypto/gcrypt/GCryptUtilities.h:
1039         (WebCore::mpiSignedData):
1040
1041 2017-07-13  Zan Dobersek  <zdobersek@igalia.com>
1042
1043         [GCrypt] Implement CryptoKeyRSA SPKI imports
1044         https://bugs.webkit.org/show_bug.cgi?id=173694
1045
1046         Reviewed by Jiewen Tan.
1047
1048         Implement the SPKI import operation for RSA keys for platforms that use
1049         libgcrypt.
1050
1051         The passed-in key data is decoded against the `SubjectPublicKeyInfo` ASN.1
1052         structure. We then validate the `algorithm.algorithm` element, ensuring that
1053         the value under that represents a supported object identifier. This check is
1054         for now mostly superficial, only ensuring that the object identifier is either
1055         id-rsaEncryption, id-RSAES-OAEP or id-RSASSA-PSS. This has to be further extended
1056         to also check the id-sha{1,256,384,512}WithRSAEncryption identifiers as well as
1057         decoding the `algorithm.parameters` element against a specific ASN.1 structure,
1058         if necessary (RSASSA-PSS-params or RSAES-OAEP-params), and cross-checking the
1059         specified digest algorithm with the algorithm that's specified through the main
1060         object identifier or the structure contained in `algorithm.parameters`. This is
1061         avoided for now because no test in WebKit or the web-platform-tests suite covers
1062         this detail of the specification.
1063
1064         After the algorithm is identified as supported, we proceed with decoding the
1065         `subjectPublicKey` data against the `RSAPublicKey` ASN.1 structure. From there,
1066         we retrieve the `modulus` and `publicExponent` data from which we can construct
1067         an RSA `public-key` s-expression that can be used through libgcrypt. A new
1068         CryptoKeyRSA object is then created, taking over ownership of the `public-key`
1069         s-expression, and returned.
1070
1071         No new tests -- related tests are now passing and are unskipped.
1072
1073         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
1074         (WebCore::supportedAlgorithmIdentifier):
1075         (WebCore::CryptoKeyRSA::importSpki):
1076
1077 2017-07-12  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1078
1079         REGRESSION(r219332): [GTK] 9 new failures on fast/forms spinbutton related tests
1080         https://bugs.webkit.org/show_bug.cgi?id=174395
1081
1082         Reviewed by Carlos Garcia Campos.
1083
1084         Covered by existing tests.
1085
1086         Before r219332 the height of the spin button widget was
1087         calculated as the maximum value between the individual button
1088         ( the [+] or [-] ) width (33 pixels) and height (16 pixels).
1089         And r219332 caused the height of the widget to be calculated as
1090         the height of the button (16 pixels), which was incorrect as
1091         each button should be first expanded vertically to fit the
1092         preferred size of the widget.
1093
1094         Fix this by making the calculations about the spin button widget
1095         on a new function spinButtonSize() that takes this into account,
1096         and use this values both for adjusting the style of the input
1097         field and the spin button widget itself.
1098
1099         * rendering/RenderThemeGtk.cpp:
1100         (WebCore::spinButtonSize):
1101         (WebCore::RenderThemeGtk::adjustTextFieldStyle):
1102         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
1103
1104 2017-07-13  Miguel Gomez  <magomez@igalia.com>
1105
1106         [GTK][WPE] border-radius with non visible border doesn't work on images that have their own RenderLayer
1107         https://bugs.webkit.org/show_bug.cgi?id=174157
1108
1109         Reviewed by Carlos Garcia Campos.
1110
1111         Do not allow direct compositing of images when they have a border-radius property on WebKitGTK+ and WPE.
1112         These platforms don't support clipping using rounded rectangles during composition, which is required
1113         when using border-radius and the border is not visible. Due to this, they need to perform the clippping
1114         with cairo.
1115
1116         This is a temporal fix, until appropriate clipping is implemented in the TextureMapper.
1117
1118         No new tests.
1119
1120         * rendering/RenderLayerBacking.cpp:
1121         (WebCore::RenderLayerBacking::isDirectlyCompositedImage):
1122
1123 2017-07-13  Chris Fleizach  <cfleizach@apple.com>
1124
1125         AX: WebView crashes app after opening VoiceOver context box menu from modal dialog
1126         https://bugs.webkit.org/show_bug.cgi?id=163999
1127         <rdar://problem/28949013>
1128
1129         Reviewed by Joanmarie Diggs.
1130
1131         Protect when m_object goes away.
1132
1133         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1134         (-[WebAccessibilityObjectWrapper accessibilityShowContextMenu]):
1135
1136 2017-07-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
1137
1138         Async image decoding for large images should be disabled by default
1139         https://bugs.webkit.org/show_bug.cgi?id=174432
1140
1141         Reviewed by Simon Fraser.
1142
1143         -- Rename GraphicsLayerPaintFlags::Snapshotting to AllowAsyncImageDecoding.
1144         -- Replace every reference to GraphicsLayerPaintFlags::Snapshotting by
1145            GraphicsLayerPaintFlags::None and every GraphicsLayerPaintFlags::None
1146            by AllowAsyncImageDecoding.
1147         -- Rename PaintBehaviorSnapshotting to PaintBehaviorAllowAsyncImageDecoding.
1148         -- Propagate PaintBehaviorAllowAsyncImageDecoding from a parent view to 
1149            a child view instead of propagating PaintBehaviorSnapshotting.
1150         -- Remove setting the bit PaintBehaviorSnapshotting in any new PaintBehavoir.
1151         -- Replace setting the bit PaintBehaviorSnapshotting in an existing PaintBehavoir
1152            by resetting the bit PaintBehaviorAllowAsyncImageDecoding.
1153
1154         * html/shadow/MediaControlElements.cpp:
1155         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
1156         * page/FrameView.cpp:
1157         (WebCore::FrameView::willPaintContents):
1158         (WebCore::FrameView::paintContentsForSnapshot):
1159         * platform/graphics/GraphicsLayer.h:
1160         * platform/graphics/GraphicsLayerClient.h:
1161         * platform/graphics/mac/WebLayer.mm:
1162         (-[WebLayer drawInContext:]):
1163         (-[WebSimpleLayer drawInContext:]):
1164         * rendering/PaintPhase.h:
1165         * rendering/RenderBoxModelObject.cpp:
1166         (WebCore::RenderBoxModelObject::decodingModeForImageDraw):
1167         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1168         * rendering/RenderBoxModelObject.h:
1169         * rendering/RenderImage.cpp:
1170         (WebCore::RenderImage::paintIntoRect):
1171         * rendering/RenderLayer.cpp:
1172         (WebCore::RenderLayer::paintLayerContents):
1173         (WebCore::RenderLayer::paintForegroundForFragments):
1174         * rendering/RenderLayerBacking.cpp:
1175         (WebCore::RenderLayerBacking::paintContents):
1176         * rendering/RenderWidget.cpp:
1177         (WebCore::RenderWidget::paintContents): We need to propagate the 
1178         PaintBehaviorAllowAsyncImageDecoding from RenderWidget to the FrameView.
1179         We did not need to do that for PaintBehaviorSnapshotting because 
1180         FrameView was setting it in its m_paintBehavior if (document->printing())
1181         in FrameView::willPaintContents().
1182
1183 2017-07-12  Timothy Hatcher  <timothy@hatcher.name>
1184
1185         REGRESSION(r219391): Broke the USE(OPENGL_ES_2) build
1186         https://bugs.webkit.org/show_bug.cgi?id=174442
1187
1188         Unreviewed build fix.
1189
1190         * platform/graphics/egl/GLContextEGL.cpp: Fix typo of OPENGL_ES2.
1191
1192 2017-07-12  Youenn Fablet  <youenn@apple.com>
1193
1194         Recreate the AudioUnit when restarting capture
1195         https://bugs.webkit.org/show_bug.cgi?id=174439
1196
1197         Reviewed by Jer Noble.
1198
1199         Sometimes other applications in the system like FaceTime may make the audio unit not functional.
1200         Reloading the tab capturing audio will trigger a call to stop the audio shared unit.
1201         When the tab requests again audio, the shared unit will restart.
1202         At that time, the AudioUnit shared unit will be fully recreated.
1203
1204         Manually tested by doing a webrtc call and then doing a FaceTime call.
1205         Remote WebRTC endpoints may not receive any audio.
1206         With the patch, reloading the web page will get back the audio.
1207         Previously, restarting the UIProcess was the only way.
1208
1209         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1210         (WebCore::CoreAudioSharedUnit::startProducingData): Cleaning the audio unit when starting to produce data if there is a preexisting audio unit.
1211
1212 2017-07-12  Youenn Fablet  <youenn@apple.com>
1213
1214         Accessing localDescription, remoteDescription, etc. after setTimeout raises EXC_BAD_ACCESS
1215         https://bugs.webkit.org/show_bug.cgi?id=174323
1216         <rdar://problem/33267876>
1217
1218         Reviewed by Eric Carlson.
1219
1220         Test: webrtc/calling-peerconnection-once-closed.html
1221
1222         In case the libwebrtc backend is null, we should not use it to get description from it.
1223         Return null in that case.
1224
1225         Adding ASSERT to other calls where the layer above LibWebRTCMediaEndpoint should protect
1226         from calling a function on a null libwebrtc backend.
1227
1228         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1229         (WebCore::LibWebRTCMediaEndpoint::currentLocalDescription):
1230         (WebCore::LibWebRTCMediaEndpoint::currentRemoteDescription):
1231         (WebCore::LibWebRTCMediaEndpoint::pendingLocalDescription):
1232         (WebCore::LibWebRTCMediaEndpoint::pendingRemoteDescription):
1233         (WebCore::LibWebRTCMediaEndpoint::localDescription):
1234         (WebCore::LibWebRTCMediaEndpoint::remoteDescription):
1235         (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
1236         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
1237         (WebCore::LibWebRTCMediaEndpoint::addTrack):
1238         (WebCore::LibWebRTCMediaEndpoint::removeTrack):
1239         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
1240         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
1241         (WebCore::LibWebRTCMediaEndpoint::createDataChannel):
1242
1243 2017-07-12  Commit Queue  <commit-queue@webkit.org>
1244
1245         Unreviewed, rolling out r219176.
1246         https://bugs.webkit.org/show_bug.cgi?id=174436
1247
1248         "Can cause infinite recursion on iOS" (Requested by mlam on
1249         #webkit).
1250
1251         Reverted changeset:
1252
1253         "WTF::Thread should have the threads stack bounds."
1254         https://bugs.webkit.org/show_bug.cgi?id=173975
1255         http://trac.webkit.org/changeset/219176
1256
1257 2017-07-12  Nan Wang  <n_wang@apple.com>
1258
1259         AX: [iOS] Implement a way to retrieve a text marker range with desired text that is closest to a position
1260         https://bugs.webkit.org/show_bug.cgi?id=174393
1261         <rdar://problem/33248006>
1262
1263         Reviewed by Chris Fleizach.
1264
1265         Used the existing findClosestPlainText function to search the range on iOS.
1266         Also exposed a function on the iOS wrapper to return the selection rects of
1267         the result range from the searching. 
1268
1269         Test: accessibility/ios-simulator/text-marker-range-matches-text.html
1270
1271         * accessibility/AXObjectCache.cpp:
1272         (WebCore::visiblePositionForPositionWithOffset):
1273         (WebCore::AXObjectCache::rangeMatchesTextNearRange):
1274         * accessibility/AXObjectCache.h:
1275         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1276         (-[WebAccessibilityObjectWrapper rangeFromMarkers:withText:]):
1277         (-[WebAccessibilityObjectWrapper textMarkerRangeFromMarkers:withText:]):
1278         (-[WebAccessibilityObjectWrapper textRectsFromMarkers:withText:]):
1279         (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
1280
1281 2017-07-12  Matt Lewis  <jlewis3@apple.com>
1282
1283         Unreviewed, rolling out r219409.
1284
1285         The revision caused the Windows builds to fail.
1286
1287         Reverted changeset:
1288
1289         "AX: [iOS] Implement a way to retrieve a text marker range
1290         with desired text that is closest to a position"
1291         https://bugs.webkit.org/show_bug.cgi?id=174393
1292         http://trac.webkit.org/changeset/219409
1293
1294 2017-07-12  Alicia Boya García  <aboya@igalia.com>
1295
1296         [FreeType] Enable BCI on webfonts
1297         https://bugs.webkit.org/show_bug.cgi?id=174403
1298
1299         Reviewed by Michael Catanzaro.
1300
1301         The FreeType BCI hinter used to be disabled on webfonts in favor of
1302         the autohinter.
1303
1304         FreeType BCI hinter has improved considerably in the past and now most
1305         other browsers enable it too. Given the old reasons no longer apply,
1306         the BCI has now been enabled in order to get better text rendering when
1307         embedded hints are available.
1308
1309         * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
1310         (WebCore::FontCustomPlatformData::FontCustomPlatformData):
1311
1312 2017-07-12  Commit Queue  <commit-queue@webkit.org>
1313
1314         Unreviewed, rolling out r219361.
1315         https://bugs.webkit.org/show_bug.cgi?id=174434
1316
1317         Huge PLUM memory regression on iOS (Requested by kling on
1318         #webkit).
1319
1320         Reverted changeset:
1321
1322         "[WebIDL] Convert MutationCallback to be a normal generate
1323         callback"
1324         https://bugs.webkit.org/show_bug.cgi?id=174140
1325         http://trac.webkit.org/changeset/219361
1326
1327 2017-07-12  Eric Carlson  <eric.carlson@apple.com>
1328
1329         [MediaStream] a capture source failure should end the MediaStreamTrack
1330         https://bugs.webkit.org/show_bug.cgi?id=174375
1331
1332         Reviewed by Youenn Fablet.
1333
1334         Test: fast/mediastream/media-stream-track-source-failure.html
1335
1336         * platform/mediastream/RealtimeMediaSource.cpp:
1337         (WebCore::RealtimeMediaSource::captureFailed): New, signal observers that the source has ended.
1338         * platform/mediastream/RealtimeMediaSource.h:
1339
1340         * platform/mediastream/mac/AVMediaCaptureSource.h:
1341         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1342         (WebCore::AVMediaCaptureSource::setupSession): Call captureFailed if setupCaptureSession fails.
1343
1344         * platform/mediastream/mac/AVVideoCaptureSource.h:
1345         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1346         (WebCore::AVVideoCaptureSource::setupCaptureSession): Return false on failure.
1347         (WebCore::AVVideoCaptureSource::shutdownCaptureSession): Delete unused instance variable.
1348         (WebCore::AVVideoCaptureSource::processNewFrame): Ditto.
1349
1350         * testing/Internals.cpp:
1351         (WebCore::Internals::endMediaStreamTrackCaptureSource): Call track.source.captureFailed().
1352         * testing/Internals.h:
1353         * testing/Internals.idl:
1354
1355 2017-07-12  Timothy Hatcher  <timothy@hatcher.name>
1356
1357         Improve font matching with FontConfig and FreeType
1358         https://bugs.webkit.org/show_bug.cgi?id=174374
1359
1360         Reviewed by Michael Catanzaro.
1361
1362         * platform/graphics/freetype/FontCacheFreeType.cpp:
1363         (WebCore::FontCache::createFontPlatformData): Loop through all family name matches from FcFontMatch.
1364
1365 2017-07-12  Youenn Fablet  <youenn@apple.com>
1366
1367         Reactivate audio ducking when restarting the shared unit
1368         https://bugs.webkit.org/show_bug.cgi?id=174428
1369
1370         Reviewed by Eric Carlson.
1371
1372         Currently, when another application ducks WebKit, there is no other way than to quit the UIProcess and restart it.
1373         By again audio ducking when starting the audio unit, reloading the page will be enough.
1374         Testing by launching a tab with audio capture and audio playing.
1375         Then make a FaceTime call and hear the tab volume go down.
1376         End the call to FaceTime and the tab volume remains low.
1377         Reload the tab and the volume has a normal level.
1378
1379         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1380         (WebCore::CoreAudioSharedUnit::setupAudioUnit):
1381         (WebCore::CoreAudioSharedUnit::startInternal):
1382
1383 2017-07-12  Antoine Quint  <graouts@apple.com>
1384
1385         Playback controls should not hide while AirPlay is active
1386         https://bugs.webkit.org/show_bug.cgi?id=174422
1387         <rdar://problem/33011477>
1388
1389         Reviewed by Eric Carlson.
1390
1391         We now also track changes in AirPlay playback status and account for it when identifying whether we
1392         ought to let media controls automatically hide, which should only happen if the media is playing and
1393         not playing back through AirPlay.
1394
1395         * Modules/modern-media-controls/media/controls-visibility-support.js:
1396         (ControlsVisibilitySupport.prototype.get mediaEvents):
1397         (ControlsVisibilitySupport.prototype._updateControls):
1398         (ControlsVisibilitySupport):
1399
1400 2017-07-12  Daniel Bates  <dabates@apple.com>
1401
1402         Attempt to fix the build following <https://trac.webkit.org/changeset/219407>
1403         (https://bugs.webkit.org/show_bug.cgi?id=174386)
1404
1405         Fix bad merge after <https://trac.webkit.org/changeset/219404>.
1406
1407         * loader/FrameLoader.cpp:
1408         (WebCore::FrameLoader::loadURL):
1409         (WebCore::FrameLoader::loadWithNavigationAction):
1410         (WebCore::FrameLoader::loadPostRequest):
1411         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
1412         (WebCore::FrameLoader::loadDifferentDocumentItem):
1413         * loader/FrameLoader.h:
1414
1415 2017-07-12  Nan Wang  <n_wang@apple.com>
1416
1417         AX: [iOS] Implement a way to retrieve a text marker range with desired text that is closest to a position
1418         https://bugs.webkit.org/show_bug.cgi?id=174393
1419         <rdar://problem/33248006>
1420
1421         Reviewed by Chris Fleizach.
1422
1423         Used the existing findClosestPlainText function to search the range on iOS.
1424         Also exposed a function on the iOS wrapper to return the selection rects of
1425         the result range from the searching. 
1426
1427         Test: accessibility/ios-simulator/text-marker-range-matches-text.html
1428
1429         * accessibility/AXObjectCache.cpp:
1430         (WebCore::visiblePositionForPositionWithOffset):
1431         (WebCore::AXObjectCache::rangeMatchesTextNearRange):
1432         * accessibility/AXObjectCache.h:
1433         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1434         (-[WebAccessibilityObjectWrapper rangeFromMarkers:withText:]):
1435         (-[WebAccessibilityObjectWrapper textMarkerRangeFromMarkers:withText:]):
1436         (-[WebAccessibilityObjectWrapper textRectsFromMarkers:withText:]):
1437         (-[WebAccessibilityObjectWrapper rectsForSelectionRects:]):
1438
1439 2017-07-12  Daniel Bates  <dabates@apple.com>
1440
1441         NavigationAction should track whether the navigation was initiated by the main frame
1442         https://bugs.webkit.org/show_bug.cgi?id=174386
1443         <rdar://problem/33245267>
1444
1445         Reviewed by Brady Eidson.
1446
1447         Although we added state to NavigationAction to track whether the navigation was
1448         initiated by the main frame in r219170 it is not possible to initialize this state
1449         when instantiating a NavigationAction. Having NavigationAction track this state
1450         will be useful to ensure that we can always compute the source frame information
1451         when asking the embedding client whether to allow a navigation. We will make use
1452         of it in the fix for <https://bugs.webkit.org/show_bug.cgi?id=174385>.
1453
1454         No behavior changed. So, no new tests.
1455
1456         * loader/FrameLoader.cpp:
1457         (WebCore::FrameLoader::loadURL): Pass whether the load was initiated by the main frame
1458         when instantiating the NavigationAction.
1459         (WebCore::FrameLoader::load): For now, pass InitiatedByMainFrame::Unknown when instantiating
1460         the NavigationAction as we do not know if the load was initiated by the main frame.
1461         (WebCore::FrameLoader::loadWithDocumentLoader): Ditto.
1462         (WebCore::FrameLoader::reload): Ditto
1463         (WebCore::FrameLoader::loadDifferentDocumentItem): Ditto.
1464         (WebCore::createWindow): Pass whether the load was initiated by the main frame when
1465         instantiating the NavigationAction.
1466         * loader/NavigationAction.cpp:
1467         (WebCore::NavigationAction::NavigationAction): Modified to take argument of type InitiatedByMainFrame
1468         that indicates whether the navigation was initiated by the main frame.
1469         * loader/NavigationAction.h:
1470         * loader/PolicyChecker.cpp:
1471         (WebCore::PolicyChecker::checkNavigationPolicy): For now, pass InitiatedByMainFrame::Unknown
1472         when instantiating the NavigationAction as we do not know if the load was initiated by the
1473         main frame.
1474         * page/ContextMenuController.cpp:
1475         (WebCore::openNewWindow): Pass whether the load was initiated by the main frame when
1476         instantiating the NavigationAction.
1477
1478 2017-07-12  Daniel Bates  <dabates@apple.com>
1479
1480         Rename NavigationInitiatedByMainFrame to InitiatedByMainFrame
1481         https://bugs.webkit.org/show_bug.cgi?id=174427
1482
1483         Rubber-stamped by Brady Eidson.
1484
1485         * inspector/InspectorFrontendClientLocal.cpp:
1486         (WebCore::InspectorFrontendClientLocal::openInNewTab):
1487         * inspector/InspectorPageAgent.cpp:
1488         (WebCore::InspectorPageAgent::navigate):
1489         * loader/FrameLoadRequest.cpp:
1490         (WebCore::FrameLoadRequest::FrameLoadRequest):
1491         * loader/FrameLoadRequest.h:
1492         (WebCore::FrameLoadRequest::FrameLoadRequest):
1493         (WebCore::FrameLoadRequest::initiatedByMainFrame):
1494         (WebCore::FrameLoadRequest::navigationInitiatedByMainFrame): Deleted.
1495         * loader/FrameLoader.cpp:
1496         (WebCore::FrameLoader::urlSelected):
1497         (WebCore::FrameLoader::loadURLIntoChildFrame):
1498         (WebCore::shouldOpenExternalURLsPolicyToApply):
1499         (WebCore::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
1500         (WebCore::FrameLoader::loadURL):
1501         (WebCore::FrameLoader::loadWithNavigationAction):
1502         (WebCore::FrameLoader::reloadWithOverrideEncoding):
1503         (WebCore::FrameLoader::reload):
1504         (WebCore::FrameLoader::loadPostRequest):
1505         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
1506         (WebCore::FrameLoader::loadDifferentDocumentItem):
1507         * loader/FrameLoader.h:
1508         * loader/FrameLoaderTypes.h:
1509         * loader/NavigationAction.h:
1510         (WebCore::NavigationAction::initiatedByMainFrame):
1511         (WebCore::NavigationAction::navigationInitiatedByMainFrame): Deleted.
1512         * loader/NavigationScheduler.cpp:
1513         (WebCore::ScheduledNavigation::ScheduledNavigation):
1514         (WebCore::ScheduledNavigation::initiatedByMainFrame):
1515         (WebCore::NavigationScheduler::scheduleLocationChange):
1516         (WebCore::ScheduledNavigation::navigationInitiatedByMainFrame): Deleted.
1517         * page/ContextMenuController.cpp:
1518         (WebCore::openNewWindow):
1519         (WebCore::ContextMenuController::contextMenuItemSelected):
1520         * page/DOMWindow.cpp:
1521         (WebCore::DOMWindow::createWindow):
1522
1523 2017-07-12  Matt Lewis  <jlewis3@apple.com>
1524
1525         Unreviewed, rolling out r219401.
1526
1527         This revision rolled out the previous patch, but after talking
1528         with reviewer, a rebaseline is what was needed.Rolling back in
1529         before rebaseline.
1530
1531         Reverted changeset:
1532
1533         "Unreviewed, rolling out r219379."
1534         https://bugs.webkit.org/show_bug.cgi?id=174400
1535         http://trac.webkit.org/changeset/219401
1536
1537 2017-07-12  Matt Lewis  <jlewis3@apple.com>
1538
1539         Unreviewed, rolling out r219379.
1540
1541         This revision caused a consistent failure in the test
1542         fast/dom/Window/property-access-on-cached-window-after-frame-
1543         removed.html.
1544
1545         Reverted changeset:
1546
1547         "Remove NAVIGATOR_HWCONCURRENCY"
1548         https://bugs.webkit.org/show_bug.cgi?id=174400
1549         http://trac.webkit.org/changeset/219379
1550
1551 2017-07-12  Zalan Bujtas  <zalan@apple.com>
1552
1553         Paginated mode: Infinite recursion in RenderTable::layout
1554         https://bugs.webkit.org/show_bug.cgi?id=174413
1555
1556         Reviewed by Simon Fraser.
1557
1558         This patch is a workaround for avoiding infinite recursion when the table layout does not stabilize.
1559         Apparently we leak some context (computed padding in this case) from the current to the subsequent layout.
1560         The subsequent layouts always end up producing different line heights for some of the cells in the <thead>.
1561         In paginated mode, when the section moves (<thead>, <tbody> etc) we call layout again recursively.
1562         This could lead to infinite recursion for unstable table layout.
1563
1564         Unable to come up with a reduction yet.
1565
1566         * rendering/RenderTable.cpp:
1567         (WebCore::RenderTable::layout):
1568         * rendering/RenderTable.h:
1569
1570 2017-07-12  Youenn Fablet  <youenn@apple.com>
1571
1572         WebRTC: Incorrect sdpMLineIndex for video breaks Firefox interop
1573         https://bugs.webkit.org/show_bug.cgi?id=173530
1574
1575         Reviewed by Alex Christensen.
1576
1577         Test: webrtc/ice-candidate-sdpMLineIndex.html
1578
1579         Reading missing parameter from libwebrtc backend and setting it when firing the RTCIceCandidate event.
1580
1581         * Modules/mediastream/PeerConnectionBackend.cpp:
1582         (WebCore::PeerConnectionBackend::disableICECandidateFiltering):
1583         (WebCore::PeerConnectionBackend::newICECandidate):
1584         * Modules/mediastream/PeerConnectionBackend.h:
1585         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1586         (WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
1587
1588 2017-07-12  Zan Dobersek  <zdobersek@igalia.com>
1589
1590         [GCrypt] Implement CryptoKeyEC PKCS#8 exports
1591         https://bugs.webkit.org/show_bug.cgi?id=173648
1592
1593         Reviewed by Jiewen Tan.
1594
1595         Implement the PKCS#8 export operation for EC keys for platforms that use
1596         libgcrypt.
1597
1598         First, the `ECParameters` and the `ECPrivateKey` ASN.1 structures are created
1599         and filled out accordingly. For the former, the appropriate object identifier
1600         is written under the `namedCurve` element of the structure. For the latter, we
1601         write out '1' under `version`, and eliminate the optional `parameters` element.
1602         An libgcrypt EC context is then used to retrieve the private and public key
1603         MPIs that are then written out under the `privateKey` and `publicKey` elements,
1604         respectively.
1605
1606         After that, we can proceed to create and fill out the `PrivateKeyInfo` structure.
1607         0 is written out under the `version` element, and the id-ecPublicKey object
1608         identifier is written out under the `privateKeyAlgorithm.algorithm` element. This
1609         doesn't strictly follow the specification, since the id-ecDH identifier should be
1610         used for ECDH keys, but no test in WebKit or the web-platform-tests suite covers
1611         this, so this specific detail should be revisited later.
1612
1613         Data of the previously-constructed `ECParameters` structure is retrieved and
1614         written out under the `privateKeyAlgorithm.parameters` element. Similarly is done
1615         for the `ECPrivateKey` structure, writing out its data under the `privateKey`
1616         element. Finally, the optional `attributes` element of the `PrivateKeyInfo`
1617         structure is eliminated, and the encoded data of this structure is retrieved and
1618         returned.
1619
1620         No new tests -- relevant tests are now passing and are unskipped.
1621
1622         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
1623         (WebCore::CryptoKeyEC::platformExportPkcs8):
1624
1625 2017-07-12  Zan Dobersek  <zdobersek@igalia.com>
1626
1627         [WPE] Use libepoxy
1628         https://bugs.webkit.org/show_bug.cgi?id=172104
1629
1630         Reviewed by Michael Catanzaro.
1631
1632         No new tests -- no changes in behavior.
1633
1634         Implement the proper libepoxy header inclusion for ports that enable it.
1635
1636         The library acts as a loading facility working on top of the system-provided
1637         OpenGL and EGL libraries, with the headers providing a complete collection of
1638         specification-defined OpenGL and EGL types, constants and entrypoints.
1639
1640         Support is added through the USE(LIBEPOXY) build guard. Note that this guard
1641         isn't exclusive with USE(OPENGL), USE(OPENGL_ES_2) or USE(EGL), so the
1642         USE(LIBEPOXY) condition is tested before those.
1643
1644         In case of OpenGL headers, the <epoxy/gl.h> header is included, and in
1645         case of EGL headers, the <epoxy/egl.h> header. <epoxy/egl.h> includes
1646         <epoxy/gl.h> on its own, so in some cases the inclusion of the latter is
1647         omitted.
1648
1649         EpoxyShims.h header is added, doing a job similar to OpenGLESShims.h. The
1650         EXT-suffixed GL entrypoints are redefined to the non-suffixed versions.
1651         No suffixed constants are defined because those are defined by the libepoxy
1652         headers to the well-known values.
1653
1654         * CMakeLists.txt:
1655         * PlatformWPE.cmake:
1656         * platform/graphics/ANGLEWebKitBridge.h:
1657         * platform/graphics/EpoxyShims.h: Added.
1658         * platform/graphics/GLContext.cpp:
1659         (WebCore::initializeOpenGLShimsIfNeeded):
1660         * platform/graphics/GraphicsContext3DPrivate.cpp:
1661         * platform/graphics/PlatformDisplay.cpp:
1662         * platform/graphics/cairo/CairoUtilities.cpp:
1663         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
1664         (WebCore::GraphicsContext3D::create):
1665         * platform/graphics/cairo/ImageBufferCairo.cpp:
1666         * platform/graphics/egl/GLContextEGL.cpp:
1667         * platform/graphics/egl/GLContextEGLWPE.cpp:
1668         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1669         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
1670         * platform/graphics/opengl/Extensions3DOpenGLES.cpp:
1671         * platform/graphics/opengl/Extensions3DOpenGLES.h:
1672         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1673         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
1674         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
1675         * platform/graphics/wpe/PlatformDisplayWPE.cpp:
1676
1677 2017-07-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1678
1679         ImageDecoder: Gifs with infinite animation only play once very often
1680         https://bugs.webkit.org/show_bug.cgi?id=173403
1681
1682         Reviewed by Michael Catanzaro.
1683
1684         It doesn't always happen, it's easier to reproduce when loading big files from the network, but it also depends
1685         on every file. The problem is that ImageFrameCache is caching the repetition count value always when the size is
1686         already available. In the case of gif files, the loop count value can be at any point of the image stream, so
1687         having the size available doesn't mean we also have the loop count. So, if the value is queried before it's
1688         available, the default value is cached (repeat once) and then always used. We should clear the cached value when
1689         new data is added to the decoder, like we do with other cached values that can change when more data is decoded.
1690
1691         * platform/graphics/ImageFrameCache.cpp:
1692         (WebCore::ImageFrameCache::clearMetadata): Clear m_repetitionCount.
1693
1694 2017-07-12  Adrian Perez de Castro  <aperez@igalia.com>
1695
1696         [SOUP] Do not use C linkage for functions using C++ features
1697         https://bugs.webkit.org/show_bug.cgi?id=174392
1698
1699         Reviewed by Michael Catanzaro.
1700
1701         No new tests because there is no behavior change.
1702
1703         * platform/network/soup/WebKitSoupRequestGeneric.h: Move G_END_DECLS
1704         to leave functions which use C++ features outside of the block it
1705         delimits.
1706
1707 2017-07-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1708
1709         [GTK] Crashes in WebCore::PasteboardHelper::fillSelectionData when source file of drag is unavailable
1710         https://bugs.webkit.org/show_bug.cgi?id=174161
1711
1712         Reviewed by Michael Catanzaro.
1713
1714         It seems selection data could contain an empty string, in which case gtk_selection_data_get_data() returns a
1715         valid pointer, but gtk_selection_data_get_length() returns 0. When this happens we end up trying to split an
1716         empty string resulting in an empty vector, but we unconditionally access the first element of the vector.
1717
1718         * platform/gtk/PasteboardHelper.cpp:
1719         (WebCore::selectionDataToUTF8String): Return a null string in case selection data length is 0.
1720         (WebCore::PasteboardHelper::fillSelectionData): Return early if selection data length is 0, instead of checking
1721         the selection data pointer.
1722
1723 2017-07-11  Carlos Garcia Campos  <cgarcia@igalia.com>
1724
1725         [GTK][WPE] Enable FILE_LOCK and implement lockFile and unlockFile
1726         https://bugs.webkit.org/show_bug.cgi?id=174357
1727
1728         Reviewed by Michael Catanzaro.
1729
1730         Implement lockFile and unlockFile using flock().
1731
1732         * PlatformWPE.cmake:
1733         * platform/glib/FileSystemGlib.cpp:
1734         (WebCore::lockFile):
1735         (WebCore::unlockFile):
1736
1737 2017-07-11  Yusuke Suzuki  <utatane.tea@gmail.com>
1738
1739         Use FastAllocator in STL containers
1740         https://bugs.webkit.org/show_bug.cgi?id=174366
1741
1742         Rubber stamped by Sam Weinig.
1743
1744         This patch uses FastAllocator for STL containers including std::set and std::map.
1745         STL can take a template parameter to be used as allocator for containers.
1746         We prepare FastAllocator, which uses fastMalloc for allocation.
1747         This allows us to use bmalloc (if supported) for STL containers which offers
1748         functionalities that is not supported in WTF containers.
1749
1750         * Modules/indexeddb/IDBKeyData.h:
1751         * Modules/indexeddb/server/IndexValueEntry.cpp:
1752         (WebCore::IDBServer::IndexValueEntry::IndexValueEntry):
1753         (WebCore::IDBServer::IndexValueEntry::Iterator::Iterator):
1754         (WebCore::IDBServer::IndexValueEntry::reverseFind):
1755         * Modules/indexeddb/server/IndexValueEntry.h:
1756         * Modules/indexeddb/server/IndexValueStore.cpp:
1757         (WebCore::IDBServer::IndexValueStore::lowestIteratorInRange):
1758         (WebCore::IDBServer::IndexValueStore::highestReverseIteratorInRange):
1759         (WebCore::IDBServer::IndexValueStore::Iterator::Iterator):
1760         * Modules/indexeddb/server/IndexValueStore.h:
1761         * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
1762         (WebCore::IDBServer::MemoryBackingStoreTransaction::objectStoreCleared):
1763         * Modules/indexeddb/server/MemoryBackingStoreTransaction.h:
1764         * Modules/indexeddb/server/MemoryObjectStore.cpp:
1765         (WebCore::IDBServer::MemoryObjectStore::replaceKeyValueStore):
1766         (WebCore::IDBServer::MemoryObjectStore::addRecord):
1767         (WebCore::IDBServer::MemoryObjectStore::updateCursorsForPutRecord):
1768         * Modules/indexeddb/server/MemoryObjectStore.h:
1769         (WebCore::IDBServer::MemoryObjectStore::orderedKeys):
1770         * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp:
1771         (WebCore::IDBServer::MemoryObjectStoreCursor::keyAdded):
1772         (WebCore::IDBServer::MemoryObjectStoreCursor::setFirstInRemainingRange):
1773         (WebCore::IDBServer::MemoryObjectStoreCursor::setForwardIteratorFromRemainingRange):
1774         (WebCore::IDBServer::MemoryObjectStoreCursor::setReverseIteratorFromRemainingRange):
1775         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementForwardIterator):
1776         (WebCore::IDBServer::MemoryObjectStoreCursor::incrementReverseIterator):
1777         * Modules/indexeddb/server/MemoryObjectStoreCursor.h:
1778         * Modules/mediasource/SampleMap.h:
1779         * page/WheelEventTestTrigger.cpp:
1780         (WebCore::WheelEventTestTrigger::deferTestsForReason):
1781         (WebCore::dumpState):
1782         * page/WheelEventTestTrigger.h:
1783         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1784         (WebCore::enumToStringMap):
1785         * rendering/OrderIterator.h:
1786
1787 2017-07-11  Per Arne Vollan  <pvollan@apple.com>
1788
1789         [Win] Build error when building WebKit.dll from WebKit.proj project file.
1790         https://bugs.webkit.org/show_bug.cgi?id=174410
1791
1792         Reviewed by Brent Fulgham.
1793
1794         Copy required header files to forwarding headers folder.
1795
1796         * PlatformWin.cmake:
1797
1798 2017-07-11  Dean Jackson  <dino@apple.com>
1799
1800         Remove NAVIGATOR_HWCONCURRENCY
1801         https://bugs.webkit.org/show_bug.cgi?id=174400
1802
1803         Reviewed by Sam Weinig.
1804
1805         * Configurations/FeatureDefines.xcconfig:
1806         * WebCore.xcodeproj/project.pbxproj:
1807         * page/NavigatorBase.cpp:
1808         (WebCore::NavigatorBase::hardwareConcurrency): Deleted.
1809         * page/NavigatorBase.h:
1810         * page/NavigatorConcurrentHardware.idl: Removed.
1811
1812 2017-07-11  Youenn Fablet  <youenn@apple.com>
1813
1814         RealtimeOutgoingAudioSource should not push more audio data if the WebRTC thread is not able to process it
1815         https://bugs.webkit.org/show_bug.cgi?id=174383
1816
1817         Reviewed by Eric Carlson.
1818
1819         This patch adds support to check for pending-processing audio data.
1820         If the amount of audio data is bigger than a high water mark of 0.5 seconds,
1821         we stop pushing new audio data until buffered audio data is lower than a low water mark of 0.1 seconds.
1822         Patch is tested by adding breakpoints to trigger the high water mark, verifying that low water mark is triggered
1823         and receiving audio is fine on the other connection endpoint.
1824
1825         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
1826         (WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataHighLimit):
1827         (WebCore::RealtimeOutgoingAudioSource::isReachingBufferedAudioDataLowLimit):
1828         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
1829         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
1830
1831 2017-07-11  Dean Jackson  <dino@apple.com>
1832
1833         Rolling out r219372.
1834
1835         * Configurations/FeatureDefines.xcconfig:
1836         * WebCore.xcodeproj/project.pbxproj:
1837         * page/NavigatorBase.cpp:
1838         (WebCore::NavigatorBase::hardwareConcurrency):
1839         * page/NavigatorBase.h:
1840         * page/NavigatorConcurrentHardware.idl: Added.
1841
1842 2017-07-11  Dean Jackson  <dino@apple.com>
1843
1844         Remove NAVIGATOR_HWCONCURRENCY
1845         https://bugs.webkit.org/show_bug.cgi?id=174400
1846
1847         Reviewed by Sam Weinig.
1848
1849         * Configurations/FeatureDefines.xcconfig:
1850         * WebCore.xcodeproj/project.pbxproj:
1851         * page/NavigatorBase.cpp:
1852         (WebCore::NavigatorBase::hardwareConcurrency): Deleted.
1853         * page/NavigatorBase.h:
1854         * page/NavigatorConcurrentHardware.idl: Removed.
1855
1856 2017-07-11  Jiewen Tan  <jiewen_tan@apple.com>
1857
1858         [WebCrypto] CryptoKeyECMac::Custom OpenSSL tag is actually tagged type [1]
1859         https://bugs.webkit.org/show_bug.cgi?id=174382
1860         <rdar://problem/33244871>
1861
1862         Reviewed by Brent Fulgham.
1863
1864         No change of behaviour.
1865
1866         * crypto/mac/CryptoKeyECMac.cpp:
1867         (WebCore::CryptoKeyEC::platformImportPkcs8):
1868         (WebCore::CryptoKeyEC::platformExportPkcs8):
1869         Replace CustomECParameters with TaggedType1 according to X.690(08/2015) section 8.14:
1870         https://www.itu.int/rec/T-REC-X.690-201508-I/en
1871         and RFC 5915 Appendix A:
1872         http://www.ietf.org/rfc/rfc5915.txt.
1873
1874 2017-07-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
1875
1876         REGRESSION(r219045): The <body> element does not get repainted when its background image finishes decoding
1877         https://bugs.webkit.org/show_bug.cgi?id=174376
1878
1879         Reviewed by Simon Fraser.
1880
1881         When adding a CachedImageClient to CachedImage::m_pendingImageDrawingClients
1882         and the CachedImageClient is not one of the CachedImage::m_clients, we
1883         should cancel the repaint optimization in CachedImage::imageFrameAvailable().
1884         This can be done by adding all the CachedImage::m_clients to CachedImage::
1885         m_pendingImageDrawingClients.
1886
1887         Test: fast/images/async-image-body-background-image.html
1888
1889         * loader/cache/CachedImage.cpp:
1890         (WebCore::CachedImage::addPendingImageDrawingClient):
1891
1892 2017-07-11  Chris Dumez  <cdumez@apple.com>
1893
1894         Unreviewed, fix Windows build after r219355.
1895
1896         * bindings/js/JSDOMWindowCustom.cpp:
1897         (WebCore::addCrossOriginWindowPropertyNames):
1898         (WebCore::addCrossOriginWindowOwnPropertyNames):
1899         (WebCore::JSDOMWindow::getOwnPropertyNames):
1900         (WebCore::addCrossOriginPropertyNames): Deleted.
1901         (WebCore::addCrossOriginOwnPropertyNames): Deleted.
1902         * bindings/js/JSLocationCustom.cpp:
1903         (WebCore::addCrossOriginLocationPropertyNames):
1904         (WebCore::addCrossOriginLocationOwnPropertyNames):
1905         (WebCore::JSLocation::getOwnPropertyNames):
1906         (WebCore::addCrossOriginPropertyNames): Deleted.
1907         (WebCore::addCrossOriginOwnPropertyNames): Deleted.
1908
1909 2017-07-10  Sam Weinig  <sam@webkit.org>
1910
1911         [WebIDL] Convert MutationCallback to be a normal generate callback
1912         https://bugs.webkit.org/show_bug.cgi?id=174140
1913
1914         Reviewed by Chris Dumez.
1915
1916         To make this work more nicely, I:
1917         - Added the ability to for non-nullable interfaces in sequences to be passed
1918           via a Ref<> rather than a RefPtr<> as a parameter to a callback function.
1919           (e.g. callback MyCallback = void (sequence<Foo> foos) will now have the 
1920           signature, CallbackResult<void> handleEvent(const Vector<Ref<Foo>>&) rather
1921           than CallbackResult<void> handleEvent(const Vector<RefPtr<Foo>>&).
1922         - Added a new extended attribute for callback functions called [CallbackNeedsCanInvoke]
1923           that adds a virtual function called canInvoke() to the generated callback.
1924           All it does is forward to ActiveDOMCallback's canInvokeCallback, but it
1925           allows the implementation to get to it. We may one day want to move the 
1926           inheritance of ActiveDOMCallback from the generated source to the base class.
1927         - Added a new extended attribute for callback functions called [CallbackThisObject=Type]
1928           which allows you to specify that the callback needs a this object in addition
1929           to its arguments. When specified, the first argument of the C++ implementation
1930           function will now correspond to the this object, with the remaining arguments
1931           shifted over one.
1932
1933         * DerivedSources.make:
1934         Add MutationCallback.
1935
1936         * WebCore.xcodeproj/project.pbxproj:
1937         Remove non-generated JSMutationCallback.cpp, and add generated JSMutationCallback.cpp.
1938
1939         * Modules/mediastream/MediaDevicesRequest.cpp:
1940         (WebCore::MediaDevicesRequest::filterDeviceList):
1941         (WebCore::MediaDevicesRequest::start):
1942         * Modules/mediastream/MediaDevicesRequest.h:
1943         Switch to using Ref.
1944
1945         * bindings/IDLTypes.h:
1946         Add InnerParameterType and NullableInnerParameterType type hooks
1947         and specialize wrappers to use Ref for InnerParameterType, and RefPtr
1948         for NullableInnerParameterType.
1949
1950         * bindings/js/JSCallbackData.cpp:
1951         * bindings/js/JSCallbackData.h:
1952         Add support for passing a this object.
1953
1954         * bindings/js/JSMutationCallback.cpp: Removed.
1955         * bindings/js/JSMutationCallback.h: Removed.
1956         Remove custom callback code.
1957
1958         * bindings/js/JSMutationObserverCustom.cpp:
1959         (WebCore::constructJSMutationObserver): Deleted.
1960         Remove no longer needed custom constructor.
1961
1962         * bindings/scripts/CodeGenerator.pm:
1963         (ParseType):
1964         Add helper to parse a type and cache the result.
1965
1966         * bindings/scripts/CodeGeneratorJS.pm:
1967         (GenerateCallbackHeaderContent):
1968         (GenerateCallbackImplementationContent):
1969         Add support for [CallbackNeedsCanInvoke] and [CallbackThisObject]. When [CallbackThisObject]
1970         is not specified, use jsUndefined() as the this object as specified by WebIDL.
1971
1972         * bindings/scripts/IDLAttributes.json:
1973         Add [CallbackNeedsCanInvoke] and [CallbackThisObject].
1974
1975         * bindings/scripts/IDLParser.pm:
1976         (ParseType):
1977         Add entry point to parse a single type.
1978
1979         * css/FontFaceSet.h:
1980         Switch to using Ref.
1981
1982         * dom/MutationCallback.h:
1983         Update signatures.
1984
1985         * dom/MutationCallback.idl: Added.
1986     
1987         * dom/MutationObserver.cpp:
1988         (WebCore::MutationObserver::canDeliver):
1989         (WebCore::MutationObserver::deliver):
1990         Switch to new signatures.
1991
1992         * dom/MutationObserver.idl:
1993         Remove CustomConstructor.
1994
1995         * page/IntersectionObserverCallback.h:
1996         Switch to using Ref.
1997
1998         * bindings/scripts/test/JS/JSTestCallbackFunction.cpp:
1999         * bindings/scripts/test/JS/JSTestCallbackFunctionRethrow.cpp:
2000         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.cpp: Added.
2001         * bindings/scripts/test/JS/JSTestCallbackFunctionWithThisObject.h: Added.
2002         * bindings/scripts/test/JS/JSTestCallbackFunctionWithTypedefs.cpp:
2003         * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
2004         * bindings/scripts/test/JS/JSTestCallbackInterface.h:
2005         * bindings/scripts/test/JS/JSTestVoidCallbackFunction.cpp:
2006         Add / update bindings tests.
2007
2008 2017-07-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
2009
2010         RenderImage should not add itself as a RelevantRepaintedObject if its image frame is being decoded
2011         https://bugs.webkit.org/show_bug.cgi?id=174336
2012
2013         Reviewed by Simon Fraser.
2014
2015         Since nothing will be drawn till the image frame finishes decoding we should
2016         treat returning ImageDrawResult::DidRequestDecoding from BitmapImage::draw
2017         the same as we do when the image is still loading.
2018
2019         * rendering/RenderImage.cpp:
2020         (WebCore::RenderImage::paintReplaced):
2021         (WebCore::RenderImage::paintIntoRect):
2022         * rendering/RenderImage.h:
2023
2024 2017-07-11  Youenn Fablet  <youenn@apple.com>
2025
2026         [WebRTC] Hanging under LibWebRTCMediaEndpoint::getStats
2027         https://bugs.webkit.org/show_bug.cgi?id=174377
2028
2029         Reviewed by Eric Carlson.
2030
2031         No change of behavior.
2032         Moving calls to libwebrtc getStats in the signalling thread since doing it in the main thread
2033         would block the main thread until the signalling thread is ready to handle getStats.
2034         Reducing stat logging since this may be too much for some devices.
2035
2036         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2037         (WebCore::LibWebRTCMediaEndpoint::getStats):
2038         (WebCore::LibWebRTCMediaEndpoint::gatherStatsForLogging):
2039         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
2040         (WebCore::LibWebRTCMediaEndpoint::startLoggingStats):
2041
2042 2017-07-11  Michael Catanzaro  <mcatanzaro@igalia.com>
2043
2044         Remove unused OpenGL files
2045         https://bugs.webkit.org/show_bug.cgi?id=174371
2046
2047         Reviewed by Timothy Hatcher.
2048
2049         * platform/graphics/opengl/GLPlatformContext.cpp: Removed.
2050         * platform/graphics/opengl/GLPlatformContext.h: Removed.
2051         * platform/graphics/opengl/GLPlatformSurface.h: Removed.
2052
2053 2017-07-11  Chris Dumez  <cdumez@apple.com>
2054
2055         Window's [[OwnPropertyKeys]] is wrong for cross origin windows
2056         https://bugs.webkit.org/show_bug.cgi?id=174364
2057         <rdar://problem/33238056>
2058
2059         Reviewed by Brent Fulgham.
2060
2061         Window's [[OwnPropertyKeys]] should not list descendant frame names
2062         when the window is cross-origin:
2063         - https://github.com/whatwg/html/pull/2777
2064
2065         This aligns our behavior with Firefox and Chrome.
2066
2067         No new tests, updated existing test.
2068
2069         * bindings/js/JSDOMWindowCustom.cpp:
2070         (WebCore::addCrossOriginPropertyNames):
2071         (WebCore::addCrossOriginOwnPropertyNames):
2072         (WebCore::JSDOMWindow::getOwnPropertyNames):
2073
2074 2017-07-11  Timothy Hatcher  <timothy@hatcher.name>
2075
2076         Fix broken build when ENABLE_VIDEO is disabled.
2077         https://bugs.webkit.org/show_bug.cgi?id=174368
2078
2079         Reviewed by Alex Christensen.
2080
2081         * dom/Document.cpp:
2082         * html/canvas/WebGLRenderingContextBase.cpp:
2083         (WebCore::WebGLRenderingContextBase::texSubImage2D):
2084         (WebCore::WebGLRenderingContextBase::texImage2D):
2085         * html/canvas/WebGLRenderingContextBase.h:
2086         * html/canvas/WebGLRenderingContextBase.idl:
2087         * testing/Internals.cpp:
2088         (WebCore::Internals::mediaResponseSources):
2089         (WebCore::Internals::mediaResponseContentRanges):
2090         * testing/Internals.h:
2091         * testing/Internals.idl:
2092
2093 2017-07-11  Ali Juma  <ajuma@chromium.org>
2094
2095         elementFromPoint() should consider x and y to be in client (layout viewport) coordinates
2096         https://bugs.webkit.org/show_bug.cgi?id=172019
2097
2098         Reviewed by Simon Fraser.
2099
2100         When visual viewports are enabled, this makes TreeScope::nodeFromPoint consider its
2101         input to be in client coordinates, and clips this input to the layout viewport. This change
2102         affects the behavior of document.elementFromPoint() and document.caretRangeFromPoint.
2103
2104         No new tests. Modified an existing test, and made a previously-failing test pass on ios.
2105
2106         * dom/TreeScope.cpp:
2107         (WebCore::TreeScope::nodeFromPoint):
2108         * page/FrameView.cpp:
2109         (WebCore::FrameView::layoutViewportToAbsoluteRect):
2110         (WebCore::FrameView::layoutViewportToAbsolutePoint):
2111         (WebCore::FrameView::clientToLayoutViewportPoint):
2112         * page/FrameView.h:
2113         * rendering/RenderLayer.cpp:
2114         (WebCore::RenderLayer::hitTest):
2115
2116 2017-07-11  Timothy Hatcher  <timothy@hatcher.name>
2117
2118         Broken build when !USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR)
2119         https://bugs.webkit.org/show_bug.cgi?id=174369
2120
2121         Reviewed by Alex Christensen.
2122
2123         * dom/ScriptedAnimationController.h: Include PlatformScreen.h.
2124
2125 2017-07-11  Wenson Hsieh  <wenson_hsieh@apple.com>
2126
2127         Address post-review feedback after http://trac.webkit.org/r219310
2128         https://bugs.webkit.org/show_bug.cgi?id=174300
2129         <rdar://problem/33030639>
2130
2131         Reviewed by Simon Fraser.
2132
2133         Removes pan-gesture-related plumbing introduced in r219310 that is no longer necessary.
2134
2135         * page/scrolling/ScrollingTree.h:
2136         (WebCore::ScrollingTree::scrollingTreeNodeWillStartPanGesture):
2137         (WebCore::ScrollingTree::scrollingTreeNodeDidEndPanGesture): Deleted.
2138
2139 2017-07-11  Alex Christensen  <achristensen@webkit.org>
2140
2141         Reduce URL size
2142         https://bugs.webkit.org/show_bug.cgi?id=174319
2143
2144         Reviewed by Andreas Kling.
2145
2146         m_fragmentEnd is redundant information. If a URL is valid, then it is always m_string.length().
2147         If a URL is not valid, then it is always 0. Rather than storing additional information,
2148         deduce the fragment end from the validity of the URL and the String's length.
2149
2150         No change in behavior.  This reduces sizeof(URL) from 56 to 48 and reduces operations when parsing.
2151
2152         * platform/URL.cpp:
2153         (WebCore::URL::invalidate):
2154         (WebCore::URL::fragmentIdentifier):
2155         (WebCore::URL::hasFragmentIdentifier):
2156         (WebCore::URL::removeFragmentIdentifier):
2157         * platform/URL.h:
2158         (WebCore::URL::encode):
2159         (WebCore::URL::decode):
2160         (WebCore::URL::hasFragment):
2161         * platform/URLParser.cpp:
2162         (WebCore::URLParser::urlLengthUntilPart):
2163         (WebCore::URLParser::copyURLPartsUntil):
2164         (WebCore::URLParser::parse):
2165         (WebCore::URLParser::allValuesEqual):
2166         (WebCore::URLParser::internalValuesConsistent):
2167
2168 2017-07-11  Alex Christensen  <achristensen@webkit.org>
2169
2170         SharedBuffer::size should return a size_t
2171         https://bugs.webkit.org/show_bug.cgi?id=174328
2172
2173         Reviewed by Andreas Kling.
2174
2175         No change in behaviour.
2176
2177         * html/FTPDirectoryDocument.cpp:
2178         (WebCore::createTemplateDocumentData):
2179         * loader/ContentFilter.cpp:
2180         (WebCore::ContentFilter::handleProvisionalLoadFailure):
2181         * loader/ResourceLoader.cpp:
2182         (WebCore::ResourceLoader::loadDataURL):
2183         * loader/ResourceLoader.h:
2184         * loader/appcache/ApplicationCacheStorage.cpp:
2185         (WebCore::ApplicationCacheStorage::store):
2186         * loader/cache/CachedScript.cpp:
2187         (WebCore::CachedScript::script):
2188         * platform/SharedBuffer.cpp:
2189         (WebCore::SharedBuffer::tryCreateArrayBuffer):
2190         * platform/SharedBuffer.h:
2191
2192 2017-07-11  Per Arne Vollan  <pvollan@apple.com>
2193
2194         [Win] Build error when building WebCore from WebCore.proj project file.
2195         https://bugs.webkit.org/show_bug.cgi?id=174330
2196
2197         Reviewed by Brent Fulgham.
2198
2199         The CMake variable PAL_DIR should be set in the project file.
2200
2201         * WebCore.vcxproj/WebCore.proj:
2202
2203 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
2204
2205         [SVG] Leak in SVGAnimatedListPropertyTearOff
2206         https://bugs.webkit.org/show_bug.cgi?id=172545
2207
2208         Reviewed by Said Abou-Hallawa.
2209
2210         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
2211         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
2212         reference to SVGAnimatedProperty.
2213
2214         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
2215         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
2216         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
2217         is going to be added to. This effectively creates a reference cycle between the
2218         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
2219
2220         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
2221
2222         * svg/properties/SVGAnimatedListPropertyTearOff.h:
2223
2224 2017-07-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2225
2226         [GTK] Spin buttons on input type number appear over the value itself for small widths
2227         https://bugs.webkit.org/show_bug.cgi?id=173572
2228
2229         Reviewed by Carlos Garcia Campos.
2230
2231         When drawing the spin buttons, override the width of the input
2232         element to increment it with the width of the spin button.
2233         This ensures that we don't end up covering the input values with
2234         the spin buttons.
2235
2236         Do this also for user controlled styles, because most web authors
2237         won't test how their site renders on WebKitGTK+, and they will
2238         assume spin buttons in the order of 13 pixels wide (that is what
2239         most browsers use), but the GTK+ spin button is much wider (66 pixels).
2240
2241         Test: platform/gtk/fast/forms/number/number-size-spinbutton-nocover.html
2242
2243         * rendering/RenderTheme.cpp:
2244         (WebCore::RenderTheme::adjustStyle):
2245         * rendering/RenderThemeGtk.cpp:
2246         (WebCore::RenderThemeGtk::adjustTextFieldStyle): Call the theme's adjustTextFieldStyle() also for user controlled styles.
2247         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
2248
2249 2017-07-11  Youenn Fablet  <youenn@apple.com>
2250
2251         We should do ICE candidate filtering at the Document level
2252         https://bugs.webkit.org/show_bug.cgi?id=173861
2253         <rdar://problem/33122058>
2254
2255         Reviewed by Eric Carlson.
2256
2257         Tests: http/tests/webrtc/filtering-ice-candidate-cross-origin-frame.html
2258                http/tests/webrtc/filtering-ice-candidate-same-origin-frame.html
2259                http/tests/webrtc/filtering-ice-candidate-same-origin-frame2.html
2260                webrtc/filtering-ice-candidate-after-reload.html
2261
2262         Making UserMediaRequest disable the ICE candidate filtering for the page RTCController.
2263         All RTCPeerConnection of the page that are created on a document that are same-origin as the top document
2264         are now registered to the RTCController.
2265         This allows disabling filtering to only these RTCPeerConnection.
2266
2267         The page keeps the default ICE candidate filtering policy.
2268         This policy allows disabling ICE candidate filtering for all RTCPeerConnection.
2269
2270         When the top document is changing, the RTCController filtering policy is reset
2271         and its list of RTCPeerConnection is emptied.
2272
2273         Internals no longer disables ICE candidate filtering by default.
2274         This allows finer grained testing.
2275         ICE candidate filtering is disabled for tests including testharnessreport.js
2276         to enable web-platform-tests to run without modifications.
2277
2278         * Modules/mediastream/RTCController.cpp:
2279         (WebCore::RTCController::reset):
2280         * Modules/mediastream/RTCController.h:
2281         * Modules/mediastream/UserMediaRequest.cpp:
2282         (WebCore::UserMediaRequest::allow):
2283         * page/Frame.cpp:
2284         (WebCore::Frame::setDocument):
2285         * page/Page.cpp:
2286         (WebCore::Page::disableICECandidateFiltering):
2287         * page/Page.h:
2288         (WebCore::Page::shouldEnableICECandidateFilteringByDefault):
2289         (WebCore::Page::disableICECandidateFiltering): Deleted.
2290         (WebCore::Page::enableICECandidateFiltering): Deleted.
2291         (WebCore::Page::isICECandidateFilteringEnabled): Deleted.
2292         * testing/Internals.cpp:
2293         (WebCore::Internals::Internals):
2294         (WebCore::Internals::setICECandidateFiltering):
2295         (WebCore::Internals::setEnumeratingAllNetworkInterfacesEnabled):
2296         (WebCore::Internals::isICECandidateFilteringEnabled): Deleted.
2297         * testing/Internals.h:
2298         * testing/Internals.idl:
2299
2300 2017-07-11  Sergio Villar Senin  <svillar@igalia.com>
2301
2302         Unreviewed, rolling out r219325.
2303
2304         The test is still flaky
2305
2306         Reverted changeset:
2307
2308         "[SVG] Leak in SVGAnimatedListPropertyTearOff"
2309         https://bugs.webkit.org/show_bug.cgi?id=172545
2310         http://trac.webkit.org/changeset/219325
2311
2312 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
2313
2314         [SVG] Leak in SVGAnimatedListPropertyTearOff
2315         https://bugs.webkit.org/show_bug.cgi?id=172545
2316
2317         Reviewed by Said Abou-Hallawa.
2318
2319         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
2320         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
2321         reference to SVGAnimatedProperty.
2322
2323         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
2324         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
2325         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
2326         is going to be added to. This effectively creates a reference cycle between the
2327         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
2328
2329         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
2330
2331         * svg/properties/SVGAnimatedListPropertyTearOff.h:
2332
2333 2017-07-10  Simon Fraser  <simon.fraser@apple.com>
2334
2335         [WK2 iOS] REGRESSION (r216803) During momentum scroll, getBoundingClientRect returns wrong coordinates (missing images on pinterest, elle.com and many other sites)
2336         https://bugs.webkit.org/show_bug.cgi?id=174286
2337         rdar://problem/32864180
2338
2339         Reviewed by Dean Jackson.
2340
2341         r216803 made getBoundingClientRects relative to the layout viewport, but when scrolling we
2342         only update that on stable viewport updates (at the end of the scroll). This meant that during
2343         unstable updates, getBoundingClientRects() used a "frozen" viewport origin so things on-screen
2344         would appear to be off-screen, causing sites to fail to dynamically load images etc. when
2345         scrolling.
2346
2347         Fix by pushing an optional "unstable" layout viewport rect onto FrameView, which gets used by
2348         FrameView::documentToClientOffset(). This is cleared when we do a stable update.
2349
2350         This is a short-term solution. Longer term, I would prefer to always call setLayoutViewportOverrideRect(),
2351         but fix the scrolling tree logic to work correctly in this case.
2352
2353         Add a bit more scrolling logging.
2354
2355         Test: fast/visual-viewport/ios/get-bounding-client-rect-unstable.html
2356
2357         * page/FrameView.cpp:
2358         (WebCore::FrameView::setUnstableLayoutViewportRect):
2359         (WebCore::FrameView::documentToClientOffset):
2360         * page/FrameView.h:
2361         * page/scrolling/AsyncScrollingCoordinator.cpp:
2362         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
2363         * page/scrolling/ScrollingStateFixedNode.cpp:
2364         (WebCore::ScrollingStateFixedNode::updateConstraints):
2365         (WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect):
2366
2367 2017-07-10  John Wilander  <wilander@apple.com>
2368
2369         Resource Load Statistics: Prune statistics in orders of importance
2370         https://bugs.webkit.org/show_bug.cgi?id=174215
2371         <rdar://problem/33164403>
2372
2373         Reviewed by Chris Dumez.
2374
2375         Test: http/tests/loading/resourceLoadStatistics/prune-statistics.html
2376
2377         * loader/ResourceLoadObserver.cpp:
2378         (WebCore::reduceTimeResolution):
2379         (WebCore::ResourceLoadObserver::logFrameNavigation):
2380         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2381         (WebCore::ResourceLoadObserver::logWebSocketLoading):
2382         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2383             Now all set the new statistics field lastSeen.
2384         * loader/ResourceLoadStatistics.cpp:
2385         (WebCore::ResourceLoadStatistics::encode):
2386         (WebCore::ResourceLoadStatistics::decode):
2387         (WebCore::ResourceLoadStatistics::toString):
2388         (WebCore::ResourceLoadStatistics::merge):
2389             Handling of the new statistics field lastSeen.
2390         * loader/ResourceLoadStatistics.h:
2391
2392 2017-07-10  Devin Rousso  <drousso@apple.com>
2393
2394         Web Inspector: Highlight matching CSS canvas clients when hovering contexts in the Resources tab
2395         https://bugs.webkit.org/show_bug.cgi?id=174279
2396
2397         Reviewed by Matt Baker.
2398
2399         Test: inspector/dom/highlightNodeList.html
2400
2401         * inspector/InspectorDOMAgent.h:
2402         * inspector/InspectorDOMAgent.cpp:
2403         (WebCore::InspectorDOMAgent::highlightNodeList):
2404
2405 2017-07-10  Javier Fernandez  <jfernandez@igalia.com>
2406
2407         [css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved
2408         https://bugs.webkit.org/show_bug.cgi?id=172707
2409
2410         Reviewed by Antti Koivisto.
2411
2412         The CSS Box Alignment specification has been changed recently so that
2413         now all the propeties have the specificed value as computed value. The
2414         rationale of this change are at the associated W3C github issue [1].
2415
2416         This change implies that we don't need to execute the StyleAdjuter
2417         logic we implemented specifically for supporting 'auto' values
2418         resolution for computed style. We can live now with resolution at
2419         layout time only.
2420
2421         [1] https://github.com/w3c/csswg-drafts/issues/440
2422
2423         No new tests, just updating the already defined tests.
2424
2425         * css/CSSComputedStyleDeclaration.cpp:
2426         (WebCore::ComputedStyleExtractor::propertyValue):
2427         * css/StyleResolver.cpp:
2428         (WebCore::StyleResolver::adjustRenderStyle): Removed
2429         * css/StyleResolver.h:
2430         * html/shadow/TextControlInnerElements.cpp:
2431         (WebCore::TextControlInnerElement::resolveCustomStyle):
2432         * rendering/RenderBox.cpp:
2433         (WebCore::RenderBox::columnFlexItemHasStretchAlignment):
2434         (WebCore::RenderBox::hasStretchedLogicalWidth):
2435         * rendering/RenderFlexibleBox.cpp:
2436         (WebCore::RenderFlexibleBox::styleDidChange): Added
2437         (WebCore::RenderFlexibleBox::alignmentForChild):
2438         * rendering/RenderFlexibleBox.h:
2439
2440 2017-07-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2441
2442         [WK2] Ignore touch events that interrupt platform-driven momentum scrolling
2443         https://bugs.webkit.org/show_bug.cgi?id=174300
2444         <rdar://problem/33030639>
2445
2446         Reviewed by Simon Fraser.
2447
2448         See Source/WebKit2/ChangeLog for more detail.
2449
2450         Tests: fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-mainframe.html
2451                fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-overflow.html
2452                fast/events/ios/touch-events-during-scroll-deceleration-in-overflow.html
2453
2454         * page/scrolling/ScrollingTree.h:
2455         (WebCore::ScrollingTree::scrollingTreeNodeDidEndPanGesture):
2456
2457 2017-07-10  Jeremy Jones  <jeremyj@apple.com>
2458
2459         Captions and subtitles not showing up in picture-in-picture for MSE content
2460         https://bugs.webkit.org/show_bug.cgi?id=174317
2461         rdar://problem/33188591
2462
2463         Reviewed by Eric Carlson.
2464
2465         Reverts a regression created by r218403.
2466
2467         * html/shadow/MediaControlElements.cpp:
2468         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):
2469
2470 2017-07-10  Per Arne Vollan  <pvollan@apple.com>
2471
2472         [Win] Link error when building WTF from WTF.proj project file.
2473         https://bugs.webkit.org/show_bug.cgi?id=174316
2474         <rdar://problem/33178200>
2475
2476         Reviewed by Brent Fulgham.
2477
2478         WTF_CPU_X86 cmake variable needs to be set for link libraries directories to be correct.
2479
2480         * WebCore.vcxproj/WebCore.proj:
2481
2482 2017-07-10  Jeremy Jones  <jeremyj@apple.com>
2483
2484         media element handle adding source immediately before src.
2485         https://bugs.webkit.org/show_bug.cgi?id=174284
2486         rdar://problem/33115439
2487
2488         Reviewed by David Kilzer.
2489
2490         Test: media/video-source-before-src.html
2491
2492         Adding a source causes a selectMediaResource block to be enqueued.
2493         If dataLoadingPermitted prevents creating the m_player but sets the srcAttr, then
2494         the enqueued selectMediaResource will be in a bad state, with a srcAttr but no m_player.
2495
2496         This fix prevents selectMediaResource from being called, if data loading is not permitted
2497         when adding a source element, to match how it prevents player creation when setting srcAttr.
2498
2499         This fix also adds a debug assert to catch the problem earlier and adds an early return to
2500         prevent the crash in release builds.
2501
2502         * html/HTMLMediaElement.cpp:
2503         (WebCore::HTMLMediaElement::selectMediaResource):
2504         (WebCore::HTMLMediaElement::sourceWasAdded):
2505
2506 2017-07-10  Megan Gardner  <megan_gardner@apple.com>
2507
2508         Add location to NavigationActionData
2509         https://bugs.webkit.org/show_bug.cgi?id=174233
2510         <rdar://problem/29165518>
2511
2512         Reviewed by Simon Fraser.
2513         
2514         Add the root view location of a tap to a NavigationAction to vend to Safari.
2515
2516         Test: small enough change to not be tested alone.
2517
2518         * dom/MouseRelatedEvent.cpp:
2519         (WebCore::MouseRelatedEvent::absoluteLocationConvertedToRootView):
2520         * dom/MouseRelatedEvent.h:
2521
2522 2017-07-10  Sam Weinig  <sam@webkit.org>
2523
2524         [WebIDL] Move plugin object customization into the generator
2525         https://bugs.webkit.org/show_bug.cgi?id=174238
2526
2527         Reviewed by Chris Dumez.
2528
2529         - Added [Plugin] extended attribute to forward the necessary hooks
2530           for get/set/delete to the plugin code.
2531         - Removed [CustomNamedSetter] and replaced it's remaining uses
2532           [CustomPut] (formally called [CustomPutFunction]).
2533         - Renamed [CustomNamedGetterOnPrototype] to [CustomPutOnPrototype]
2534           because that is actually what it does.
2535         - Removed [CustomGetOwnPropertySlotByIndex] and made 
2536           [CustomGetOwnPropertySlot] imply it, as the other custom hooks
2537           do.
2538         - Renamed [CustomEnumerateProperty] to [CustomGetOwnPropertyNames]
2539           to conform with other attribute names.
2540         - Renamed [CustomCall] to [CustomGetCallData] to conform with other 
2541           attribute names.
2542
2543         * CMakeLists.txt:
2544         * WebCore.xcodeproj/project.pbxproj:
2545         * bindings/js/JSBindingsAllInOne.cpp:
2546         * bindings/js/JSHTMLAppletElementCustom.cpp: Removed.
2547         * bindings/js/JSHTMLEmbedElementCustom.cpp: Removed.
2548         * bindings/js/JSHTMLObjectElementCustom.cpp: Removed.
2549         Remove custom bindings.
2550
2551         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2552         (WebCore::putCommon):
2553         (WebCore::JSCSSStyleDeclaration::put):
2554         (WebCore::JSCSSStyleDeclaration::putByIndex):
2555         (WebCore::JSCSSStyleDeclaration::putDelegate): Deleted.
2556         Use [CustomPut] rather than [CustomNamedSetter] to allow us
2557         to get rid of [CustomNamedSetter]. Reuse put delegate as
2558         common code to share between put and putByIndex.
2559
2560         * bindings/js/JSLocationCustom.cpp:
2561         (WebCore::getOwnPropertySlotCommon):
2562         (WebCore::JSLocation::getOwnPropertySlot):
2563         (WebCore::JSLocation::getOwnPropertySlotByIndex):
2564         Replace [CustomGetOwnPropertySlotAndDescriptor] with [CustomGetOwnPropertySlot]
2565         which is more clear and reduces the number of variants of this hook override
2566         we need.
2567
2568         (WebCore::putCommon):
2569         (WebCore::JSLocation::put):
2570         (WebCore::JSLocation::putByIndex):
2571         Use [CustomPut] rather than [CustomNamedSetter] to allow us
2572         to get rid of [CustomNamedSetter]. Reuse put delegate as
2573         common code to share between put and putByIndex.
2574
2575         (WebCore::JSLocationPrototype::put):
2576         [CustomPutOnPrototype] (which weirdly used incorrectly be called 
2577         [CustomNamedGetterOnPrototype]) now works like [CustomPut] meaning
2578         you need to call Base.
2579
2580         * bindings/js/JSPluginElementFunctions.cpp:
2581         (WebCore::pluginElementPropertyGetter):
2582         (WebCore::pluginElementCustomGetOwnPropertySlot):
2583         (WebCore::pluginElementCustomPut):
2584         * bindings/js/JSPluginElementFunctions.h:
2585         (WebCore::pluginElementCustomGetOwnPropertySlot): Deleted.
2586         Remove templatized pluginElementCustomGetOwnPropertySlot, which was 
2587         completely unnecessary and merge its functionality into the out of
2588         line overload. Remove pluginElementPropertyGetter from the header,
2589         since it is only used in implementation, and unify the naming and
2590         argument position (JSHTMLElement* comes first) of the hooks.
2591
2592         * bindings/scripts/CodeGeneratorJS.pm:
2593         (GenerateIndexedGetter):
2594         (GenerateNamedGetter):
2595         (GenerateGetOwnPropertySlot):
2596         (GenerateGetOwnPropertySlotByIndex):
2597         (GenerateGetOwnPropertyNames):
2598         (GeneratePut):
2599         (GeneratePutByIndex):
2600         (GenerateDeleteProperty):
2601         (GenerateDeletePropertyByIndex):
2602         (GenerateNamedDeleterDefinition):
2603         (InstanceOverridesGetOwnPropertySlot):
2604         (InstanceOverridesGetOwnPropertyNames):
2605         (InstanceOverridesPut):
2606         (InstanceOverridesDeleteProperty):
2607         (GenerateHeader):
2608         (GenerateImplementation):
2609         (GenerateGetCallData):
2610         (GeneratePluginCall):
2611         (GenerateLegacyCallerDefinitions):
2612         (GenerateLegacyCallerDefinition):
2613         (GeneratePrototypeDeclaration):
2614         (InstanceOverridesGetCallData):
2615         (HeaderNeedsPrototypeDeclaration):
2616         - Add support for [Plugin]
2617         - Remove support for [CustomNamedSetter]
2618         - Replace [CustomGetOwnPropertySlotByIndex] with [CustomGetOwnPropertySlot]
2619         - Replace [CustomEnumerateProperty] with [CustomGetOwnPropertyNames]
2620         - Replace [CustomPutFunction] with [CustomPut].
2621         - Make subroutine names more consistent (remove a few Definition suffixes)
2622
2623         * bindings/scripts/IDLAttributes.json:
2624         Update for new / removed attributes.
2625
2626         * bindings/scripts/test/JS/JSTestInterface.cpp:
2627         * bindings/scripts/test/JS/JSTestInterface.h:
2628         * bindings/scripts/test/JS/JSTestPluginInterface.cpp: Added.
2629         * bindings/scripts/test/JS/JSTestPluginInterface.h: Added.
2630         * bindings/scripts/test/TestInterface.idl:
2631         * bindings/scripts/test/TestPluginInterface.idl: Added.
2632         Update / add tests.
2633
2634         * css/CSSStyleDeclaration.idl:
2635         * html/HTMLAppletElement.idl:
2636         * html/HTMLEmbedElement.idl:
2637         * html/HTMLObjectElement.idl:
2638         * page/DOMWindow.idl:
2639         * page/Location.idl:
2640         * storage/Storage.idl:
2641         Update for new / renamed attributes.
2642
2643 2017-07-03  Brian Burg  <bburg@apple.com>
2644
2645         Web Replay: remove some unused code
2646         https://bugs.webkit.org/show_bug.cgi?id=173903
2647
2648         Rubber-stamped by Joseph Pecoraro.
2649
2650         * CMakeLists.txt:
2651         * Configurations/FeatureDefines.xcconfig:
2652         * DerivedSources.make:
2653         * PlatformMac.cmake:
2654         * WebCore.xcodeproj/project.pbxproj:
2655         * dom/Document.cpp:
2656         (WebCore::Document::Document):
2657         (WebCore::Document::lastModified):
2658         (WebCore::Document::inputCursor): Deleted.
2659         (WebCore::Document::setInputCursor): Deleted.
2660         * dom/Document.h:
2661         * inspector/InspectorController.cpp:
2662         (WebCore::InspectorController::InspectorController):
2663         * inspector/InspectorInstrumentation.cpp:
2664         (WebCore::InspectorInstrumentation::willDispatchEventImpl):
2665         (WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl):
2666         (WebCore::InspectorInstrumentation::frameDetachedFromParentImpl):
2667         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
2668         (WebCore::InspectorInstrumentation::sessionCreatedImpl): Deleted.
2669         (WebCore::InspectorInstrumentation::sessionLoadedImpl): Deleted.
2670         (WebCore::InspectorInstrumentation::sessionModifiedImpl): Deleted.
2671         (WebCore::InspectorInstrumentation::segmentCreatedImpl): Deleted.
2672         (WebCore::InspectorInstrumentation::segmentCompletedImpl): Deleted.
2673         (WebCore::InspectorInstrumentation::segmentLoadedImpl): Deleted.
2674         (WebCore::InspectorInstrumentation::segmentUnloadedImpl): Deleted.
2675         (WebCore::InspectorInstrumentation::captureStartedImpl): Deleted.
2676         (WebCore::InspectorInstrumentation::captureStoppedImpl): Deleted.
2677         (WebCore::InspectorInstrumentation::playbackStartedImpl): Deleted.
2678         (WebCore::InspectorInstrumentation::playbackPausedImpl): Deleted.
2679         (WebCore::InspectorInstrumentation::playbackHitPositionImpl): Deleted.
2680         (WebCore::InspectorInstrumentation::playbackFinishedImpl): Deleted.
2681         (WebCore::InspectorInstrumentation::replayAgentEnabled): Deleted.
2682         * inspector/InspectorInstrumentation.h:
2683         (WebCore::InspectorInstrumentation::sessionCreated): Deleted.
2684         (WebCore::InspectorInstrumentation::sessionLoaded): Deleted.
2685         (WebCore::InspectorInstrumentation::sessionModified): Deleted.
2686         (WebCore::InspectorInstrumentation::segmentCreated): Deleted.
2687         (WebCore::InspectorInstrumentation::segmentCompleted): Deleted.
2688         (WebCore::InspectorInstrumentation::segmentLoaded): Deleted.
2689         (WebCore::InspectorInstrumentation::segmentUnloaded): Deleted.
2690         (WebCore::InspectorInstrumentation::captureStarted): Deleted.
2691         (WebCore::InspectorInstrumentation::captureStopped): Deleted.
2692         (WebCore::InspectorInstrumentation::playbackStarted): Deleted.
2693         (WebCore::InspectorInstrumentation::playbackPaused): Deleted.
2694         (WebCore::InspectorInstrumentation::playbackFinished): Deleted.
2695         (WebCore::InspectorInstrumentation::playbackHitPosition): Deleted.
2696         * inspector/InspectorReplayAgent.cpp: Removed.
2697         * inspector/InspectorReplayAgent.h: Removed.
2698         * inspector/InstrumentingAgents.cpp:
2699         (WebCore::InstrumentingAgents::reset):
2700         * inspector/InstrumentingAgents.h:
2701         (WebCore::InstrumentingAgents::inspectorReplayAgent): Deleted.
2702         (WebCore::InstrumentingAgents::setInspectorReplayAgent): Deleted.
2703         * page/EventHandler.h:
2704         * page/Page.cpp:
2705         (WebCore::Page::Page):
2706         * page/Page.h:
2707         (WebCore::Page::replayController): Deleted.
2708         * page/scrolling/ScrollingCoordinator.cpp:
2709         (WebCore::ScrollingCoordinator::synchronousScrollingReasons):
2710         (WebCore::ScrollingCoordinator::replaySessionStateDidChange): Deleted.
2711         * page/scrolling/ScrollingCoordinator.h:
2712         * platform/Logging.h:
2713         * plugins/DOMMimeTypeArray.cpp:
2714         (WebCore::DOMMimeTypeArray::getPluginData):
2715         * plugins/DOMPluginArray.cpp:
2716         (WebCore::DOMPluginArray::pluginData):
2717         * replay/AllReplayInputs.h: Removed.
2718         * replay/CapturingInputCursor.cpp: Removed.
2719         * replay/CapturingInputCursor.h: Removed.
2720         * replay/EventLoopInput.cpp: Removed.
2721         * replay/EventLoopInput.h: Removed.
2722         * replay/EventLoopInputDispatcher.cpp: Removed.
2723         * replay/EventLoopInputDispatcher.h: Removed.
2724         * replay/FunctorInputCursor.h: Removed.
2725         * replay/MemoizedDOMResult.cpp: Removed.
2726         * replay/MemoizedDOMResult.h: Removed.
2727         * replay/ReplayController.cpp: Removed.
2728         * replay/ReplayController.h: Removed.
2729         * replay/ReplayInputCreationMethods.cpp: Removed.
2730         * replay/ReplayInputDispatchMethods.cpp: Removed.
2731         * replay/ReplaySession.cpp: Removed.
2732         * replay/ReplaySession.h: Removed.
2733         * replay/ReplaySessionSegment.cpp: Removed.
2734         * replay/ReplaySessionSegment.h: Removed.
2735         * replay/ReplayingInputCursor.cpp: Removed.
2736         * replay/ReplayingInputCursor.h: Removed.
2737         * replay/SegmentedInputStorage.cpp: Removed.
2738         * replay/SegmentedInputStorage.h: Removed.
2739         * replay/SerializationMethods.cpp: Removed.
2740         * replay/SerializationMethods.h: Removed.
2741         * replay/WebInputs.json: Removed.
2742
2743 2017-07-10  Brady Eidson  <beidson@apple.com>
2744
2745         Cleanup lifetime issues of UniqueIDBDatabase and IDBBackingStore.
2746         <rdar://problem/32908525> and https://bugs.webkit.org/show_bug.cgi?id=174244
2747
2748         Reviewed by David Kilzer and Alex Christensen. 
2749
2750         No targeted test possible, implicitly covered by all IDB tests.
2751
2752         The original idea behind UniqueIDBDatabase lifetime was that they are ThreadSafeRefCounted and
2753         we take protector Refs when any operation that needs it alive is in flight.
2754         
2755         This added variability to their lifetime which made it difficult to enforce a few different 
2756         design invariants, namely:
2757             - UniqueIBDDatabase objects are always created and destroyed only on the main thread.
2758             - IDBBackingStore objects are always created and destroyed only on the database thread.
2759         
2760         This patch removes the ref counting and instead ties UniqueIDBDatabase lifetime to a
2761         std::unique_ptr that is owned by the IDBServer.
2762         
2763         Whenever any operations on the UniqueIDBDatabase are in flight it is kept alive by virtue
2764         of that unique_ptr in the IDBServer. Once a UniqueIDBDatabase is completely done with all of
2765         its work, the following happens:
2766             - On the main thread the IDBServer removes the unique_ptr owning the UniqueIDBDatabase
2767               from its map.
2768             - It hands the unique_ptr to the UniqueIDBDatabase itself, which schedules one final 
2769               database thread task.
2770             - That database thread task is to destroy the IDBBackingStore, kill its message queues,
2771               and then message back to the main thread for one final task.
2772             - That main thread task is to release the unique_ptr, resulting in destruction of the
2773               UniqueIDBDatabase object.
2774         
2775         This is safe, predictable, solves the lifetime issues that r218516 originally tried to solve,
2776         and solves the lifetime issues that r218516 introduced.
2777
2778         (This patch also adds many more assertions to cover various design invariants throughout the
2779         lifecycle of a particular UniqueIDBDatabase)
2780
2781         ASSERT that IDBBackingStores are only ever created and destroyed on the background thread:
2782         * Modules/indexeddb/server/IDBBackingStore.h:
2783         (WebCore::IDBServer::IDBBackingStore::~IDBBackingStore):
2784         (WebCore::IDBServer::IDBBackingStore::IDBBackingStore):
2785         
2786         Transition UniqueIDBDatabase ownership from a RefPtr to a std::unique_ptr:
2787         * Modules/indexeddb/server/IDBServer.cpp:
2788         (WebCore::IDBServer::IDBServer::getOrCreateUniqueIDBDatabase):
2789         (WebCore::IDBServer::IDBServer::closeAndTakeUniqueIDBDatabase):
2790         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
2791         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
2792         (WebCore::IDBServer::IDBServer::closeUniqueIDBDatabase): Deleted.
2793         * Modules/indexeddb/server/IDBServer.h:
2794         
2795         Make all the other changes mentioned above:
2796         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2797         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase): Bulk up on ASSERTs
2798         (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection): 
2799         (WebCore::IDBServer::UniqueIDBDatabase::performUnconditionalDeleteBackingStore):
2800         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
2801         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
2802         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
2803         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
2804         (WebCore::IDBServer::UniqueIDBDatabase::handleCurrentOperation):
2805         (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
2806         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
2807         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
2808         (WebCore::IDBServer::UniqueIDBDatabase::activateTransactionInBackingStore):
2809         (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
2810         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
2811         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
2812         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask):
2813         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply):
2814         (WebCore::IDBServer::UniqueIDBDatabase::maybeFinishHardClose):
2815         (WebCore::IDBServer::UniqueIDBDatabase::isDoneWithHardClose):
2816         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
2817         (WebCore::IDBServer::UniqueIDBDatabase::didPerformUnconditionalDeleteBackingStore): Deleted.
2818         * Modules/indexeddb/server/UniqueIDBDatabase.h:
2819         (WebCore::IDBServer::UniqueIDBDatabase::create): Deleted.
2820
2821 2017-07-10  Chris Dumez  <cdumez@apple.com>
2822
2823         Further WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore clean up
2824         https://bugs.webkit.org/show_bug.cgi?id=174301
2825
2826         Reviewed by Brent Fulgham.
2827
2828         Moved some generic file system utility functions down to platform's FileSystem.h.
2829
2830         * platform/FileSystem.cpp:
2831         (WebCore::openAndLockFile):
2832         (WebCore::unlockAndCloseFile):
2833         * platform/FileSystem.h:
2834
2835 2017-07-10  Andreas Kling  <akling@apple.com>
2836
2837         REGRESSION(r210226): Keyboard-focused element not preserved when navigating back through page cache, causing multiple elements to have focus
2838         https://bugs.webkit.org/show_bug.cgi?id=174302
2839         <rdar://problem/33204273>
2840
2841         Reviewed by Antti Koivisto.
2842
2843         Don't clear the active/hovered/focused elements when destroying the render tree,
2844         since we might need to reconstruct it later, and would like to remember which
2845         elements those were.
2846
2847         Only the focused state actually stuck when going in and out of the page cache,
2848         but this patch removes all the element pointer clearing for consistency.
2849
2850         Test: fast/history/page-cache-element-state-focused.html
2851
2852         * dom/Document.cpp:
2853         (WebCore::Document::destroyRenderTree):
2854
2855 2017-07-10  Daniel Bates  <dabates@apple.com>
2856
2857         REGRESSION (r218616): Cannot build WebCore for macOS 10.12 with macOS 10.13 SDK
2858         https://bugs.webkit.org/show_bug.cgi?id=173939
2859
2860         Reviewed by Dan Bernstein.
2861
2862         (The code in this change was either suggested or written by Dan Bernstein with a very
2863         minor adjustment to get it to build).
2864
2865         Allow WebCore to link even though CTFontCreatePhysicalFontForCharactersWithLanguage() is
2866         undefined when building against the macOS 10.13 SDK targeting macOS 10.12. Let the dynamic
2867         linker resolve the undefined symbol.
2868
2869         For completeness the SPI CTFontCreatePhysicalFontForCharactersWithLanguage() was removed
2870         from the macOS 10.13 SDK.
2871
2872         * Configurations/WebCore.xcconfig: Tell the linker that CTFontCreatePhysicalFontForCharactersWithLanguage()
2873         can be undefined when building against macOS 10.13 or later SDK.
2874         * platform/spi/cocoa/CoreTextSPI.h: Annotate CTFontCreatePhysicalFontForCharactersWithLanguage()
2875         with its availability information.
2876
2877 2017-07-10  Zalan Bujtas  <zalan@apple.com>
2878
2879         Block of text is missing in iBooks sample books.
2880         https://bugs.webkit.org/show_bug.cgi?id=174295
2881         <rdar://problem/32955620>
2882
2883         Reviewed by Antti Koivisto.
2884
2885         In the simple line layout context, translating y coordinate to a line index is
2886         normally just a (y / line height) operation. However in case of strut offsets (pagination)
2887         we need to take these extra paddings into account while resolving the line index.
2888         This patch fixes the boundary checking for a given line by using the font size only
2889         when the font is taller than the line.
2890
2891         * rendering/SimpleLineLayoutResolver.cpp:
2892         (WebCore::SimpleLineLayout::RunResolver::adjustLineIndexForStruts):
2893
2894 2017-07-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2895
2896         [SOUP] SoupCookieJar is never released (resulting in sqlite temp files lying around)
2897         https://bugs.webkit.org/show_bug.cgi?id=166029
2898
2899         Reviewed by Michael Catanzaro.
2900
2901         Add clearSoupNetworkSessionAndCookieStorage() to clear the SoupNetworkSession and cookie storage of the main
2902         network session, ensuring the cookies database is properly closed.
2903
2904         * platform/network/NetworkStorageSession.h:
2905         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2906         (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage):
2907
2908 2017-07-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2909
2910         Move make-js-file-arrays.py from WebCore to JavaScriptCore
2911         https://bugs.webkit.org/show_bug.cgi?id=174024
2912
2913         Reviewed by Michael Catanzaro.
2914
2915         * CMakeLists.txt: Explicitly add files generated by MAKE_JS_FILE_ARRAYS to the build, since the macro no longer
2916         does it.
2917         * DerivedSources.make: Updated to use make-js-file-arrays.py from JavaScriptCore. It's no longer needed to set
2918         PYTHON_PATH to find jsmin.py.
2919
2920 2017-07-10  Charlie Turner  <cturner@igalia.com>
2921
2922         [GTK] http/tests/media/video-redirect.html is failing
2923         https://bugs.webkit.org/show_bug.cgi?id=174260
2924
2925         Reviewed by Carlos Garcia Campos.
2926
2927         Make sure we're testing new URLs within the same security origin.
2928
2929         Covered by existing tests.
2930
2931         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2932         (WebCore::convertToInternalProtocol): Factor out setting our
2933         internal URL schema.
2934         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Use the
2935         refactored helper.
2936         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Use
2937         refactored helper to ensure both URLs have the same origin.
2938
2939 2017-07-08  John Wilander  <wilander@apple.com>
2940
2941         Resource Load Statistics: User interaction should always go to top document
2942         https://bugs.webkit.org/show_bug.cgi?id=174120
2943         <rdar://problem/33117899>
2944
2945         Reviewed by Chris Dumez.
2946
2947         Test: http/tests/loading/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame.html
2948
2949         * dom/UserGestureIndicator.cpp:
2950         (WebCore::UserGestureIndicator::UserGestureIndicator):
2951             Now logs user interaction for the top document.
2952         * loader/ResourceLoadObserver.cpp:
2953         (WebCore::ResourceLoadObserver::setThrottledObserverNotifications):
2954             Test infrastructure.
2955         (WebCore::ResourceLoadObserver::setNotificationCallback):
2956             Callback now takes a ResourceLoadObserver::NotificationType.
2957         (WebCore::ResourceLoadObserver::logFrameNavigation):
2958             Submits the configured ResourceLoadObserver::NotificationType.
2959         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2960             Submits the configured ResourceLoadObserver::NotificationType.
2961         (WebCore::ResourceLoadObserver::logWebSocketLoading):
2962             Submits the configured ResourceLoadObserver::NotificationType.
2963         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2964             Submits the configured ResourceLoadObserver::NotificationType.
2965         * loader/ResourceLoadObserver.h:
2966         * testing/Internals.cpp:
2967         (WebCore::Internals::resetToConsistentState):
2968             Resets to throttled notifications.
2969         (WebCore::Internals::setResourceLoadStatisticsThrottledObserverNotifications):
2970             Test infrastructure.
2971         * testing/Internals.h:
2972         * testing/Internals.idl:
2973             Added internals.setResourceLoadStatisticsThrottledObserverNotifications().
2974
2975 2017-07-09  Brady Eidson  <beidson@apple.com>
2976
2977         Remove some obsolete WebKitVersionChecks.
2978         https://bugs.webkit.org/show_bug.cgi?id=174294
2979
2980         Reviewed by Dan Bernstein.
2981
2982         No new tests (No change to testable behavior)
2983
2984         * dom/ScriptExecutionContext.cpp:
2985         (WebCore::ScriptExecutionContext::dispatchErrorEvent):
2986         
2987         * page/Settings.in:
2988         
2989         * platform/RuntimeApplicationChecks.h:
2990         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2991         (WebCore::IOSApplication::isOkCupid): Deleted.
2992         (WebCore::IOSApplication::isFacebook): Deleted.
2993         
2994         * rendering/RenderBox.cpp:
2995         (WebCore::RenderBox::layoutOverflowRectForPropagation):
2996
2997 2017-07-08  Brady Eidson  <beidson@apple.com>
2998
2999         Remove some obsolete RuntimeApplicationChecks.
3000         https://bugs.webkit.org/show_bug.cgi?id=174293
3001
3002         Reviewed by Dan Bernstein.
3003
3004         No new tests (No change to testable behavior)
3005
3006         * html/HTMLObjectElement.cpp:
3007         (WebCore::HTMLObjectElement::parametersForPlugin):
3008         (WebCore::shouldNotPerformURLAdjustment): Deleted.
3009
3010         * platform/RuntimeApplicationChecks.h:
3011         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
3012         (WebCore::IOSApplication::isDaijisenDictionary): Deleted.
3013         (WebCore::IOSApplication::isNASAHD): Deleted.
3014         (WebCore::IOSApplication::isTheEconomistOnIphone): Deleted.
3015
3016         * platform/ios/wak/WebCoreThread.h:
3017         * platform/ios/wak/WebCoreThread.mm:
3018         (StartWebThread):
3019         (WebThreadSetDelegateSourceRunLoopMode): Deleted.
3020
3021 2017-07-08  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3022
3023         [Curl] Safe access and life cycle management of bare Curl handle
3024         by wrapping with C++ class
3025         https://bugs.webkit.org/show_bug.cgi?id=174002
3026
3027         Reviewed by Alex Christensen.
3028
3029         * platform/network/ResourceHandle.h:
3030         * platform/network/ResourceHandleInternal.h:
3031         * platform/network/curl/CookieJarCurl.cpp:
3032         (WebCore::setCookiesFromDOM):
3033         (WebCore::cookiesForSession):
3034         * platform/network/curl/CurlContext.cpp:
3035         (WebCore::CurlContext::CurlContext):
3036         (WebCore::CurlContext::~CurlContext):
3037         (WebCore::CurlContext::initCookieSession):
3038         (WebCore::CurlShareHandle::CurlShareHandle):
3039         (WebCore::CurlShareHandle::~CurlShareHandle):
3040         (WebCore::CurlShareHandle::lockCallback):
3041         (WebCore::CurlShareHandle::unlockCallback):
3042         (WebCore::CurlShareHandle::mutexFor):
3043         (WebCore::CurlMultiHandle::CurlMultiHandle):
3044         (WebCore::CurlMultiHandle::~CurlMultiHandle):
3045         (WebCore::CurlMultiHandle::addHandle):
3046         (WebCore::CurlMultiHandle::removeHandle):
3047         (WebCore::CurlMultiHandle::getFdSet):
3048         (WebCore::CurlMultiHandle::perform):
3049         (WebCore::CurlMultiHandle::readInfo):
3050         (WebCore::CurlHandle::CurlHandle):
3051         (WebCore::CurlHandle::~CurlHandle):
3052         (WebCore::CurlHandle::perform):
3053         (WebCore::CurlHandle::pause):
3054         (WebCore::CurlHandle::enableShareHandle):
3055         (WebCore::CurlHandle::setPrivateData):
3056         (WebCore::CurlHandle::setUrl):
3057         (WebCore::CurlHandle::clearUrl):
3058         (WebCore::CurlHandle::clearRequestHeaders):
3059         (WebCore::CurlHandle::appendRequestHeader):
3060         (WebCore::CurlHandle::enableRequestHeaders):
3061         (WebCore::CurlHandle::enableHttpGetRequest):
3062         (WebCore::CurlHandle::enableHttpHeadRequest):
3063         (WebCore::CurlHandle::enableHttpPostRequest):
3064         (WebCore::CurlHandle::setPostFields):
3065         (WebCore::CurlHandle::setPostFieldLarge):
3066         (WebCore::CurlHandle::enableHttpPutRequest):
3067         (WebCore::CurlHandle::setInFileSizeLarge):
3068         (WebCore::CurlHandle::setHttpCustomRequest):
3069         (WebCore::CurlHandle::enableAcceptEncoding):
3070         (WebCore::CurlHandle::enableAllowedProtocols):
3071         (WebCore::CurlHandle::enableFollowLocation):
3072         (WebCore::CurlHandle::enableAutoReferer):
3073         (WebCore::CurlHandle::enableHttpAuthentication):
3074         (WebCore::CurlHandle::setHttpAuthUserPass):
3075         (WebCore::CurlHandle::enableCAInfoIfExists):
3076         (WebCore::CurlHandle::setSslVerifyPeer):
3077         (WebCore::CurlHandle::setSslVerifyHost):
3078         (WebCore::CurlHandle::setSslCert):
3079         (WebCore::CurlHandle::setSslCertType):
3080         (WebCore::CurlHandle::setSslKeyPassword):
3081         (WebCore::CurlHandle::enableCookieJarIfExists):
3082         (WebCore::CurlHandle::setCookieList):
3083         (WebCore::CurlHandle::getCookieList):
3084         (WebCore::CurlHandle::clearCookieList):
3085         (WebCore::CurlHandle::enableProxyIfExists):
3086         (WebCore::CurlHandle::enableTimeout):
3087         (WebCore::CurlHandle::setHeaderCallbackFunction):
3088         (WebCore::CurlHandle::setWriteCallbackFunction):
3089         (WebCore::CurlHandle::setReadCallbackFunction):
3090         (WebCore::CurlHandle::setSslCtxCallbackFunction):
3091         (WebCore::CurlHandle::getEffectiveURL):
3092         (WebCore::CurlHandle::getPrimaryPort):
3093         (WebCore::CurlHandle::getResponseCode):
3094         (WebCore::CurlHandle::getContentLenghtDownload):
3095         (WebCore::CurlHandle::getHttpAuthAvail):
3096         (WebCore::CurlHandle::getTimes):
3097         (WebCore::CurlHandle::maxCurlOffT):
3098         (WebCore::CurlHandle::expectedSizeOfCurlOffT):
3099         (WebCore::CurlHandle::enableVerboseIfUsed):
3100         (WebCore::CurlHandle::enableStdErrIfUsed):
3101         (WebCore::CurlContext::getEffectiveURL): Deleted.
3102         (WebCore::CurlContext::createMultiHandle): Deleted.
3103         (WebCore::CurlContext::mutexFor): Deleted.
3104         (WebCore::CurlContext::lock): Deleted.
3105         (WebCore::CurlContext::unlock): Deleted.
3106         * platform/network/curl/CurlContext.h:
3107         (WebCore::CurlGlobal::CurlGlobal):
3108         (WebCore::CurlGlobal::~CurlGlobal):
3109         (WebCore::CurlShareHandle::handle):
3110         (WebCore::CurlContext::shareHandle):
3111         (WebCore::CurlHandle::handle):
3112         (WebCore::CurlHandle::url):
3113         (WebCore::CurlContext::curlShareHandle): Deleted.
3114         * platform/network/curl/CurlDownload.cpp:
3115         (WebCore::CurlDownload::~CurlDownload):
3116         (WebCore::CurlDownload::init):
3117         (WebCore::CurlDownload::start):
3118         (WebCore::CurlDownload::cancel):
3119         (WebCore::CurlDownload::getUrl):
3120         (WebCore::CurlDownload::addHeaders):
3121         (WebCore::CurlDownload::didReceiveHeader):
3122         (WebCore::CurlDownload::writeCallback):
3123         * platform/network/curl/CurlDownload.h:
3124         * platform/network/curl/CurlJobManager.cpp:
3125         (WebCore::CurlJobManager::CurlJobManager):
3126         (WebCore::CurlJobManager::~CurlJobManager):
3127         (WebCore::CurlJobManager::addToCurl):
3128         (WebCore::CurlJobManager::removeFromCurl):
3129         (WebCore::CurlJobManager::workerThread):
3130         * platform/network/curl/CurlJobManager.h:
3131         (WebCore::CurlJobManager::getMultiHandle): Deleted.
3132         * platform/network/curl/ResourceHandleCurl.cpp:
3133         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
3134         (WebCore::ResourceHandle::platformSetDefersLoading):
3135         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
3136         (WebCore::ResourceHandle::receivedCredential):
3137         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
3138         (WebCore::calculateWebTimingInformations):
3139         (WebCore::handleLocalReceiveResponse):
3140         (WebCore::writeCallback):
3141         (WebCore::getProtectionSpace):
3142         (WebCore::headerCallback):
3143         (WebCore::readCallback):
3144         (WebCore::setupFormData):
3145         (WebCore::ResourceHandle::setupPUT):
3146         (WebCore::ResourceHandle::setupPOST):
3147         (WebCore::ResourceHandle::dispatchSynchronousJob):
3148         (WebCore::ResourceHandle::applyAuthentication):
3149         (WebCore::ResourceHandle::initialize):
3150         (WebCore::ResourceHandle::handleCurlMsg):
3151         * platform/network/curl/ResourceHandleManager.cpp:
3152         (WebCore::ResourceHandleManager::ResourceHandleManager):
3153         (WebCore::ResourceHandleManager::~ResourceHandleManager):
3154         (WebCore::ResourceHandleManager::downloadTimerCallback):
3155         (WebCore::ResourceHandleManager::removeFromCurl):
3156         (WebCore::ResourceHandleManager::startJob):
3157         * platform/network/curl/ResourceHandleManager.h:
3158         * platform/network/curl/SSLHandle.cpp:
3159         (WebCore::setSSLClientCertificate):
3160         (WebCore::certVerifyCallback):
3161         (WebCore::setSSLVerifyOptions):
3162
3163 2017-07-08  Antoine Quint  <graouts@apple.com>
3164
3165         REGRESSION: "visibility:hidden" does not hide play button for video elements
3166         https://bugs.webkit.org/show_bug.cgi?id=174258
3167         <rdar://problem/33181452>
3168
3169         Reviewed by Dean Jackson.
3170
3171         In order to not have most styles from the page affect the shadow root, we set "all: initial" on the
3172         media controls container. However, we need to still make the "visibility" property inherit from its
3173         host such that "visibility: hidden" on the host won't be overridden by setting the property back to
3174         its initial value, which is "visible".
3175
3176         Test: media/modern-media-controls/css/visibility-hidden.html
3177
3178         * Modules/modern-media-controls/controls/media-controls.css:
3179         (.media-controls-container):
3180
3181 2017-07-08  Yusuke Suzuki  <utatane.tea@gmail.com>
3182
3183         Drop NOSNIFF compile flag
3184         https://bugs.webkit.org/show_bug.cgi?id=174289
3185
3186         Reviewed by Michael Catanzaro.
3187
3188         * Configurations/FeatureDefines.xcconfig:
3189         * css/StyleSheetContents.cpp:
3190         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
3191         (WebCore::StyleSheetContents::notifyLoadedSheet):
3192         * dom/LoadableClassicScript.cpp:
3193         (WebCore::LoadableClassicScript::notifyFinished):
3194         * loader/cache/CachedCSSStyleSheet.cpp:
3195         (WebCore::CachedCSSStyleSheet::mimeTypeAllowedByNosniff):
3196         (WebCore::CachedCSSStyleSheet::canUseSheet):
3197         * loader/cache/CachedCSSStyleSheet.h:
3198         * platform/network/HTTPParsers.cpp:
3199         (WebCore::parseContentTypeOptionsHeader):
3200         * platform/network/HTTPParsers.h:
3201         * platform/network/ResourceResponseBase.cpp:
3202         (WebCore::isScriptAllowedByNosniff):
3203         * platform/network/ResourceResponseBase.h:
3204         * workers/WorkerScriptLoader.cpp:
3205         (WebCore::WorkerScriptLoader::didReceiveResponse):
3206
3207 2017-07-07  Brent Fulgham  <bfulgham@apple.com>
3208
3209         [WK2] Use a rolling 30-day uptime for processing statistics
3210         https://bugs.webkit.org/show_bug.cgi?id=174235
3211         <rdar://problem/33164381>
3212
3213         Reviewed by Chris Dumez.
3214
3215         Add a KeyedDecoder specialization for Deque.
3216
3217         * platform/KeyedCoding.h:
3218         (WebCore::KeyedDecoder::decodeObjects):
3219
3220 2017-07-07  Daniel Bates  <dabates@apple.com>
3221
3222         [AppCache] Ignore fallback entries whose namespace is not prefixed with manifest path
3223         https://bugs.webkit.org/show_bug.cgi?id=174273
3224         <rdar://problem/33011682>
3225
3226         Reviewed by Brent Fulgham.
3227
3228         As per <https://html.spec.whatwg.org/multipage/offline.html#parsing-cache-manifests> (07/06/2017)
3229         we should ignore fallback entires whose fallback namespace URL is not prefixed with
3230         the manifest path. For now we only apply this policy when the manifest is served with
3231         a non-standard Content-Type to minimize web compatibility risk.
3232
3233         Test: http/tests/appcache/fallback-namespace-outside-manifest-path.html
3234
3235         * loader/appcache/ApplicationCacheGroup.cpp:
3236         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): Pass the MIME type of the manifest.
3237         * loader/appcache/ManifestParser.cpp:
3238         (WebCore::manifestPath): Computes the manifest path from a manifest URL.
3239         (WebCore::parseManifest): Modified to take the MIME type of the manifest. If the MIME type is
3240         non-standard (i.e. not text/cached-manifest) then skip fallback entries whose namespace is not
3241         prefixed with the manifest path. Otherwise, process fallback entries as we do now. Also cleaned
3242         up the code a bit while I was here, including renaming a local variable to be more descriptive
3243         and using a const character array for the manifest signature to avoid the need to document the
3244         length of the manifest signature in a comment.
3245         * loader/appcache/ManifestParser.h:
3246
3247 2017-07-07  Wenson Hsieh  <wenson_hsieh@apple.com>
3248
3249         [iOS DnD] For cross-app drags, 'drop' event handlers are never invoked if dataTransfer.dropEffect is not set while dragging
3250         https://bugs.webkit.org/show_bug.cgi?id=174219
3251         <rdar://problem/32083177>
3252
3253         Reviewed by Ryosuke Niwa.
3254
3255         Currently, in DragController.cpp, defaultOperationForDrag maps a drag source operation mask of
3256         DragOperationGeneric to DragOperationMove across all platforms. However, on iOS, where cross-app drag moves do
3257         not trigger a drop, this means drop handlers won't fire unless the dropEffect is explicitly set to copy.
3258
3259         To fix this, we introduce DragController::platformGenericDragOperation(), which returns DragOperationCopy on iOS
3260         and DragOperationMove (the existing behavior) elsewhere. defaultOperationForDrag then maps a drag source
3261         operation mask of DragOperationGeneric to platformGenericDragOperation().
3262
3263         Tests:  DataInteractionTests.ExternalSourceHTMLToUploadArea
3264                 DataInteractionTests.ExternalSourceImageAndHTMLToUploadArea
3265                 DataInteractionTests.ExternalSourceMoveOperationNotAllowed
3266
3267         * page/DragController.cpp:
3268         (WebCore::DragController::platformGenericDragOperation):
3269         (WebCore::defaultOperationForDrag):
3270         * page/DragController.h:
3271         * page/mac/DragControllerMac.mm:
3272         (WebCore::DragController::platformGenericDragOperation):
3273
3274 2017-07-07  Devin Rousso  <drousso@apple.com>
3275
3276         Web Inspector: Show all elements currently using a given CSS Canvas
3277         https://bugs.webkit.org/show_bug.cgi?id=173965
3278
3279         Reviewed by Joseph Pecoraro.
3280
3281         Test: inspector/canvas/css-canvas-clients.html
3282
3283         * css/CSSImageGeneratorValue.cpp:
3284         (WebCore::CSSImageGeneratorValue::addClient):
3285         (WebCore::CSSImageGeneratorValue::removeClient):
3286         * css/CSSImageGeneratorValue.h:
3287         (WebCore::CSSImageGeneratorValue::clients):
3288         * html/HTMLCanvasElement.cpp:
3289         (WebCore::HTMLCanvasElement::addObserver):
3290         (WebCore::HTMLCanvasElement::removeObserver):
3291         (WebCore::HTMLCanvasElement::cssCanvasClients):
3292         Each time an observer is added/removed for a given HTMLCanvasElement, send an event to the
3293         inspector frontend that the CSS canvas client nodes have changed. Additionally, anytime a
3294         client/use is added/removed from one of the observing CSSCanvasValue, fire the same event.
3295
3296         * css/CSSCanvasValue.h:
3297         (isType):
3298         * html/HTMLCanvasElement.h:
3299         (WebCore::CanvasObserver::isCSSCanvasValueObserver):
3300         Allows type traits to distinguish CanvasObserver from CSSCanvasValue::CanvasObserverProxy.
3301
3302         * inspector/InspectorCanvasAgent.h:
3303         * inspector/InspectorCanvasAgent.cpp:
3304         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
3305         (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
3306         * inspector/InspectorInstrumentation.h:
3307         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodes):
3308         * inspector/InspectorInstrumentation.cpp:
3309         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl):
3310         Notify the frontend that the list of client nodes has changed for the given canvas. Let the
3311         frontend request the actual list of node IDs when it needs, possibly at a later time.
3312
3313 2017-07-07  Jer Noble  <jer.noble@apple.com>
3314
3315         AVPlayer can continue to be active after released by MediaPlayerPrivateAVFoundationObjC.
3316         https://bugs.webkit.org/show_bug.cgi?id=174264
3317
3318         Reviewed by Eric Carlson.
3319
3320         If the AVPlayer is retained (by an autorelease pool, or internally by other objects in
3321         AVFoundation), releasing the AVPlayer is not enough to cancel loading or playback. So before
3322         releasing the AVPlayer, make sure to disassociate the current AVPlayerItem, which should
3323         cancel all activity in the AVPlayer.
3324
3325         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3326         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
3327
3328 2017-07-07  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3329
3330         [Curl] Remove data url handler for async load
3331         https://bugs.webkit.org/show_bug.cgi?id=174263
3332
3333         data url is handled by ResourceLoader. No need for specific handling
3334         in platform dependent layer.
3335
3336         Reviewed by Alex Christensen.
3337
3338         * platform/network/curl/ResourceHandleManager.cpp:
3339         (WebCore::ResourceHandleManager::startJob):
3340
3341 2017-07-07  Matt Lewis  <jlewis3@apple.com>
3342
3343         Unreviewed, rolling out r219257.
3344
3345         The test added in the revision was still extreamly flaky on
3346         all testers.
3347
3348         Reverted changeset:
3349
3350         "[SVG] Leak in SVGAnimatedListPropertyTearOff"
3351         https://bugs.webkit.org/show_bug.cgi?id=172545
3352         http://trac.webkit.org/changeset/219257
3353
3354 2017-07-07  Commit Queue  <commit-queue@webkit.org>
3355
3356         Unreviewed, rolling out r219238, r219239, and r219241.
3357         https://bugs.webkit.org/show_bug.cgi?id=174265
3358
3359         "fast/workers/dedicated-worker-lifecycle.html is flaky"
3360         (Requested by yusukesuzuki on #webkit).
3361
3362         Reverted changesets:
3363
3364         "[WTF] Implement WTF::ThreadGroup"
3365         https://bugs.webkit.org/show_bug.cgi?id=174081
3366         http://trac.webkit.org/changeset/219238
3367
3368         "Unreviewed, build fix after r219238"
3369         https://bugs.webkit.org/show_bug.cgi?id=174081
3370         http://trac.webkit.org/changeset/219239
3371
3372         "Unreviewed, CLoop build fix after r219238"
3373         https://bugs.webkit.org/show_bug.cgi?id=174081
3374         http://trac.webkit.org/changeset/219241
3375
3376 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
3377
3378         [SVG] Leak in SVGAnimatedListPropertyTearOff
3379         https://bugs.webkit.org/show_bug.cgi?id=172545
3380
3381         Reviewed by Said Abou-Hallawa.
3382
3383         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
3384         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
3385         reference to SVGAnimatedProperty.
3386
3387         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
3388         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
3389         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
3390         is going to be added to. This effectively creates a reference cycle between the
3391         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
3392
3393         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
3394
3395         * svg/properties/SVGAnimatedListPropertyTearOff.h:
3396
3397 2017-07-07  Charlie Turner  <cturner@igalia.com>
3398
3399         [GStreamer] vid.me videos do not play
3400         https://bugs.webkit.org/show_bug.cgi?id=172240
3401
3402         Reviewed by Xabier Rodriguez-Calvar.
3403
3404         In r142251, code to hide the WK HTTP source elements from elsewhere in
3405         the pipeline was removed. This has the nasty side-effect of
3406         auto-plugging the WK HTTP source into things it really should not be
3407         used in, especially the adaptive streaming demuxers. The reasons this
3408         is bad are documented in several places on Bugzilla, see the parent
3409         bug report for more details. The high-level issue is that the WK HTTP
3410         source and its use of WebCore is not thread-safe. Although work has
3411         been recently done to improve this situation, it's still not perfect.
3412
3413         Another issue is the interface hlsdemux expects its HTTP source to
3414         implement, specifically seeking in READY.
3415
3416         This does rely on HTTP context sharing being available in GStreamer,
3417         upstream bug is here:
3418         https://bugzilla.gnome.org/show_bug.cgi?id=761099. The failing case
3419         can be demonstrated with
3420         https://github.com/thiagoss/adaptive-test-server but manual testing on
3421         popular video hosting sites, including vid.me, shows that this doesn't
3422         bite us at the moment, just something else to fix in the future.
3423
3424         There are some QoS issues with the adaptive streaming code in
3425         GStreamer, but it seems much better to offer a below par QoS in lieu
3426         of crashing/livelocking when playing certain streams, and issues can be
3427         raised upstream when they arise.
3428
3429         This patch does take us further away from the future goal of having all
3430         networking operations go through the network process, but in return it
3431         solves some nasty crashes and livelocks that have been irritating
3432         users for some time. With the pressure off on this issue, work can be
3433         planned to consider how to make the WK HTTP source a better citizen
3434         inside the GStreamer pipeline when we migrate the netcode to go
3435         through the network process.
3436
3437         A new test is added to check that the single file HLS playlists
3438         (new in version 4) can be played, which was the primary cause of
3439         this bug report.
3440
3441         Test: http/tests/media/hls/range-request.html
3442
3443         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3444         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Perform
3445         some trickery to make sure that we only ever fetch URLs handed to
3446         us by WebCore. Any further URLs discovered inside the pipeline
3447         will not get WKWS auto-plugged, since they'll be plain https?
3448         schemas.
3449         (WebCore::MediaPlayerPrivateGStreamer::load): Refactor to use the
3450         setPlaybinURL helper method.
3451         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Ditto.
3452         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add
3453         the setPlaybinURL helper method.
3454         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3455         (webKitWebSrcGetProtocols): Only advertise webkit+https?, this
3456         ensures we won't get auto-plugged by pipeline elements asking for
3457         an element to fetch https? resources (like adaptive demuxers).
3458         (convertPlaybinURI): Undo the trick when another element asks us
3459         for our URI.
3460
3461 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
3462
3463         [WTF] Implement WTF::ThreadGroup
3464         https://bugs.webkit.org/show_bug.cgi?id=174081
3465
3466         Reviewed by Mark Lam.
3467
3468         * page/ResourceUsageThread.h:
3469
3470 2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
3471
3472         [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
3473         https://bugs.webkit.org/show_bug.cgi?id=174150
3474
3475         Reviewed by Mark Lam.
3476
3477         * Modules/mediacontrols/MediaControlsHost.cpp:
3478         (WebCore::MediaControlsHost::captionDisplayMode):
3479         * Modules/mediastream/RTCDataChannel.cpp:
3480         (WebCore::RTCDataChannel::binaryType):
3481         * accessibility/AXObjectCache.cpp:
3482         (WebCore::createFromRenderer):
3483         * accessibility/AccessibilityMediaControls.cpp:
3484         (WebCore::AccessibilityMediaControl::controlTypeName):
3485         * accessibility/AccessibilityObject.cpp:
3486         (WebCore::AccessibilityObject::language):
3487         (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
3488         (WebCore::AccessibilityObject::actionVerb):
3489         (WebCore::AccessibilityObject::getAttribute):
3490         (WebCore::AccessibilityObject::placeholderValue):
3491         * accessibility/AccessibilityObject.h:
3492         (WebCore::AccessibilityObject::accessKey):
3493         (WebCore::AccessibilityObject::ariaLiveRegionRelevant):
3494         * accessibility/AccessibilityRenderObject.cpp:
3495         (WebCore::AccessibilityRenderObject::accessKey):
3496         (WebCore::AccessibilityRenderObject::actionVerb):
3497         * bindings/js/JSCustomElementInterface.cpp:
3498         (WebCore::JSCustomElementInterface::constructElementWithFallback):
3499         * bindings/js/JSCustomElementRegistryCustom.cpp:
3500         (WebCore::JSCustomElementRegistry::define):
3501         * bindings/scripts/CodeGeneratorJS.pm:
3502         (GenerateDefaultValue):
3503         * bindings/scripts/test/JS/JSTestObj.cpp:
3504         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringBody):
3505         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNullBody):
3506         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyStringBody):
3507         * css/CSSPageRule.cpp:
3508         (WebCore::CSSPageRule::selectorText):
3509         * css/CSSPrimitiveValue.cpp:
3510         (WebCore::valueName):
3511         * css/CSSSelector.cpp:
3512         (WebCore::simpleSelectorSpecificityInternal):
3513         (WebCore::CSSSelector::specificityForPage):
3514         (WebCore::CSSSelector::RareData::RareData):
3515         * css/CSSSelector.h:
3516         (WebCore::CSSSelector::argument):
3517         * css/CSSSelectorList.cpp:
3518         (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
3519         * css/PageRuleCollector.cpp:
3520         (WebCore::checkPageSelectorComponents):
3521         * css/RuleSet.cpp:
3522         (WebCore::computeMatchBasedOnRuleHash):
3523         (WebCore::RuleSet::addRule):
3524         * css/SelectorChecker.cpp:
3525         (WebCore::tagMatches):
3526         * css/SelectorFilter.cpp:
3527         (WebCore::collectDescendantSelectorIdentifierHashes):
3528         * css/StyleBuilderConverter.h:
3529         (WebCore::StyleBuilderConverter::convertStringOrAuto):
3530         (WebCore::StyleBuilderConverter::convertStringOrNone):
3531         * css/StyleBuilderCustom.h:
3532         (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
3533         (WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
3534         (WebCore::StyleBuilderCustom::applyValueContent):
3535         (WebCore::StyleBuilderCustom::applyValueAlt):
3536         * css/StyleSheetContents.cpp:
3537         (WebCore::StyleSheetContents::StyleSheetContents):
3538         (WebCore::StyleSheetContents::namespaceURIFromPrefix):
3539         * css/makeprop.pl:
3540         * css/parser/CSSParserImpl.cpp:
3541         (WebCore::CSSParserImpl::parsePageSelector):
3542         * css/parser/CSSSelectorParser.cpp:
3543         (WebCore::CSSSelectorParser::consumeCompoundSelector):
3544         (WebCore::CSSSelectorParser::consumeName):
3545         (WebCore::CSSSelectorParser::consumeAttribute):
3546         (WebCore::CSSSelectorParser::defaultNamespace):
3547         (WebCore::CSSSelectorParser::determineNamespace):
3548         (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
3549         * cssjit/SelectorCompiler.cpp:
3550         (WebCore::SelectorCompiler::attributeNameTestingRequiresNamespaceRegister):
3551         (WebCore::SelectorCompiler::equalTagNames):
3552         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
3553         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
3554         * dom/Attr.cpp:
3555         (WebCore::Attr::setPrefix):
3556         (WebCore::Attr::attachToElement):
3557         * dom/Attribute.h:
3558         (WebCore::Attribute::nameMatchesFilter):
3559         * dom/ConstantPropertyMap.cpp:
3560         (WebCore::ConstantPropertyMap::nameForProperty):
3561         * dom/ContainerNode.cpp:
3562         (WebCore::ContainerNode::getElementsByTagName):
3563         (WebCore::ContainerNode::getElementsByTagNameNS):
3564         * dom/CustomElementReactionQueue.cpp:
3565         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
3566         * dom/DatasetDOMStringMap.cpp:
3567         (WebCore::convertPropertyNameToAttributeName):
3568         * dom/Document.cpp:
3569         (WebCore::createUpgradeCandidateElement):
3570         (WebCore::Document::createElementForBindings):
3571         (WebCore::Document::importNode):
3572         (WebCore::Document::hasValidNamespaceForElements):
3573         (WebCore::Document::processBaseElement):
3574         (WebCore::Document::dir):
3575         (WebCore::Document::bgColor):
3576         (WebCore::Document::fgColor):
3577         (WebCore::Document::alinkColor):
3578         (WebCore::Document::linkColorForBindings):
3579         (WebCore::Document::vlinkColor):
3580         * dom/Document.h:
3581         * dom/Element.cpp:
3582         (WebCore::Element::setBooleanAttribute):
3583         (WebCore::Element::synchronizeAttribute):
3584         (WebCore::Element::getAttribute):
3585         (WebCore::Element::getAttributeNS):
3586         (WebCore::Element::setAttribute):
3587         (WebCore::Element::parserSetAttributes):
3588         (WebCore::Element::didMoveToNewDocument):
3589         (WebCore::Element::setPrefix):
3590         (WebCore::Element::insertedInto):
3591         (WebCore::Element::removedFrom):
3592         (WebCore::Element::removeAttributeInternal):
3593         (WebCore::Element::addAttributeInternal):
3594         (WebCore::Element::removeAttributeNS):
3595         (WebCore::Element::getAttributeNodeNS):
3596         (WebCore::Element::hasAttributeNS):
3597         (WebCore::Element::computeInheritedLanguage):
3598         (WebCore::Element::updateNameForDocument):
3599         (WebCore::Element::updateIdForDocument):
3600         (WebCore::Element::didAddAttribute):
3601         (WebCore::Element::didRemoveAttribute):
3602         (WebCore::Element::cloneAttributesFromElement):
3603         * dom/Element.h:
3604         (WebCore::Element::attributeWithoutSynchronization):
3605         (WebCore::Element::idForStyleResolution):
3606         (WebCore::Element::getIdAttribute):
3607         (WebCore::Element::getNameAttribute):
3608         * dom/EventTarget.cpp:
3609         (WebCore::legacyType):
3610         * dom/MutationRecord.h:
3611         (WebCore::MutationRecord::attributeName):
3612         (WebCore::MutationRecord::attributeNamespace):
3613         * dom/NamedNodeMap.cpp:
3614         (WebCore::NamedNodeMap::removeNamedItemNS):
3615         * dom/Node.cpp:
3616         (WebCore::Node::prefix):
3617         (WebCore::Node::localName):
3618         (WebCore::Node::namespaceURI):
3619         (WebCore::Node::checkSetPrefix):
3620         (WebCore::locateDefaultNamespace):
3621         (WebCore::Node::isDefaultNamespace):
3622         (WebCore::Node::lookupNamespaceURI):
3623         (WebCore::locateNamespacePrefix):
3624         (WebCore::Node::lookupPrefix):
3625         * dom/NodeRareData.h:
3626         (WebCore::NodeListsNodeData::addCachedTagCollectionNS):
3627         (WebCore::NodeListsNodeData::addCachedCollection):
3628         (WebCore::NodeListsNodeData::cachedCollection):
3629         (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
3630         (WebCore::NodeListsNodeData::removeCachedTagCollectionNS):
3631         (WebCore::NodeListsNodeData::removeCachedCollection):
3632         * dom/PseudoElement.cpp:
3633         (WebCore::pseudoElementTagName):
3634         * dom/QualifiedName.cpp:
3635         (WebCore::QualifiedName::init):
3636         (WebCore::nullQName):
3637         (WebCore::createQualifiedName):
3638         * dom/QualifiedName.h:
3639         (WebCore::QualifiedName::hasPrefix):
3640         * dom/SelectorQuery.cpp:
3641         (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
3642         * dom/SlotAssignment.cpp:
3643         (WebCore::slotNameFromAttributeValue):
3644         * dom/SlotAssignment.h:
3645         (WebCore::SlotAssignment::defaultSlotName):
3646         (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost):
3647         (WebCore::ShadowRoot::didChangeDefaultSlot):
3648         * dom/TagCollection.cpp:
3649         (WebCore::TagCollection::TagCollection):
3650         (WebCore::HTMLTagCollection::HTMLTagCollection):
3651         * dom/TagCollection.h:
3652         (WebCore::TagCollectionNS::elementMatches):
3653         * dom/make_names.pl:
3654         (printNamesCppFile):
3655         (printDefinitions):
3656         (printFactoryCppFile):
3657         * editing/CompositeEditCommand.cpp:
3658         (WebCore::CompositeEditCommand::removeNodeAttribute):
3659         * editing/Editing.cpp:
3660         (WebCore::createHTMLElement):
3661         * editing/MarkupAccumulator.cpp:
3662         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
3663         (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
3664         (WebCore::MarkupAccumulator::shouldAddNamespaceAttribute):
3665         (WebCore::MarkupAccumulator::appendNamespace):
3666         (WebCore::MarkupAccumulator::appendOpenTag):
3667         (WebCore::MarkupAccumulator::appendAttribute):
3668         * editing/gtk/EditorGtk.cpp:
3669         (WebCore::elementURL):
3670         * editing/markup.cpp:
3671         (WebCore::AttributeChange::AttributeChange):
3672         * html/Autocapitalize.cpp:
3673         (WebCore::stringForAutocapitalizeType):
3674         * html/Autofill.cpp:
3675         (WebCore::AutofillData::createFromHTMLFormControlElement):
3676         * html/DOMTokenList.h:
3677         (WebCore::DOMTokenList::item):
3678         * html/FormAssociatedElement.cpp:
3679         (WebCore::FormAssociatedElement::name):
3680         * html/HTMLButtonElement.cpp:
3681         (WebCore::HTMLButtonElement::formControlType):
3682         * html/HTMLDetailsElement.cpp:
3683         (WebCore::HTMLDetailsElement::toggleOpen):
3684         * html/HTMLDocument.cpp:
3685         (WebCore::HTMLDocument::isCaseSensitiveAttribute):
3686         * html/HTMLElement.cpp:
3687         (WebCore::HTMLElement::eventNameForEventHandlerAttribute):
3688         (WebCore::toValidDirValue):
3689         * html/HTMLImageElement.cpp:
3690         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
3691         * html/HTMLInputElement.cpp:
3692         (WebCore::HTMLInputElement::name):
3693         (WebCore::HTMLInputElement::updateType):
3694         * html/HTMLMediaElement.cpp:
3695         (WebCore::HTMLMediaElement::doesHaveAttribute):
3696         * html/HTMLOptionElement.cpp:
3697         (WebCore::HTMLOptionElement::createForJSConstructor):
3698         * html/HTMLParamElement.cpp:
3699         (WebCore::HTMLParamElement::name):
3700         * html/HTMLSelectElement.cpp:
3701         (WebCore::HTMLSelectElement::setMultiple):
3702         * html/HTMLTableCellElement.cpp:
3703         (WebCore::HTMLTableCellElement::scope):
3704         * html/HTMLTrackElement.cpp:
3705         (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute):
3706         * html/LabelableElement.cpp:
3707         (WebCore::LabelableElement::labels):
3708         * html/LabelsNodeList.cpp:
3709         (WebCore::LabelsNodeList::~LabelsNodeList):
3710         * html/MediaController.cpp:
3711         (MediaController::playbackState):
3712         (eventNameForReadyState):
3713         * html/MediaDocument.cpp:
3714         (WebCore::MediaDocumentParser::createDocumentStructure):
3715         * html/parser/AtomicHTMLToken.h:
3716         (WebCore::AtomicHTMLToken::initializeAttributes):
3717         * html/parser/HTMLConstructionSite.cpp:
3718         (WebCore::HTMLConstructionSite::createElement):
3719         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
3720         * html/parser/HTMLParserIdioms.cpp:
3721         (WebCore::stripLeadingAndTrailingHTMLSpaces):
3722         (WebCore::parseHTMLHashNameReference):
3723         * html/parser/HTMLTreeBuilder.cpp:
3724         (WebCore::createForeignAttributesMap):
3725         * html/track/InbandTextTrack.cpp:
3726         (WebCore::InbandTextTrack::InbandTextTrack):
3727         * html/track/LoadableTextTrack.cpp:
3728         (WebCore::LoadableTextTrack::id):
3729         * html/track/TextTrack.cpp:
3730         (WebCore::TextTrack::captionMenuOffItem):
3731         (WebCore::TextTrack::captionMenuAutomaticItem):
3732         * html/track/TrackBase.cpp:
3733         (WebCore::MediaTrackBase::setKindInternal):
3734         * html/track/VTTRegion.cpp:
3735         (WebCore::VTTRegion::scroll):
3736         * html/track/WebVTTElement.cpp:
3737         (WebCore::nodeTypeToTagName):
3738         * html/track/WebVTTElement.h:
3739         * html/track/WebVTTToken.h:
3740         (WebCore::WebVTTToken::StartTag):
3741         * loader/FrameLoader.cpp:
3742         (WebCore::FrameLoader::clear):
3743         * loader/FrameLoader.h:
3744         * loader/ImageLoader.cpp:
3745         (WebCore::ImageLoader::clearFailedLoadURL):
3746         * loader/NavigationAction.h:
3747         * loader/PolicyChecker.cpp:
3748         (WebCore::PolicyChecker::checkNavigationPolicy):
3749         * page/DOMWindow.cpp:
3750         (WebCore::DOMWindow::showModalDialog):
3751         * page/EventHandler.cpp:
3752         (WebCore::eventNameForTouchPointState):
3753         * page/FrameTree.cpp:
3754         (WebCore::FrameTree::setName):
3755         (WebCore::FrameTree::clearName):
3756         * page/Page.cpp:
3757         (WebCore::Page::groupName):
3758         * platform/graphics/ComplexTextController.cpp:
3759         (WebCore::ComplexTextController::offsetForPosition):
3760         * platform/graphics/FontCache.cpp:
3761         (WebCore::FontCache::alternateFamilyName):
3762         * platform/graphics/FontDescription.h:
3763         (WebCore::FontCascadeDescription::initialLocale):
3764         * platform/graphics/FontGenericFamilies.cpp:
3765         (WebCore::genericFontFamilyForScript):
3766         * platform/graphics/InbandTextTrackPrivate.h:
3767         (WebCore::InbandTextTrackPrivate::inBandMetadataTrackDispatchType):
3768         * platform/graphics/TrackPrivateBase.h:
3769         (WebCore::TrackPrivateBase::id):
3770         (WebCore::TrackPrivateBase::label):
3771         (WebCore::TrackPrivateBase::language):
3772         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
3773         (WebCore::AVTrackPrivateAVFObjCImpl::id):
3774         (WebCore::AVTrackPrivateAVFObjCImpl::label):
3775         (WebCore::AVTrackPrivateAVFObjCImpl::language):
3776         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
3777         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
3778         (WebCore::InbandTextTrackPrivateAVCF::label):
3779         (WebCore::InbandTextTrackPrivateAVCF::language):
3780         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
3781         (WebCore::InbandTextTrackPrivateLegacyAVCF::label):
3782         (WebCore::InbandTextTrackPrivateLegacyAVCF::language):
3783         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
3784         (WebCore::InbandTextTrackPrivateAVFObjC::label):
3785         (WebCore::InbandTextTrackPrivateAVFObjC::language):
3786         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
3787         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label):
3788         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::language):
3789         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3790         (WebCore::metadataType):
3791         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
3792         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3793         (WebCore::FontCache::platformAlternateFamilyName):
3794         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
3795         (WebCore::FontCascadeDescription::effectiveFamilyAt):
3796         * platform/graphics/freetype/FontCacheFreeType.cpp:
3797         (WebCore::FontCache::platformAlternateFamilyName):
3798         * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
3799         (WebCore::InbandMetadataTextTrackPrivateGStreamer::create):
3800         * platform/graphics/win/FontCacheWin.cpp:
3801         (WebCore::FontCache::platformAlternateFamilyName):
3802         * platform/mediastream/AudioTrackPrivateMediaStream.h:
3803         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
3804         (WebCore::RealtimeMediaSourceSettings::facingMode):
3805         * platform/mediastream/VideoTrackPrivateMediaStream.h:
3806         * rendering/HitTestResult.cpp:
3807         (WebCore::HitTestResult::linkSuggestedFilename):
3808         * rendering/InlineTextBox.cpp:
3809         (WebCore::InlineTextBox::paint):
3810         * rendering/RenderListItem.cpp:
3811         (WebCore::RenderListItem::markerText):
3812         * rendering/RenderText.cpp:
3813         (WebCore::RenderText::previousOffset):
3814         (WebCore::RenderText::nextOffset):
3815         * rendering/RenderTreeAsText.cpp:
3816         (WebCore::RenderTreeAsText::writeRenderObject):
3817         * rendering/TextPainter.cpp:
3818         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
3819         * rendering/style/RenderStyle.cpp:
3820         (WebCore::RenderStyle::textEmphasisMarkString):
3821         * rendering/style/RenderStyle.h:
3822         (WebCore::RenderStyle::initialHyphenationString):
3823         (WebCore::RenderStyle::initialTextEmphasisCustomMark):
3824         (WebCore::RenderStyle::initialContentAltText):
3825         (WebCore::RenderStyle::initialLineGrid):
3826         (WebCore::RenderStyle::initialFlowThread):
3827         (WebCore::RenderStyle::initialRegionThread):
3828         * style/StyleScope.cpp:
3829         (WebCore::Style::Scope::collectActiveStyleSheets):
3830         * svg/SVGElement.cpp:
3831         (WebCore::SVGElement::getPresentationAttribute):
3832         * svg/SVGElement.h:
3833         (WebCore::SVGAttributeHashTranslator::hash):
3834         * svg/SVGUseElement.cpp:
3835         (WebCore::SVGUseElement::transferSizeAttributesToTargetClone):
3836         * svg/animation/SVGSMILElement.cpp:
3837         (WebCore::SVGSMILElement::constructAttributeName):
3838         * testing/MockCDMFactory.cpp:
3839         (WebCore::MockCDMInstance::requestLicense):
3840         * xml/XMLErrors.cpp:
3841         (WebCore::createXHTMLParserErrorHeader):
3842         * xml/XPathStep.cpp:
3843         (WebCore::XPath::nodeMatchesBasicTest):
3844         (WebCore::XPath::Step::nodesInAxis):
3845         * xml/parser/XMLDocumentParserLibxml2.cpp:
3846         (WebCore::XMLDocumentParser::XMLDocumentParser):
3847         (WebCore::handleNamespaceAttributes):
3848         (WebCore::handleElementAttributes):
3849
3850 2017-07-06  Chris Dumez  <cdumez@apple.com>
3851
3852         Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver
3853         https://bugs.webkit.org/show_bug.cgi?id=174234
3854
3855         Reviewed by Brent Fulgham.
3856
3857         Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver. It is
3858         always 0 since this member is only initialized later on, in the UIProcess.
3859
3860         * loader/ResourceLoadObserver.cpp:
3861         (WebCore::ResourceLoadObserver::logFrameNavigation):
3862         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3863         (WebCore::ResourceLoadObserver::logWebSocketLoading):
3864
3865 2017-07-06  Yoav Weiss  <yoav@yoav.ws>
3866
3867         [preload] Avoid reflecting "video" and "audio" when they are not supported `as` value
3868         https://bugs.webkit.org/show_bug.cgi?id=174199
3869
3870         Reviewed by Youenn Fablet.
3871
3872         No new tests as video/audio is supported in tests. I tested this manually.
3873
3874         * html/HTMLLinkElement.cpp:
3875         (WebCore::HTMLLinkElement::as): Make sure "video" and "audio" will not be reflected when they are not supported.
3876
3877 2017-07-06  Chris Dumez  <cdumez@apple.com>
3878
3879         Drop unused ResourceLoadStatistics members
3880         https://bugs.webkit.org/show_bug.cgi?id=174226
3881
3882         Reviewed by Brent Fulgham.
3883
3884         * loader/ResourceLoadObserver.cpp:
3885         (WebCore::ResourceLoadObserver::logFrameNavigation):
3886         (WebCore::ResourceLoadObserver::logSubresourceLoading):
3887         (WebCore::ResourceLoadObserver::logWebSocketLoading):
3888         (WebCore::ResourceLoadObserver::isPrevalentResource): Deleted.
3889         * loader/ResourceLoadObserver.h:
3890         * loader/ResourceLoadStatistics.cpp:
3891         (WebCore::ResourceLoadStatistics::encode):
3892         (WebCore::ResourceLoadStatistics::decode):
3893         (WebCore::ResourceLoadStatistics::toString):
3894         (WebCore::ResourceLoadStatistics::merge):
3895         * loader/ResourceLoadStatistics.h:
3896
3897 2017-07-06  Youenn Fablet  <youenn@apple.com>
3898
3899         Rendering of WebRTC audio in AudioSampleDataSource may trigger crackles
3900         https://bugs.webkit.org/show_bug.cgi?id=174223
3901
3902         Reviewed by Eric Carlson.
3903
3904         We try reading too quickly and need to back off a little bit if we do not enough data.
3905         This only affects real audio and not web audio, hence validated through manual testing only.
3906
3907         * platform/audio/mac/AudioSampleDataSource.mm:
3908         (WebCore::AudioSampleDataSource::pullSamplesInternal):
3909
3910 2017-07-06  Sam Weinig  <sam@webkit.org>
3911
3912         [WebIDL] Remove custom bindings for WebGL code dealing with WebGL extensions
3913         https://bugs.webkit.org/show_bug.cgi?id=174186
3914
3915         Reviewed by Alex Christensen.
3916
3917         * CMakeLists.txt:
3918         * WebCore.xcodeproj/project.pbxproj:
3919         Update files. Categorize some of the remaining custom bindings into groups.
3920
3921         * bindings/IDLTypes.h:
3922         Add a IDLWebGLExtension type, to model the special WebGLExtension type. In
3923         the future, WebGLExtension can probably be replaced by a Variant.
3924         
3925         * bindings/js/JSDOMConvertWebGL.cpp: Added.
3926         Move WebGLAny's convertToJSValue and add a convertToJSValue for WebGLExtension.
3927
3928         * bindings/js/JSDOMConvertWebGL.h:
3929         (WebCore::convertToJSValue):
3930         Since WebGLExtension is a wrapper type, we need both a pointer and reference variant
3931         of the conversion.
3932
3933         (WebCore::JSConverter<IDLWebGLExtension>::convert):
3934         Added.
3935
3936         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
3937         (WebCore::toJS): Deleted.
3938         (WebCore::JSWebGL2RenderingContext::getExtension): Deleted.
3939         Remove custom operation and converter.
3940
3941         * bindings/js/JSWebGLRenderingContextCustom.cpp:
3942         (WebCore::toJS): Deleted.
3943         (WebCore::JSWebGLRenderingContext::getExtension): Deleted.
3944         Remove custom operation and converter.
3945
3946         * bindings/scripts/CodeGeneratorJS.pm:
3947         (AddToIncludesForIDLType):
3948         (NativeToJSValueDOMConvertNeedsState):
3949         (NativeToJSValueDOMConvertNeedsGlobalObject):
3950         Add support for IDLWebGLExtension.
3951
3952         * html/canvas/WebGLAny.cpp: Removed.
3953         * html/canvas/WebGLAny.h:
3954         Moved convertToJSValue to the bindings where it belongs.
3955
3956         * html/canvas/WebGLRenderingContextBase.idl:
3957         Annotate getExtension with [OverrideIDLType=IDLWebGLExtension].
3958
3959 2017-07-06  Joseph Pecoraro  <pecoraro@apple.com>
3960
3961         [Cocoa] CTParagraphStyle leak under WebCore::LinkImageLayout::LinkImageLayout
3962         https://bugs.webkit.org/show_bug.cgi?id=174228
3963
3964         Reviewed by Andreas Kling.
3965
3966         * platform/mac/DragImageMac.mm:
3967         (WebCore::LinkImageLayout::LinkImageLayout):
3968
3969 2017-07-06  Myles C. Maxfield  <mmaxfield@apple.com>
3970
3971         [Cocoa] Improve performance of font lookups
3972         https://bugs.webkit.org/show_bug.cgi?id=173960
3973         <rdar://problem/31996891>
3974
3975         Reviewed by Darin Adler.
3976
3977         Looking up kCTFontPostScriptNameAttribute is faster than kCTFontNameAttribute.
3978
3979         No new tests because there is no behavior change.
3980
3981         * platform/spi/cocoa/CoreTextSPI.h:
3982         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3983         (WebCore::FontDatabase::fontForPostScriptName):
3984
3985 2017-07-06  Myles C. Maxfield  <mmaxfield@apple.com>
3986
3987         REGRESSION(r216944): Font loads can cause Chinese characters to draw as .notdef
3988         https://bugs.webkit.org/show_bug.cgi?id=173962
3989         <rdar://problem/32925318>
3990
3991         Reviewed by Simon Fraser.
3992
3993         Previously, there was no signalling between our font loading code
3994         which determined whether or not a font should be invisible (because