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