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