RenderTheme does not need to be per-page
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-05-15  Antti Koivisto  <antti@apple.com>
2
3         RenderTheme does not need to be per-page
4         https://bugs.webkit.org/show_bug.cgi?id=172116
5         <rdar://problem/30426457>
6
7         Reviewed by Zalan Bujtas.
8
9         There are no implementations of RenderTheme::themeForPage that actually care about the page.
10         It can be replaced with a singleton, simplifying a bunch of code.
11
12         * Modules/mediacontrols/MediaControlsHost.cpp:
13         (WebCore::MediaControlsHost::shadowRootCSSText):
14         (WebCore::MediaControlsHost::base64StringForIconNameAndType):
15         * css/CSSDefaultStyleSheets.cpp:
16         (WebCore::CSSDefaultStyleSheets::loadFullDefaultStyle):
17         (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
18
19             Fix a potential crash if we get here when page is null (though it doesn't appear to repro on trunk).
20
21         * css/StyleColor.cpp:
22         (WebCore::StyleColor::colorFromKeyword):
23         * css/StyleResolver.cpp:
24         (WebCore::StyleResolver::adjustRenderStyle):
25         * css/parser/CSSParser.cpp:
26         (WebCore::CSSParser::parseSystemColor):
27         * css/parser/CSSParser.h:
28         * css/parser/CSSPropertyParser.cpp:
29         (WebCore::CSSPropertyParser::consumeSystemFont):
30         * editing/FrameSelection.cpp:
31         (WebCore::FrameSelection::updateAppearance):
32         * html/HTMLMediaElement.cpp:
33         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
34         * html/HTMLMeterElement.cpp:
35         (WebCore::HTMLMeterElement::createElementRenderer):
36         * html/HTMLSelectElement.cpp:
37         (WebCore::HTMLSelectElement::usesMenuList):
38         (WebCore::HTMLSelectElement::platformHandleKeydownEvent):
39         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
40         * html/HTMLTextFormControlElement.cpp:
41         (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle):
42         * html/InputType.cpp:
43         (WebCore::InputType::themeSupportsDataListUI):
44         * html/TextFieldInputType.cpp:
45         (WebCore::TextFieldInputType::shouldHaveSpinButton):
46         (WebCore::TextFieldInputType::shouldHaveCapsLockIndicator):
47         * html/canvas/CanvasRenderingContext2D.cpp:
48         (WebCore::CanvasRenderingContext2D::setStrokeColor):
49         (WebCore::CanvasRenderingContext2D::setFillColor):
50         * html/canvas/CanvasStyle.cpp:
51         (WebCore::parseColor):
52         (WebCore::parseColorOrCurrentColor):
53         (WebCore::CanvasStyle::createFromString):
54         * html/canvas/CanvasStyle.h:
55         * html/shadow/MediaControlElements.cpp:
56         (WebCore::MediaControlPanelElement::startTimer):
57         (WebCore::MediaControlPanelElement::makeOpaque):
58         (WebCore::MediaControlPanelElement::makeTransparent):
59         * html/shadow/MediaControls.cpp:
60         (WebCore::MediaControls::reset):
61         (WebCore::MediaControls::reportedError):
62         (WebCore::MediaControls::updateCurrentTimeDisplay):
63         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
64         (WebCore::ImageControlsButtonElementMac::tryCreate):
65         * page/MemoryRelease.cpp:
66         (WebCore::releaseNoncriticalMemory):
67         * page/Page.cpp:
68         (WebCore::Page::Page):
69         * page/Page.h:
70         (WebCore::Page::theme): Deleted.
71         * platform/wpe/RenderThemeWPE.cpp:
72         (WebCore::RenderTheme::singleton):
73         (WebCore::RenderTheme::themeForPage): Deleted.
74         * rendering/RenderEmbeddedObject.cpp:
75         (WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
76         * rendering/RenderObject.cpp:
77         (WebCore::RenderObject::theme):
78         * rendering/RenderTheme.cpp:
79         (WebCore::RenderTheme::focusRingColor):
80         * rendering/RenderTheme.h:
81         (WebCore::RenderTheme::defaultTheme): Deleted.
82         * rendering/RenderThemeGtk.cpp:
83         (WebCore::RenderTheme::singleton):
84         (WebCore::RenderTheme::themeForPage): Deleted.
85         * rendering/RenderThemeIOS.mm:
86         (WebCore::RenderTheme::singleton):
87         (WebCore::RenderTheme::themeForPage): Deleted.
88         * rendering/RenderThemeMac.mm:
89         (WebCore::RenderTheme::singleton):
90         (WebCore::RenderTheme::themeForPage): Deleted.
91         * rendering/RenderThemeWin.cpp:
92         (WebCore::RenderTheme::singleton):
93         (WebCore::RenderTheme::themeForPage): Deleted.
94         * rendering/TextPaintStyle.cpp:
95         (WebCore::computeTextPaintStyle):
96
97 2017-05-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
98
99         Do not delete asynchronously decoded frames for large images if their clients are in the viewport
100         https://bugs.webkit.org/show_bug.cgi?id=170640
101
102         Reviewed by Simon Fraser.
103
104         The image flickering problem happens when a large image is visible in the
105         view port and for some reason, the decoded frame gets destroyed. When this
106         image is repainted, BitmapImage::draw() does not find a valid decoded frame
107         for that image. It then requests an async decoding for the image and just
108         draws nothing in the image rectangle. Drawing no content between two drawing
109         phases in which the image is drawn causes the unwanted flickering.
110
111         To fix this issue we need to protect the decoded frames of all the images
112         in the view port from being destroyed. When BitmapImage::destroyDecodedData()
113         is called, it is going to check, through the ImageObserver, whether any
114         of its clients is visible. And if so, the current decoded frame won't be
115         destroyed.
116
117         Tests: Modifying existing tests.
118
119         * loader/cache/CachedImage.cpp:
120         (WebCore::CachedImage::CachedImageObserver::decodedSizeChanged):
121         (WebCore::CachedImage::CachedImageObserver::didDraw):
122         (WebCore::CachedImage::CachedImageObserver::canDestroyDecodedData):
123         (WebCore::CachedImage::CachedImageObserver::imageFrameAvailable):
124         (WebCore::CachedImage::CachedImageObserver::changedInRect):
125         (WebCore::CachedImage::decodedSizeChanged):
126         (WebCore::CachedImage::didDraw):
127         (WebCore::CachedImage::canDestroyDecodedData): Finds out whether it's okay
128         to discard the image decoded data or not.
129         (WebCore::CachedImage::imageFrameAvailable):
130         (WebCore::CachedImage::changedInRect):
131         * loader/cache/CachedImage.h:
132         * loader/cache/CachedImageClient.h:
133         (WebCore::CachedImageClient::canDestroyDecodedData):
134         * loader/cache/MemoryCache.cpp:
135         (WebCore::MemoryCache::destroyDecodedDataForAllImages): This function is
136         currently not used. Use in the internal destroyDecodedDataForAllImages()
137         but unlike what CachedImage::destroyDecodedData() does, make it destroy
138         the decoded frames without deleting the image itself.
139         * loader/cache/MemoryCache.h:
140         * platform/graphics/BitmapImage.cpp:
141         (WebCore::BitmapImage::destroyDecodedData):
142         (WebCore::BitmapImage::draw):
143         (WebCore::BitmapImage::canDestroyCurrentFrameDecodedData): 
144         (WebCore::BitmapImage::advanceAnimation):
145         (WebCore::BitmapImage::internalAdvanceAnimation):
146         (WebCore::BitmapImage::imageFrameAvailableAtIndex):
147         * platform/graphics/BitmapImage.h:
148         * platform/graphics/GraphicsContext3D.cpp:
149         (WebCore::GraphicsContext3D::packImageData):
150         * platform/graphics/ImageFrameCache.cpp:
151         (WebCore::ImageFrameCache::decodedSizeChanged):
152         (ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): The assertion in this
153         function is wrong. frameIsCompleteAtIndex() can be false when the an image
154         decoding is requested but can be true when the decoding finishes.
155         * platform/graphics/ImageObserver.h:
156         * platform/graphics/cairo/ImageCairo.cpp:
157         (WebCore::Image::drawPattern):
158         * platform/graphics/cg/ImageCG.cpp:
159         (WebCore::Image::drawPattern):
160         * platform/graphics/cg/ImageDecoderCG.cpp:
161         (WebCore::ImageDecoder::frameIsCompleteAtIndex):
162         * platform/graphics/cg/PDFDocumentImage.cpp:
163         (WebCore::PDFDocumentImage::decodedSizeChanged):
164         (WebCore::PDFDocumentImage::draw):
165         * platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
166         (WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
167         * platform/graphics/win/ImageDirect2D.cpp:
168         (WebCore::Image::drawPattern):
169         * rendering/RenderElement.cpp:
170         (WebCore::RenderElement::isVisibleInDocumentRect):
171         (WebCore::RenderElement::isVisibleInViewport):
172         (WebCore::RenderElement::imageFrameAvailable):
173         (WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):
174         (WebCore::RenderElement::shouldRepaintInVisibleRect): Deleted. Function
175         is renamed to isVisibleInViewport() for better readability.
176         * rendering/RenderElement.h:
177         * svg/graphics/SVGImage.cpp:
178         (WebCore::SVGImage::draw):
179         * svg/graphics/SVGImageClients.h:
180         * testing/Internals.cpp:
181         (WebCore::Internals::destroyDecodedDataForAllImages):
182         * testing/Internals.h:
183         * testing/Internals.idl:
184
185 2017-05-15  Youenn Fablet  <youenn@apple.com>
186
187         Simplify RealtimeMediaSource data production and state
188         https://bugs.webkit.org/show_bug.cgi?id=171999
189
190         Reviewed by Eric Carlson.
191
192         RealtimeMediaSource takes 3 booleans:
193         - m_isProducingData tells whether data is produced or not. In the case of capturing, it tells whether capture
194           happens.
195         - m_muted/m_enabled allows JS or WebKit level to start/stop the source.
196
197         Changed MediaStream capture state computation so that capture is reported as follows:
198         - m_isProducing is true, capture is happenning and is active
199         - m_muted is true, capture is happening but is inactive.
200
201         Except in the case of WebRTC incoming sources, for which sources may be created as muted as per the spec,
202         all sources are unmuted, enabled and not producing data when created.
203
204         RealtimeMediaSource is now activable either by calling start/stop or by calling setMuted/setEnabled.
205         This in turns will set the boolean values accordingly and will call the underlying
206         startProducingData/stopProducingData methods doing the actual stuff.
207
208         Removing from all RealtimeMediaSource subclasses the handling of producing data.
209         Making more methods non-virtual/member fields private to simplify the model.
210
211         * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
212         (WebCore::CanvasCaptureMediaStreamTrack::Source::create):
213         (WebCore::CanvasCaptureMediaStreamTrack::Source::startProducingData):
214         (WebCore::CanvasCaptureMediaStreamTrack::Source::stopProducingData):
215         (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasDestroyed):
216         (WebCore::CanvasCaptureMediaStreamTrack::Source::captureCanvas):
217         * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
218         * Modules/mediastream/MediaStream.cpp:
219         (WebCore::MediaStream::mediaState):
220         * platform/mediastream/MediaStreamTrackPrivate.h:
221         (WebCore::MediaStreamTrackPrivate::startProducingData):
222         (WebCore::MediaStreamTrackPrivate::stopProducingData):
223         * platform/mediastream/RealtimeMediaSource.cpp:
224         (WebCore::RealtimeMediaSource::setMuted):
225         (WebCore::RealtimeMediaSource::notifyMutedChange):
226         (WebCore::RealtimeMediaSource::setEnabled):
227         (WebCore::RealtimeMediaSource::start):
228         (WebCore::RealtimeMediaSource::stop):
229         (WebCore::RealtimeMediaSource::requestStop):
230         (WebCore::RealtimeMediaSource::reset): Deleted.
231         * platform/mediastream/RealtimeMediaSource.h:
232         * platform/mediastream/mac/AVMediaCaptureSource.h:
233         * platform/mediastream/mac/AVMediaCaptureSource.mm:
234         (WebCore::AVMediaCaptureSource::AVMediaCaptureSource):
235         (WebCore::AVMediaCaptureSource::captureSessionIsRunningDidChange):
236         (WebCore::AVMediaCaptureSource::reset): Deleted.
237         (WebCore::AVMediaCaptureSource::isProducingData): Deleted.
238         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
239         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
240         (WebCore::CoreAudioCaptureSource::startProducingData):
241         (WebCore::CoreAudioCaptureSource::stopProducingData):
242         (WebCore::CoreAudioCaptureSource::audioSourceProvider):
243         * platform/mediastream/mac/CoreAudioCaptureSource.h:
244         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
245         (WebCore::MockRealtimeAudioSourceMac::render):
246         (WebCore::MockRealtimeAudioSource::createMuted): Deleted.
247         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
248         (WebCore::MockRealtimeVideoSource::createMuted): Deleted.
249         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
250         (WebCore::RealtimeIncomingAudioSource::create):
251         (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
252         (WebCore::RealtimeIncomingAudioSource::~RealtimeIncomingAudioSource):
253         (WebCore::RealtimeIncomingAudioSource::startProducingData):
254         (WebCore::RealtimeIncomingAudioSource::stopProducingData):
255         (WebCore::RealtimeIncomingAudioSource::setSourceTrack):
256         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
257         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
258         (WebCore::RealtimeIncomingVideoSource::create):
259         (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
260         (WebCore::RealtimeIncomingVideoSource::startProducingData):
261         (WebCore::RealtimeIncomingVideoSource::setSourceTrack):
262         (WebCore::RealtimeIncomingVideoSource::stopProducingData):
263         (WebCore::RealtimeIncomingVideoSource::OnFrame):
264         * platform/mediastream/mac/RealtimeIncomingVideoSource.h:
265         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
266         (WebCore::WebAudioSourceProviderAVFObjC::setClient):
267         * platform/mock/MockMediaEndpoint.cpp:
268         (WebCore::MockMediaEndpoint::createMutedRemoteSource):
269         (WebCore::MockMediaEndpoint::unmuteTimerFired):
270         * platform/mock/MockRealtimeAudioSource.cpp:
271         (WebCore::MockRealtimeAudioSource::createMuted):
272         (WebCore::MockRealtimeAudioSource::startProducingData):
273         (WebCore::MockRealtimeAudioSource::stopProducingData):
274         * platform/mock/MockRealtimeAudioSource.h:
275         * platform/mock/MockRealtimeMediaSource.cpp:
276         (WebCore::MockRealtimeMediaSource::startProducingData): Deleted.
277         (WebCore::MockRealtimeMediaSource::stopProducingData): Deleted.
278         * platform/mock/MockRealtimeMediaSource.h:
279         * platform/mock/MockRealtimeVideoSource.cpp:
280         (WebCore::MockRealtimeVideoSource::createMuted):
281         (WebCore::MockRealtimeVideoSource::startProducingData):
282         (WebCore::MockRealtimeVideoSource::stopProducingData):
283         (WebCore::MockRealtimeVideoSource::generateFrame):
284         * platform/mock/MockRealtimeVideoSource.h:
285
286 2017-05-15  Myles C. Maxfield  <mmaxfield@apple.com>
287
288         Migrate Font constructor from bools to enums
289         https://bugs.webkit.org/show_bug.cgi?id=172140
290
291         Reviewed by Tim Horton.
292
293         In https://bugs.webkit.org/show_bug.cgi?id=168487, I'm adding a new flag to Font. We can't
294         keep having just a pile of bools in this class. Instead, we should be using enums.
295
296         No new tests because there is no behavior change.
297
298         * css/CSSFontFace.cpp:
299         (WebCore::CSSFontFace::font):
300         * css/CSSFontFaceSource.cpp:
301         (WebCore::CSSFontFaceSource::font):
302         * css/CSSSegmentedFontFace.cpp:
303         * loader/cache/CachedFont.cpp:
304         (WebCore::CachedFont::createFont):
305         * platform/graphics/Font.cpp:
306         (WebCore::Font::Font):
307         (WebCore::Font::verticalRightOrientationFont):
308         (WebCore::Font::uprightOrientationFont):
309         (WebCore::Font::brokenIdeographFont):
310         (WebCore::Font::description):
311         (WebCore::Font::mathData):
312         * platform/graphics/Font.h:
313         (WebCore::Font::create):
314         (WebCore::Font::origin):
315         (WebCore::Font::isInterstitial):
316         (WebCore::Font::widthForGlyph):
317         (WebCore::Font::isCustomFont): Deleted.
318         (WebCore::Font::isLoading): Deleted.
319         * platform/graphics/FontRanges.cpp:
320         * platform/graphics/cocoa/FontCocoa.mm:
321         (WebCore::Font::platformInit):
322         * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
323         (WebCore::Font::platformCreateScaledFont):
324         * platform/graphics/win/SimpleFontDataCGWin.cpp:
325         (WebCore::Font::platformInit):
326         * platform/graphics/win/SimpleFontDataDirect2D.cpp:
327         (WebCore::Font::platformInit):
328         * platform/graphics/win/SimpleFontDataWin.cpp:
329         (WebCore::Font::platformCreateScaledFont):
330         (WebCore::Font::determinePitch):
331         * rendering/SimpleLineLayout.cpp:
332         (WebCore::SimpleLineLayout::canUseForFontAndText):
333
334 2017-05-15  Youenn Fablet  <youenn@apple.com>
335
336         WebRTC outgoing muted video sources should send black frames
337         https://bugs.webkit.org/show_bug.cgi?id=170627
338         <rdar://problem/31513869>
339
340         Reviewed by Eric Carlson.
341
342         Covered by updated test.
343
344         Instead of sending one black frame and then another one asynchronously,
345         we use the timer to send a black frame every second when outgoing source is muted.
346
347         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
348         (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged):
349         (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged):
350         (WebCore::RealtimeOutgoingVideoSource::sendBlackFrames):
351         (WebCore::RealtimeOutgoingVideoSource::sendBlackFrame): Deleted.
352         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
353         * testing/Internals.cpp:
354         (WebCore::Internals::videoSampleAvailable):
355
356 2017-05-15  David Kilzer  <ddkilzer@apple.com>
357
358         Crash in libxml2.2.dylib: xmlDictReference
359         <https://webkit.org/b/172086>
360         <rdar://problem/23643436>
361
362         Reviewed by Daniel Bates.
363
364         Speculative fix and code clean-up based on source code
365         inspection.  The fix for the crash is in two parts that change
366         XSLStyleSheet::parseString():
367         1. Always set m_stylesheetDoc to nullptr after freeing it via
368            XSLStyleSheet::clearXSLStylesheetDocument().
369         2. Add nullptr check before using m_stylesheetDoc from parent.
370
371         Broadly speaking, the changes are:
372         - Extract code to reset m_stylesheetDoc into new private
373           XSLStyleSheet::clearXSLStylesheetDocument() method.  There is
374           a special contract between m_stylesheetDoc and
375           m_stylesheetDocTaken that wasn't being followed every time.
376           See comment in XSLStyleSheet::compileStyleSheet().
377         - XSLStyleSheet::clearDocuments() now calls new
378           clearXSLStylesheetDocument() method.  Previously, it was not
379           checking or resetting m_stylesheetDocTaken, and it might have
380           leaked an xmlDocPtr if m_stylesheetDoc was set and
381           m_stylesheetDocTaken was false.
382         - XSLStyleSheet::parseString() now calls new
383           clearXSLStylesheetDocument() method.  Previously, it did not
384           clear m_stylesheetDoc after freeing it, and it could return
385           early due to a failure in xmlCreateMemoryParserCtxt().
386         - In XSLStyleSheet::parseString() use checked arithmetic when
387           calculating 'size' for xmlCreateMemoryParserCtxt() and
388           xmlCtxtReadMemory().  This code used to do an implicit
389           unsigned -> signed integer conversion that could overflow.
390         - Always iterate m_children using an 'auto& import' variable.
391
392         * xml/XSLStyleSheet.h:
393         (WebCore::XSLStyleSheet::clearXSLStylesheetDocument): Add declaration.
394         (WebCore::XSLStyleSheet::m_disabled): Add default initializer.
395         (WebCore::XSLStyleSheet::m_stylesheetDoc): Ditto.
396         (WebCore::XSLStyleSheet::m_stylesheetDocTaken): Ditto.
397         (WebCore::XSLStyleSheet::m_parentStyleSheet): Ditto.
398
399         * xml/XSLStyleSheetLibxslt.cpp:
400         (WebCore::XSLStyleSheet::XSLStyleSheet): Get rid of redundant
401         initializers.  Set m_parentStyleSheet if needed.
402         (WebCore::XSLStyleSheet::~XSLStyleSheet): Call
403         clearXSLStylesheetDocument() instead of custom code.  Switch
404         m_children fast iteration to use 'auto& import' variable.
405         (WebCore::XSLStyleSheet::isLoading): Switch m_children fast
406         iteration to use 'auto& import' variable.
407         (WebCore::XSLStyleSheet::clearDocuments): Call
408         clearXSLStylesheetDocument() instead of setting m_stylesheetDoc
409         to nullptr.  This might fix an occasional xmlDocPtr leak.
410         (WebCore::XSLStyleSheet::clearXSLStylesheetDocument): Add.  This
411         method always sets m_stylesheetDoc to nullptr (after freeing it
412         if necessary) and sets m_stylesheetDocTaken to false.
413         (WebCore::XSLStyleSheet::parseString): Call
414         clearXSLStylesheetDocument().  Prior to this, m_stylesheetDoc
415         might be left pointing to a freed value, and this method could
416         return early if xmlCreateMemoryParserCtxt() failed.  Switch to
417         using Checked<> to compute required buffer size to parse XSL
418         stylesheet, and return early on overflow.  Clean up existing
419         return statements to use boolean expressions.  Add nullptr check
420         for m_parentStyleSheet->m_stylesheetDoc before using it.
421         (WebCore::XSLStyleSheet::loadChildSheet): Get rid of local
422         variable by calling loadSheet() from last array element.
423         (WebCore::XSLStyleSheet::compileStyleSheet): Add debug assert
424         that m_stylesheetDoc is not nullptr.
425
426 2017-05-15  Jer Noble  <jer.noble@apple.com>
427
428         Add experimental setting to allow document gesture interaction to fulfill media playback gesture requirement
429         https://bugs.webkit.org/show_bug.cgi?id=172131
430
431         Reviewed by Eric Carlson.
432
433         Test: media/restricted-audio-playback-with-document-gesture.html
434
435         Move all calls to ScriptController::processingUserGestureForMedia() to the new Document equivalent. In Document,
436         if the new setting is enabled, return true from processingUserGestureForMedia() if the top-level document has had
437         a user gesture interaction.
438
439         * Modules/mediastream/MediaStream.cpp:
440         (WebCore::MediaStream::processingUserGestureForMedia):
441         * Modules/mediastream/MediaStream.h:
442         * Modules/webaudio/AudioContext.cpp:
443         (WebCore::AudioContext::processingUserGestureForMedia):
444         (WebCore::AudioContext::willBeginPlayback):
445         (WebCore::AudioContext::willPausePlayback):
446         * Modules/webaudio/AudioContext.h:
447         * dom/Document.cpp:
448         (WebCore::Document::processingUserGestureForMedia):
449         * dom/Document.h:
450         * html/HTMLMediaElement.cpp:
451         (WebCore::HTMLMediaElement::load):
452         (WebCore::HTMLMediaElement::audioTrackEnabledChanged):
453         (WebCore::HTMLMediaElement::seekWithTolerance):
454         (WebCore::HTMLMediaElement::play):
455         (WebCore::HTMLMediaElement::playInternal):
456         (WebCore::HTMLMediaElement::pause):
457         (WebCore::HTMLMediaElement::pauseInternal):
458         (WebCore::HTMLMediaElement::setMuted):
459         (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker):
460         (WebCore::HTMLMediaElement::processingUserGestureForMedia):
461         * html/HTMLMediaElement.h:
462         * html/MediaElementSession.cpp:
463         (WebCore::MediaElementSession::playbackPermitted):
464         (WebCore::MediaElementSession::dataLoadingPermitted):
465         (WebCore::MediaElementSession::fullscreenPermitted):
466         (WebCore::MediaElementSession::canShowControlsManager):
467         (WebCore::MediaElementSession::showPlaybackTargetPicker):
468         * page/Settings.in:
469         * platform/audio/PlatformMediaSession.h:
470
471 2017-05-15  Jer Noble  <jer.noble@apple.com>
472
473         Only ever initialize LibWebRTCProvider's staticFactoryAndThreads() factories once.
474         https://bugs.webkit.org/show_bug.cgi?id=172047
475
476         Reviewed by Youenn Fablet.
477
478         Wrap the initilization of the factories contained in staticFactoryAndThreads() in a call_once to ensure
479         new factories aren't created every time it's called.
480
481         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
482         (WebCore::staticFactoryAndThreads):
483
484 2017-05-15  Joseph Pecoraro  <pecoraro@apple.com>
485
486         Web Inspector: CRASH seen with DOM.setOuterHTML when there is no documentElement
487         https://bugs.webkit.org/show_bug.cgi?id=172135
488         <rdar://problem/32175860>
489
490         Reviewed by Brian Burg.
491
492         Test: inspector/dom/setOuterHTML-no-document-element.html
493
494         * inspector/DOMPatchSupport.cpp:
495         (WebCore::DOMPatchSupport::patchDocument):
496         Null check the document element which might not exist.
497
498 2017-05-15  Said Abou-Hallawa  <sabouhallawa@apple.com>
499
500         REGRESSION (216471): Infinite repaint-drawing loop when asynchronously decoding incomplete image frames
501         https://bugs.webkit.org/show_bug.cgi?id=171900
502
503         Reviewed by Tim Horton.
504
505         -- Don't destroy incomplete decoded image frames for large images. This
506         is to avoid flickering while decoding another image frame with the new
507         data. The old incomplete image frame will be destroyed once the newer one
508         finishes decoding.
509
510         -- Extend the enum ImageFrame::DecodingStatus by adding a new value called
511         'Decoding'. This new value will never be cached in the ImageFrame::
512         m_decodingStatus. Add a member m_currentFrameDecodingStatus to BitmapImage.
513         The purpose of this member is to invalidate the current frame, without
514         deleting it, when new encoded data is received.
515
516         -- Don't wait until the native image is decoded to cache the ImageFrame
517         decodingStatus. There is a big chance that more data arrives between
518         starting the decoding and finishing it such that the decoding changes
519         from Partial to Complete. We need to prevent keeping incomplete ImageFrames
520         cached because we mistakenly assume they are complete. To fix this issue
521         we need to know the ImageFrame decodingStatus when the decoding is requested.
522
523         * platform/graphics/BitmapImage.cpp:
524         (WebCore::BitmapImage::destroyDecodedData):
525         (WebCore::BitmapImage::dataChanged):
526         (WebCore::BitmapImage::draw):
527         (WebCore::BitmapImage::internalStartAnimation): At the beginning of this 
528         function we check whether the next frame is being decoded or not and we 
529         return DecodingActive if it is. Let's handle the second check here also 
530         before requesting the decoding of nextFrame. We need to check whether the
531         nextFrame has a native image with decoded with the native size or not.
532         (WebCore::BitmapImage::internalAdvanceAnimation):
533         (WebCore::BitmapImage::imageFrameAvailableAtIndex):
534         * platform/graphics/BitmapImage.h:
535         * platform/graphics/ImageFrame.cpp:
536         (WebCore::ImageFrame::operator=):
537         (WebCore::ImageFrame::setDecodingStatus):
538         (WebCore::ImageFrame::decodingStatus):
539         * platform/graphics/ImageFrame.h:
540         (WebCore::ImageFrame::isInvalid):
541         (WebCore::ImageFrame::isPartial):
542         (WebCore::ImageFrame::isComplete):
543         (WebCore::ImageFrame::setDecoding): Deleted.
544         (WebCore::ImageFrame::decoding): Deleted.
545         (WebCore::ImageFrame::isEmpty): Deleted.
546         * platform/graphics/ImageFrameCache.cpp:
547         (WebCore::ImageFrameCache::setNativeImage):
548         (WebCore::ImageFrameCache::cacheMetadataAtIndex):
549         (WebCore::ImageFrameCache::cacheNativeImageAtIndex):
550         (WebCore::ImageFrameCache::cacheNativeImageAtIndexAsync):
551         (WebCore::ImageFrameCache::startAsyncDecodingQueue):
552         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex):
553         (WebCore::ImageFrameCache::stopAsyncDecodingQueue):
554         (WebCore::ImageFrameCache::frameAtIndexCacheIfNeeded):
555         (WebCore::ImageFrameCache::frameDecodingStatusAtIndex):
556         (WebCore::ImageFrameCache::cacheFrameMetadataAtIndex): Deleted.
557         (WebCore::ImageFrameCache::cacheFrameNativeImageAtIndex): Deleted.
558         (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex): Deleted.
559         (WebCore::ImageFrameCache::frameIsCompleteAtIndex): Deleted.
560         * platform/graphics/ImageFrameCache.h:
561         (WebCore::ImageFrameCache::ImageFrameRequest::operator==):
562         * platform/graphics/ImageSource.cpp:
563         (WebCore::ImageSource::dataChanged):
564         * platform/graphics/ImageSource.h:
565         (WebCore::ImageSource::destroyIncompleteDecodedData):
566         (WebCore::ImageSource::requestFrameAsyncDecodingAtIndex): Let the caller
567         decide whether another request for the same image frame is allowed or not.
568         (WebCore::ImageSource::frameDecodingStatusAtIndex):
569         (WebCore::ImageSource::frameIsCompleteAtIndex): Deleted.
570         * platform/image-decoders/ImageDecoder.cpp:
571         (WebCore::ImageDecoder::frameDurationAtIndex):
572         (WebCore::ImageDecoder::createFrameImageAtIndex):
573         * platform/image-decoders/bmp/BMPImageReader.cpp:
574         (WebCore::BMPImageReader::decodeBMP):
575         * platform/image-decoders/gif/GIFImageDecoder.cpp:
576         (WebCore::GIFImageDecoder::clearFrameBufferCache):
577         (WebCore::GIFImageDecoder::haveDecodedRow):
578         (WebCore::GIFImageDecoder::frameComplete):
579         (WebCore::GIFImageDecoder::initFrameBuffer):
580         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
581         (WebCore::JPEGImageDecoder::outputScanlines):
582         (WebCore::JPEGImageDecoder::jpegComplete):
583         * platform/image-decoders/png/PNGImageDecoder.cpp:
584         (WebCore::PNGImageDecoder::rowAvailable):
585         (WebCore::PNGImageDecoder::pngComplete):
586         (WebCore::PNGImageDecoder::clearFrameBufferCache):
587         (WebCore::PNGImageDecoder::frameComplete):
588         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
589         (WebCore::WEBPImageDecoder::decode):
590
591 2017-05-15  Chris Dumez  <cdumez@apple.com>
592
593         Align WebKitCSSMatrix stringifier with spec for DOMMatrix
594         https://bugs.webkit.org/show_bug.cgi?id=172114
595
596         Reviewed by Simon Fraser.
597
598         Align WebKitCSSMatrix stringifier with spec for DOMMatrix after:
599         - https://github.com/w3c/fxtf-drafts/pull/148
600
601         The following changes were made:
602         - Use EcmaScript's ToString() to convert floating point values to string
603         - Throw an invalid state error if the matrix contains non-finite values
604         - Made WebKitCSSMatrix.toString enumerable as per [1].
605
606         [1] https://heycam.github.io/webidl/#es-stringifier
607
608         Test: fast/css/matrix-stringifier.html
609
610         * css/WebKitCSSMatrix.cpp:
611         (WebCore::WebKitCSSMatrix::toString):
612         * css/WebKitCSSMatrix.h:
613         * css/WebKitCSSMatrix.idl:
614         * platform/graphics/transforms/TransformationMatrix.cpp:
615         (WebCore::TransformationMatrix::containsOnlyFiniteValues):
616         * platform/graphics/transforms/TransformationMatrix.h:
617
618 2017-05-15  Mark Lam  <mark.lam@apple.com>
619
620         WorkerRunLoop::Task::performTask() should check !scriptController->isTerminatingExecution().
621         https://bugs.webkit.org/show_bug.cgi?id=171775
622         <rdar://problem/30975761>
623
624         Reviewed by Filip Pizlo.
625
626         Currently, WorkerThread::stop() calls scheduleExecutionTermination() to terminate
627         JS execution first, followed by posting a cleanup task to the worker, and lastly,
628         it invokes terminate() on the WorkerRunLoop.
629
630         As a result, before the run loop is terminated, the worker thread may observe the
631         TerminatedExecutionException in JS code, bail out, see another JS task to run,
632         re-enters the VM to run said JS code, and fails with an assertion due to the
633         TerminatedExecutionException still being pending on VM entry.
634
635         WorkerRunLoop::Task::performTask() already has a check to only allow a task to
636         run if and only if !runLoop.terminated() and the task is not a clean up task.
637         We'll fix the above race by changing WorkerRunLoop::Task::performTask() to check
638         !context->script()->isTerminatingExecution() instead of !runLoop.terminated().
639         Since WorkerThread::stop() always scheduleExecutionTermination() before it
640         terminates the run loop, !context->script()->isTerminatingExecution() implies
641         !runLoop.terminated().
642
643         The only time that runLoop is terminated without scheduleExecutionTermination()
644         being called is when WorkerThread::stop() is called before the WorkerThread has
645         finished creating its WorkerGlobalScope.  In this scenario, WorkerThread::stop()
646         will still terminate the run loop.  Hence, after the WorkerGlobalScope is created
647         (in WorkerThread::workerThread()), we will check if the run loop has been
648         terminated (i.e. stop() was called).  If so, we'll scheduleExecutionTermination()
649         there, and guarantee that if runloop.terminated() is true, then
650         context->script()->isTerminatingExecution() is also true.
651
652         Solutions that were considered but did not work (recorded for future reference):
653
654         1. In WorkerThread::stop(), call scheduleExecutionTermination() only after it
655            posts the cleanup task and terminate the run loop.
656
657            This did not work because this creates a race where the worker thread may run
658            the cleanup task before WorkerThread::stop() finishes.  As a result, the
659            scriptController may be deleted before we get to invoke scheduleExecutionTermination()
660            on it, thereby resulting in a use after free.
661
662            To make this work, we would have to change the life cycle management strategy
663            of the WorkerScriptController.  This is a more risky change that we would
664            want to take on at this time, and may also not be worth the gain.
665
666         2. Break scheduleExecutionTermination() up into 2 parts i.e. WorkerThread::stop()
667            will:
668            1. set the scriptControllers m_isTerminatingExecution flag before
669               posting the cleanup task and terminating the run loop, and
670            2. invoke VM::notifyNeedsTermination() after posting the cleanup task and
671               terminating the run loop.
672
673            This requires that we protect the liveness of the VM until we can invoke
674            notifyNeedsTermination() on it.
675
676            This did not work because:
677            1. We may end up destructing the VM in WorkerThread::stop() i.e. in the main
678               web frame, but only the worker thread holds the JS lock for the VM.
679
680               We can make the WorkerThread::stop() acquire the JS lock just before it
681               releases the protected VM's RefPtr, but that would mean the main thread
682               may be stuck waiting a bit for the worker thread to release its JSLock.
683               This is not desirable.
684
685            2. In practice, changing the liveness period of the Worker VM relative to its
686               WorkerScriptController and WorkerGlobalScope also has unexpected
687               ramifications.  We observed many worker tests failing with assertion
688               failures and crashes due to this change.
689
690            Hence, this approach is also a more risky change than it appears on the
691            surface, and is not worth exploring at this time.
692
693         In the end, changing WorkerRunLoop::Task::performTask() to check for
694         !scriptController->isTerminatingExecution() is the most straight forward solution
695         that is easy to prove correct.
696
697         Also fixed a race in WorkerThread::workerThread() where it can delete the
698         WorkerGlobalScope while WorkerThread::stop() is in the midst of accessing it.
699         We now guard the the nullifying of m_workerGlobalScope with the
700         m_threadCreationAndWorkerGlobalScopeMutex as well.
701
702         UPDATE: the only new thing in this patch for re-landing (vs one previously landed)
703         is that instead of nullifying m_workerGlobalScope directly (thereby deleting the
704         WorkerGlobalScope context), we'll swap it out and delete it only after we've
705         unlocked the m_threadCreationAndWorkerGlobalScopeMutex.  This is needed because
706         the destruction of the WorkerGlobalScope will cause the main thread to race against
707         the worker thread to delete the WorkerThread object, and the WorkerThread object
708         owns the mutex that we need to unlock after nullifying the m_workerGlobalScope
709         field.
710
711         This issue is covered by an existing test that I just unskipped in TestExpectations.
712
713         * bindings/js/JSDOMPromiseDeferred.cpp:
714         (WebCore::DeferredPromise::callFunction):
715
716         * bindings/js/WorkerScriptController.cpp:
717         (WebCore::WorkerScriptController::scheduleExecutionTermination):
718         - Added a check to do nothing and return early if the scriptController is already
719           terminating execution.
720
721         * workers/WorkerRunLoop.cpp:
722         (WebCore::WorkerRunLoop::runInMode):
723         (WebCore::WorkerRunLoop::runCleanupTasks):
724         (WebCore::WorkerRunLoop::Task::performTask):
725
726         * workers/WorkerRunLoop.h:
727         - Made Task::performTask() private and make Task befriend the WorkerRunLoop class.
728           This ensures that only the WorkerRunLoop may call performTask().
729           Note: this change only formalizes and hardens a relationship that was already
730           in place before this.
731
732         * workers/WorkerThread.cpp:
733         (WebCore::WorkerThread::start):
734         (WebCore::WorkerThread::workerThread):
735         (WebCore::WorkerThread::stop):
736         * workers/WorkerThread.h:
737         - Renamed m_threadCreationMutex to m_threadCreationAndWorkerGlobalScopeMutex so
738           that it more accurately describes what it guards.
739
740 2017-05-15  Myles C. Maxfield  <mmaxfield@apple.com>
741
742         Unicode characters which can't be rendered in any font are invisible
743         https://bugs.webkit.org/show_bug.cgi?id=171942
744         <rdar://problem/32054234>
745
746         Reviewed by Tim Horton.
747
748         There are some Unicode characters which don't have any font on the system which can render them.
749         These characters should be drawn as the .notdef "tofu." This is for security and usability, as
750         well as what Firefox and Chrome do. However, we still shouldn't draw characters with the
751         Default_Ignorable_Code_Point property, because this is what CoreText does.
752
753         This behavior is also what the Unicode spec recommends: In UTR #36 Unicode Security Considerations:
754         http://www.unicode.org/reports/tr36/#Recommendations_General
755         "If there is no available glyph for a character, never show a simple "?" or omit the character."
756
757         Also relevant is the Unicode Standard section 5.3 Unknown and MIssing Characters, starting at page
758         marked 203 in the following: http://www.unicode.org/versions/Unicode9.0.0/ch05.pdf
759
760         Tests: fast/text/default-ignorable.html
761                fast/text/unknown-char-notdef.html
762
763         * platform/graphics/WidthIterator.cpp:
764         (WebCore::characterMustDrawSomething):
765
766 2017-05-15  Timothy Horton  <timothy_horton@apple.com>
767
768         Null deref under WebContentReader::readURL when interacting with a file URL
769         https://bugs.webkit.org/show_bug.cgi?id=172045
770         <rdar://problem/25880647>
771
772         Reviewed by Wenson Hsieh.
773
774         * editing/ios/EditorIOS.mm:
775         (WebCore::Editor::WebContentReader::readURL):
776         The AppSupport soft link was wrong, as there is no such framework in /System/Library/Frameworks.
777         Thus, any time we hit this codepath, the soft linked function would be null, and calling it would crash.
778         Instead of just fixing the soft link, remove the code, because it does not seem necessary to
779         special-case fileURLs to images in the media directory.
780
781 2017-05-15  Eric Carlson  <eric.carlson@apple.com>
782
783         ASSERTION FAILED: wasRemoved in WebCore::RealtimeMediaSourceCenter::removeDevicesChangedObserver(DevicesChangedObserverToken)
784         https://bugs.webkit.org/show_bug.cgi?id=171529
785         <rdar://problem/31945791>
786
787         Reviewed by Jer Noble.
788
789         No new tests, fixes a crash in existing tests.
790
791         * Modules/mediastream/MediaDevices.cpp:
792         (WebCore::MediaDevices::MediaDevices): Use a weak ptr.
793
794         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
795         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
796         (WebCore::observerMap):  Use a static hash map for observers because the
797         source center can change at runtime.
798         (WebCore::RealtimeMediaSourceCenter::addDevicesChangedObserver):
799         (WebCore::RealtimeMediaSourceCenter::removeDevicesChangedObserver):
800         (WebCore::RealtimeMediaSourceCenter::captureDevicesChanged):
801
802 2017-05-15  Brent Fulgham  <bfulgham@apple.com>
803
804         [iOS WK1] Do not try to dispatch messages to subframes if their documents have not been constructed yet.
805         https://bugs.webkit.org/show_bug.cgi?id=172059
806         <rdar://problem/31963192>
807
808         Reviewed by Zalan Bujtas.
809
810         On iOS WK1 we can end up in an inconsistent state, where
811         1. The web thread is inside a newly-injected iframe's document's constructor and
812         2. waiting on a delegate callback on the main thread
813         while the main thread
814         (a) Evaluates arbitrary JavaScript that modifies storage which
815         (b) Triggers an event dispatch.
816  
817         * storage/StorageEventDispatcher.cpp:
818         (WebCore::StorageEventDispatcher::dispatchSessionStorageEvents): If the sub-frame's document
819         is in an inconsistent state, skip it.
820         (WebCore::StorageEventDispatcher::dispatchLocalStorageEvents): Ditto.
821         (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames): Ditto.
822         (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames): Ditto.
823
824 2017-05-15  Zalan Bujtas  <zalan@apple.com>
825
826         Simple line layout: Leading whitespace followed by a <br> produces an extra linebreak.
827         https://bugs.webkit.org/show_bug.cgi?id=172076
828
829         Reviewed by Antti Koivisto.
830
831         When the collapsed whitespace does not fit the line, we need to push it to the next line
832         so that we can decide whether any soft/hard linebreak should be skipped (to avoid double line breaks) or not.
833
834         Test: fast/text/simple-line-layout-leading-whitespace-with-soft-hard-linebreak.html
835
836         * rendering/SimpleLineLayout.cpp:
837         (WebCore::SimpleLineLayout::consumeLineBreakIfNeeded): special handling <br>
838         (WebCore::SimpleLineLayout::firstFragment): Now we need to deal with leading collapsed whitespace.
839         (WebCore::SimpleLineLayout::createLineRuns): We need to push even the collapsed whitespace to the next line.
840
841 2017-05-15  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
842
843         Invalid MediaSource duration value should throw TyperError instead of InvalidStateError
844         https://bugs.webkit.org/show_bug.cgi?id=171653
845
846         Reviewed by Chris Dumez.
847
848         Modify MediaSource::setDuration to throw a TypeError when duration value is invalid as per MSE specification
849         (https://www.w3.org/TR/2016/REC-media-source-20161117/#dom-mediasource-duration).
850
851         Update expectations of corresponding WPT test.
852
853         * Modules/mediasource/MediaSource.cpp:
854         (WebCore::MediaSource::setDuration):
855         (WebCore::MediaSource::setDurationInternal):
856
857 2017-05-15  Gwang Yoon Hwang  <yoon@igalia.com>
858
859         [CAIRO] Painting an image mask with a matrix above Pixman's limit breaks internal states of Cairo
860         https://bugs.webkit.org/show_bug.cgi?id=169094
861
862         Reviewed by Žan Doberšek.
863
864         It is the same problem which addressed in r212431.
865         In HiDPI situation, it happens easily due to the size of coordinates.
866         Also, if this bug happens, it will break the rendering continuously
867         since we are reusing graphics contexts to render webpages in same
868         webview.
869
870         Test: fast/hidpi/hidpi-long-page-with-inset-element.html
871
872         * platform/graphics/cairo/PlatformContextCairo.cpp:
873         (WebCore::PlatformContextCairo::pushImageMask):
874         We can avoid the limit of the Pixman by reducing the source surface's
875         size, and it will create a minimal pattern matrix.
876
877 2017-05-14  Zan Dobersek  <zdobersek@igalia.com>
878
879         Unreviewed build fix with newer Perl versions.
880
881         * bindings/scripts/CodeGeneratorJS.pm:
882         (AddLegacyCallerOperationIfNeeded): Support for experimental push on scalar (and
883         other auto-dereferencing) was removed in Perl 5.24. Instead, the LegacyCallers array
884         has to be dereferenced when pushing new values to it.
885
886 2017-05-14  Sam Weinig  <sam@webkit.org>
887
888         [WebIDL/DOM] Remove need for custom bindings for HTMLAllCollection and bring up to spec
889         https://bugs.webkit.org/show_bug.cgi?id=172095
890
891         Reviewed by Darin Adler.
892
893         - Adds support for the legacycaller WebIDL special annotation.
894         - Updates implementation of HTMLAllCollection to match the current HTML spec.
895
896         Test: fast/dom/document-all.html
897
898         * CMakeLists.txt:
899         * WebCore.xcodeproj/project.pbxproj:
900         * bindings/js/JSBindingsAllInOne.cpp:
901         * bindings/js/JSHTMLAllCollectionCustom.cpp: Removed.
902         Removed JSHTMLAllCollectionCustom.cpp
903
904         * bindings/scripts/CodeGeneratorJS.pm:
905         (GenerateInterface):
906         (AddLegacyCallerOperationIfNeeded):
907         Before code generation, clone all the legacycaller operations and put them
908         in their own set, so they can form an overload set.
909         
910         (AddStringifierOperationIfNeeded):
911         Use IDLParser::cloneType as the FIXME suggested.
912
913         (GenerateHeader):
914         Group call related functionality together and use new IsCallable predicate.
915
916         (GenerateOverloadedFunctionOrConstructor):
917         Generalize a little bit to allow the function being overloaded to be an overloaded legacycaller.
918
919         (GenerateImplementation):
920         Add call to generate the legacycaller code.
921
922         (GenerateLegacyCallerDefinitions):
923         (GenerateLegacyCallerDefinition):
924         Generate the legacycaller definition, using GenerateArgumentsCountCheck, GenerateParametersCheck
925         and GenerateImplementationFunctionCall to do all the heavy lifting.
926
927         (IsCallable):
928         Add helper predicate for both custom calls and legacycaller.
929
930         * bindings/scripts/IDLParser.pm:
931         (cloneType):.
932         (cloneArgument):.
933         (cloneOperation):
934         Add cloning functions for IDLArgument and IDLOperation, and make IDLType's
935         clone feasible for calling outside the package by removing the unneeded 
936         self parameter.
937
938         * bindings/scripts/test/JS/JSTestObj.cpp
939         * bindings/scripts/test/JS/JSTestObj.h
940         * bindings/scripts/test/TestObj.idl:
941         Add testing of legacycaller overloading.
942
943         * dom/Document.cpp:
944         (WebCore::Document::allFilteredByName):
945         * dom/Document.h:
946         Add new collection access for the HTMLAllNamedSubCollection.
947
948         * html/CachedHTMLCollection.h:
949         (WebCore::nameShouldBeVisibleInDocumentAll):
950         Update list of tags to match the current spec.
951
952         * html/CollectionType.h:
953         Add new type for HTMLAllNamedSubCollection.
954
955         * html/GenericCachedHTMLCollection.cpp:
956         (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches):
957         Specify that DocumentAllNamedItems does not want
958         the default elementMatches.
959  
960         * html/HTMLAllCollection.cpp:
961         (WebCore::HTMLAllCollection::namedOrIndexedItemOrItems):
962         (WebCore::HTMLAllCollection::namedItemOrItems):
963         (WebCore::HTMLAllNamedSubCollection::~HTMLAllNamedSubCollection):
964         (WebCore::HTMLAllNamedSubCollection::elementMatches):
965         * html/HTMLAllCollection.h:
966         Move implementations from the custom binding, and re-implement to
967         match the spec. Alternate names to item/namedItem were needed to not
968         shadow the existing ones in HTMLCollection. HTMLAllNamedSubCollection
969         is a simple HTMLCollection that matches on a name, following the rules
970         of document.all about which tags can have name attributes.
971
972         * html/HTMLAllCollection.idl:
973         Remove custom annotations and add legacycaller which is now supported.
974
975         * html/HTMLCollection.cpp:
976         (WebCore::invalidationTypeExcludingIdAndNameAttributes):
977         (WebCore::HTMLCollection::~HTMLCollection):
978         Add DocumentAllNamedItems.
979
980 2017-05-14  Zalan Bujtas  <zalan@apple.com>
981
982         Remove unused lambda in TextFragmentIterator::TextFragment::split() and cleanup dependencies.
983         https://bugs.webkit.org/show_bug.cgi?id=172089
984
985         Reviewed by David Kilzer.
986
987         * rendering/SimpleLineLayout.cpp:
988         (WebCore::SimpleLineLayout::splitFragmentToFitLine):
989         * rendering/SimpleLineLayoutTextFragmentIterator.h:
990         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split):
991         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen):
992
993 2017-05-13  David Kilzer  <ddkilzer@apple.com>
994
995         Unused lambda in JSWebKitSubtleCrypto::wrapKey()
996         <https://webkit.org/b/172087>
997
998         Reviewed by Chris Dumez.
999
1000         Fixes the following warning with newer clang:
1001
1002             Source/WebCore/bindings/js/JSWebKitSubtleCryptoCustom.cpp:594:35: error: lambda capture 'keyFormat' is not used [-Werror,-Wunused-lambda-capture]
1003                 auto exportSuccessCallback = [keyFormat, algorithm, parameters, wrappingKey, wrapper](const Vector<uint8_t>& exportedKeyData) mutable {
1004                                               ^
1005
1006         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
1007         (WebCore::JSWebKitSubtleCrypto::wrapKey): Remove unused lambda.
1008
1009 2017-05-13  Eric Carlson  <eric.carlson@apple.com>
1010
1011         [MediaStream] deviceId constraint doesn't work with getUserMedia
1012         https://bugs.webkit.org/show_bug.cgi?id=171877
1013         <rdar://problem/31899730>
1014
1015         Reviewed by Jer Noble.
1016
1017         Test: fast/mediastream/get-user-media-device-id.html
1018
1019         * Modules/mediastream/MediaConstraintsImpl.h:
1020         (WebCore::MediaConstraintsData::MediaConstraintsData): Add a constructor that 
1021         takes a const MediaConstraints&.
1022
1023         * Modules/mediastream/MediaDevices.cpp:
1024         (WebCore::MediaDevices::~MediaDevices): m_deviceChangedToken is a std::optional<>.
1025         * Modules/mediastream/MediaDevices.h:
1026
1027         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
1028         (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin): Don't return
1029         NULL for the main frame so the origin matches that returned for a UserMediaRequest.
1030
1031         * Modules/mediastream/UserMediaController.h:
1032         (WebCore::UserMediaController::setDeviceIDHashSalt): Deleted, not used.
1033         (WebCore::UserMediaController::deviceIDHashSalt): Deleted, not used.
1034
1035         * Modules/mediastream/UserMediaRequest.cpp:
1036         (WebCore::UserMediaRequest::allow): Add device ID hash salt parameter, set it on
1037         constraints.
1038         * Modules/mediastream/UserMediaRequest.h:
1039
1040         * platform/mediastream/MediaConstraints.h:
1041         * platform/mediastream/RealtimeMediaSource.cpp:
1042         (WebCore::RealtimeMediaSource::fitnessDistance): ASSERT if called for DeviceId.
1043         (WebCore::RealtimeMediaSource::selectSettings): Special case DeviceId because it
1044         we have to hash the device ID before comparing, and because the DeviceId can't be
1045         changed so it should never be added to the flattened constraints.
1046         (WebCore::RealtimeMediaSource::supportsConstraints):
1047         (WebCore::RealtimeMediaSource::applyConstraints):
1048         * platform/mediastream/RealtimeMediaSource.h:
1049
1050         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
1051         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Implement.
1052         * platform/mediastream/RealtimeMediaSourceCenter.h:
1053
1054         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp:
1055         (WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint): Deleted, unused.
1056         (WebCore::RealtimeMediaSourceSupportedConstraints::constraintFromName): Deleted, unused.
1057         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:
1058
1059         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1060         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
1061         (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints): Pass device
1062         id, not empty string.
1063         (WebCore::RealtimeMediaSourceCenterMac::validateRequestConstraints): Deleted.
1064         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
1065
1066         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
1067         (WebCore::MockRealtimeMediaSourceCenter::validateRequestConstraints): Deleted.
1068         * platform/mock/MockRealtimeMediaSourceCenter.h:
1069
1070 2017-05-13  Chris Dumez  <cdumez@apple.com>
1071
1072         Stop using RefPtr::release()
1073         https://bugs.webkit.org/show_bug.cgi?id=172074
1074
1075         Reviewed by Geoffrey Garen.
1076
1077         * css/parser/CSSPropertyParser.cpp:
1078         (WebCore::FontVariantLigaturesParser::finalizeValue):
1079         (WebCore::FontVariantNumericParser::finalizeValue):
1080         * css/parser/CSSPropertyParserHelpers.cpp:
1081         (WebCore::CSSPropertyParserHelpers::CalcParser::consumeValue):
1082         * loader/SubresourceLoader.cpp:
1083         (WebCore::SubresourceLoader::create):
1084         * loader/archive/mhtml/MHTMLArchive.cpp:
1085         (WebCore::MHTMLArchive::generateMHTMLData):
1086         * loader/archive/mhtml/MHTMLArchive.h:
1087         * loader/archive/mhtml/MHTMLParser.cpp:
1088         (WebCore::MHTMLParser::parseArchiveWithHeader):
1089         * platform/audio/ios/AudioFileReaderIOS.cpp:
1090         (WebCore::AudioFileReader::createBus):
1091         * platform/glib/SharedBufferGlib.cpp:
1092         (WebCore::SharedBuffer::createFromReadingFile):
1093         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
1094         (WebCore::CACFLayerTreeHost::create):
1095         * platform/graphics/cairo/CairoUtilities.cpp:
1096         (WebCore::copyCairoImageSurface):
1097         * platform/graphics/cairo/ImageBufferCairo.cpp:
1098         (WebCore::getImageData):
1099         * platform/graphics/gtk/IconGtk.cpp:
1100         (WebCore::Icon::createIconForFiles):
1101         * platform/graphics/win/FontCacheWin.cpp:
1102         (WebCore::FontCache::systemFallbackForCharacters):
1103         * platform/win/SharedBufferWin.cpp:
1104         (WebCore::SharedBuffer::createFromReadingFile):
1105
1106 2017-05-13  Javier Fernandez  <jfernandez@igalia.com>
1107
1108         [css-align] Implement the place-self shorthand
1109         https://bugs.webkit.org/show_bug.cgi?id=168846
1110
1111         Reviewed by Zalan Bujtas.
1112
1113         The CSS Box Alignment specification defines a new shorthand to set the
1114         Content Alignment properties (align-self and justify-self) at the
1115         same time.
1116
1117         This patch provides the implementation of the CSS parsing logic and the
1118         required regression tests.
1119
1120         Test: css3/parse-place-self.html
1121
1122         * css/CSSComputedStyleDeclaration.cpp:
1123         (WebCore::ComputedStyleExtractor::propertyValue):
1124         * css/CSSProperties.json:
1125         * css/StyleProperties.cpp:
1126         (WebCore::StyleProperties::getPropertyValue):
1127         * css/parser/CSSPropertyParser.cpp:
1128         (WebCore::CSSPropertyParser::consumePlaceSelfShorthand):
1129         (WebCore::CSSPropertyParser::parseShorthand):
1130         * css/parser/CSSPropertyParser.h:
1131
1132 2017-05-13  Commit Queue  <commit-queue@webkit.org>
1133
1134         Unreviewed, rolling out r216801.
1135         https://bugs.webkit.org/show_bug.cgi?id=172072
1136
1137         Many memory corruption crashes on worker threads (Requested by
1138         ap on #webkit).
1139
1140         Reverted changeset:
1141
1142         "WorkerRunLoop::Task::performTask() should check
1143         !scriptController->isTerminatingExecution()."
1144         https://bugs.webkit.org/show_bug.cgi?id=171775
1145         http://trac.webkit.org/changeset/216801
1146
1147 2017-05-13  Zalan Bujtas  <zalan@apple.com>
1148
1149         AccessibilityRenderObject::textUnderElement needs to assert on unclean tree.
1150         https://bugs.webkit.org/show_bug.cgi?id=172065
1151
1152         Reviewed by Simon Fraser.
1153
1154         r192103 changed the assert logic incorrectly. If the tree is dirty, regardless of the renderer's type,
1155         TextIterator will end up forcing style update/layout on the render tree.
1156         The original assert would have hit with bug 171546 prior to r216726.
1157
1158         * accessibility/AccessibilityRenderObject.cpp:
1159         (WebCore::AccessibilityRenderObject::textUnderElement):
1160
1161 2017-05-12  Simon Fraser  <simon.fraser@apple.com>
1162
1163         event.clientX/clientY should be in layout viewport coordinates
1164         https://bugs.webkit.org/show_bug.cgi?id=172018
1165
1166         Reviewed by Zalan Bujtas.
1167
1168         Fix clientX and clientY on mouse events to be relative to the layout viewport, to match
1169         getBoundingClientRect(), getClientRects() and fixed-position objects.
1170
1171         Also minor cleanup of MouseRelatedEvent to use initializers.
1172
1173         Test: fast/visual-viewport/client-coordinates-relative-to-layout-viewport.html
1174
1175         * dom/MouseRelatedEvent.cpp:
1176         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
1177         (WebCore::MouseRelatedEvent::init):
1178         (WebCore::MouseRelatedEvent::initCoordinates):
1179         (WebCore::contentsScrollOffset): Deleted.
1180         * dom/MouseRelatedEvent.h:
1181
1182 2017-05-12  Sam Weinig  <sam@webkit.org>
1183
1184         [WebIDL] Remove need for custom binding for Worker constructor
1185         https://bugs.webkit.org/show_bug.cgi?id=172050
1186
1187         Reviewed by Chris Dumez.
1188
1189         * CMakeLists.txt:
1190         * WebCore.xcodeproj/project.pbxproj:
1191         * bindings/js/JSWorkerCustom.cpp: Removed.
1192         Remove JSWorkerCustom.cpp
1193
1194         * bindings/scripts/CodeGeneratorJS.pm:
1195         (GenerateCallWith):
1196         * bindings/scripts/IDLAttributes.json:
1197         Add RuntimeFlags as a new option for the ConstructorCallWith extended attribute.
1198
1199         * workers/Worker.cpp:
1200         (WebCore::Worker::create):
1201         * workers/Worker.h:
1202         Update order of arguments to appease the generator.
1203
1204         * workers/Worker.idl:
1205         Add extended attributes for the constructor.
1206
1207 2017-05-12  Simon Fraser  <simon.fraser@apple.com>
1208
1209         The rects returned by Element/Range.getClientRects() should not be rounded
1210         https://bugs.webkit.org/show_bug.cgi?id=172057
1211
1212         Reviewed by Chris Dumez.
1213
1214         Fix createDOMRectVector() to not expand the rects to integer boundaries (which
1215         quad.enclosingBoundingBox() does), but to return rects with floating point
1216         values. This matches Chrome and Firefox, and matches getBoundingClientRect(),
1217         which does not integral snap.
1218
1219         * dom/DOMRect.cpp:
1220         (WebCore::createDOMRectVector):
1221
1222 2017-05-12  Jiewen Tan  <jiewen_tan@apple.com>
1223
1224         Elements should be inserted into a template element as its content's last child
1225         https://bugs.webkit.org/show_bug.cgi?id=171373
1226         <rdar://problem/31862949>
1227
1228         Reviewed by Ryosuke Niwa.
1229
1230         Before this change, our HTML parser obeys the following premises:
1231         1) A fostering child whose parent is a table should be inserted before its parent and under its grandparent.
1232         2) When inserting into a template element, an element should be inserted into its content.
1233
1234         Let's walk through the example:
1235         a) Before eventhandler takes place
1236         template
1237         table
1238             svg <- parser
1239         b) After eventhandler takes place
1240         template
1241             table
1242                 svg <- parser
1243         c) after parsing svg
1244         template
1245             content
1246                 svg
1247                 (table)
1248             table
1249
1250         Finally, in the example, the svg element will be inserted into the content of the template element while
1251         having its next sibling point to the table element. However, the table element is actually under the
1252         template element not its content.
1253
1254         This messy tree is constructed because the second premise is incompleted. It should be: When inserting into
1255         a template element, an element should be inserted into its content as its last child.
1256         Quoted from Step 3 of https://html.spec.whatwg.org/multipage/syntax.html#appropriate-place-for-inserting-a-node
1257         A correct tree will then looks like:
1258         template
1259             content
1260                 svg
1261             table
1262
1263         Tests: fast/dom/HTMLTemplateElement/insert-fostering-child-crash.html
1264                fast/dom/HTMLTemplateElement/insert-fostering-child.html
1265
1266         * html/parser/HTMLConstructionSite.cpp:
1267         (WebCore::insert):
1268         By nullifying task.nextChild, it will force the parser to append the element as task.parent's last child.
1269
1270 2017-05-12  Alex Christensen  <achristensen@webkit.org>
1271
1272         Rename WKContentExtension to WKContentRuleList
1273         https://bugs.webkit.org/show_bug.cgi?id=172053
1274         <rdar://problem/32141005>
1275
1276         Reviewed by Geoffrey Garen.
1277
1278         Covered by existing API tests.
1279
1280         * English.lproj/Localizable.strings:
1281
1282 2017-05-12  Timothy Horton  <timothy_horton@apple.com>
1283
1284         Don't use LinkPresentation URL shortening if it's not available
1285         https://bugs.webkit.org/show_bug.cgi?id=172064
1286         <rdar://problem/32169232>
1287
1288         Rubber-stamped by Wenson Hsieh.
1289
1290         * platform/mac/DragImageMac.mm:
1291         (WebCore::LinkImageLayout::LinkImageLayout):
1292         * platform/spi/cocoa/LinkPresentationSPI.h:
1293
1294 2017-05-11  Simon Fraser  <simon.fraser@apple.com>
1295
1296         Incorrect position when dragging jQuery Draggable elements with position fixed after pinch zoom
1297         https://bugs.webkit.org/show_bug.cgi?id=171113
1298         rdar://problem/31746516
1299
1300         Reviewed by Tim Horton.
1301
1302         Make getBoundingClientRect() and getClientRects() return rects which are relative to the layout
1303         viewport, rather than the visual viewport. This goes part of the way to fixing webkit.org/b/170981,
1304         which aims to make pinch-zoom invisible to web pages ("inert visual viewport"). It fixes issues on various
1305         sites like Facebook when zoomed.
1306
1307         Factor coordinate conversion code into functions on FrameView, which now documents
1308         the various coordinate systems in a big comment. Document::adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale()
1309         and Document::adjustFloatRectForScrollAndAbsoluteZoomAndFrameScale() are renamed and factored
1310         to use these helpers.
1311
1312         There are two behavior changes here:
1313
1314         1. FrameView::documentToClientOffset() now uses the origin of the layout viewport in the "document to client"
1315            coordinate mapping.
1316            
1317         2. The two document functions would apply the scale and offset in the wrong order. We need
1318            to first undo the effects of CSS zoom, page zoom and page scale, and then map from document
1319            to client coordinates.
1320
1321         Tests: fast/visual-viewport/client-rects-relative-to-layout-viewport.html
1322                fast/zooming/client-rects-with-css-and-page-zoom.html
1323
1324         * dom/Document.cpp:
1325         (WebCore::Document::convertAbsoluteToClientQuads):
1326         (WebCore::Document::convertAbsoluteToClientRect):
1327         (WebCore::Document::adjustFloatQuadsForScrollAndAbsoluteZoomAndFrameScale): Deleted.
1328         (WebCore::Document::adjustFloatRectForScrollAndAbsoluteZoomAndFrameScale): Deleted.
1329         * dom/Document.h:
1330         * dom/Element.cpp:
1331         (WebCore::Element::getClientRects):
1332         (WebCore::Element::getBoundingClientRect):
1333         * dom/Range.cpp:
1334         (WebCore::Range::borderAndTextQuads):
1335         * page/FrameView.cpp:
1336         (WebCore::FrameView::absoluteToDocumentScaleFactor):
1337         (WebCore::FrameView::absoluteToDocumentRect):
1338         (WebCore::FrameView::absoluteToDocumentPoint):
1339         (WebCore::FrameView::documentToClientOffset):
1340         (WebCore::FrameView::documentToClientRect):
1341         (WebCore::FrameView::documentToClientPoint):
1342         * page/FrameView.h:
1343         * platform/ScrollableArea.h: #pragma once
1344         * platform/Scrollbar.h: #pragma once
1345         * platform/Widget.h: #pragma once
1346
1347 2017-05-12  Mark Lam  <mark.lam@apple.com>
1348
1349         WorkerRunLoop::Task::performTask() should check !scriptController->isTerminatingExecution().
1350         https://bugs.webkit.org/show_bug.cgi?id=171775
1351         <rdar://problem/30975761>
1352
1353         Reviewed by Saam Barati.
1354
1355         Currently, WorkerThread::stop() calls scheduleExecutionTermination() to terminate
1356         JS execution first, followed by posting a cleanup task to the worker, and lastly,
1357         it invokes terminate() on the WorkerRunLoop.
1358
1359         As a result, before the run loop is terminated, the worker thread may observe the
1360         TerminatedExecutionException in JS code, bail out, see another JS task to run,
1361         re-enters the VM to run said JS code, and fails with an assertion due to the
1362         TerminatedExecutionException still being pending on VM entry.
1363
1364         WorkerRunLoop::Task::performTask() already has a check to only allow a task to
1365         run if and only if !runLoop.terminated() and the task is not a clean up task.
1366         We'll fix the above race by changing WorkerRunLoop::Task::performTask() to check
1367         !context->script()->isTerminatingExecution() instead of !runLoop.terminated().
1368         Since WorkerThread::stop() always scheduleExecutionTermination() before it
1369         terminates the run loop, !context->script()->isTerminatingExecution() implies
1370         !runLoop.terminated().
1371
1372         The only time that runLoop is terminated without scheduleExecutionTermination()
1373         being called is when WorkerThread::stop() is called before the WorkerThread has
1374         finished creating its WorkerGlobalScope.  In this scenario, WorkerThread::stop()
1375         will still terminate the run loop.  Hence, after the WorkerGlobalScope is created
1376         (in WorkerThread::workerThread()), we will check if the run loop has been
1377         terminated (i.e. stop() was called).  If so, we'll scheduleExecutionTermination()
1378         there, and guarantee that if runloop.terminated() is true, then
1379         context->script()->isTerminatingExecution() is also true.
1380
1381         Solutions that were considered but did not work (recorded for future reference):
1382
1383         1. In WorkerThread::stop(), call scheduleExecutionTermination() only after it
1384            posts the cleanup task and terminate the run loop.
1385
1386            This did not work because this creates a race where the worker thread may run
1387            the cleanup task before WorkerThread::stop() finishes.  As a result, the
1388            scriptController may be deleted before we get to invoke scheduleExecutionTermination()
1389            on it, thereby resulting in a use after free.
1390
1391            To make this work, we would have to change the life cycle management strategy
1392            of the WorkerScriptController.  This is a more risky change that we would
1393            want to take on at this time, and may also not be worth the gain.
1394
1395         2. Break scheduleExecutionTermination() up into 2 parts i.e. WorkerThread::stop()
1396            will:
1397            1. set the scriptControllers m_isTerminatingExecution flag before
1398               posting the cleanup task and terminating the run loop, and
1399            2. invoke VM::notifyNeedsTermination() after posting the cleanup task and
1400               terminating the run loop.
1401
1402            This requires that we protect the liveness of the VM until we can invoke
1403            notifyNeedsTermination() on it.
1404
1405            This did not work because:
1406            1. We may end up destructing the VM in WorkerThread::stop() i.e. in the main
1407               web frame, but only the worker thread holds the JS lock for the VM.
1408
1409               We can make the WorkerThread::stop() acquire the JS lock just before it
1410               releases the protected VM's RefPtr, but that would mean the main thread
1411               may be stuck waiting a bit for the worker thread to release its JSLock.
1412               This is not desirable.
1413
1414            2. In practice, changing the liveness period of the Worker VM relative to its
1415               WorkerScriptController and WorkerGlobalScope also has unexpected
1416               ramifications.  We observed many worker tests failing with assertion
1417               failures and crashes due to this change.
1418
1419            Hence, this approach is also a more risky change than it appears on the
1420            surface, and is not worth exploring at this time.
1421
1422         In the end, changing WorkerRunLoop::Task::performTask() to check for
1423         !scriptController->isTerminatingExecution() is the most straight forward solution
1424         that is easy to prove correct.
1425
1426         Also fixed a race in WorkerThread::workerThread() where it can delete the
1427         WorkerGlobalScope while WorkerThread::stop() is in the midst of accessing it.
1428         We now guard the the nullifying of m_workerGlobalScope with the
1429         m_threadCreationAndWorkerGlobalScopeMutex as well.
1430
1431         This issue is covered by an existing test that I just unskipped in TestExpectations.
1432
1433         * bindings/js/JSDOMPromiseDeferred.cpp:
1434         (WebCore::DeferredPromise::callFunction):
1435
1436         * bindings/js/WorkerScriptController.cpp:
1437         (WebCore::WorkerScriptController::scheduleExecutionTermination):
1438         - Added a check to do nothing and return early if the scriptController is already
1439           terminating execution.
1440
1441         * workers/WorkerRunLoop.cpp:
1442         (WebCore::WorkerRunLoop::runInMode):
1443         (WebCore::WorkerRunLoop::runCleanupTasks):
1444         (WebCore::WorkerRunLoop::Task::performTask):
1445
1446         * workers/WorkerRunLoop.h:
1447         - Made Task::performTask() private and make Task befriend the WorkerRunLoop class.
1448           This ensures that only the WorkerRunLoop may call performTask().
1449           Note: this change only formalizes and hardens a relationship that was already
1450           in place before this.
1451
1452         * workers/WorkerThread.cpp:
1453         (WebCore::WorkerThread::start):
1454         (WebCore::WorkerThread::workerThread):
1455         (WebCore::WorkerThread::stop):
1456         * workers/WorkerThread.h:
1457         - Renamed m_threadCreationMutex to m_threadCreationAndWorkerGlobalScopeMutex so
1458           that it more accurately describes what it guards.
1459
1460 2017-05-12  Zalan Bujtas  <zalan@apple.com>
1461
1462         [iOS WK1] Do not try to layout a subframe if its document has not been constructed yet.
1463         https://bugs.webkit.org/show_bug.cgi?id=172042
1464         <rdar://problem/32084098>
1465
1466         Reviewed by Antti Koivisto.
1467
1468         On iOS WK1 we can end up in an inconsistent state, where 
1469         1. the web thread is inside a newly injected iframe's document's c'tor and 
1470         2. waiting on a delegate callback on the main thread
1471         while the main thread
1472         1. executes a pending didLayout() task
1473         2. triggers layout on the newly injected iframe.
1474
1475         * rendering/RenderWidget.cpp:
1476         (WebCore::RenderWidget::updateWidgetPosition):
1477
1478 2017-05-11  Jiewen Tan  <jiewen_tan@apple.com>
1479
1480         Check existence of a page before accessing its plugins
1481         https://bugs.webkit.org/show_bug.cgi?id=171712
1482         <rdar://problem/32007806>
1483
1484         Reviewed by Brent Fulgham.
1485
1486         Test: plugins/navigator-plugin-crash.html
1487
1488         * plugins/DOMPlugin.cpp:
1489         (WebCore::DOMPlugin::item):
1490         (WebCore::DOMPlugin::namedItem):
1491
1492 2017-05-12  Simon Fraser  <simon.fraser@apple.com>
1493
1494         Add some logging for layer tree commits, and resize and orientation change events
1495         https://bugs.webkit.org/show_bug.cgi?id=172041
1496
1497         Reviewed by Tim Horton.
1498
1499         Add some logging that's useful during rotation investigations.
1500
1501         * dom/Document.cpp:
1502         (WebCore::Document::orientationChanged):
1503         * page/FrameView.cpp:
1504         (WebCore::FrameView::sendResizeEventIfNeeded):
1505
1506 2017-05-12  Romain Bellessort  <romain.bellessort@crf.canon.fr>
1507
1508         [Readable Streams API] Add ReadableStreamBYOBReader closed getter
1509         https://bugs.webkit.org/show_bug.cgi?id=172024
1510
1511         Reviewed by Youenn Fablet.
1512
1513         Added tests to check closed getter behaviour.
1514
1515         * Modules/streams/ReadableStreamBYOBReader.js:
1516         (closed): Implemented.
1517
1518 2017-05-12  Andreas Kling  <akling@apple.com>
1519
1520         MediaResourceLoader shouldn't keep its HTMLMediaElement alive.
1521         https://bugs.webkit.org/show_bug.cgi?id=172032
1522         <rdar://problem/30816144>
1523
1524         Reviewed by Joseph Pecoraro.
1525
1526         Use a WeakPtr<HTMLMediaElement> in MediaResourceLoader instead, since the loader
1527         is retained by a NSURLSession object we hand over to AVFoundation.
1528
1529         This prevents AVFoundation from keeping entire documents alive outside our control.
1530
1531         * html/HTMLMediaElement.cpp:
1532         (WebCore::HTMLMediaElement::HTMLMediaElement):
1533         * html/HTMLMediaElement.h:
1534         (WebCore::HTMLMediaElement::createWeakPtr):
1535         * loader/MediaResourceLoader.cpp:
1536         (WebCore::MediaResourceLoader::MediaResourceLoader):
1537         (WebCore::MediaResourceLoader::requestResource):
1538         * loader/MediaResourceLoader.h:
1539
1540 2017-05-12  Andreas Kling  <akling@apple.com>
1541
1542         Memory pressure response should only do sync bmalloc scavenge in sync mode.
1543         https://bugs.webkit.org/show_bug.cgi?id=172035
1544
1545         Reviewed by Michael Saboff.
1546
1547         Only call WTF::releaseFastMallocFreeMemory() and his threading-related friends
1548         when releaseMemory() is invoked with Synchronous::Yes, or if it's a critical
1549         pressure response (maintaining the behavior added in r215775.)
1550
1551         * page/MemoryRelease.cpp:
1552         (WebCore::releaseMemory):
1553
1554 2017-05-12  Daniel Bates  <dabates@apple.com>
1555
1556         Cleanup: Use Ref instead of RefPtr to hold DOMWrapperWorld
1557         https://bugs.webkit.org/show_bug.cgi?id=171988
1558
1559         Reviewed by Chris Dumez.
1560
1561         * bindings/js/JSCustomElementInterface.cpp:
1562         (WebCore::JSCustomElementInterface::JSCustomElementInterface):
1563         (WebCore::JSCustomElementInterface::upgradeElement):
1564         (WebCore::JSCustomElementInterface::invokeCallback):
1565         * bindings/js/JSCustomElementInterface.h:
1566         * bindings/js/JSMutationCallback.cpp:
1567         (WebCore::JSMutationCallback::JSMutationCallback):
1568         (WebCore::JSMutationCallback::call):
1569         * bindings/js/JSMutationCallback.h:
1570         * bindings/js/ScheduledAction.cpp:
1571         (WebCore::ScheduledAction::ScheduledAction):
1572         (WebCore::ScheduledAction::execute):
1573         * bindings/js/ScheduledAction.h:
1574         (WebCore::ScheduledAction::ScheduledAction):
1575         * page/DOMWindowExtension.cpp:
1576         (WebCore::DOMWindowExtension::DOMWindowExtension):
1577         * page/DOMWindowExtension.h:
1578         (WebCore::DOMWindowExtension::world):
1579
1580 2017-05-12  Daniel Bates  <dabates@apple.com>
1581
1582         Cleanup: Make QueueTaskToEventLoopFunctionPtr take JSGlobalObject&
1583         https://bugs.webkit.org/show_bug.cgi?id=172021
1584
1585         Reviewed by Mark Lam.
1586
1587         * bindings/js/JSDOMGlobalObjectTask.cpp: Include header JSDOMGlobalObject.h.
1588         (WebCore::JSGlobalObjectTask::JSGlobalObjectTask): Change type of first argument from JSDOMGlobalObject*
1589         to JSDOMGlobalObject& and update code as necessary. Also, use C++11 brace initialization syntax
1590         for member initializer list.
1591         * bindings/js/JSDOMGlobalObjectTask.h: Remove header JSDOMGlobalObject.h and forward declare
1592         JSDOMGlobalObject and JSC::Microtask.
1593         * bindings/js/JSDOMWindowBase.cpp:
1594         (WebCore::JSDOMWindowMicrotaskCallback::create):
1595         (WebCore::JSDOMWindowMicrotaskCallback::JSDOMWindowMicrotaskCallback): Change type of first argument
1596         from JSDOMWindowBase* to JSDOMWindowBase& and update code as necessary. Also, use C++11 brace
1597         initialization syntax for member initializer list.
1598         (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
1599         * bindings/js/JSDOMWindowBase.h:
1600         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1601         (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
1602         * bindings/js/JSWorkerGlobalScopeBase.h:
1603
1604 2017-05-12  Jer Noble  <jer.noble@apple.com>
1605
1606         [MediaStream] Streams while play while page is in background can get "stuck" when page is forgrounded.
1607         https://bugs.webkit.org/show_bug.cgi?id=172022
1608
1609         Reviewed by Youenn Fablet.
1610
1611         When an AVSampleBufferDisplayLayer is disconnected from the CA renderer, none of its samples will be decoded
1612         and enqueued for rendering. Once the layer is attached to a renderer again, it's stuffed full of samples which
1613         will never be decoded as their decode time has long passed.
1614
1615         Pass the visibility state of the element through to the MediaPlayer so that MediaPlayerPrivateMediaStreamAVFObjC
1616         can flush its renderers when going from not visible -> visible.
1617
1618         * html/HTMLMediaElement.cpp:
1619         (WebCore::HTMLMediaElement::visibilityStateChanged):
1620         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1621         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1622         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVisible):
1623         * rendering/RenderVideo.cpp:
1624         (WebCore::RenderVideo::updatePlayer):
1625
1626 2017-05-12  Per Arne Vollan  <pvollan@apple.com>
1627
1628         Unreviewed Windows build fix.
1629
1630         * bindings/js/JSWebGLRenderingContextCustom.cpp:
1631
1632 2017-05-12  Antti Koivisto  <antti@apple.com>
1633
1634         Updating class name of a shadow host does not update the style applied by descendants of :host()
1635         https://bugs.webkit.org/show_bug.cgi?id=170762
1636         <rdar://problem/31572668>
1637
1638         Reviewed by Ryosuke Niwa.
1639
1640         We need to invalidate shadow tree style when host classes or attributes change if it may be
1641         affected by host rules.
1642
1643         Test: fast/shadow-dom/css-scoping-host-class-and-attribute-mutation.html
1644
1645         * css/RuleSet.cpp:
1646         (WebCore::isHostSelectorMatchingInShadowTree):
1647         (WebCore::RuleSet::addRule):
1648
1649             Check if we have :host selectors that affect shadow tree.
1650
1651         * css/RuleSet.h:
1652         (WebCore::RuleSet::hasHostPseudoClassRulesMatchingInShadowTree):
1653         * style/AttributeChangeInvalidation.cpp:
1654         (WebCore::Style::mayBeAffectedByHostRules):
1655         (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
1656
1657             Invalidate the whole subtree if there is a class change that may affect shadow tree style.
1658
1659         * style/ClassChangeInvalidation.cpp:
1660         (WebCore::Style::mayBeAffectedByHostRules):
1661         (WebCore::Style::ClassChangeInvalidation::invalidateStyle):
1662         * style/IdChangeInvalidation.cpp:
1663         (WebCore::Style::mayBeAffectedByHostRules):
1664         (WebCore::Style::IdChangeInvalidation::invalidateStyle):
1665
1666             Same for classes and ids.
1667             This should be refactored at some point to reduce copy-code.
1668
1669 2017-05-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1670
1671         [GTK] ASSERTION FAILED: !m_flushingLayers
1672         https://bugs.webkit.org/show_bug.cgi?id=172025
1673
1674         Reviewed by Žan Doberšek.
1675
1676         The problem is that syncImageBacking() is calling didChangeLayerState(). All sync methods are called by
1677         flushCompositingStateForThisLayerOnly() while flushing layers, so none of them should call didChange method that
1678         will schedule a new flush while flushing.
1679
1680         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1681         (WebCore::CoordinatedGraphicsLayer::syncImageBacking):
1682
1683 2017-05-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1684
1685         [GTK] GIF images are not properly loaded the first time
1686         https://bugs.webkit.org/show_bug.cgi?id=170432
1687
1688         Reviewed by Carlos Alberto Lopez Perez.
1689
1690         When the GIF image is loaded for the first time, it's always read from the network, and the decoder is usually
1691         fetched with chunks of data. Then the data is cached in disk by the network process, so that when loaded from
1692         the cache, the whole encoded data is available to fetch the encoder. The problem is that we are failing to
1693         decode the image when giving chunks of data, that's why it only happens the first time loaded. If the first
1694         chunk of data provided is enough to get some metadata, including the size, but not frame contents, the load fails
1695         in CachedImage::addIncrementalDataBuffer() because the EncodedDataStatus reported is SizeAvailable but
1696         Image::isNull() returns true. An Image is considered to be Null when its size is empty, and the size is
1697         calculated always using the first frame in ImageFrameCache. Since we still don't have frames, the image is
1698         always Null in this case. It is not expected that EncodedDataStatus returns SizeAvailable and the image is Null,
1699         that's why it's considered an error and the load finishes with a decode error. However, the non CG ImageDecoder
1700         has a m_size member to handle this particular case, and it's when m_size is set when EncodedDataStatus changes
1701         to SizeAvailable. We should return the ImageEncoder size as the ImageSize when we have a decoder but
1702         not frames yet.
1703
1704         Test: http/tests/images/gif-progressive-load.html
1705
1706         * platform/graphics/ImageFrameCache.cpp:
1707         (WebCore::ImageFrameCache::size): Return ImageDecoder::size() without caching it, if frame list is empty.
1708
1709 2017-05-12  Per Arne Vollan  <pvollan@apple.com>
1710
1711         The iBooks application is not able to get current position.
1712         https://bugs.webkit.org/show_bug.cgi?id=171982
1713         rdar://problem/29318409
1714
1715         Reviewed by Brent Fulgham.
1716
1717         Geolocation requests from iBooks are currently blocked. Make an exemption from the policy for iBooks.
1718
1719         No new tests since we currently can't mock the iBooks application bundle ID.
1720
1721         * Modules/geolocation/Geolocation.cpp:
1722         (WebCore::isRequestFromIBooks):
1723         (WebCore::Geolocation::shouldBlockGeolocationRequests):
1724
1725 2017-05-11  Per Arne Vollan  <pvollan@apple.com>
1726
1727         Geolocation requests should not be blocked when the security origin is local.
1728         https://bugs.webkit.org/show_bug.cgi?id=171857
1729         rdar://problem/29318409
1730
1731         Reviewed by Brent Fulgham.
1732
1733         Geolocation requests from security origins where the url scheme is registered as local,
1734         should not be blocked. This applies to the file url scheme, but also to other local url
1735         schemes.
1736
1737         Test: fast/misc/geolocation-local-security-origin.html
1738
1739         * Modules/geolocation/Geolocation.cpp:
1740         (WebCore::Geolocation::shouldBlockGeolocationRequests):
1741
1742 2017-05-11  Chris Dumez  <cdumez@apple.com>
1743
1744         Drop remaining uses of PassRefPtr in WebCore
1745         https://bugs.webkit.org/show_bug.cgi?id=172013
1746
1747         Reviewed by Yusuke Suzuki.
1748
1749         * bindings/js/ScriptController.cpp:
1750         (WebCore::ScriptController::createRootObject):
1751         * bindings/js/ScriptController.h:
1752         * bindings/js/ScriptControllerMac.mm:
1753         * bridge/objc/WebScriptObject.mm:
1754         (WebCore::createJSWrapper):
1755         (-[WebScriptObject _setImp:originRootObject:rootObject:]):
1756         (-[WebScriptObject _setOriginRootObject:andRootObject:]):
1757         (-[WebScriptObject _initWithJSObject:originRootObject:rootObject:]):
1758         * bridge/objc/WebScriptObjectPrivate.h:
1759
1760 2017-05-11  Zalan Bujtas  <zalan@apple.com>
1761
1762         RenderImageResource::hasImage is redundant and RenderImageResourceStyleImage's override is incorrect.
1763         https://bugs.webkit.org/show_bug.cgi?id=172010
1764         <rdar://problem/31086735>
1765
1766         Reviewed by Simon Fraser.
1767
1768         RenderImageResourceStyleImage::hasImage() always returns true even when ::cachedImage()
1769         returns nullptr (e.g. image is pending).
1770         Remove it and use cachedImage() instead.
1771
1772         Test: fast/images/missing-content-image-crash.html
1773
1774         * html/HTMLImageElement.cpp:
1775         (WebCore::HTMLImageElement::didAttachRenderers):
1776         * rendering/RenderImage.cpp:
1777         (WebCore::RenderImage::updateIntrinsicSizeIfNeeded):
1778         (WebCore::RenderImage::isShowingMissingOrImageError):
1779         (WebCore::RenderImage::hasNonBitmapImage):
1780         (WebCore::RenderImage::paintReplaced):
1781         (WebCore::RenderImage::paintIntoRect):
1782         (WebCore::RenderImage::foregroundIsKnownToBeOpaqueInRect):
1783         * rendering/RenderImageResource.h:
1784         (WebCore::RenderImageResource::cachedImage):
1785         (WebCore::RenderImageResource::hasImage): Deleted.
1786         * rendering/RenderImageResourceStyleImage.h:
1787         * rendering/svg/RenderSVGImage.cpp:
1788         (WebCore::RenderSVGImage::paint):
1789         * svg/SVGImageElement.cpp:
1790         (WebCore::SVGImageElement::hasSingleSecurityOrigin):
1791         (WebCore::SVGImageElement::didAttachRenderers):
1792
1793 2017-05-11  Zalan Bujtas  <zalan@apple.com>
1794
1795         AX: Defer text changes until after the tree is clean if needed.
1796         https://bugs.webkit.org/show_bug.cgi?id=171546
1797         <rdar://problem/31934942>
1798
1799         Reviewed by Simon Fraser.
1800
1801         While updating an accessibility object state, we might
1802         trigger unintentional style updates. This style update could
1803         end up destroying renderes that are still referenced by functions
1804         on the callstack.
1805         To avoid that, defer such changes and let AXObjectCache operate on a clean tree.         
1806
1807         Test: accessibility/crash-when-render-tree-is-not-clean.html
1808
1809         * accessibility/AXObjectCache.cpp:
1810         (WebCore::AXObjectCache::remove):
1811         (WebCore::AXObjectCache::handleAttributeChanged):
1812         (WebCore::AXObjectCache::labelChanged):
1813         (WebCore::AXObjectCache::performDeferredCacheUpdate):
1814         (WebCore::AXObjectCache::deferRecomputeIsIgnored):
1815         (WebCore::AXObjectCache::deferTextChangedIfNeeded):
1816         (WebCore::AXObjectCache::recomputeDeferredIsIgnored): Deleted.
1817         (WebCore::AXObjectCache::deferTextChanged): Deleted.
1818         * accessibility/AXObjectCache.h: Decouple different type of changes.
1819         (WebCore::AXObjectCache::deferRecomputeIsIgnored):
1820         (WebCore::AXObjectCache::deferTextChangedIfNeeded):
1821         (WebCore::AXObjectCache::recomputeDeferredIsIgnored): Deleted.
1822         (WebCore::AXObjectCache::deferTextChanged): Deleted.
1823         * rendering/RenderBlock.cpp:
1824         (WebCore::RenderBlock::deleteLines):
1825         * rendering/RenderBlockLineLayout.cpp:
1826         (WebCore::RenderBlockFlow::createAndAppendRootInlineBox):
1827         * rendering/RenderText.cpp:
1828         (WebCore::RenderText::setText):
1829
1830 2017-05-11  Chris Dumez  <cdumez@apple.com>
1831
1832         Drop remaining uses of PassRefPtr under platform/
1833         https://bugs.webkit.org/show_bug.cgi?id=172007
1834
1835         Reviewed by Geoffrey Garen.
1836
1837         * platform/graphics/wpe/ImageWPE.cpp:
1838         (WebCore::Image::loadPlatformResource):
1839         * platform/ios/LegacyTileGrid.h:
1840         * platform/ios/LegacyTileGrid.mm:
1841         (WebCore::LegacyTileGrid::tileForIndex):
1842         (WebCore::LegacyTileGrid::tileForPoint):
1843         * platform/ios/LegacyTileGridTile.h:
1844         (WebCore::LegacyTileGridTile::create):
1845         * platform/mediastream/RTCIceCandidateDescriptor.cpp:
1846         (WebCore::RTCIceCandidateDescriptor::create):
1847         * platform/mediastream/RTCIceCandidateDescriptor.h:
1848         * platform/mediastream/RTCPeerConnectionHandlerClient.h:
1849         * platform/mediastream/RTCSessionDescriptionDescriptor.cpp:
1850         (WebCore::RTCSessionDescriptionDescriptor::create):
1851         * platform/mediastream/RTCSessionDescriptionDescriptor.h:
1852         * platform/mediastream/RTCSessionDescriptionRequest.h:
1853         (WebCore::RTCSessionDescriptionRequest::extraData):
1854         (WebCore::RTCSessionDescriptionRequest::setExtraData):
1855         * platform/mediastream/RealtimeMediaSourceCenter.h:
1856         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
1857         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
1858         (WebCore::RealtimeMediaSourceCenterOwr::firstSource):
1859         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
1860         * platform/mock/DeviceOrientationClientMock.cpp:
1861         (WebCore::DeviceOrientationClientMock::setOrientation):
1862         * platform/mock/DeviceOrientationClientMock.h:
1863         * platform/mock/GeolocationClientMock.cpp:
1864         (WebCore::GeolocationClientMock::setPosition):
1865         * platform/mock/GeolocationClientMock.h:
1866         * platform/mock/RTCNotifiersMock.cpp:
1867         (WebCore::SessionRequestNotifier::SessionRequestNotifier):
1868         (WebCore::SessionRequestNotifier::fire):
1869         (WebCore::VoidRequestNotifier::VoidRequestNotifier):
1870         * platform/mock/RTCNotifiersMock.h:
1871         * platform/mock/TimerEventBasedMock.h:
1872         (WebCore::TimerEventBasedMock::removeEvent):
1873         (WebCore::TimerEvent::TimerEvent):
1874         (WebCore::TimerEvent::timerFired):
1875         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
1876         (WebCore::MockSourceBufferPrivateHasAudio):
1877         (WebCore::MockSourceBufferPrivateHasVideo):
1878         * platform/wpe/RenderThemeWPE.h:
1879
1880 2017-05-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1881
1882         [WPE] Stop using PassRefPtr in platform/graphics/wpe
1883         https://bugs.webkit.org/show_bug.cgi?id=171977
1884
1885         Unreviewed build fix after r216702.
1886
1887         * platform/graphics/wpe/ImageWPE.cpp:
1888         (WebCore::Image::loadPlatformResource):
1889
1890 2017-05-11  Youenn Fablet  <youenn@apple.com>
1891
1892         [iOS] Unset active media capture source when stopped capturing
1893         https://bugs.webkit.org/show_bug.cgi?id=171815
1894         <rdar://problem/32117885>
1895
1896         Reviewed by Eric Carlson.
1897
1898         Test: platform/ios/mediastream/getUserMedia-single-capture.html
1899
1900         Introducing SingleSourceFactory template class to be used by capture factories for iOS.
1901         This class ensures that only one source is active at a time.
1902         Update all capture sources accordingly.
1903         Ensure sources are no longer considered as active sources when being destroyed.
1904         Add support for mock sources and introducing m_isProducingData for them as well.
1905
1906         Update WebRTC outgoing source classes to handle the case of replaced track and resetting the enabled/mute
1907         state according the new source.
1908
1909         Update the way we handle timestamps for audio data. We now consider that we read/write as a flow.
1910         This allows smooth audio track replacing.
1911
1912         * platform/mediastream/RealtimeMediaSource.h:
1913         * platform/mediastream/mac/AVAudioCaptureSource.mm:
1914         (WebCore::AVAudioCaptureSource::~AVAudioCaptureSource):
1915         (WebCore::AVAudioCaptureSourceFactory::setActiveSource): Deleted.
1916         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1917         (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
1918         (WebCore::AVVideoCaptureSourceFactory::setActiveSource): Deleted.
1919         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1920         (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource):
1921         (WebCore::CoreAudioCaptureSource::stopProducingData):
1922         (WebCore::CoreAudioCaptureSourceFactory::setActiveSource): Deleted.
1923         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
1924         (WebCore::RealtimeOutgoingAudioSource::setSource):
1925         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
1926         (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
1927         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
1928         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
1929         (WebCore::RealtimeOutgoingVideoSource::setSource):
1930         (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged):
1931         (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged):
1932         * platform/mock/MockRealtimeAudioSource.cpp:
1933         (WebCore::mockAudioCaptureSourceFactory):
1934         (WebCore::MockRealtimeAudioSource::factory):
1935         (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource):
1936         (WebCore::MockRealtimeAudioSource::startProducingData):
1937         (WebCore::MockRealtimeAudioSource::stopProducingData):
1938         * platform/mock/MockRealtimeAudioSource.h:
1939         * platform/mock/MockRealtimeVideoSource.cpp:
1940         (WebCore::mockVideoCaptureSourceFactory):
1941         (WebCore::MockRealtimeVideoSource::factory):
1942         (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource):
1943         (WebCore::MockRealtimeVideoSource::startProducingData):
1944         (WebCore::MockRealtimeVideoSource::stopProducingData):
1945         * platform/mock/MockRealtimeVideoSource.h:
1946         (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): Deleted.
1947
1948 2017-05-11  Timothy Horton  <timothy_horton@apple.com>
1949
1950         Fix the iOS build
1951
1952         * platform/spi/mac/NSSpellCheckerSPI.h:
1953
1954 2017-05-11  Matt Lewis  <jlewis3@apple.com>
1955
1956         Unreviewed, rolling out r216677.
1957
1958         Patch caused layout test crashes.
1959
1960         Reverted changeset:
1961
1962         "WorkerThread::stop() should call
1963         scheduleExecutionTermination() last."
1964         https://bugs.webkit.org/show_bug.cgi?id=171775
1965         http://trac.webkit.org/changeset/216677
1966
1967 2017-05-11  Don Olmstead  <don.olmstead@am.sony.com>
1968
1969         [CMake] Add HAVE check for regex.h
1970         https://bugs.webkit.org/show_bug.cgi?id=171950
1971
1972         Reviewed by Michael Catanzaro.
1973
1974         No new tests. No change in behavior.
1975
1976         * WebCorePrefix.h:
1977         * testing/js/WebCoreTestSupportPrefix.h:
1978
1979 2017-05-11  Tim Horton  <timothy_horton@apple.com>
1980
1981         Mail spins launching spell checker when typing
1982         https://bugs.webkit.org/show_bug.cgi?id=171986
1983         <rdar://problem/26305327>
1984
1985         Reviewed by Beth Dakin.
1986
1987         * platform/spi/mac/NSSpellCheckerSPI.h:
1988
1989 2017-05-11  Chris Dumez  <cdumez@apple.com>
1990
1991         Stop using PassRefPtr in platform/graphics
1992         https://bugs.webkit.org/show_bug.cgi?id=171977
1993
1994         Reviewed by Alex Christensen.
1995
1996         Stop using PassRefPtr in platform/graphics.
1997
1998         * css/CSSCrossfadeValue.cpp:
1999         (WebCore::CSSCrossfadeValue::image):
2000         * css/CSSFilterImageValue.cpp:
2001         (WebCore::CSSFilterImageValue::image):
2002         * loader/cache/CachedImage.cpp:
2003         (WebCore::CachedImage::brokenImage):
2004         (WebCore::CachedImage::image):
2005         (WebCore::CachedImage::imageForRenderer):
2006         * page/PageSerializer.cpp:
2007         (WebCore::PageSerializer::addImageToResources):
2008         * platform/ScrollView.cpp:
2009         (WebCore::ScrollView::paintPanScrollIcon):
2010         * platform/graphics/CrossfadeGeneratedImage.cpp:
2011         (WebCore::CrossfadeGeneratedImage::drawCrossfade):
2012         * platform/graphics/FontPlatformData.h:
2013         * platform/graphics/GraphicsContext.h:
2014         * platform/graphics/Image.cpp:
2015         (WebCore::Image::nullImage):
2016         * platform/graphics/Image.h:
2017         * platform/graphics/MediaPlayer.cpp:
2018         (WebCore::MediaPlayer::createResourceLoader):
2019         * platform/graphics/MediaPlayer.h:
2020         * platform/graphics/Pattern.cpp:
2021         (WebCore::Pattern::create):
2022         (WebCore::Pattern::Pattern):
2023         * platform/graphics/Pattern.h:
2024         * platform/graphics/PlatformTextTrack.h:
2025         (WebCore::PlatformTextTrack::create):
2026         (WebCore::PlatformTextTrack::createOutOfBand):
2027         (WebCore::PlatformTextTrack::captionMenuOffItem):
2028         (WebCore::PlatformTextTrack::captionMenuAutomaticItem):
2029         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp:
2030         (WebCore::InbandMetadataTextTrackPrivateAVF::create):
2031         (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):
2032         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
2033         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
2034         (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings):
2035         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h:
2036         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
2037         (WebCore::MediaSelectionOptionAVFObjC::create):
2038         (WebCore::MediaSelectionGroupAVFObjC::create):
2039         (WebCore::MediaSelectionGroupAVFObjC::updateOptions):
2040         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.h:
2041         (WebCore::InbandTextTrackPrivateAVCF::create):
2042         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.h:
2043         (WebCore::InbandTextTrackPrivateLegacyAVCF::create):
2044         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
2045         (WebCore::WebCoreAVCFResourceLoader::create):
2046         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.h:
2047         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
2048         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
2049         (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage):
2050         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
2051         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
2052         (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):
2053         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.h:
2054         (WebCore::InbandTextTrackPrivateAVFObjC::create):
2055         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.h:
2056         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::create):
2057         * platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h:
2058         (WebCore::OutOfBandTextTrackPrivateAVF::create):
2059         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
2060         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2061         (WebCore::WebCoreAVFResourceLoader::create):
2062         * platform/graphics/ca/GraphicsLayerCA.cpp:
2063         (WebCore::GraphicsLayerCA::createPlatformCALayer):
2064         (WebCore::GraphicsLayerCA::createPlatformCAAnimation):
2065         (WebCore::GraphicsLayerCA::setContentsToPlatformLayer):
2066         (WebCore::GraphicsLayerCA::replicatedLayerRoot):
2067         (WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
2068         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
2069         (WebCore::GraphicsLayerCA::createBasicAnimation):
2070         (WebCore::GraphicsLayerCA::createKeyframeAnimation):
2071         (WebCore::GraphicsLayerCA::createSpringAnimation):
2072         * platform/graphics/ca/GraphicsLayerCA.h:
2073         (WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
2074         * platform/graphics/ca/PlatformCAAnimation.h:
2075         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.h:
2076         * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
2077         (PlatformCAAnimationCocoa::create):
2078         (PlatformCAAnimationCocoa::copy):
2079         * platform/graphics/ca/win/AbstractCACFLayerTreeHost.h:
2080         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
2081         (WebCore::CACFLayerTreeHost::create):
2082         (WebCore::CACFLayerTreeHost::addPendingAnimatedLayer):
2083         * platform/graphics/ca/win/CACFLayerTreeHost.h:
2084         * platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
2085         (PlatformCAAnimationWin::create):
2086         (PlatformCAAnimationWin::copy):
2087         * platform/graphics/ca/win/PlatformCAAnimationWin.h:
2088         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2089         (PlatformCALayerWin::addAnimationForKey):
2090         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
2091         (WebCore::WKCACFViewLayerTreeHost::create):
2092         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.h:
2093         * platform/graphics/cairo/PatternCairo.cpp:
2094         (WebCore::Pattern::createPlatformPattern):
2095         * platform/graphics/cairo/PlatformContextCairo.cpp:
2096         (WebCore::PlatformContextCairo::clipForPatternFilling):
2097         * platform/graphics/cg/PDFDocumentImage.h:
2098         * platform/graphics/cg/PatternCG.cpp:
2099         (WebCore::Pattern::createPlatformPattern):
2100         * platform/graphics/filters/FEDiffuseLighting.cpp:
2101         (WebCore::FEDiffuseLighting::FEDiffuseLighting):
2102         (WebCore::FEDiffuseLighting::create):
2103         (WebCore::FEDiffuseLighting::lightSource):
2104         * platform/graphics/filters/FEDiffuseLighting.h:
2105         * platform/graphics/filters/FELighting.cpp:
2106         (WebCore::FELighting::FELighting):
2107         (WebCore::FELighting::drawLighting):
2108         * platform/graphics/filters/FELighting.h:
2109         * platform/graphics/filters/FESpecularLighting.cpp:
2110         (WebCore::FESpecularLighting::FESpecularLighting):
2111         (WebCore::FESpecularLighting::create):
2112         (WebCore::FESpecularLighting::lightSource):
2113         * platform/graphics/filters/FESpecularLighting.h:
2114         * platform/graphics/filters/FETile.cpp:
2115         (WebCore::FETile::platformApplySoftware):
2116         * platform/graphics/filters/FilterEffect.cpp:
2117         (WebCore::FilterEffect::asUnmultipliedImage):
2118         (WebCore::FilterEffect::asPremultipliedImage):
2119         * platform/graphics/filters/FilterEffect.h:
2120         * platform/graphics/filters/FilterOperation.cpp:
2121         (WebCore::ReferenceFilterOperation::setFilterEffect):
2122         (WebCore::BasicColorMatrixFilterOperation::blend):
2123         (WebCore::BasicComponentTransferFilterOperation::blend):
2124         (WebCore::BlurFilterOperation::blend):
2125         (WebCore::DropShadowFilterOperation::blend):
2126         * platform/graphics/filters/FilterOperation.h:
2127         (WebCore::FilterOperation::blend):
2128         (WebCore::PassthroughFilterOperation::create):
2129         (WebCore::ReferenceFilterOperation::create):
2130         * platform/graphics/gpu/Texture.cpp:
2131         (WebCore::Texture::create):
2132         * platform/graphics/gpu/Texture.h:
2133         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
2134         * platform/graphics/gstreamer/ImageGStreamer.h:
2135         (WebCore::ImageGStreamer::createImage):
2136         (WebCore::ImageGStreamer::image):
2137         * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
2138         (WebCore::InbandMetadataTextTrackPrivateGStreamer::create):
2139         (WebCore::InbandMetadataTextTrackPrivateGStreamer::addGenericCue):
2140         * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.h:
2141         (WebCore::InbandTextTrackPrivateGStreamer::create):
2142         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2143         (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry):
2144         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2145         (WebCore::MediaPlayerPrivateGStreamerBase::paint):
2146         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
2147         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
2148         (WebCore::MediaSourceClientGStreamerMSE::enqueueSample):
2149         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
2150         * platform/graphics/gstreamer/mse/MediaSourceGStreamer.cpp:
2151         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
2152         (WebCore::PlaybackPipeline::enqueueSample):
2153         * platform/graphics/gstreamer/mse/PlaybackPipeline.h:
2154         * platform/graphics/gtk/ImageGtk.cpp:
2155         (WebCore::loadImageFromGResource):
2156         (WebCore::loadResourceSharedBuffer):
2157         (WebCore::loadMissingImageIconFromTheme):
2158         (WebCore::Image::loadPlatformResource):
2159         * platform/graphics/harfbuzz/HarfBuzzFace.cpp:
2160         (WebCore::FaceCacheEntry::create):
2161         * platform/graphics/harfbuzz/HarfBuzzFace.h:
2162         (WebCore::HarfBuzzFace::create):
2163         * platform/graphics/mac/ImageMac.mm:
2164         (WebCore::Image::loadPlatformResource):
2165         * platform/graphics/opentype/OpenTypeMathData.h:
2166         (WebCore::OpenTypeMathData::create):
2167         * platform/graphics/texmap/BitmapTexture.h:
2168         (WebCore::BitmapTexture::applyFilters):
2169         * platform/graphics/texmap/BitmapTextureGL.cpp:
2170         (WebCore::BitmapTextureGL::applyFilters):
2171         * platform/graphics/texmap/BitmapTextureGL.h:
2172         (WebCore::BitmapTextureGL::FilterInfo::FilterInfo):
2173         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2174         (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
2175         * platform/graphics/texmap/TextureMapper.cpp:
2176         (WebCore::TextureMapper::acquireTextureFromPool):
2177         * platform/graphics/texmap/TextureMapper.h:
2178         * platform/graphics/texmap/TextureMapperGL.cpp:
2179         (WebCore::TextureMapperGL::createTexture):
2180         * platform/graphics/texmap/TextureMapperGL.h:
2181         * platform/graphics/texmap/TextureMapperLayer.cpp:
2182         (WebCore::TextureMapperLayer::paintIntoSurface):
2183         (WebCore::commitSurface):
2184         (WebCore::TextureMapperLayer::paintWithIntermediateSurface):
2185         (WebCore::TextureMapperLayer::setBackingStore):
2186         * platform/graphics/texmap/TextureMapperLayer.h:
2187         * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
2188         (WebCore::TextureMapperTiledBackingStore::create):
2189         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2190         (WebCore::CoordinatedGraphicsLayer::syncImageBacking):
2191         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2192         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
2193         (WebCore::CoordinatedImageBacking::create):
2194         (WebCore::CoordinatedImageBacking::CoordinatedImageBacking):
2195         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h:
2196         * platform/graphics/win/ImageWin.cpp:
2197         (WebCore::Image::loadPlatformResource):
2198         * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
2199         (WebCore::MediaPlayerPrivateFullscreenWindow::setRootChildLayer):
2200         * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h:
2201         * platform/graphics/win/PatternDirect2D.cpp:
2202         (WebCore::Pattern::createPlatformPattern):
2203         * platform/graphics/win/SharedGDIObject.h:
2204         (WebCore::SharedGDIObject::create):
2205         * rendering/FilterEffectRenderer.cpp:
2206         (WebCore::FilterEffectRenderer::build):
2207         * rendering/RenderImageResource.cpp:
2208         (WebCore::RenderImageResource::image):
2209         * rendering/RenderLayer.cpp:
2210         (WebCore::RenderLayer::drawPlatformResizerImage):
2211         * rendering/svg/RenderSVGResourcePattern.cpp:
2212         (WebCore::RenderSVGResourcePattern::buildPattern):
2213         * svg/SVGFEDiffuseLightingElement.cpp:
2214         (WebCore::SVGFEDiffuseLightingElement::setFilterEffectAttribute):
2215         (WebCore::SVGFEDiffuseLightingElement::build):
2216         * svg/SVGFESpecularLightingElement.cpp:
2217         (WebCore::SVGFESpecularLightingElement::setFilterEffectAttribute):
2218         (WebCore::SVGFESpecularLightingElement::build):
2219         * svg/graphics/SVGImageCache.cpp:
2220         (WebCore::SVGImageCache::imageForRenderer):
2221
2222 2017-05-11  Joseph Pecoraro  <pecoraro@apple.com>
2223
2224         Remove Vibration API
2225         https://bugs.webkit.org/show_bug.cgi?id=171766
2226
2227         Rubber-stamped by Alexey Proskuryakov.
2228
2229         * features.json:
2230         Mark the Vibration API as removed.
2231
2232         * CMakeLists.txt:
2233         * DerivedSources.cpp:
2234         * Modules/vibration/NavigatorVibration.cpp: Removed.
2235         * Modules/vibration/NavigatorVibration.h: Removed.
2236         * Modules/vibration/NavigatorVibration.idl: Removed.
2237         * Modules/vibration/Vibration.cpp: Removed.
2238         * Modules/vibration/Vibration.h: Removed.
2239         * Modules/vibration/VibrationClient.h: Removed.
2240         * testing/Internals.cpp:
2241         (WebCore::Internals::isVibrating): Deleted.
2242         * testing/Internals.h:
2243         * testing/Internals.idl:
2244
2245 2017-05-11  Dean Jackson  <dino@apple.com>
2246
2247         WebGLRenderingContext should implement WebGLRenderingContextBase
2248         https://bugs.webkit.org/show_bug.cgi?id=171961
2249         <rdar://problem/32124920>
2250
2251         Reviewed by Sam Weinig.
2252
2253         WebGLRenderingContext and WebGL2RenderingContext are both
2254         defined to "implement" WebGLRenderingContextBase. However, we
2255         were doing it via inheritance, which meant that some things
2256         were not visible on the WebGLRenderingContext prototype.
2257
2258         Test: fast/canvas/webgl/constants-on-interface.html
2259
2260         * WebCore.xcodeproj/project.pbxproj: Move the Custom.cpp files
2261         out of the GC-only area now they have real content.
2262
2263         * bindings/js/JSDocumentCustom.cpp: Handle the fact that we
2264         don't use the base class from the bindings, so we need to
2265         translate WebGL1 and WebGL2 contexts into the right JS classes.
2266         (WebCore::JSDocument::getCSSCanvasContext):
2267         * bindings/js/JSHTMLCanvasElementCustom.cpp:
2268         (WebCore::JSHTMLCanvasElement::getContext):
2269
2270         * bindings/js/JSWebGL2RenderingContextCustom.cpp: Implement the
2271         custom methods. In this case, we don't yet expose any
2272         extensions for WebGL 2.
2273         (WebCore::toJS):
2274         (WebCore::JSWebGL2RenderingContext::getExtension):
2275
2276         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp: Removed.
2277
2278         * bindings/js/JSWebGLRenderingContextCustom.cpp:
2279         (WebCore::toJS):
2280         (WebCore::JSWebGLRenderingContext::getExtension):
2281
2282         * html/canvas/WebGL2RenderingContext.h: Make some things public.
2283         * html/canvas/WebGLRenderingContext.h: Ditto.
2284
2285         * html/canvas/WebGL2RenderingContext.idl: Use implements.
2286         * html/canvas/WebGLRenderingContext.idl: Ditto.
2287
2288         * testing/Internals.cpp: This now takes a WebGLRenderingContext.
2289         (WebCore::Internals::simulateWebGLContextChanged):
2290         * testing/Internals.h:
2291         * testing/Internals.idl:
2292
2293 2017-05-11  Andy Estes  <aestes@apple.com>
2294
2295         Fix a spelling mistake in ApplePayErrorCode
2296         https://bugs.webkit.org/show_bug.cgi?id=171981
2297         <rdar://problem/32136567>
2298
2299         Reviewed by Beth Dakin.
2300
2301         * Modules/applepay/ApplePayError.idl:
2302         * Modules/applepay/PaymentRequest.h:
2303
2304 2017-05-11  John Wilander  <wilander@apple.com>
2305
2306         Resource Load Statistics: Enable configuration through preferences
2307         https://bugs.webkit.org/show_bug.cgi?id=171949
2308         <rdar://problem/31894518>
2309
2310         Reviewed by Alex Christensen.
2311
2312         No new tests. Just an added setter.
2313
2314         * loader/ResourceLoadObserver.cpp:
2315         (WebCore::ResourceLoadObserver::setReducedTimestampResolution):
2316
2317 2017-05-11  Frederic Wang  <fwang@igalia.com>
2318
2319         Unify hasTouchScrollableOverflow/needsCompositedScrolling concepts
2320         https://bugs.webkit.org/show_bug.cgi?id=171974
2321
2322         Reviewed by Simon Fraser.
2323
2324         This commit moves the following pattern in a single RenderLayer::usesAcceleratedScrolling function:
2325         #if PLATFORM(IOS)
2326         ...hasTouchScrollableOverflow()...
2327         #else
2328         ...needsCompositedScrolling()...
2329         #endif
2330
2331         No new tests, behavior unchanged.
2332
2333         * rendering/RenderLayer.cpp:
2334         (WebCore::RenderLayer::usesAcceleratedScrolling): Introduce helper function.
2335         * rendering/RenderLayer.h: Declare the function.
2336         * rendering/RenderLayerBacking.cpp:
2337         (WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling): Use the new function.
2338         (WebCore::RenderLayerBacking::updateConfiguration): Ditto.
2339         * rendering/RenderLayerCompositor.cpp:
2340         (WebCore::useCoordinatedScrollingForLayer): Ditto.
2341
2342 2017-05-11  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2343
2344         [Readable Streams API] Implement ReadableStreamBYOBReader cancel()
2345         https://bugs.webkit.org/show_bug.cgi?id=171919
2346
2347         Reviewed by Youenn Fablet.
2348
2349         Implemented ReadableStreamBYOBReader cancel() method.
2350
2351         Added tests checking cancel().
2352
2353         * Modules/streams/ReadableStreamBYOBReader.js:
2354         (cancel): Implemented.
2355         * Modules/streams/ReadableStreamInternals.js:
2356         (readableStreamError): Updated to support ReadableStreamBYOBReader case.
2357
2358 2017-05-11  Chris Dumez  <cdumez@apple.com>
2359
2360         Stop using PassRefPtr in WebGPU code
2361         https://bugs.webkit.org/show_bug.cgi?id=171965
2362
2363         Reviewed by Alex Christensen.
2364
2365         Stop using PassRefPtr in WebGPU code.
2366
2367         * html/canvas/WebGPUDrawable.cpp:
2368         (WebCore::WebGPUDrawable::WebGPUDrawable):
2369         * html/canvas/WebGPURenderingContext.cpp:
2370         (WebCore::WebGPURenderingContext::create):
2371         (WebCore::WebGPURenderingContext::WebGPURenderingContext):
2372         * html/canvas/WebGPURenderingContext.h:
2373         * html/canvas/WebGPUTexture.cpp:
2374         (WebCore::WebGPUTexture::createFromDrawableTexture):
2375         (WebCore::WebGPUTexture::WebGPUTexture):
2376         * html/canvas/WebGPUTexture.h:
2377
2378 2017-05-11  Youenn Fablet  <youenn@apple.com>
2379
2380         Name WebRTC Threads
2381         https://bugs.webkit.org/show_bug.cgi?id=171975
2382
2383         Reviewed by Eric Carlson.
2384
2385         No change of behavior.
2386
2387         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp:
2388         (WebCore::LibWebRTCAudioModule::LibWebRTCAudioModule): Setting audio module thread name.
2389         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2390         (WebCore::initializePeerConnectionFactoryAndThreads): Setting signaling and networking thread names.
2391
2392 2017-05-11  Chris Dumez  <cdumez@apple.com>
2393
2394         Stop using PassRefPtr in platform/audio
2395         https://bugs.webkit.org/show_bug.cgi?id=171966
2396
2397         Reviewed by Ryosuke Niwa.
2398
2399         Stop using PassRefPtr in platform/audio.
2400
2401         * platform/audio/AudioBus.h:
2402         (WebCore::AudioBus::AudioBus):
2403         * platform/audio/AudioFileReader.h:
2404         * platform/audio/HRTFDatabaseLoader.cpp:
2405         (WebCore::HRTFDatabaseLoader::createAndLoadAsynchronouslyIfNecessary):
2406         * platform/audio/HRTFDatabaseLoader.h:
2407         * platform/audio/HRTFKernel.cpp:
2408         (WebCore::HRTFKernel::createInterpolatedKernel):
2409         * platform/audio/HRTFKernel.h:
2410         (WebCore::HRTFKernel::create):
2411         * platform/audio/glib/AudioBusGLib.cpp:
2412         (WebCore::AudioBus::loadPlatformResource):
2413         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
2414         (WebCore::AudioFileReader::createBus):
2415         (WebCore::createBusFromAudioFile):
2416         (WebCore::createBusFromInMemoryAudioFile):
2417         * platform/audio/ios/AudioFileReaderIOS.cpp:
2418         (WebCore::AudioFileReader::createBus):
2419         (WebCore::createBusFromAudioFile):
2420         (WebCore::createBusFromInMemoryAudioFile):
2421         * platform/audio/ios/AudioFileReaderIOS.h:
2422         * platform/audio/mac/AudioBusMac.mm:
2423         (WebCore::AudioBus::loadPlatformResource):
2424         * platform/audio/mac/AudioFileReaderMac.cpp:
2425         (WebCore::AudioFileReader::createBus):
2426         (WebCore::createBusFromAudioFile):
2427         (WebCore::createBusFromInMemoryAudioFile):
2428         * platform/audio/mac/AudioFileReaderMac.h:
2429
2430 2017-05-11  Mark Lam  <mark.lam@apple.com>
2431
2432         WorkerThread::stop() should call scheduleExecutionTermination() last.
2433         https://bugs.webkit.org/show_bug.cgi?id=171775
2434         <rdar://problem/30975761>
2435
2436         Reviewed by Geoffrey Garen.
2437
2438         Currently, WorkerThread::stop() calls scheduleExecutionTermination() to terminate
2439         JS execution first, followed by posting a cleanup task to the worker, and lastly,
2440         it invokes terminate() on the WorkerRunLoop.
2441
2442         As a result, before run loop is terminate, the worker thread may observe the
2443         TerminatedExecutionException in JS code, bail out, see another JS task to run,
2444         re-enters the VM to run said JS code, and fails with an assertion due to the
2445         TerminatedExecutionException still being pending on VM entry.
2446
2447         WorkerRunLoop::Task::performTask() already has a check to only allow a task to
2448         run if and only if !runLoop.terminated() and the task is not a clean up task.
2449         We'll fix the above race by ensuring that having WorkerThread::stop() terminate
2450         the run loop before it scheduleExecutionTermination() which throws the
2451         TerminatedExecutionException.  This way, by the time JS code unwinds out of the
2452         VM due to the TerminatedExecutionException, runLoop.terminated() is guaranteed
2453         to be true and thereby prevents re-entry into the VM.
2454
2455         This issue is covered by an existing test that I just unskipped in TestExpectations.
2456
2457         * bindings/js/JSDOMPromiseDeferred.cpp:
2458         (WebCore::DeferredPromise::callFunction):
2459         * workers/WorkerThread.cpp:
2460         (WebCore::WorkerThread::stop):
2461
2462 2017-05-11  Chris Dumez  <cdumez@apple.com>
2463
2464         Drop custom bindings code for HTMLFormControlsCollection's named property getter
2465         https://bugs.webkit.org/show_bug.cgi?id=171964
2466
2467         Reviewed by Sam Weinig.
2468
2469         Drop custom bindings code for HTMLFormControlsCollection's named property getter as
2470         we are able to generate it.
2471
2472         No new tests, no expected Web-facing behavior change.
2473
2474         * CMakeLists.txt:
2475         * WebCore.xcodeproj/project.pbxproj:
2476         * bindings/js/JSBindingsAllInOne.cpp:
2477         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp: Removed.
2478         * bindings/scripts/CodeGeneratorJS.pm:
2479         (GenerateNamedGetter):
2480         * html/HTMLFormControlsCollection.cpp:
2481         (WebCore::HTMLFormControlsCollection::namedItemOrItems):
2482         * html/HTMLFormControlsCollection.h:
2483         * html/HTMLFormControlsCollection.idl:
2484
2485 2017-05-10  Eric Carlson  <eric.carlson@apple.com>
2486
2487         [MediaStream] CoreAudioCaptureSource claims to never be muted
2488         https://bugs.webkit.org/show_bug.cgi?id=171946
2489         <rdar://problem/32111991>
2490
2491         Reviewed by Jer Noble.
2492
2493         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2494         (WebCore::CoreAudioCaptureSource::stopProducingData): Set m_muted to true.
2495
2496 2017-05-10  Jer Noble  <jer.noble@apple.com>
2497
2498         RELEASE_ASSERT at WebAudioSourceProviderAVFObjC::provideInput()
2499         https://bugs.webkit.org/show_bug.cgi?id=171711
2500
2501         Reviewed by Youenn Fablet.
2502
2503         Before iterating over the channels in either the WebAudioBufferList or the AudioBus, ensure
2504         we don't walk over the end of either by only iterating over the minimum length of either.
2505         Also, when the internal format of WebAudioSourceProviderAVFObjC changes, notify the
2506         MediaStreamAudioSourceNode that the number of channels and sample rate have changed.
2507
2508         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
2509         (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
2510         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
2511
2512 2017-05-10  Andy Estes  <aestes@apple.com>
2513
2514         REGRESSION (r167845): ASSERT(!m_renderView.needsLayout()) in svg/custom/bug79798.html
2515         https://bugs.webkit.org/show_bug.cgi?id=132297
2516
2517         Reviewed by Simon Fraser.
2518
2519         We don't know why m_renderView needs layout in this case, but we know that we don't need to
2520         assert if the client hasn't set the ScrollableInnerFrameTrigger compositing trigger.
2521
2522         * rendering/RenderLayerCompositor.cpp:
2523         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame):
2524
2525 2017-05-10  Ryan Haddad  <ryanhaddad@apple.com>
2526
2527         Unreviewed, rolling out r216630.
2528
2529         This change caused assertion failures with webrtc LayoutTests.
2530
2531         Reverted changeset:
2532
2533         "RELEASE_ASSERT at
2534         WebAudioSourceProviderAVFObjC::provideInput()"
2535         https://bugs.webkit.org/show_bug.cgi?id=171711
2536         http://trac.webkit.org/changeset/216630
2537
2538 2017-05-09  Sam Weinig  <sam@webkit.org>
2539
2540         Remove support for legacy Notifications
2541         https://bugs.webkit.org/show_bug.cgi?id=171487
2542
2543         Reviewed by Jon Lee.
2544
2545         * CMakeLists.txt:
2546         * WebCore.xcodeproj/project.pbxproj:
2547         Remove files.
2548
2549         * Configurations/FeatureDefines.xcconfig:
2550         Remove definition of ENABLE_LEGACY_NOTIFICATIONS.
2551
2552         * DerivedSources.make:
2553         Remove IDL files.
2554
2555         * Modules/notifications/DOMWindowNotifications.cpp: Removed.
2556         * Modules/notifications/DOMWindowNotifications.h: Removed.
2557         * Modules/notifications/DOMWindowNotifications.idl: Removed.
2558         * Modules/notifications/NotificationCenter.cpp: Removed.
2559         * Modules/notifications/NotificationCenter.h: Removed.
2560         * Modules/notifications/NotificationCenter.idl: Removed.
2561         * Modules/notifications/NotificationClient.h:
2562         * Modules/notifications/NotificationController.cpp:
2563         * Modules/notifications/NotificationController.h:
2564         * Modules/notifications/WorkerGlobalScopeNotifications.cpp: Removed.
2565         * Modules/notifications/WorkerGlobalScopeNotifications.h: Removed.
2566         * Modules/notifications/WorkerGlobalScopeNotifications.idl: Removed.
2567         * Modules/notifications/Notification.idl:
2568         * Modules/notifications/Notification.cpp:
2569         * Modules/notifications/Notification.h:
2570         * dom/EventTargetFactory.in:
2571         * page/DOMWindow.cpp:
2572         * workers/WorkerThread.h:
2573         Remove code legacy Notification code. Replace use of NotificationCenter with direct
2574         calls to the NotificationClient.
2575
2576 2017-05-10  Commit Queue  <commit-queue@webkit.org>
2577
2578         Unreviewed, rolling out r216635.
2579         https://bugs.webkit.org/show_bug.cgi?id=171953
2580
2581         "Some worker tests are failing". (Requested by mlam on #webkit).
2582
2583         Reverted changeset:
2584
2585         "WorkerThread::stop() should call
2586         scheduleExecutionTermination() last."
2587         https://bugs.webkit.org/show_bug.cgi?id=171775
2588         http://trac.webkit.org/changeset/216635
2589
2590 2017-05-10  Mark Lam  <mark.lam@apple.com>
2591
2592         WorkerThread::stop() should call scheduleExecutionTermination() last.
2593         https://bugs.webkit.org/show_bug.cgi?id=171775
2594         <rdar://problem/30975761>
2595
2596         Reviewed by Geoffrey Garen.
2597
2598         Currently, WorkerThread::stop() calls scheduleExecutionTermination() to terminate
2599         JS execution first, followed by posting a cleanup task to the worker, and lastly,
2600         it invokes terminate() on the WorkerRunLoop.
2601
2602         As a result, before run loop is terminate, the worker thread may observe the
2603         TerminatedExecutionException in JS code, bail out, see another JS task to run,
2604         re-enters the VM to run said JS code, and fails with an assertion due to the
2605         TerminatedExecutionException still being pending on VM entry.
2606
2607         WorkerRunLoop::Task::performTask() already has a check to only allow a task to
2608         run if and only if !runLoop.terminated() and the task is not a clean up task.
2609         We'll fix the above race by ensuring that having WorkerThread::stop() terminate
2610         the run loop before it scheduleExecutionTermination() which throws the
2611         TerminatedExecutionException.  This way, by the time JS code unwinds out of the
2612         VM due to the TerminatedExecutionException, runLoop.terminated() is guaranteed
2613         to be true and thereby prevents re-entry into the VM.
2614
2615         This issue is covered by an existing test that I just unskipped in TestExpectations.
2616
2617         * bindings/js/JSDOMPromiseDeferred.cpp:
2618         (WebCore::DeferredPromise::callFunction):
2619         * workers/WorkerThread.cpp:
2620         (WebCore::WorkerThread::stop):
2621
2622 2017-05-10  Tim Horton  <timothy_horton@apple.com>
2623
2624         Add an experimental feature flag for viewport-fit
2625         https://bugs.webkit.org/show_bug.cgi?id=171948
2626         <rdar://problem/31995518>
2627
2628         Reviewed by Simon Fraser.
2629
2630         * dom/ViewportArguments.cpp:
2631         (WebCore::setViewportFeature):
2632         * page/Settings.in:
2633         Disable parsing of viewport-fit if the experimental feature is disabled.
2634
2635 2017-05-10  Chris Dumez  <cdumez@apple.com>
2636
2637         Simplify relationship between Attr and Element now that Attr is childless
2638         https://bugs.webkit.org/show_bug.cgi?id=171909
2639
2640         Reviewed by Ryosuke Niwa.
2641
2642         Simplify relationship between Attr and Element now that Attr is childless
2643         after r216259.
2644
2645         No new tests, no Web facing behavior change.
2646
2647         * dom/Attr.cpp:
2648         (WebCore::Attr::setValue):
2649         Attr::setValue() was only called by Element::setAttributeInternal() to make sure
2650         we updated the Attr node's Text child. However, now that Attr has no Text child,
2651         Element no longer needs to update the Attr node's value.
2652         Attr::setValueForBindings() was thus renamed to setValue(). Its implementation
2653         was also simplified by calling Element::setAttribute() on its ownerElement, if
2654         it has one, instead of duplicating a bunch of code from Element::setAttributeInternal().
2655
2656         (WebCore::Attr::setNodeValue):
2657         Call setValue() instead of setValueForBindings() now that it has been renamed.
2658
2659         * dom/Attr.h:
2660         * dom/Attr.idl:
2661         Rename valueForBindings / setValueForBindings to value / setValue.
2662
2663         * dom/Document.h:
2664         Split shouldInvalidateNodeListAndCollectionCaches() into 2 methods, one taking an Attr name
2665         and another that does not. There are now 2 calls sites instead of one, so we no longer need
2666         to branch in this function.
2667
2668         * dom/Element.cpp:
2669         (WebCore::Element::setAttributeInternal):
2670         Drop code calling Attr::setValue() on the Attr node since Attr::setValue() was only
2671         duplicating logic from Element::setAttributeInternal() after r216259. There is nothing
2672         on Attr that needs updating when an element attribute gets updated.
2673
2674         (WebCore::Element::attributeChanged):
2675         Call the new invalidateNodeListAndCollectionCachesInAncestorsForAttribute(). This
2676         is the only call site that passes an attribute name.
2677
2678         * dom/Node.cpp:
2679         (WebCore::Document::shouldInvalidateNodeListAndCollectionCaches):
2680         (WebCore::Document::shouldInvalidateNodeListAndCollectionCachesForAttribute):
2681         Split into 2 to avoid branching, as explained above.
2682
2683         (WebCore::Node::invalidateNodeListAndCollectionCachesInAncestors):
2684         (WebCore::Node::invalidateNodeListAndCollectionCachesInAncestorsForAttribute):
2685         - invalidateNodeListAndCollectionCachesInAncestors() used to invalidate childNodeLists
2686           if the Node was an attribute node. Drop this as this is no longer needed as of r216259.
2687         - After the change to Attr::setValue(), call sites for
2688           invalidateNodeListAndCollectionCachesInAncestors() either had no parameters, or both
2689           parameters present and non-null. There is therefore no longer any need to handle
2690           having an attrName but no attributeOwnerElement. To make this obvious, I split this
2691           into 2 methods: invalidateNodeListAndCollectionCachesInAncestors() and
2692           invalidateNodeListAndCollectionCachesInAncestorsForAttribute(attrName). We no longer
2693           need the attributeOwnerElement parameter as it was only used to exit early.
2694
2695         * dom/Node.h:
2696
2697 2017-05-10  Antti Koivisto  <antti@apple.com>
2698
2699         REGRESSION (r207372) Visibility property is not inherited when used in an animation
2700         https://bugs.webkit.org/show_bug.cgi?id=171883
2701         <rdar://problem/32086550>
2702
2703         Reviewed by Simon Fraser.
2704
2705         The problem here is that our animation code is tied to renderers. We don't have renderers during
2706         the initial style resolution so animations are not applied yet. When constructing renderers we set
2707         their style to the initial animated style but this step can't implement inheritance.
2708
2709         Normally this is invisible as the first animation frame will immediately inherit the style correctly.
2710         However in this case the animation is discrete and the first frame is the same as the initial state.
2711         With r207372 we optimize the descendant style change away.
2712
2713         This patch fixes the problem by tracking that the renderer has initial animated style and inheriting
2714         it to descendants during next style resolution even if it doesn't change.
2715
2716         Test: animations/animation-initial-inheritance.html
2717
2718         * rendering/RenderElement.cpp:
2719         (WebCore::RenderElement::RenderElement):
2720         * rendering/RenderElement.h:
2721         (WebCore::RenderElement::hasInitialAnimatedStyle):
2722         (WebCore::RenderElement::setHasInitialAnimatedStyle):
2723         * style/RenderTreeUpdater.cpp:
2724         (WebCore::RenderTreeUpdater::createRenderer):
2725
2726             Set a bit on renderer indicating it has initial animated style.
2727
2728         * style/StyleTreeResolver.cpp:
2729         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
2730
2731             Return at least 'Inherit' for style change when updating renderer with initial animated style.
2732
2733 2017-05-10  Jer Noble  <jer.noble@apple.com>
2734
2735         RELEASE_ASSERT at WebAudioSourceProviderAVFObjC::provideInput()
2736         https://bugs.webkit.org/show_bug.cgi?id=171711
2737
2738         Reviewed by Youenn Fablet.
2739
2740         Before iterating over the channels in either the WebAudioBufferList or the AudioBus, ensure
2741         we don't walk over the end of either by only iterating over the minimum length of either.
2742         Also, when the internal format of WebAudioSourceProviderAVFObjC changes, notify the
2743         MediaStreamAudioSourceNode that the number of channels and sample rate have changed.
2744
2745         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
2746         (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
2747         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
2748
2749 2017-05-04  Filip Pizlo  <fpizlo@apple.com>
2750
2751         GCController.cpp's collect() should be Async
2752         https://bugs.webkit.org/show_bug.cgi?id=171708
2753
2754         Reviewed by Saam Barati and Geoffrey Garen.
2755
2756         No new tests because no change in behavior.
2757         
2758         This is one step towards not requesting sync GCs in WebCore. I'm landing this incrementally to
2759         make bisecting super easy.
2760         
2761         This is a ~7% JetStream iOS "regression", because JetStream has a bug where it allows trunk
2762         to sneakily hide GC work between when JetStream measures time. After this change, we are no
2763         longer trying to be sneaky.
2764
2765         * bindings/js/GCController.cpp:
2766         (WebCore::collect):
2767
2768 2017-05-10  Jer Noble  <jer.noble@apple.com>
2769
2770         CoreAudioCaptureSource reports 3 or 5 channel audio output; actually only mono
2771         https://bugs.webkit.org/show_bug.cgi?id=171940
2772
2773         Reviewed by Eric Carlson.
2774
2775         Asking for the Input VPIO stream format will return the internal mic format, before processing. Instead
2776         ask for the input bus's output format, which is post processing, which will return the correct number
2777         of channels (one).
2778
2779         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2780         (WebCore::CoreAudioSharedUnit::configureMicrophoneProc):
2781
2782 2017-05-10  Ryan Haddad  <ryanhaddad@apple.com>
2783
2784         Unreviewed, rolling out r216591.
2785
2786         This change broke an internal build.
2787
2788         Reverted changeset:
2789
2790         "REGRESSION (r207372) Visibility property is not inherited
2791         when used in an animation"
2792         https://bugs.webkit.org/show_bug.cgi?id=171883
2793         http://trac.webkit.org/changeset/216591
2794
2795 2017-05-10  Chris Dumez  <cdumez@apple.com>
2796
2797         Drop custom bindings code now window.open()
2798         https://bugs.webkit.org/show_bug.cgi?id=171933
2799
2800         Reviewed by Geoffrey Garen.
2801
2802         Drop custom bindings code now window.open() as it is not doing anything special.
2803
2804         * bindings/js/JSDOMWindowCustom.cpp:
2805         (WebCore::JSDOMWindow::open): Deleted.
2806         * page/DOMWindow.cpp:
2807         (WebCore::DOMWindow::open):
2808         * page/DOMWindow.h:
2809         * page/DOMWindow.idl:
2810         * testing/Internals.cpp:
2811         (WebCore::Internals::openDummyInspectorFrontend):
2812
2813 2017-05-10  Tim Horton  <timothy_horton@apple.com>
2814
2815         Add an experimental feature flag for constant properties
2816         https://bugs.webkit.org/show_bug.cgi?id=171913
2817         <rdar://problem/31995518>
2818
2819         Reviewed by Ryosuke Niwa.
2820
2821         * css/parser/CSSParser.cpp:
2822         (WebCore::CSSParserContext::CSSParserContext):
2823         (WebCore::operator==):
2824         * css/parser/CSSParserImpl.cpp:
2825         (WebCore::CSSParserImpl::consumeCustomPropertyValue):
2826         * css/parser/CSSParserMode.h:
2827         * css/parser/CSSPropertyParser.cpp:
2828         (WebCore::CSSPropertyParser::parseValueStart):
2829         * css/parser/CSSVariableParser.cpp:
2830         (WebCore::classifyBlock):
2831         (WebCore::isValidVariableReference):
2832         (WebCore::isValidConstantReference):
2833         (WebCore::classifyVariableRange):
2834         (WebCore::CSSVariableParser::containsValidVariableReferences):
2835         (WebCore::CSSVariableParser::parseDeclarationValue):
2836         * css/parser/CSSVariableParser.h:
2837         Plumb the experimental feature flag down into CSSVariableParser by way
2838         of CSSParserContext.
2839
2840         * page/Settings.in:
2841
2842 2017-05-10  Chris Dumez  <cdumez@apple.com>
2843
2844         REGRESSION (r206960): Possible null pointer dereference under DOMSelection::getRangeAt()
2845         https://bugs.webkit.org/show_bug.cgi?id=171925
2846         <rdar://problem/29931223>
2847
2848         Reviewed by Wenson Hsieh.
2849
2850         We have evidence that selection().firstRange() can return null in DOMSelection::getRangeAt().
2851         When this happens, we now throw an INDEX_SIZE_ERR instead of dereferencing it.
2852
2853         I believe this can happen if the VisibleSelection is orphaned but not none, because
2854         rangeCount() only checks for isNone() but VisibleSelection::firstRange() can return null
2855         if isNoneOrOrphaned().
2856
2857         No new tests, I do not know how to reproduce.
2858
2859         * page/DOMSelection.cpp:
2860         (WebCore::DOMSelection::getRangeAt):
2861
2862 2017-05-10  Matt Rajca  <mrajca@apple.com>
2863
2864         DumpRenderTree crashed in com.apple.WebCore: std::optional<WTF::MediaTime>::operator-> + 71 :: CRASHING TEST: fullscreen/video-controls-timeline.html
2865         https://bugs.webkit.org/show_bug.cgi?id=171932
2866
2867         Reviewed by Eric Carlson.
2868
2869         Explicitly initialize m_playbackWithoutUserGesture to "None".
2870
2871         * html/HTMLMediaElement.h:
2872
2873 2017-05-10  Andy Estes  <aestes@apple.com>
2874
2875         Keyboard input suppression should extend to subframes
2876         https://bugs.webkit.org/show_bug.cgi?id=171880
2877         <rdar://problem/31201793>
2878
2879         Reviewed by Ryosuke Niwa.
2880
2881         Test: http/tests/navigation/keyboard-events-during-provisional-subframe-navigation.html
2882
2883         * dom/EventDispatcher.cpp:
2884         (WebCore::shouldSuppressEventDispatchInDOM): Changed to call shouldSuppressKeyboardInput()
2885         on the main frame's loader.
2886         * editing/Editor.cpp:
2887         (WebCore::Editor::shouldInsertText): Ditto.
2888
2889 2017-05-10  Matt Lewis  <jlewis3@apple.com>
2890
2891         Unreviewed, rolling out r216563.
2892
2893         Revision caused 2 api failures
2894
2895         Reverted changeset:
2896
2897         "[MediaStream] deviceId constraint doesn't work with
2898         getUserMedia"
2899         https://bugs.webkit.org/show_bug.cgi?id=171877
2900         http://trac.webkit.org/changeset/216563
2901
2902 2017-05-10  Frederic Wang  <fwang@igalia.com>
2903
2904         Refactor ScrollingCoordinator::setSynchronousScrollingReasons to accept a FrameView
2905         https://bugs.webkit.org/show_bug.cgi?id=171923
2906
2907         Reviewed by Simon Fraser.
2908
2909         Currently ScrollingCoordinator::setSynchronousScrollingReasons implementations assumes
2910         SynchronousScrollingReasons apply to the main frame. This commit allows to specify
2911         a FrameView in order to prepare support for fast scrolling of frames.
2912
2913         No new tests, no behavior changes.
2914
2915         * page/scrolling/AsyncScrollingCoordinator.cpp:
2916         (WebCore::AsyncScrollingCoordinator::setSynchronousScrollingReasons): Use the FrameView to
2917         find the state node.
2918         (WebCore::AsyncScrollingCoordinator::updateScrollLayerPosition): Rename this function
2919         updateMainFrameScrollLayerPosition and use the specified FrameView.
2920         * page/scrolling/AsyncScrollingCoordinator.h: Add FrameView parameter.
2921         * page/scrolling/ScrollingCoordinator.cpp:
2922         (WebCore::ScrollingCoordinator::updateSynchronousScrollingReasons): Remove the const since
2923         AsyncScrollingCoordinator uses scrollLayerForFrameView. Pass the frameView to
2924         setSynchronousScrollingReasons.
2925         * page/scrolling/ScrollingCoordinator.h:
2926         (WebCore::ScrollingCoordinator::setSynchronousScrollingReasons): Add FrameView parameter.
2927
2928 2017-05-10  Antti Koivisto  <antti@apple.com>
2929
2930         REGRESSION (r207372) Visibility property is not inherited when used in an animation
2931         https://bugs.webkit.org/show_bug.cgi?id=171883
2932         <rdar://problem/32086550>
2933
2934         Reviewed by Simon Fraser.
2935
2936         The problem here is that our animation code is tied to renderers. We don't have renderers during
2937         the initial style resolution so animations are not applied yet. When constructing renderers we set
2938         their style to the initial animated style but this step can't implement inheritance.
2939
2940         Normally this is invisible as the first animation frame will immediately inherit the style correctly.
2941         However in this case the animation is discrete and the first frame is the same as the initial state.
2942         With r207372 we optimize the descendant style change away.
2943
2944         This patch fixes the problem by tracking that the renderer has initial animated style and inheriting
2945         it to descendants during next style resolution even if it doesn't change.
2946
2947         Test: animations/animation-initial-inheritance.html
2948
2949         * rendering/RenderElement.cpp:
2950         (WebCore::RenderElement::RenderElement):
2951         * rendering/RenderElement.h:
2952         (WebCore::RenderElement::hasInitialAnimatedStyle):
2953         (WebCore::RenderElement::setHasInitialAnimatedStyle):
2954         * style/RenderTreeUpdater.cpp:
2955         (WebCore::RenderTreeUpdater::createRenderer):
2956
2957             Set a bit on renderer indicating it has initial animated style.
2958
2959         * style/StyleTreeResolver.cpp:
2960         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
2961
2962             Return at least 'Inherit' for style change when updating renderer with initial animated style.
2963
2964 2017-05-10  Myles C. Maxfield  <mmaxfield@apple.com>
2965
2966         Tiny cleanup in Font::DerivedFonts
2967         https://bugs.webkit.org/show_bug.cgi?id=171893
2968
2969         Reviewed by Jon Lee.
2970
2971         This variable was written to but never read.
2972
2973         No new tests because there is no behavior change.
2974
2975         * css/CSSFontFaceSource.cpp:
2976         (WebCore::CSSFontFaceSource::font):
2977         * platform/graphics/Font.cpp:
2978         (WebCore::Font::verticalRightOrientationFont):
2979         (WebCore::Font::uprightOrientationFont):
2980         (WebCore::Font::smallCapsFont):
2981         (WebCore::Font::noSynthesizableFeaturesFont):
2982         (WebCore::Font::emphasisMarkFont):
2983         (WebCore::Font::brokenIdeographFont):
2984         (WebCore::Font::DerivedFonts::~DerivedFonts): Deleted.
2985         * platform/graphics/Font.h:
2986         (WebCore::Font::DerivedFonts::DerivedFonts): Deleted.
2987
2988 2017-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
2989
2990         Remove user agent quirk for Slack
2991         https://bugs.webkit.org/show_bug.cgi?id=171869
2992
2993         Reviewed by Carlos Garcia Campos.
2994
2995         The user agent quirk for Slack does not seem to be necessary anymore. I am able to use Slack
2996         without difficulty using our default user agent.
2997
2998         * platform/UserAgentQuirks.cpp:
2999         (WebCore::urlRequiresChromeBrowser):
3000
3001 2017-05-10  Hyungwook Lee  <hyungwook.lee@navercorp.com>
3002
3003         [GTK] Fix compile warnings in CryptoKeyECGCrypt.cpp
3004         https://bugs.webkit.org/show_bug.cgi?id=171851
3005
3006         Reviewed by Alex Christensen.
3007
3008         * crypto/gcrypt/CryptoKeyECGCrypt.cpp:
3009         (WebCore::curveSize):
3010         (WebCore::curveName):
3011         (WebCore::uncompressedPointSizeForCurve):
3012         (WebCore::uncompressedFieldElementSizeForCurve):
3013
3014 2017-05-08  Sergio Villar Senin  <svillar@igalia.com>
3015
3016         [css-grid] Remove Blink-specific code for handling orthogonal grid items
3017         https://bugs.webkit.org/show_bug.cgi?id=171807
3018
3019         Reviewed by Darin Adler.
3020
3021         This code was added in r203252 as part of a patch improving the handling of
3022         {min|max}-content with orthogonal flows. The original code came from Blink which performs a
3023         pre-layout of orthogonal boxes in FrameView. That is not true in the case of WebKit so we do
3024         not need this code at all. Actually it was causing incorrect renderings in some tests.
3025
3026         I'm also removing an invalid return statement just after another return.
3027
3028         * rendering/GridTrackSizingAlgorithm.cpp:
3029         (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild):
3030         (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild):
3031
3032 2017-05-09  Zan Dobersek  <zdobersek@igalia.com>
3033
3034         Unreviewed build fix.
3035
3036         * platform/wpe/WidgetWPE.cpp:
3037         (WebCore::Widget::paint): Add the missing SecurityOriginPaintPolicy parameter.
3038
3039 2017-05-09  Eric Carlson  <eric.carlson@apple.com>
3040
3041         [MediaStream] deviceId constraint doesn't work with getUserMedia
3042         https://bugs.webkit.org/show_bug.cgi?id=171877
3043         <rdar://problem/31899730>
3044
3045         Reviewed by Jer Noble.
3046
3047         Test: fast/mediastream/get-user-media-device-id.html
3048
3049         * Modules/mediastream/MediaConstraintsImpl.h:
3050         (WebCore::MediaConstraintsData::MediaConstraintsData): Add a constructor that 
3051         takes a const MediaConstraints&.
3052
3053         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
3054         (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin): Don't return
3055         NULL for the main frame so the origin matches that returned for a UserMediaRequest.
3056
3057         * Modules/mediastream/UserMediaController.h:
3058         (WebCore::UserMediaController::setDeviceIDHashSalt): Deleted, not used.
3059         (WebCore::UserMediaController::deviceIDHashSalt): Deleted, not used.
3060
3061         * Modules/mediastream/UserMediaRequest.cpp:
3062         (WebCore::UserMediaRequest::allow): Add device ID hash salt parameter, set it on
3063         constraints.
3064         * Modules/mediastream/UserMediaRequest.h:
3065
3066         * platform/mediastream/MediaConstraints.h:
3067         * platform/mediastream/RealtimeMediaSource.cpp:
3068         (WebCore::RealtimeMediaSource::fitnessDistance): ASSERT if called for DeviceId.
3069         (WebCore::RealtimeMediaSource::selectSettings): Special case DeviceId because it
3070         we have to hash the device ID before comparing, and because the DeviceId can't be
3071         changed so it should never be added to the flattened constraints.
3072
3073         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp:
3074         (WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint): Deleted, unused.
3075         (WebCore::RealtimeMediaSourceSupportedConstraints::constraintFromName): Deleted, unused.
3076         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:
3077
3078         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3079         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
3080         (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints): Pass device
3081         id, not empty string.
3082
3083 2017-05-09  Jeremy Jones  <jeremyj@apple.com>
3084
3085         Video fullscreen window level should be below status bar.
3086         https://bugs.webkit.org/show_bug.cgi?id=171892
3087         rdar://problem/31771707
3088
3089         Reviewed by Jer Noble.
3090
3091         No new tests because it only affects platform window level.
3092
3093         Move the fullscreen window below the status bar, but above the input field window level.
3094
3095         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3096         (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
3097
3098 2017-05-09  Sam Weinig  <sam@webkit.org>
3099
3100         Implement Subresource Integrity (SRI) [Part 2 - Fetch]
3101         https://bugs.webkit.org/show_bug.cgi?id=148363
3102         <rdar://problem/18945879>
3103
3104         Reviewed by Youenn Fablet.
3105
3106         Tests: http/tests/subresource-integrity/sri-fetch-worker.html
3107                http/tests/subresource-integrity/sri-fetch.html
3108
3109         * loader/FetchOptions.h:
3110         * loader/ThreadableLoader.cpp:
3111         (WebCore::ThreadableLoaderOptions::isolatedCopy):
3112         * loader/ThreadableLoader.h:
3113         * loader/WorkerThreadableLoader.cpp:
3114         (WebCore::LoaderTaskOptions::LoaderTaskOptions):
3115         Add integrity metadata to the fetch options, and fix the implementation of
3116         ThreadableLoaderOptions::isolatedCopy to work correctly (it was missing isolated
3117         copy derivedCachedDataTypesToRetrieve).
3118
3119         * Modules/fetch/FetchRequest.cpp:
3120         (WebCore::buildOptions):
3121         (WebCore::FetchRequest::initializeOptions):
3122         * Modules/fetch/FetchRequest.h:
3123         Switch to using the integrity metadata on the fetchOptions, removing the need to
3124         store them directly on the internal request.
3125
3126         * loader/DocumentThreadableLoader.cpp:
3127         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
3128         (WebCore::DocumentThreadableLoader::didReceiveResponse):
3129         (WebCore::DocumentThreadableLoader::didReceiveData):
3130         (WebCore::DocumentThreadableLoader::didFinishLoading):
3131         (WebCore::DocumentThreadableLoader::loadRequest):
3132         (WebCore::DocumentThreadableLoader::reportIntegrityMetadataError):
3133         * loader/DocumentThreadableLoader.h:
3134         Add a new flag, m_delayCallbacksForIntegrityCheck, which is used when integrity metadata
3135         is present, so we can implement the 'wait' concept from the fetch spec, and delay informing
3136         the clients until we have validated the integrity metadata.
3137
3138 2017-05-09  Commit Queue  <commit-queue@webkit.org>
3139
3140         Unreviewed, rolling out r216545.
3141         https://bugs.webkit.org/show_bug.cgi?id=171889
3142
3143         Caused a test failure (Requested by eric_carlson on #webkit).
3144
3145         Reverted changeset:
3146
3147         "[MediaStream] deviceId constraint doesn't work with
3148         getUserMedia"
3149         https://bugs.webkit.org/show_bug.cgi?id=171877
3150         http://trac.webkit.org/changeset/216545
3151
3152 2017-05-09  Zalan Bujtas  <zalan@apple.com>
3153
3154         resetFlowThreadContainingBlockAndChildInfoIncludingDescendants should not ignore RenderElement subtrees.
3155         https://bugs.webkit.org/show_bug.cgi?id=171873
3156         <rdar://problem/32004954>
3157
3158         Reviewed by Simon Fraser.
3159
3160         Normally a RenderBlock's parent is another RenderBlock, but In some cases (e.g. tables) a RenderBlock can
3161         have a non-RenderBlock(RenderBox) ancestor.
3162         While updating the flow thread state on a subtree, we should descent into subtrees with RenderElement
3163         roots and not just RenderBlocks so that we clear the state on the entire subtree.
3164
3165         Test: fast/multicol/crash-when-column-inside-table.html
3166
3167         * rendering/RenderBlock.cpp:
3168         (WebCore::RenderBlock::resetFlowThreadContainingBlockAndChildInfoIncludingDescendants):
3169         * rendering/RenderBlock.h:
3170         * rendering/RenderElement.cpp:
3171         (WebCore::RenderElement::resetFlowThreadContainingBlockAndChildInfoIncludingDescendants):
3172         * rendering/RenderElement.h:
3173
3174 2017-05-09  Eric Carlson  <eric.carlson@apple.com>
3175
3176         [MediaStream] deviceId constraint doesn't work with getUserMedia
3177         https://bugs.webkit.org/show_bug.cgi?id=171877
3178         <rdar://problem/31899730>
3179
3180         Reviewed by Jer Noble.
3181
3182         Test: fast/mediastream/get-user-media-device-id.html
3183
3184         * Modules/mediastream/MediaConstraintsImpl.h:
3185         (WebCore::MediaConstraintsData::MediaConstraintsData): Add a constructor that 
3186         takes a const MediaConstraints&.
3187
3188         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
3189         (WebCore::MediaDevicesEnumerationRequest::topLevelDocumentOrigin): Don't return
3190         NULL for the main frame so the origin matches that returned for a UserMediaRequest.
3191
3192         * Modules/mediastream/UserMediaController.h:
3193         (WebCore::UserMediaController::setDeviceIDHashSalt): Deleted, not used.
3194         (WebCore::UserMediaController::deviceIDHashSalt): Deleted, not used.
3195
3196         * Modules/mediastream/UserMediaRequest.cpp:
3197         (WebCore::UserMediaRequest::allow): Add device ID hash salt parameter, set it on
3198         constraints.
3199         * Modules/mediastream/UserMediaRequest.h:
3200
3201         * platform/mediastream/MediaConstraints.h:
3202         * platform/mediastream/RealtimeMediaSource.cpp:
3203         (WebCore::RealtimeMediaSource::fitnessDistance): ASSERT if called for DeviceId.
3204         (WebCore::RealtimeMediaSource::selectSettings): Special case DeviceId because it
3205         we have to hash the device ID before comparing, and because the DeviceId can't be
3206         changed so it should never be added to the flattened constraints.
3207
3208         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp:
3209         (WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint): Deleted, unused.
3210         (WebCore::RealtimeMediaSourceSupportedConstraints::constraintFromName): Deleted, unused.
3211         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.h:
3212
3213         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3214         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
3215         (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints): Pass device
3216         id, not empty string.
3217
3218 2017-05-09  Antoine Quint  <graouts@apple.com>
3219
3220         [Modern Media Controls] Localized strings aren't loaded
3221         https://bugs.webkit.org/show_bug.cgi?id=171884
3222
3223         Reviewed by Dean Jackson.
3224
3225         Remove the extraneous file extension in the file name.
3226
3227         * rendering/RenderThemeIOS.mm:
3228         (WebCore::RenderThemeIOS::mediaControlsScript):
3229         * rendering/RenderThemeMac.mm:
3230         (WebCore::RenderThemeMac::mediaControlsScript):
3231
3232 2017-05-09  Chris Dumez  <cdumez@apple.com>
3233
3234         Introduce DocumentAndElementEventHandlers IDL interface
3235         https://bugs.webkit.org/show_bug.cgi?id=171879
3236
3237         Reviewed by Simon Fraser and Ryosuke Niwa.
3238
3239         Introduce DocumentAndElementEventHandlers IDL interface:
3240         - https://html.spec.whatwg.org/#documentandelementeventhandlers
3241
3242         This avoids duplication between Document.idl and Element.idl.
3243
3244         Also mark oncopy / oncut / onpaste EventHandlers as enumerable to match
3245         the specification.
3246
3247         Test: fast/events/DocumentAndElementEventHandlers.html
3248
3249         * CMakeLists.txt:
3250         * DerivedSources.make:
3251         * WebCore.xcodeproj/project.pbxproj:
3252         * dom/Document.idl:
3253         * dom/DocumentAndElementEventHandlers.idl: Added.
3254         * dom/Element.idl:
3255
3256 2017-05-10  Dean Jackson  <dino@apple.com>
3257
3258         Restrict SVG filters to accessible security origins
3259         https://bugs.webkit.org/show_bug.cgi?id=118689
3260         <rdar://problem/27362159>
3261
3262         Reviewed by Brent Fulgham.
3263
3264         Certain SVG filters should only be allowed to operate
3265         on content that is has SecurityOrigin access to. Implement
3266         this by including a flag in PaintInfo and LayerPaintingInfo,
3267         and have RenderWidget make sure the documents have acceptable
3268         SecurityOrigins as it goes to paint.
3269
3270         This could be used as the first step in a "safe painting"
3271         strategy, allowing some content to be rendered into a 
3272         canvas or via the element() CSS function... but it is only
3273         a small first step.
3274
3275         Test: http/tests/css/filters-on-iframes.html
3276
3277         * page/FrameView.cpp:
3278         (WebCore::FrameView::paintContents):
3279         * page/FrameView.h:
3280         * platform/ScrollView.cpp:
3281         (WebCore::ScrollView::paint):
3282         * platform/ScrollView.h:
3283         * platform/Scrollbar.cpp:
3284         (WebCore::Scrollbar::paint):
3285         * platform/Scrollbar.h:
3286         * platform/Widget.h:
3287         * platform/graphics/filters/FilterOperation.h:
3288         (WebCore::FilterOperation::shouldBeRestrictedBySecurityOrigin):
3289         * platform/graphics/filters/FilterOperations.cpp:
3290         (WebCore::FilterOperations::hasFilterThatShouldBeRestrictedBySecurityOrigin):
3291         * platform/graphics/filters/FilterOperations.h:
3292         * platform/mac/WidgetMac.mm:
3293         (WebCore::Widget::paint):
3294         * rendering/FilterEffectRenderer.cpp:
3295         (WebCore::FilterEffectRenderer::build):
3296         * rendering/FilterEffectRenderer.h:
3297         * rendering/PaintInfo.h:
3298         (WebCore::PaintInfo::PaintInfo):
3299         * rendering/RenderLayer.cpp:
3300         (WebCore::RenderLayer::paint):
3301         (WebCore::RenderLayer::setupFilters):
3302         (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
3303         * rendering/RenderLayer.h:
3304         * rendering/RenderScrollbar.cpp:
3305         (WebCore::RenderScrollbar::paint):
3306         * rendering/RenderScrollbar.h:
3307         * rendering/RenderWidget.cpp:
3308         (WebCore::RenderWidget::paintContents):
3309
3310 2017-05-09  Chris Dumez  <cdumez@apple.com>
3311
3312         Move onanimation* EventHandlers to GlobalEventHandlers
3313         https://bugs.webkit.org/show_bug.cgi?id=171874
3314
3315         Reviewed by Simon Fraser.
3316
3317         Move onanimation* EventHandlers to GlobalEventHandlers to match the specification:
3318         - https://drafts.csswg.org/css-animations/#interface-globaleventhandlers-idl
3319
3320         We previously have those on Window and Element only. Firefox complies with the
3321         specification.
3322
3323         Test: fast/css/onanimation-eventhandlers.html
3324
3325         * dom/Element.idl:
3326         * dom/GlobalEventHandlers.idl:
3327         * page/DOMWindow.idl:
3328
3329 2017-05-09  Youenn Fablet  <youenn@apple.com>
3330
3331         Refresh webrtc WPT tests
3332         https://bugs.webkit.org/show_bug.cgi?id=171878
3333
3334         Reviewed by Eric Carlson.
3335
3336         Tests: imported/w3c/web-platform-tests/webrtc/RTCConfiguration-iceCandidatePoolSize.html
3337                imported/w3c/web-platform-tests/webrtc/RTCDataChannel-id.html
3338                imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-canTrickleIceCandidates.html
3339                imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-constructor.html
3340                imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-createDataChannel.html
3341                imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-iceGatheringState.html
3342                imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-idl.html
3343                imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription.html
3344                imported/w3c/web-platform-tests/webrtc/datachannel-idlharness.html
3345                imported/w3c/web-platform-tests/webrtc/getstats.html
3346                imported/w3c/web-platform-tests/webrtc/interfaces.html
3347
3348         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3349         (WebCore::LibWebRTCMediaEndpoint::createDataChannel): exiting early if libwebrtc is not creating a data channel.
3350
3351 2017-05-09  Javier Fernandez  <jfernandez@igalia.com>
3352
3353         space-evenly misbehaves with flexbox
3354         https://bugs.webkit.org/show_bug.cgi?id=170445
3355
3356         Reviewed by David Hyatt.
3357
3358         The CSS Box Alignment specification defines the <content-distribution>
3359         set as some of the allowed values for the Content Distribution
3360         properties, align-content and justify-content. The 'space-evenly' value
3361         is not among the ones allowed for these properties according to the CSS
3362         Flexible Box specification.
3363
3364         The CSS Flexbible box specification states that it must follow the CSS
3365         Box Alignment specification, so this new value must be considered as
3366         part of an upgraded level of the spec, which should be implemented
3367         eventually.
3368
3369         Since we have already shipped an implementation of the new CSS Box
3370         Alignment values for CSS Grid Layout, we need to implement it for
3371         Flexbox as well.
3372
3373         No new tests, but several new test cases added.
3374
3375         * rendering/RenderFlexibleBox.cpp:
3376         (WebCore::initialJustifyContentOffset):
3377         (WebCore::justifyContentSpaceBetweenChildren):
3378         (WebCore::initialAlignContentOffset):
3379         (WebCore::alignContentSpaceBetweenChildren):
3380
3381 2017-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
3382
3383         Avoid -Wformat warnings in RenderLayerCompositor.cpp and RenderLayerBacking.cpp
3384         https://bugs.webkit.org/show_bug.cgi?id=171875
3385
3386         Reviewed by Simon Fraser.
3387
3388         * rendering/RenderLayerBacking.cpp:
3389         (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
3390         * rendering/RenderLayerCompositor.cpp:
3391         (WebCore::RenderLayerCompositor::logLayerInfo):
3392         (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
3393
3394 2017-05-09  Chris Dumez  <cdumez@apple.com>
3395
3396         Drop custom bindings code for Window.location setter
3397         https://bugs.webkit.org/show_bug.cgi?id=171846
3398
3399         Reviewed by Sam Weinig.
3400
3401         Drop custom bindings code for Window.location setter as the custom code was merely needed
3402         to address a very old Mac widget that has long been fixed (rdar://problem/5695330).
3403
3404         No new tests, no Web-facing behavior change.
3405
3406         * bindings/js/JSDOMWindowCustom.cpp:
3407         (WebCore::JSDOMWindow::setLocation): Deleted.
3408         Drop custom code.
3409
3410         * page/DOMWindow.idl:
3411         Align Window.location with https://html.spec.whatwg.org/#the-window-object:
3412         - Mark property as readonly.
3413         - Add [PutsForward=href] IDL extended attribute.
3414         Also, we need to mark the atribute as nullable as this reflects our current implementation.
3415         We currently return null if the associated Window does not have a frame. This does not match
3416         the specification and we should update our implementation in the future to never return null.
3417
3418 2017-05-09  Matt Lewis  <jlewis3@apple.com>