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