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