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