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