[GStreamer] Adopt nullptr
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-03-06  Vanessa Chipirrás Navalón  <vchipirras@igalia.com>
2
3         [GStreamer] Adopt nullptr
4         https://bugs.webkit.org/show_bug.cgi?id=123438
5
6         Reviewed by Xabier Rodriguez-Calvar.
7
8         To adapt the code to the C++11 standard, all NULL or 0 pointers have been changed to nullptr.
9
10         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
11         (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
12         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
13         (WebCore::AudioFileReader::handleNewDeinterleavePad):
14         (WebCore::AudioFileReader::plugDeinterleave):
15         (WebCore::AudioFileReader::decodeAudioForBusCreation):
16         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
17         (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
18         (WebCore::AudioSourceProviderGStreamer::configureAudioBin):
19         (WebCore::AudioSourceProviderGStreamer::setClient):
20         (WebCore::AudioSourceProviderGStreamer::handleNewDeinterleavePad):
21         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
22         (webkit_web_audio_src_init):
23         (webKitWebAudioSrcLoop):
24         (webKitWebAudioSrcChangeState):
25         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
26         (WebCore::AudioTrackPrivateGStreamer::setEnabled):
27         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
28         (WebCore::initializeGStreamer):
29         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
30         (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
31         (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
32         (WebCore::initializeGStreamerAndRegisterWebKitElements):
33         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
34         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
35         (WebCore::MediaPlayerPrivateGStreamer::newTextSample):
36         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
37         (WebCore::MediaPlayerPrivateGStreamer::processTableOfContents):
38         Removed the unused second argument on processTableOfContentsEntry function.
39         (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry):
40         Removed the unused second argument on this function.
41         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
42         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
43         (WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
44         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
45         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
46         Removed the unused second argument on processTableOfContentsEntry function.
47         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
48         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
49         (WebCore::MediaPlayerPrivateGStreamerBase::setMuted):
50         (WebCore::MediaPlayerPrivateGStreamerBase::muted):
51         (WebCore::MediaPlayerPrivateGStreamerBase::notifyPlayerOfMute):
52         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
53         (WebCore::MediaPlayerPrivateGStreamerBase::decodedFrameCount):
54         (WebCore::MediaPlayerPrivateGStreamerBase::droppedFrameCount):
55         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
56         (WebCore::MediaPlayerPrivateGStreamerOwr::registerMediaEngine):
57         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
58         (webkit_text_combiner_init):
59         (webkitTextCombinerPadEvent):
60         (webkitTextCombinerRequestNewPad):
61         (webkitTextCombinerNew):
62         * platform/graphics/gstreamer/TextSinkGStreamer.cpp:
63         (webkitTextSinkNew):
64         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
65         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
66         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged):
67         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
68         (webkit_video_sink_init):
69         (webkitVideoSinkProposeAllocation):
70         (webkitVideoSinkNew):
71         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
72         (WebCore::VideoTrackPrivateGStreamer::setSelected):
73         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
74         (webkit_web_src_init):
75         (webKitWebSrcDispose):
76         (webKitWebSrcSetProperty):
77         (webKitWebSrcStop):
78         (webKitWebSrcChangeState):
79         (webKitWebSrcQueryWithParent):
80         (webKitWebSrcGetProtocols):
81         (StreamingClient::handleResponseReceived):
82         (StreamingClient::handleDataReceived):
83         (ResourceHandleStreamingClient::didFail):
84         (ResourceHandleStreamingClient::wasBlocked):
85         (ResourceHandleStreamingClient::cannotShowURL):
86         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
87         (webKitMediaSrcGetProtocols):
88
89 2017-03-06  Andreas Kling  <akling@apple.com>
90
91         [iOS] Report domains crashing under memory pressure via enhanced privacy logging.
92         <https://webkit.org/b/169133>
93         <rdar://problem/29964017>
94
95         Reviewed by Antti Koivisto.
96
97         * page/DiagnosticLoggingKeys.h:
98
99 2017-03-05  Simon Fraser  <simon.fraser@apple.com>
100
101         Avoid backing store for layers with empty text nodes in a few more cases
102         https://bugs.webkit.org/show_bug.cgi?id=169185
103
104         Reviewed by Dan Bernstein.
105
106         In hasPaintingNonLayerDescendants() we can check whether the RenderText's linesBoundingBox()
107         is empty to avoid backing store in a few more cases. Also use containsOnlyWhitespace() rather
108         than isAllCollapsibleWhitespace(), because there's no need for backing store for non-selectable
109         whitespace text.
110
111         Covered by existing tests.
112
113         * rendering/RenderLayer.cpp:
114         (WebCore::RenderLayer::calculateClipRects):
115
116 2017-03-05  Chris Dumez  <cdumez@apple.com>
117
118         Drop unnecessary backslash in ResourceResponse::sanitizeSuggestedFilename()
119         https://bugs.webkit.org/show_bug.cgi?id=169066
120
121         Reviewed by Sam Weinig.
122
123         Drop unnecessary backslash in ResourceResponse::sanitizeSuggestedFilename().
124
125         * platform/network/ResourceResponseBase.cpp:
126         (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
127
128 2017-03-05  Chris Dumez  <cdumez@apple.com>
129
130         Using <form> in <template> causes following <form> to get swallowed
131         https://bugs.webkit.org/show_bug.cgi?id=163552
132
133         Reviewed by Sam Weinig.
134
135         As per the HTML specification [1], when finding a "form" tag in the "in body"
136         insertion mode, we should insert an HTML element for the token, and, if there
137         is no template element on the stack of open elements, set the form element
138         pointer to point to the element created.
139
140         We were missing the "if there is no template element on the stack of open
141         elements" check and setting the form element pointer unconditionally.
142         This patch fixes the issue.
143
144         [1] https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody:form-element-pointer-2
145
146         Test: fast/parser/form-after-template.html
147
148         * html/parser/HTMLConstructionSite.cpp:
149         (WebCore::HTMLConstructionSite::insertHTMLFormElement):
150
151 2017-03-04  Myles C. Maxfield  <mmaxfield@apple.com>
152
153         Update CSSFontSelector's matching algorithm to understand ranges
154         https://bugs.webkit.org/show_bug.cgi?id=168892
155
156         Reviewed by Jon Lee.
157
158         This patch migrates the font selection algorithm out of FontCacheCoreText and into its own file which can be shared
159         among all ports. It then migrates our web font selection algorithm to use it.
160
161         This patch doesn't actually change the parsing rules; it just changes the internal machinery for how fonts get
162         selected. Therefore, this patch simply makes zero-length ranges from the discrete values the parser emits, and passes
163         those zero-length ranges to the range-based font selection routine. This means that this patch doesn't actually
164         change the results of the font selection algorithm.
165
166         One of the inputs to the new font selection algorithm is font-stretch, which previously was not parsed inside
167         @font-face blocks or the CSS Font Loading API. This patch therefore adds parsing support and modifies the existing
168         tests for these pieces to expect parsing to work. Because the font selection algorithm itself is shared between
169         installed fonts and webfonts, this patch doesn't add any additional tests for it (because it is already covered under
170         existing tests).
171
172         No new tests because there is no behavior change.
173
174         * CMakeLists.txt:
175         * WebCore.xcodeproj/project.pbxproj: Add new file for the font selection algorithm.
176         * css/CSSFontFace.cpp:
177         (WebCore::CSSFontFace::calculateStretch): Used on @font-face blocks and the CSS Font Loading API.
178         (WebCore::CSSFontFace::setStretch): Fill out the previously stubbed function.
179         * css/CSSFontFace.h: Add the range member variable to CSSFontFaces.
180         * css/CSSFontFaceSet.cpp:
181         (WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered): Now that we care about font-stretch, we need to
182         look it up for local fonts too. This current approach of an extra FontSelectionValue hanging around with a
183         FontTraitsMask is very ugly and will be removed soon (https://bugs.webkit.org/show_bug.cgi?id=168889 and
184         https://bugs.webkit.org/show_bug.cgi?id=168890).
185         (WebCore::computeFontStretch): Used on @font-face blocks and the CSS Font Loading API.
186         (WebCore::CSSFontFaceSet::matchingFaces): Educate about font-stretch.
187         (WebCore::CSSFontFaceSet::fontFace): Migrate to the new font-selection algorithm.
188         (WebCore::fontFaceComparator): Deleted.
189         * css/CSSFontFaceSet.h:
190         * css/CSSFontSelector.cpp:
191         (WebCore::CSSFontSelector::addFontFaceRule): Educate about font-stretch.
192         (WebCore::CSSFontSelector::fontRangesForFamily): Ditto.
193         * css/FontFace.cpp:
194         (WebCore::FontFace::setStretch): Ditto.
195         (WebCore::FontFace::stretch): Ditto.
196         * css/parser/CSSPropertyParser.cpp:
197         (WebCore::CSSPropertyParser::parseFontFaceDescriptor): Ditto.
198         * platform/graphics/FontCache.h: Ditto.
199         * platform/graphics/FontDescription.h:
200         * platform/graphics/FontSelectionAlgorithm.cpp: Added.
201         (WebCore::FontSelectionAlgorithm::filterCapability):
202         (WebCore::FontSelectionAlgorithm::indexOfBestCapabilities):
203         (WebCore::fontSelectionRequestForTraitsMask):
204         (WebCore::initialFontSelectionCapabilitiesForTraitsMask):
205         (WebCore::fontSelectionCapabilitiesForTraitsMask):
206         * platform/graphics/FontSelectionAlgorithm.h: Added. Taken from FontCacheCoreText.cpp.
207         (WebCore::FontSelectionValue::FontSelectionValue):
208         (WebCore::FontSelectionValue::operator float):
209         (WebCore::FontSelectionValue::rawValue):
210         (WebCore::FontSelectionValue::maximumValue):
211         (WebCore::FontSelectionValue::minimumValue):
212         (WebCore::FontSelectionValue::operator+):
213         (WebCore::FontSelectionValue::operator-):
214         (WebCore::FontSelectionValue::operator*):
215         (WebCore::FontSelectionValue::operator/):
216         (WebCore::FontSelectionValue::operator==):
217         (WebCore::FontSelectionValue::operator!=):
218         (WebCore::FontSelectionValue::operator<):
219         (WebCore::FontSelectionValue::operator<=):
220         (WebCore::FontSelectionValue::operator>):
221         (WebCore::FontSelectionValue::operator>=):
222         (WebCore::FontSelectionRange::isValid):
223         (WebCore::FontSelectionRange::expand):
224         (WebCore::FontSelectionRange::includes):
225         (WebCore::FontSelectionRequest::operator==):
226         (WebCore::FontSelectionRequest::operator!=):
227         (WebCore::FontSelectionRequestKey::FontSelectionRequestKey):
228         (WebCore::FontSelectionRequestKey::isHashTableDeletedValue):
229         (WebCore::FontSelectionRequestKey::operator==):
230         (WebCore::FontSelectionRequestKeyHash::hash):
231         (WebCore::FontSelectionRequestKeyHash::equal):
232         (WebCore::FontSelectionCapabilities::expand):
233         (WebCore::FontSelectionAlgorithm::FontSelectionAlgorithm):
234         (WebCore::FontSelectionAlgorithm::iterateActiveCapabilitiesWithReturn):
235         (WebCore::FontSelectionAlgorithm::iterateActiveCapabilities):
236         * platform/graphics/cocoa/FontCacheCoreText.cpp: Moved to FontSelectionAlgorithm.
237         (WebCore::stretchFromCoreTextTraits):
238         (WebCore::FontDatabase::capabilitiesForFontDescriptor):
239         (WebCore::findClosestFont):
240         (WebCore::calculateFontSelectionRequest):
241         (WebCore::platformFontLookupWithFamily):
242         (WebCore::FontCache::getTraitsInFamily): Deleted.
243         (WebCore::iterateActiveFontsWithReturn): Deleted.
244         (WebCore::iterateActiveFonts): Deleted.
245         (WebCore::findClosestStretch): Deleted.
246         (WebCore::filterStretch): Deleted.
247         (WebCore::findClosestStyle): Deleted.
248         (WebCore::filterStyle): Deleted.
249         (WebCore::findClosestWeight): Deleted.
250         (WebCore::filterWeight): Deleted.
251         (WebCore::computeTargetWeight): Deleted.
252         * platform/text/TextFlags.h: Moved to FontSelectionAlgorithm.
253         (WebCore::FontSelectionValue::FontSelectionValue): Deleted.
254         (WebCore::FontSelectionValue::operator float): Deleted.
255         (WebCore::FontSelectionValue::operator+): Deleted.
256         (WebCore::FontSelectionValue::operator-): Deleted.
257         (WebCore::FontSelectionValue::operator*): Deleted.
258         (WebCore::FontSelectionValue::operator/): Deleted.
259         (WebCore::FontSelectionValue::operator==): Deleted.
260         (WebCore::FontSelectionValue::operator!=): Deleted.
261         (WebCore::FontSelectionValue::operator<): Deleted.
262         (WebCore::FontSelectionValue::operator<=): Deleted.
263         (WebCore::FontSelectionValue::operator>): Deleted.
264         (WebCore::FontSelectionValue::operator>=): Deleted.
265         (WebCore::FontSelectionValue::rawValue): Deleted.
266         (WebCore::FontSelectionValue::maximumValue): Deleted.
267         (WebCore::FontSelectionValue::minimumValue): Deleted.
268         (WebCore::FontSelectionRange::isValid): Deleted.
269         (WebCore::FontSelectionRange::expand): Deleted.
270         (WebCore::FontSelectionRange::includes): Deleted.
271         (WebCore::FontSelectionCapabilities::expand): Deleted.
272
273 2017-03-05  Simon Fraser  <simon.fraser@apple.com>
274
275         Make some RenderLayer tree traversal in RenderLayerBacking more generic
276         https://bugs.webkit.org/show_bug.cgi?id=169177
277
278         Reviewed by Zalan Bujtas.
279
280         The real goal of this patch is reduce the number of callers of
281         RenderLayerBacking::isPaintDestinationForDescendantLayers() to one. To achieve that,
282         have the setContentsVisible() logic (which is really just about the CSS 'visibility' property)
283         do its own tree traversal which just consults layer.hasVisibleContent(). So
284         make descendantLayerPaintsIntoAncestor() a generic traversal function which walks
285         descendant layers which may paint into the target layer. The "Visible" in the name
286         reflects the fact that it can bypass a subtree for a layer with !hasVisibleDescendant().
287
288         * rendering/RenderLayerBacking.cpp:
289         (WebCore::RenderLayerBacking::updateAfterDescendants):
290         (WebCore::traverseVisibleNonCompositedDescendantLayers):
291         (WebCore::RenderLayerBacking::isPaintDestinationForDescendantLayers):
292         (WebCore::RenderLayerBacking::hasVisibleNonCompositedDescendants):
293         (WebCore::descendantLayerPaintsIntoAncestor): Deleted.
294         * rendering/RenderLayerBacking.h:
295
296 2017-03-04  Simon Fraser  <simon.fraser@apple.com>
297
298         Clarify some terminology in RenderLayerBacking
299         https://bugs.webkit.org/show_bug.cgi?id=169174
300
301         Reviewed by Zalan Bujtas.
302
303         Rename some functions related to directly-composited background images and
304         box decorations for clarify.
305
306         Only behavior change is for canDirectlyCompositeBackgroundBackgroundImage() to check
307         GraphicsLayer::supportsContentsTiling(), which means that RenderLayerBacking::contentChanged()
308         will no longer trigger a updateGeometry() when it gets BackgroundImageChanged on non-
309         CoordinateGraphics platforms.
310
311         * rendering/RenderLayerBacking.cpp:
312         (WebCore::RenderLayerBacking::updateConfiguration):
313         (WebCore::RenderLayerBacking::updateAfterDescendants):
314         (WebCore::RenderLayerBacking::updateDirectlyCompositedBoxDecorations):
315         (WebCore::canDirectlyCompositeBackgroundBackgroundImage):
316         (WebCore::hasPaintedBoxDecorationsOrBackgroundImage):
317         (WebCore::supportsDirectlyCompositedBoxDecorations):
318         (WebCore::RenderLayerBacking::paintsBoxDecorations):
319         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
320         (WebCore::RenderLayerBacking::contentChanged):
321         (WebCore::RenderLayerBacking::updateDirectlyCompositedContents): Deleted.
322         (WebCore::canCreateTiledImage): Deleted.
323         (WebCore::hasVisibleBoxDecorationsOrBackgroundImage): Deleted.
324         (WebCore::supportsDirectBoxDecorationsComposition): Deleted.
325         * rendering/RenderLayerBacking.h:
326
327 2017-03-04  Alex Christensen  <achristensen@webkit.org>
328
329         Cleanup after r213418
330         https://bugs.webkit.org/show_bug.cgi?id=169165
331
332         Reviewed by Youenn Fablet.
333
334         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
335         (WebCore::RealtimeIncomingAudioSource::OnData):
336         Restore the assertion I removed.
337
338 2017-03-04  Commit Queue  <commit-queue@webkit.org>
339
340         Unreviewed, rolling out r213379.
341         https://bugs.webkit.org/show_bug.cgi?id=169169
342
343         broke GTK+ and Windows builds (Requested by mcatanzaro on
344         #webkit).
345
346         Reverted changeset:
347
348         "Enable fieldsets to be flexboxes, grids and multicolumn."
349         https://bugs.webkit.org/show_bug.cgi?id=169082
350         http://trac.webkit.org/changeset/213379
351
352 2017-03-03  Youenn Fablet  <youenn@apple.com>
353
354         [WebRTC] Update libwebrtc source code
355         https://bugs.webkit.org/show_bug.cgi?id=168599
356
357         Reviewed by Alex Christensen.
358
359         * Modules/mediastream/RTCStatsReport.h:
360         * Modules/mediastream/RTCStatsReport.idl:
361         Update to match the latest spec, which matches the new structures in libwebrtc.
362         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
363         (WebCore::fillRTCRTPStreamStats):
364         (WebCore::fillOutboundRTPStreamStats):
365         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
366         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
367         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
368         (WebCore::RealtimeIncomingAudioSource::OnData):
369         Comment out an assertion that was failing.  We should revisit this.
370         * testing/MockLibWebRTCPeerConnection.h:
371
372 2017-03-03  Commit Queue  <commit-queue@webkit.org>
373
374         Unreviewed, rolling out r213400.
375         https://bugs.webkit.org/show_bug.cgi?id=169163
376
377         Caused frequent assertion failures (Requested by ap on
378         #webkit).
379
380         Reverted changeset:
381
382         "[Modern Media Controls] Improve media documents across macOS,
383         iPhone and iPad"
384         https://bugs.webkit.org/show_bug.cgi?id=169145
385         http://trac.webkit.org/changeset/213400
386
387 2017-03-03  Andy Estes  <aestes@apple.com>
388
389         Add support for canvas.toBlob
390         https://bugs.webkit.org/show_bug.cgi?id=148878
391
392         Reviewed by Tim Horton.
393
394         Address additional review feedback received after r213412 landed.
395
396         * html/HTMLCanvasElement.cpp:
397         (WebCore::HTMLCanvasElement::toBlob): Passed null to the blob callback if blob conversion
398         fails for any reason.
399         * platform/graphics/cg/ImageBufferCG.cpp:
400         (WebCore::cgImage): Removed an unnecessary local variable.
401
402 2017-03-03  Andy Estes  <aestes@apple.com>
403
404         Add support for canvas.toBlob
405         https://bugs.webkit.org/show_bug.cgi?id=148878
406         <rdar://problem/22590406>
407
408         Reviewed by Tim Horton.
409
410         These tests now pass:
411         imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.jpeg.html
412         imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.png.html
413
414         * CMakeLists.txt:
415         * DerivedSources.make:
416         * WebCore.xcodeproj/project.pbxproj:
417         * fileapi/BlobCallback.cpp: Added.
418         (WebCore::BlobCallback::scheduleCallback):
419         * fileapi/BlobCallback.h: Added.
420         (WebCore::BlobCallback::~BlobCallback):
421         * fileapi/BlobCallback.idl: Added.
422         * html/HTMLCanvasElement.cpp:
423         (WebCore::HTMLCanvasElement::toBlob):
424         * html/HTMLCanvasElement.h:
425         * html/HTMLCanvasElement.idl:
426         * platform/graphics/ImageBuffer.h:
427         * platform/graphics/cairo/ImageBufferCairo.cpp:
428         (WebCore::writeFunction):
429         (WebCore::encodeImage):
430         (WebCore::ImageBuffer::toDataURL):
431         (WebCore::ImageBuffer::toData):
432         * platform/graphics/cg/ImageBufferCG.cpp:
433         (WebCore::data):
434         (WebCore::ImageBuffer::toDataURL):
435         (WebCore::ImageBuffer::toData):
436         (WebCore::ImageBuffer::toCGImage):
437         (WebCore::cgImage):
438         (WebCore::dataURL):
439         * platform/graphics/gtk/ImageBufferGtk.cpp:
440         (WebCore::ImageBuffer::toDataURL):
441         (WebCore::ImageBuffer::toData):
442         * platform/graphics/win/ImageBufferDirect2D.cpp:
443         (WebCore::ImageBuffer::toData):
444
445 2017-03-03  Dean Jackson  <dino@apple.com>
446
447         Add WebGPU compile flag and experimental feature flag
448         https://bugs.webkit.org/show_bug.cgi?id=169161
449         <rdar://problem/30846689>
450
451         Reviewed by Tim Horton.
452
453         Add ENABLE_WEBGPU, an experimental feature flag, a RuntimeEnabledFeature,
454         and an InternalSetting.
455
456         * Configurations/FeatureDefines.xcconfig:
457         * page/RuntimeEnabledFeatures.h:
458         (WebCore::RuntimeEnabledFeatures::setWebGPUEnabled):
459         (WebCore::RuntimeEnabledFeatures::webGPUEnabled):
460         * testing/InternalSettings.cpp:
461         (WebCore::InternalSettings::Backup::Backup):
462         (WebCore::InternalSettings::Backup::restoreTo):
463         (WebCore::InternalSettings::setWebGPUEnabled):
464         * testing/InternalSettings.h:
465         * testing/InternalSettings.idl:
466
467 2017-03-03  Simon Fraser  <simon.fraser@apple.com>
468
469         Clean up some RenderLayerBacking code
470         https://bugs.webkit.org/show_bug.cgi?id=169160
471
472         Reviewed by Dean Jackson.
473
474         Modern loops in descendantLayerPaintsIntoAncestor().
475
476         Rename RenderLayerBacking::paintsChildren() to RenderLayerBacking::paintsChildRenderers() to clarify that
477         it refers to renderers, not RenderLayers.
478
479         Rename RenderLayerBacking::paintsNonDirectCompositedBoxDecoration() to RenderLayerBacking::paintsBoxDecorations().
480         "Paints" already implies non-composited.
481
482         No behavior change.
483
484         * rendering/RenderLayerBacking.cpp:
485         (WebCore::RenderLayerBacking::updateDrawsContent):
486         (WebCore::RenderLayerBacking::paintsBoxDecorations):
487         (WebCore::RenderLayerBacking::paintsChildRenderers):
488         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
489         (WebCore::descendantLayerPaintsIntoAncestor):
490         (WebCore::RenderLayerBacking::paintsNonDirectCompositedBoxDecoration): Deleted.
491         (WebCore::RenderLayerBacking::paintsChildren): Deleted.
492         * rendering/RenderLayerBacking.h:
493
494 2017-03-03  Simon Fraser  <simon.fraser@apple.com>
495
496         Clean up RenderImage and a RenderImageResource function
497         https://bugs.webkit.org/show_bug.cgi?id=169153
498
499         Reviewed by Zalan Bujtas.
500         
501         Change all calls to imageResource().cachedImage() in RenderImage to use the inline
502         cachedImage() function.
503
504         In RenderImage::paintReplaced(), early return after the broken image block (and no need
505         to test imageResource().hasImage() again in the second condition). Convert height/width to size,
506         which also forces us to be explicit about using flooredIntSize() when fetching the image
507         (perhaps this should be a roundedIntSize, but I didn't want to change behavior).
508
509         Change RenderImageResource::image() to take an IntSize, rather than int height and width.
510
511         No behavior change.
512
513         * rendering/RenderImage.cpp:
514         (WebCore::RenderImage::styleDidChange):
515         (WebCore::RenderImage::imageChanged):
516         (WebCore::RenderImage::notifyFinished):
517         (WebCore::RenderImage::paintReplaced):
518         (WebCore::RenderImage::paintIntoRect):
519         (WebCore::RenderImage::foregroundIsKnownToBeOpaqueInRect):
520         (WebCore::RenderImage::embeddedContentBox):
521         * rendering/RenderImageResource.cpp:
522         (WebCore::RenderImageResource::image):
523         * rendering/RenderImageResource.h:
524         (WebCore::RenderImageResource::image):
525         * rendering/RenderImageResourceStyleImage.cpp:
526         (WebCore::RenderImageResourceStyleImage::image):
527         * rendering/RenderImageResourceStyleImage.h:
528
529 2017-03-03  Antoine Quint  <graouts@apple.com>
530
531         [Modern Media Controls] Improve media documents across macOS, iPhone and iPad
532         https://bugs.webkit.org/show_bug.cgi?id=169145
533         <rdar://problem/17048858>
534
535         Reviewed by Dean Jackson.
536
537         There were a variety of issues with media documents, some longstanding, and some specifically
538         about modern media controls.
539
540         One issue was that fullscreen and picture-in-picture buttons would show for audio media documents,
541         due to using a <video> element to load the audio file. We now have additional logic in MediaController
542         to identify if the loaded media is really an audio file, and using this information to hide the
543         fullscreen and picture-in-picture buttons.
544
545         Another issue was that we would inject style in MediaDocument.cpp that was specific to modern media
546         controls when we could have the modern-media-controls module injected CSS handle this styling. We now
547         use the injected style in the shadow root to size media documents based on the device characteristics
548         and ensuring that page styles are overridden.
549
550         We also simplify how MediaDocument.cpp sets the source of the media element to simply use the "src"
551         attribute and not a <source> element.
552
553         Finally, we introduce a MediaDocumentController class that is instantiated when we're dealing with
554         a media document to hide the controls while we determine the type of media we're loading (audio vs.
555         video) in order to apply the appropriate styling without flashes.
556
557         As a result of the new styles applied by the modern-media-controls module, media documents have a
558         similar behavior on macOS and iPad, where we only enforce a min-width for video allowing them
559         to play at their natural size otherwise, and enforcing a fixed width for audio. On iPhone however,
560         we want to always play the media at full width, with some padding in the case of audio.
561
562         Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html
563                media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing.html
564                media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing.html
565                media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html
566                media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html
567                media/modern-media-controls/media-documents/media-document-video-ios-sizing.html
568                media/modern-media-controls/media-documents/media-document-video-mac-sizing.html
569                media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html
570
571         * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
572         (:host(audio) .media-controls.ios.inline > .controls-bar:before,):
573         (:host(audio) .media-controls.ios.inline > .controls-bar:before): Deleted.
574         * Modules/modern-media-controls/controls/macos-media-controls.css:
575         (:host(audio) .media-controls.mac.inline > .controls-bar,):
576         (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint,):
577         (:host(audio) .media-controls.mac.inline > .controls-bar): Deleted.
578         (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint): Deleted.
579         * Modules/modern-media-controls/controls/media-document.css: Added.
580         (:host(.media-document)):
581         (:host(.media-document.ready)):
582         (:host(.media-document.audio.mac)):
583         (:host(.media-document.audio.ipad)):
584         (:host(.media-document.audio.iphone)):
585         (:host(.media-document.video.mac)):
586         (:host(.media-document.video.ipad)):
587         (:host(.media-document.video.iphone)):
588         * Modules/modern-media-controls/js-files:
589         * Modules/modern-media-controls/media/fullscreen-support.js:
590         (FullscreenSupport.prototype.syncControl):
591         (FullscreenSupport):
592         * Modules/modern-media-controls/media/media-controller.js:
593         (MediaController):
594         (MediaController.prototype.get isAudio):
595         * Modules/modern-media-controls/media/media-document-controller.js: Added.
596         (MediaDocumentController):
597         (MediaDocumentController.prototype.handleEvent):
598         (MediaDocumentController.prototype._mediaDocumentHasMetadata):
599         (MediaDocumentController.prototype._mediaDocumentHasSize):
600         * Modules/modern-media-controls/media/pip-support.js:
601         (PiPSupport.prototype.syncControl):
602         (PiPSupport):
603         * html/MediaDocument.cpp:
604         (WebCore::MediaDocumentParser::createDocumentStructure):
605
606 2017-03-03  Chris Dumez  <cdumez@apple.com>
607
608         [iOS] Throttle SVG SMIL animations to 30fps in low power mode
609         https://bugs.webkit.org/show_bug.cgi?id=169137
610         <rdar://problem/30833754>
611
612         Reviewed by Simon Fraser.
613
614         Throttle SVG SMIL animations to 30fps in low power mode on iOS to save
615         battery.
616
617         Test: svg/animations/animations-lowPowerMode-throttling.html
618
619         * svg/SVGSVGElement.cpp:
620         (WebCore::SVGSVGElement::SVGSVGElement):
621         * svg/SVGSVGElement.idl:
622         * svg/animation/SMILTime.h:
623         (WebCore::SMILTime::SMILTime):
624         * svg/animation/SMILTimeContainer.cpp:
625         (WebCore::SMILTimeContainer::SMILTimeContainer):
626         (WebCore::SMILTimeContainer::animationFrameDelay):
627         (WebCore::SMILTimeContainer::updateDocumentOrderIndexes):
628         (WebCore::SMILTimeContainer::updateAnimations):
629         * svg/animation/SMILTimeContainer.h:
630         * svg/animation/SVGSMILElement.cpp:
631         (WebCore::SVGSMILElement::calculateNextProgressTime):
632         * testing/Internals.cpp:
633         (WebCore::Internals::svgAnimationsInterval):
634         * testing/Internals.h:
635         * testing/Internals.idl:
636
637 2017-03-03  Joseph Pecoraro  <pecoraro@apple.com>
638
639         [Mac] WebCore.framework is missing a symlink from Frameworks to Versions/Current/Frameworks when the latter exists
640         https://bugs.webkit.org/show_bug.cgi?id=169067
641
642         Reviewed by Dan Bernstein.
643
644         * WebCore.xcodeproj/project.pbxproj:
645
646 2017-03-03  Sam Weinig  <sam@webkit.org>
647
648         REGRESSION (r209760): Apple Pay doesn't work on casper.com, shopspring.com, maybe other sites
649         <rdar://problem/30313445>
650         https://bugs.webkit.org/show_bug.cgi?id=169149
651
652         Reviewed by Simon Fraser.
653
654         Relax restriction that the ApplePayShippingMethod sequence must not be empty. This
655         was incorrect.
656
657         * Modules/applepay/ApplePaySession.cpp:
658         (WebCore::convertAndValidate):
659
660 2017-03-03  Alex Christensen  <achristensen@webkit.org>
661
662         [URLParser] Fix file: as a relative file URL
663         https://bugs.webkit.org/show_bug.cgi?id=169122
664
665         Reviewed by Tim Horton.
666
667         This is clearly defined in https://url.spec.whatwg.org/#file-state with the EOF code point.
668         I got it wrong and didn't test it.  It's been added to the web platform tests since we last updated.
669
670         * platform/URLParser.cpp:
671         (WebCore::URLParser::parse):
672
673 2017-03-03  Dave Hyatt  <hyatt@apple.com>
674
675         Enable fieldsets to be flexboxes, grids and multicolumn.
676         https://bugs.webkit.org/show_bug.cgi?id=169082
677
678         Reviewed by Simon Fraser.
679
680         Added new tests in fast/forms/fieldset.
681
682         This patch eliminates RenderFieldset and moves the functionality into RenderBlock so that
683         derived classes can also be fieldsets.
684
685         * CMakeLists.txt:
686         * WebCore.xcodeproj/project.pbxproj:
687         Remove RenderFieldset from the project.
688
689         * accessibility/AccessibilityRenderObject.cpp:
690         (WebCore::AccessibilityRenderObject::titleUIElement):
691         Call in to RenderBlock now instead of RenderFieldset.
692
693         * html/HTMLFieldSetElement.cpp:
694         (WebCore::HTMLFieldSetElement::createElementRenderer):
695         * html/HTMLFieldSetElement.h:
696         The fieldset DOM element now uses RenderElement::createFor to make renderers so that multiple display types
697         can be supported. A special flag has been added that indicates only to make flexbox and block-related
698         renderers (not table display types).
699
700         * rendering/OrderIterator.cpp:
701         (WebCore::OrderIterator::shouldSkipChild):
702         (WebCore::OrderIteratorPopulator::collectChild):
703         * rendering/OrderIterator.h:
704         Streamline child collection for flexboxes and grids to indicate whether the child should be skipped as a return
705         value from collectChild. Add a shouldSkipChild method that skips both out of flow positioned objects and
706         excluded children like the legends of fieldsets.
707
708         * rendering/RenderBlock.cpp:
709         (WebCore::RenderBlockRareData::RenderBlockRareData):
710         When the legend is taller than the fieldset's borderBefore(), intrinsic border is added to the CSS border width.
711         This intrinsic border being factored in ensures that the padding and content boxes of fieldsets are correct
712         across any layout system, since the legend is now just treated as part of the border.
713
714         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
715         Call the new computePreferredWidthsForExcludedChildren to ensure that excluded children contribute to
716         preferred width in their own way and not as part of a specific layout system.
717
718         (WebCore::RenderBlock::renderName):
719         Hacked to still return RenderFieldSet for RenderBlockFlow-backed fieldsets for layout test compatibility.
720
721         (WebCore::RenderBlock::layoutExcludedChildren):
722         Renamed from layoutSpecialExcludedChild to more accurately reflect the fact that multiple excluded children
723         can be included here (e.g., both a multicolumn flow thread and a legend). The RenderBlock base class handles
724         the layout of legends by both placing them and setting the correct intrinsic border before amount on the
725         block.
726
727         (WebCore::RenderBlock::findFieldsetLegend):
728         Moved from RenderFieldset.
729
730         (WebCore::RenderBlock::adjustBorderBoxRectForPainting):
731         (WebCore::RenderBlock::paintRectToClipOutFromBorder):
732         These methods are used when painting to shrink the border box as needed to account for the legend and to
733         provide the portion of the border that needs to be clipped out. These methods have been enhanced to
734         properly support all writing modes.
735
736         (WebCore::RenderBlock::intrinsicBorderForFieldset):
737         (WebCore::RenderBlock::setIntrinsicBorderForFieldset):
738         (WebCore::RenderBlock::borderTop):
739         (WebCore::RenderBlock::borderLeft):
740         (WebCore::RenderBlock::borderBottom):
741         (WebCore::RenderBlock::borderRight):
742         (WebCore::RenderBlock::borderBefore):
743         These methods are overridden for border to ensure that the intrinsic border added by a tall legend is
744         properly factored in.
745
746         (WebCore::RenderBlock::computePreferredWidthsForExcludedChildren):
747         * rendering/RenderBlock.h:
748         This method computes the preferred widths for legend children in order to ensure that the legend properly
749         grows the width of the fieldset when it is the widest item.
750
751         (WebCore::RenderBlock::adjustBorderBoxLogicalHeightForBoxSizing):
752         (WebCore::RenderBlock::adjustContentBoxLogicalHeightForBoxSizing):
753         Preserve the behavior of fieldsets in that the available content size includes the space lost accounting
754         for the legend. I don't think this makes much sense, but it matches the behavior of other browsers
755         (and our old behavior).
756
757         (WebCore::RenderBlock::paintExcludedChildrenInBorder):
758         Method for painting the excluded children that might be present in our border. We only do this if the
759         paint phase is a box decoration painting phase and if the legend isn't self-painting.
760
761         * rendering/RenderBlockFlow.cpp:
762         (WebCore::RenderBlockFlow::willCreateColumns):
763         Allow fieldsets to create columns now.
764
765         (WebCore::RenderBlockFlow::layoutBlockChildren):
766         (WebCore::RenderBlockFlow::layoutExcludedChildren):
767         Renamed this method and change it to call the base class to ensure that legends in multicolumn fieldsets
768         get handled properly.
769
770         (WebCore::RenderBlockFlow::addChild):
771         Patched to make sure legends don't get put into the multicolumn flow thread, as they need to
772         remain outside of it.
773
774         (WebCore::RenderBlockFlow::layoutSpecialExcludedChild): Deleted.
775         Renamed to layoutExcludedChildren.
776
777         * rendering/RenderBlockFlow.h:
778         * rendering/RenderBox.cpp:
779         (WebCore::RenderBox::paintBoxDecorations):
780         (WebCore::RenderBox::paintMask):
781         Patched to call the new adjustBorderBoxRectForPainting and paintRectToClipOutFromBorder methods in
782         order to properly shrink the border box rect for painting and to clip out the portion of the border
783         covered by the legend.
784
785         (WebCore::RenderBox::avoidsFloats):
786         Add fieldsets as avoiding floats. RenderFieldset used to subclass this method to return true, but with
787         its removal, we need to put this in the base class along with legends.
788
789         * rendering/RenderBox.h:
790         (WebCore::RenderBox::isGridItem):
791         (WebCore::RenderBox::isFlexItem):
792         Patched to exclude legends so that they don't try to size like they are really in the grid or flexbox.
793
794         (WebCore::RenderBox::adjustBorderBoxRectForPainting):
795         This method is overridden by RenderBLock to handle adjusting fieldset border rects for painting.
796
797         * rendering/RenderBoxModelObject.cpp:
798         (WebCore::RenderBoxModelObject::paintBorder):
799         * rendering/RenderBoxModelObject.h:
800         (WebCore::RenderBoxModelObject::paintRectToClipOutFromBorder):
801         Patched to properly paint fieldsets using the new helpers.
802
803         * rendering/RenderDeprecatedFlexibleBox.cpp:
804         (WebCore::FlexBoxIterator::next):
805         (WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
806         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
807         Make sure deprecated flexible boxes lay out their legends properly by calling layoutExcludedChildren.
808
809         * rendering/RenderElement.cpp:
810         (WebCore::RenderElement::createFor):
811         * rendering/RenderElement.h:
812         Patched to take a flag that limits what renderers can be created so that fieldsets don't make table
813         display types.
814
815         * rendering/RenderFieldset.cpp: Removed.
816         * rendering/RenderFieldset.h: Removed.
817         Remove RenderFieldset files from the tree.
818
819         * rendering/RenderFlexibleBox.cpp:
820         (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
821         (WebCore::RenderFlexibleBox::firstLineBaseline):
822         (WebCore::RenderFlexibleBox::layoutBlock):
823         (WebCore::RenderFlexibleBox::layoutFlexItems):
824         (WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins):
825         Make sure flexible boxes lay out their legends properly by calling layoutExcludedChildren.
826         Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't
827         part of the flexible box layout.
828
829         * rendering/RenderGrid.cpp:
830         (WebCore::RenderGrid::layoutBlock):
831         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
832         (WebCore::RenderGrid::placeItemsOnGrid):
833         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
834         (WebCore::RenderGrid::layoutGridItems):
835         Make sure grids lay out their legends properly by calling layoutExcludedChildren.
836         Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't
837         part of the grid's layout.
838
839         * rendering/RenderMultiColumnFlowThread.cpp:
840         (WebCore::RenderMultiColumnFlowThread::populate):
841         Pull legends back up into the block and don't let them be part of the flow thread.
842
843         * rendering/RenderMultiColumnSet.cpp:
844         (WebCore::RenderMultiColumnSet::requiresBalancing):
845         Fix an assert to allow legends to exist as siblings of multicolumn sets.
846
847         * rendering/RenderObject.cpp:
848         (WebCore::RenderObject::isFieldset):
849         Changed to examine the HTML element rather than RenderFieldset.
850
851         * rendering/RenderObject.h:
852         (WebCore::RenderObject::isExcludedFromNormalLayout):
853         (WebCore::RenderObject::setIsExcludedFromNormalLayout):
854         (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
855         RenderObjects now have a new bit that is set for excluded objects like legends, flow threads,
856         placeholders, and ruby text. This bit lets code easily detect that an object is excluded from
857         the layout system and can be skipped.
858
859         (WebCore::RenderObject::isExcludedAndPlacedInBorder):
860         Helper method for asking if an object is painting inside the border. Used to know we
861         need to factor it into preferred width calculations outside of any one layout system
862         and also to know that we need to paint it when we paint the fieldset's border instead of
863         later (after we might have scrolled or clipped the child painting area).
864
865         * rendering/RenderRubyRun.cpp:
866         (WebCore::RenderRubyRun::layoutExcludedChildren):
867         (WebCore::RenderRubyRun::layoutSpecialExcludedChild): Deleted.
868         * rendering/RenderRubyRun.h:
869         Rename layoutSpecialExcludedChild to layoutExcludedChildren.
870
871         * rendering/RenderTable.cpp:
872         (WebCore::RenderTable::adjustBorderBoxRectForPainting):
873         (WebCore::RenderTable::paintBoxDecorations):
874         (WebCore::RenderTable::paintMask):
875         (WebCore::RenderTable::subtractCaptionRect): Deleted.
876         * rendering/RenderTable.h:
877         Patched tables to share the same border box rect adjustment used by fieldsets when subtracting
878         out captions. This is prep work to allow tables to be fieldsets, but for now I didn't go all the
879         way.
880
881         * rendering/RenderTableCell.cpp:
882         (WebCore::RenderTableCell::paintBoxDecorations):
883         (WebCore::RenderTableCell::paintMask):
884         Make sure table cells adjust their border box rects for painting. Again this is prep work for
885         cells potentially being fieldsets, but not supported yet.
886
887         * rendering/RenderTextControl.cpp:
888         (WebCore::RenderTextControl::layoutExcludedChildren):
889         (WebCore::RenderTextControl::layoutSpecialExcludedChild): Deleted.
890         * rendering/RenderTextControl.h:
891         * rendering/RenderTextControlMultiLine.cpp:
892         (WebCore::RenderTextControlMultiLine::layoutExcludedChildren):
893         (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild): Deleted.
894         * rendering/RenderTextControlMultiLine.h:
895         Renamed the methods for doing the excluded child layout.
896
897         * rendering/RenderTreeAsText.cpp:
898         (WebCore::RenderTreeAsText::writeRenderObject):
899         Make sure to dump the original fieldset border and not the border with the extra legend stuff in it.
900
901 2017-03-03  Ryan Haddad  <ryanhaddad@apple.com>
902
903         Unreviewed, rolling out r213344.
904
905         This changed caused LayoutTest crashes under GuardMalloc.
906
907         Reverted changeset:
908
909         "Add support for canvas.toBlob"
910         https://bugs.webkit.org/show_bug.cgi?id=148878
911         http://trac.webkit.org/changeset/213344
912
913 2017-03-03  Konstantin Tokarev  <annulen@yandex.ru>
914
915         Unreviewed typo fix
916
917         * features.json:
918
919 2017-03-03  Eric Carlson  <eric.carlson@apple.com>
920
921         [MediaStream] Remove #if USE(VIDEOTOOLBOX) from AVVideoCaptureSource
922         https://bugs.webkit.org/show_bug.cgi?id=169131
923
924         Reviewed by Youenn Fablet.
925
926         * platform/mediastream/mac/AVVideoCaptureSource.mm:
927         (WebCore::AVVideoCaptureSource::currentFrameCGImage):
928
929 2017-03-03  Chris Dumez  <cdumez@apple.com>
930
931         Add assertion in Frame::setView() to make sure associated document has no living render tree
932         https://bugs.webkit.org/show_bug.cgi?id=169134
933
934         Reviewed by Brent Fulgham.
935
936         Add assertion in Frame::setView() to make sure associated document has no living render tree.
937         This is not supposed to happen and r213311 fixed one case where this could happen. We need
938         to find out if it can still happen.
939
940         * page/Frame.cpp:
941         (WebCore::Frame::setView):
942
943 2017-03-02  Sam Weinig  <sam@webkit.org>
944
945         Rename htmlediting.h/cpp to Editing.h/cpp
946         https://bugs.webkit.org/show_bug.cgi?id=169103
947
948         Reviewed by Alex Christensen.
949
950         * CMakeLists.txt:
951         * WebCore.xcodeproj/project.pbxproj:
952         * accessibility/AXObjectCache.cpp:
953         * accessibility/AccessibilityNodeObject.cpp:
954         * accessibility/AccessibilityObject.cpp:
955         * accessibility/AccessibilityRenderObject.cpp:
956         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
957         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
958         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
959         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
960         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
961         * dom/Document.cpp:
962         * dom/Element.cpp:
963         * dom/Node.h:
964         * dom/Position.cpp:
965         * dom/PositionIterator.cpp:
966         * dom/Range.cpp:
967         * editing/AlternativeTextController.cpp:
968         * editing/AppendNodeCommand.cpp:
969         * editing/ApplyBlockElementCommand.cpp:
970         * editing/ApplyStyleCommand.cpp:
971         * editing/BreakBlockquoteCommand.cpp:
972         * editing/CompositeEditCommand.cpp:
973         * editing/CreateLinkCommand.cpp:
974         (WebCore::CreateLinkCommand::CreateLinkCommand):
975         * editing/DeleteFromTextNodeCommand.cpp:
976         * editing/DeleteSelectionCommand.cpp:
977         * editing/EditCommand.cpp:
978         * editing/Editing.cpp: Copied from Source/WebCore/editing/htmlediting.cpp.
979         * editing/Editing.h: Copied from Source/WebCore/editing/htmlediting.h.
980         * editing/EditingAllInOne.cpp:
981         * editing/EditingStyle.cpp:
982         * editing/Editor.cpp:
983         * editing/EditorCommand.cpp:
984         * editing/FormatBlockCommand.cpp:
985         * editing/FrameSelection.cpp:
986         * editing/HTMLInterchange.cpp:
987         * editing/IndentOutdentCommand.cpp:
988         * editing/InsertLineBreakCommand.cpp:
989         * editing/InsertListCommand.cpp:
990         * editing/InsertNodeBeforeCommand.cpp:
991         * editing/InsertParagraphSeparatorCommand.cpp:
992         * editing/InsertTextCommand.cpp:
993         * editing/ModifySelectionListLevel.cpp:
994         * editing/RemoveNodeCommand.cpp:
995         * editing/ReplaceNodeWithSpanCommand.cpp:
996         * editing/ReplaceSelectionCommand.cpp:
997         * editing/SpellChecker.cpp:
998         * editing/TextIterator.cpp:
999         * editing/TypingCommand.cpp:
1000         * editing/VisiblePosition.cpp:
1001         * editing/VisibleSelection.cpp:
1002         * editing/VisibleUnits.cpp:
1003         * editing/cocoa/DataDetection.mm:
1004         * editing/cocoa/EditorCocoa.mm:
1005         * editing/htmlediting.cpp: Removed.
1006         * editing/htmlediting.h: Removed.
1007         * editing/ios/EditorIOS.mm:
1008         * editing/mac/DictionaryLookup.mm:
1009         * editing/mac/EditorMac.mm:
1010         * editing/markup.cpp:
1011         * html/HTMLTextFormControlElement.cpp:
1012         * inspector/InspectorDOMAgent.cpp:
1013         * page/DOMSelection.cpp:
1014         * page/DragController.cpp:
1015         * page/EventHandler.cpp:
1016         * page/FocusController.cpp:
1017         * page/Frame.cpp:
1018         * platform/ios/PasteboardIOS.mm:
1019         * platform/mac/PasteboardMac.mm:
1020         * rendering/RenderBox.cpp:
1021         * rendering/RenderObject.cpp:
1022
1023 2017-03-02  Matt Baker  <mattbaker@apple.com>
1024
1025         Web Inspector: Should be able to push nodes in an iframe subtree to the frontend
1026         https://bugs.webkit.org/show_bug.cgi?id=169086
1027
1028         Reviewed by Joseph Pecoraro.
1029
1030         Test: inspector/dom/push-node-by-path-to-frontend.html
1031
1032         * inspector/InspectorDOMAgent.cpp:
1033         (WebCore::InspectorDOMAgent::nodeForPath):
1034         During top-down document traversal, descend into content document nodes
1035         when visiting an HTMLFrameOwnerElement.
1036
1037 2017-03-02  Ryan Haddad  <ryanhaddad@apple.com>
1038
1039         Unreviewed, rolling out r213274.
1040
1041         This change caused flakiness with LayoutTest memory/memory-
1042         pressure-simulation.html
1043
1044         Reverted changeset:
1045
1046         "Don't keep dead resources in MemoryCache while under memory
1047         pressure."
1048         https://bugs.webkit.org/show_bug.cgi?id=169070
1049         http://trac.webkit.org/changeset/213274
1050
1051 2017-03-02  Jiewen Tan  <jiewen_tan@apple.com>
1052
1053         WebCrypto API support for AES-GCM
1054         https://bugs.webkit.org/show_bug.cgi?id=157175
1055         <rdar://problem/27311691>
1056
1057         Reviewed by Brent Fulgham.
1058
1059         This patch adds support for AES-GCM. Operations of AES-GCM include: encrypt, decrypt, generateKey,
1060         importKey, exportKey, wrapKey, and unwrapKey. https://www.w3.org/TR/WebCryptoAPI/#aes-gcm
1061
1062         Tests: crypto/subtle/aes-gcm-decrypt-malformed-parameters.html
1063                crypto/subtle/aes-gcm-encrypt-malformed-parameters.html
1064                crypto/subtle/aes-gcm-generate-export-key-jwk-length-128.html
1065                crypto/subtle/aes-gcm-generate-export-key-jwk-length-192.html
1066                crypto/subtle/aes-gcm-generate-export-key-jwk-length-256.html
1067                crypto/subtle/aes-gcm-generate-export-raw-key.html
1068                crypto/subtle/aes-gcm-generate-key-encrypt-decrypt.html
1069                crypto/subtle/aes-gcm-generate-key.html
1070                crypto/subtle/aes-gcm-import-jwk-key-length-128.html
1071                crypto/subtle/aes-gcm-import-jwk-key-length-192.html
1072                crypto/subtle/aes-gcm-import-jwk-key-length-256.html
1073                crypto/subtle/aes-gcm-import-key-decrypt-additional-data-tag-length-32.html
1074                crypto/subtle/aes-gcm-import-key-decrypt-additional-data.html
1075                crypto/subtle/aes-gcm-import-key-decrypt-tagLengths.html
1076                crypto/subtle/aes-gcm-import-key-decrypt.html
1077                crypto/subtle/aes-gcm-import-key-encrypt-additional-data-tag-length-32.html
1078                crypto/subtle/aes-gcm-import-key-encrypt-additional-data.html
1079                crypto/subtle/aes-gcm-import-key-encrypt-tagLengths.html
1080                crypto/subtle/aes-gcm-import-key-encrypt.html
1081                crypto/subtle/aes-gcm-import-key-unwrap-jwk-key.html
1082                crypto/subtle/aes-gcm-import-key-unwrap-raw-key.html
1083                crypto/subtle/aes-gcm-import-key-wrap-jwk-key.html
1084                crypto/subtle/aes-gcm-import-key-wrap-raw-key.html
1085                crypto/subtle/aes-gcm-import-raw-key.html
1086                crypto/workers/subtle/aes-gcm-import-key-decrypt.html
1087                crypto/workers/subtle/aes-gcm-import-key-encrypt.html
1088                crypto/workers/subtle/aes-gcm-import-key-unwrap-key.html
1089                crypto/workers/subtle/aes-gcm-import-key-wrap-key.html
1090
1091         * CMakeLists.txt:
1092         * DerivedSources.make:
1093         * PlatformGTK.cmake:
1094         * PlatformMac.cmake:
1095         Add CryptoAlgorithmAES_CFBMac.cpp as well.
1096         * WebCore.xcodeproj/project.pbxproj:
1097         * bindings/js/JSSubtleCryptoCustom.cpp:
1098         (WebCore::normalizeCryptoAlgorithmParameters):
1099         Add support for AES-GCM.
1100         * crypto/CommonCryptoUtilities.h:
1101         Include SPI header for AES-GCM support. We have a mismatch SPI between different OS version.
1102         Therefore, a guardian is placed.
1103         * crypto/CryptoAlgorithmParameters.h:
1104         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp: Added.
1105         (WebCore::usagesAreInvalidForCryptoAlgorithmAES_GCM):
1106         (WebCore::tagLengthIsValid):
1107         (WebCore::CryptoAlgorithmAES_GCM::create):
1108         (WebCore::CryptoAlgorithmAES_GCM::identifier):
1109         (WebCore::CryptoAlgorithmAES_GCM::encrypt):
1110         (WebCore::CryptoAlgorithmAES_GCM::decrypt):
1111         (WebCore::CryptoAlgorithmAES_GCM::generateKey):
1112         (WebCore::CryptoAlgorithmAES_GCM::importKey):
1113         (WebCore::CryptoAlgorithmAES_GCM::exportKey):
1114         * crypto/algorithms/CryptoAlgorithmAES_GCM.h: Added.
1115         * crypto/gnutls/CryptoAlgorithmAES_GCMGnuTLS.cpp: Added.
1116         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1117         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1118         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp: Added.
1119         (WebCore::encryptAES_GCM):
1120         (WebCore::decyptAES_GCM):
1121         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1122         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1123         * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
1124         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
1125         * crypto/parameters/AesGcmParams.idl: Added.
1126         * crypto/parameters/CryptoAlgorithmAesGcmParams.h: Added.
1127
1128 2017-03-02  Andy Estes  <aestes@apple.com>
1129
1130         Add support for canvas.toBlob
1131         https://bugs.webkit.org/show_bug.cgi?id=148878
1132         <rdar://problem/22590406>
1133
1134         Reviewed by Tim Horton.
1135
1136         These tests now pass:
1137         imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.jpeg.html
1138         imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.png.html
1139
1140         * CMakeLists.txt:
1141         * DerivedSources.make:
1142         * WebCore.xcodeproj/project.pbxproj:
1143         * fileapi/BlobCallback.cpp: Added.
1144         (WebCore::BlobCallback::scheduleCallback):
1145         * fileapi/BlobCallback.h: Added.
1146         (WebCore::BlobCallback::~BlobCallback):
1147         * fileapi/BlobCallback.idl: Added.
1148         * html/HTMLCanvasElement.cpp:
1149         (WebCore::HTMLCanvasElement::toBlob):
1150         * html/HTMLCanvasElement.h:
1151         * html/HTMLCanvasElement.idl:
1152         * platform/graphics/ImageBuffer.h:
1153         * platform/graphics/cairo/ImageBufferCairo.cpp:
1154         (WebCore::writeFunction):
1155         (WebCore::encodeImage):
1156         (WebCore::ImageBuffer::toDataURL):
1157         (WebCore::ImageBuffer::toData):
1158         * platform/graphics/cg/ImageBufferCG.cpp:
1159         (WebCore::data):
1160         (WebCore::ImageBuffer::toDataURL):
1161         (WebCore::ImageBuffer::toData):
1162         (WebCore::ImageBuffer::toCGImage):
1163         (WebCore::cgImage):
1164         (WebCore::dataURL):
1165         * platform/graphics/gtk/ImageBufferGtk.cpp:
1166         (WebCore::ImageBuffer::toDataURL):
1167         (WebCore::ImageBuffer::toData):
1168         * platform/graphics/win/ImageBufferDirect2D.cpp:
1169         (WebCore::ImageBuffer::toData):
1170
1171 2017-03-02  Myles C. Maxfield  <mmaxfield@apple.com>
1172
1173         Migrate font-stretch to use fixed-point values
1174         https://bugs.webkit.org/show_bug.cgi?id=169107
1175
1176         Reviewed by Dean Jackson.
1177
1178         There are a few benefits of using fixed-point values:
1179         - Not all of the entropy of a float is necessary for font selection. In particular, values are
1180         expected to stay between around -1000 to 1000, and only need to have a few fractional bits.
1181         Therefore, the values can be represented by 16-bit fixed point numbers, which includes one sign
1182         bit and two fractional bits. This is smaller than the 32-bit floating point numbers we were
1183         using, which means FontDescription can be slimmed down. This becomes even more important when
1184         the rest of the variation font properties are implemented, since those will use these fixed-
1185         point values too.
1186         - Fixed point values have a larger distance between adjacent representable values, which means
1187         there are more collisions, which means our cache hit rates are higher.
1188
1189         No new tests because there is no behavior change.
1190
1191         * css/CSSComputedStyleDeclaration.cpp:
1192         (WebCore::fontStretchFromStyle):
1193         * css/StyleBuilderConverter.h:
1194         (WebCore::StyleBuilderConverter::convertFontStretch):
1195         * platform/graphics/FontCache.h:
1196         (WebCore::FontDescriptionKey::FontDescriptionKey):
1197         * platform/graphics/FontDescription.h:
1198         (WebCore::FontDescription::stretch):
1199         (WebCore::FontDescription::setStretch):
1200         (WebCore::FontCascadeDescription::initialStretch):
1201         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1202         (WebCore::defaultFontSelectionValues):
1203         (WebCore::preparePlatformFont):
1204         (WebCore::FontDatabase::InstalledFont::InstalledFont):
1205         (WebCore::FontDatabase::InstalledFontFamily::expand):
1206         (WebCore::FontDatabase::capabilitiesForFontDescriptor):
1207         (WebCore::FontDatabase::stretchThreshold):
1208         (WebCore::FontDatabase::italicThreshold):
1209         (WebCore::FontDatabase::weightThreshold):
1210         (WebCore::findClosestStretch):
1211         (WebCore::filterStretch):
1212         (WebCore::findClosestStyle):
1213         (WebCore::filterStyle):
1214         (WebCore::findClosestWeight):
1215         (WebCore::filterWeight):
1216         (WebCore::computeTargetWeight):
1217         (WebCore::findClosestFont):
1218         (WebCore::platformFontLookupWithFamily):
1219         (WebCore::fontWithFamily):
1220         (WebCore::defaultVariationValues): Deleted.
1221         (WebCore::FontDatabase::Range::Range): Deleted.
1222         (WebCore::FontDatabase::Range::isValid): Deleted.
1223         (WebCore::FontDatabase::Range::expand): Deleted.
1224         (WebCore::FontDatabase::Range::includes): Deleted.
1225         (): Deleted.
1226         * platform/text/TextFlags.h:
1227         (WebCore::FontSelectionValue::FontSelectionValue):
1228         (WebCore::FontSelectionValue::operator float):
1229         (WebCore::FontSelectionValue::operator+):
1230         (WebCore::FontSelectionValue::operator-):
1231         (WebCore::FontSelectionValue::operator*):
1232         (WebCore::FontSelectionValue::operator/):
1233         (WebCore::FontSelectionValue::operator==):
1234         (WebCore::FontSelectionValue::operator!=):
1235         (WebCore::FontSelectionValue::operator<):
1236         (WebCore::FontSelectionValue::operator<=):
1237         (WebCore::FontSelectionValue::operator>):
1238         (WebCore::FontSelectionValue::operator>=):
1239         (WebCore::FontSelectionValue::rawValue):
1240         (WebCore::FontSelectionRange::isValid):
1241         (WebCore::FontSelectionRange::expand):
1242         (WebCore::FontSelectionRange::includes):
1243         (WebCore::FontSelectionCapabilities::expand):
1244
1245 2017-03-02  Alex Christensen  <achristensen@webkit.org>
1246
1247         Modernize ContentExtensionParser
1248         https://bugs.webkit.org/show_bug.cgi?id=169106
1249
1250         Reviewed by Andy Estes.
1251
1252         We were returning std::error_code and passing the return value as a parameter reference.
1253         because we wrote this code before we had WTF::Expected.
1254
1255         No change in behavior, verified by many API tests.
1256
1257         * contentextensions/ContentExtensionCompiler.cpp:
1258         (WebCore::ContentExtensions::compileRuleList):
1259         * contentextensions/ContentExtensionParser.cpp:
1260         (WebCore::ContentExtensions::getDomainList):
1261         (WebCore::ContentExtensions::loadTrigger):
1262         (WebCore::ContentExtensions::loadAction):
1263         (WebCore::ContentExtensions::loadRule):
1264         (WebCore::ContentExtensions::loadEncodedRules):
1265         (WebCore::ContentExtensions::parseRuleList):
1266         * contentextensions/ContentExtensionParser.h:
1267         * contentextensions/ContentExtensionRule.cpp:
1268         (WebCore::ContentExtensions::ContentExtensionRule::ContentExtensionRule):
1269         * contentextensions/ContentExtensionRule.h:
1270
1271 2017-03-02  Ryan Haddad  <ryanhaddad@apple.com>
1272
1273         Unreviewed, rolling out r213301.
1274
1275         This change broke internal builds.
1276
1277         Reverted changeset:
1278
1279         "WebCrypto API support for AES-GCM"
1280         https://bugs.webkit.org/show_bug.cgi?id=157175
1281         http://trac.webkit.org/changeset/213301
1282
1283 2017-03-02  Aakash Jain  <aakash_jain@apple.com>
1284
1285         Move stringMatchesWildcardString from WebKit2 to WebCore
1286         https://bugs.webkit.org/show_bug.cgi?id=169065
1287
1288         Reviewed by Alexey Proskuryakov.
1289
1290         * WebCore.xcodeproj/project.pbxproj: Added StringUtilities.h and StringUtilities.mm
1291         * PlatformMac.cmake: Added StringUtilities.mm
1292         * platform/mac/StringUtilities.h: Added.
1293         * platform/mac/StringUtilities.mm: Added.
1294         (WebCore::wildcardRegexPatternString): Added.
1295         (WebCore::stringMatchesWildcardString): Added.
1296
1297 2017-02-28  Matt Rajca  <mrajca@apple.com>
1298
1299         Media: send "did interfere with playback" events when the user pauses an autoplaying element
1300         https://bugs.webkit.org/show_bug.cgi?id=169006
1301
1302         Reviewed by Alex Christensen.
1303
1304         Added API tests.
1305
1306         * html/HTMLMediaElement.cpp:
1307         (WebCore::HTMLMediaElement::pauseInternal):
1308
1309 2017-03-02  Chris Dumez  <cdumez@apple.com>
1310
1311         We should prevent load of subframes inserted during FrameTree deconstruction
1312         https://bugs.webkit.org/show_bug.cgi?id=169095
1313
1314         Reviewed by Brent Fulgham.
1315
1316         When deconstructing the FrameTree, we fire the unload event in each subframe.
1317         Such unload event handler may insert a new frame, we would previously load
1318         such new frame which was unsafe as we would end up with an attached subframe
1319         on a detached tree. To address the issue, we prevent new subframes from loading
1320         while deconstructing the FrameTree and firing the unload events. This new
1321         behavior is consistent with Chrome and should therefore be safe from a
1322         compatibility standpoint.
1323
1324         Test: fast/frames/insert-frame-unload-handler.html
1325
1326         * dom/ContainerNodeAlgorithms.cpp:
1327         (WebCore::disconnectSubframes):
1328         Update SubframeLoadingDisabler call site now that the constructor takes in
1329         a pointer instead of a reference.
1330
1331         * html/HTMLFrameOwnerElement.h:
1332         (WebCore::SubframeLoadingDisabler::SubframeLoadingDisabler):
1333         (WebCore::SubframeLoadingDisabler::~SubframeLoadingDisabler):
1334         Update SubframeLoadingDisabler constructor to take in a pointer instead
1335         of a reference, for convenience.
1336
1337         * loader/FrameLoader.cpp:
1338         (WebCore::FrameLoader::detachChildren):
1339         Prevent loads in subframes while detaching the subframes. It would be unsafe
1340         as we copy the list of frames before iterating to fire the unload events.
1341         Therefore, newly inserted frames would not get unloaded.
1342
1343 2017-03-02  Dave Hyatt  <hyatt@apple.com>
1344
1345         flex-basis should be 0% (not 0px) when omitted
1346         https://bugs.webkit.org/show_bug.cgi?id=169100
1347         rdar://problem/30429154
1348
1349         Reviewed by Dean Jackson.
1350
1351         Covered by existing tests.
1352
1353         * css/parser/CSSPropertyParser.cpp:
1354         (WebCore::CSSPropertyParser::consumeFlex):
1355
1356 2017-02-22  Jiewen Tan  <jiewen_tan@apple.com>
1357
1358         WebCrypto API support for AES-GCM
1359         https://bugs.webkit.org/show_bug.cgi?id=157175
1360         <rdar://problem/27311691>
1361
1362         Reviewed by Brent Fulgham.
1363
1364         This patch adds support for AES-GCM. Operations of AES-GCM include: encrypt, decrypt, generateKey,
1365         importKey, exportKey, wrapKey, and unwrapKey. https://www.w3.org/TR/WebCryptoAPI/#aes-gcm
1366
1367         Tests: crypto/subtle/aes-gcm-decrypt-malformed-parameters.html
1368                crypto/subtle/aes-gcm-encrypt-malformed-parameters.html
1369                crypto/subtle/aes-gcm-generate-export-key-jwk-length-128.html
1370                crypto/subtle/aes-gcm-generate-export-key-jwk-length-192.html
1371                crypto/subtle/aes-gcm-generate-export-key-jwk-length-256.html
1372                crypto/subtle/aes-gcm-generate-export-raw-key.html
1373                crypto/subtle/aes-gcm-generate-key-encrypt-decrypt.html
1374                crypto/subtle/aes-gcm-generate-key.html
1375                crypto/subtle/aes-gcm-import-jwk-key-length-128.html
1376                crypto/subtle/aes-gcm-import-jwk-key-length-192.html
1377                crypto/subtle/aes-gcm-import-jwk-key-length-256.html
1378                crypto/subtle/aes-gcm-import-key-decrypt-additional-data-tag-length-32.html
1379                crypto/subtle/aes-gcm-import-key-decrypt-additional-data.html
1380                crypto/subtle/aes-gcm-import-key-decrypt-tagLengths.html
1381                crypto/subtle/aes-gcm-import-key-decrypt.html
1382                crypto/subtle/aes-gcm-import-key-encrypt-additional-data-tag-length-32.html
1383                crypto/subtle/aes-gcm-import-key-encrypt-additional-data.html
1384                crypto/subtle/aes-gcm-import-key-encrypt-tagLengths.html
1385                crypto/subtle/aes-gcm-import-key-encrypt.html
1386                crypto/subtle/aes-gcm-import-key-unwrap-jwk-key.html
1387                crypto/subtle/aes-gcm-import-key-unwrap-raw-key.html
1388                crypto/subtle/aes-gcm-import-key-wrap-jwk-key.html
1389                crypto/subtle/aes-gcm-import-key-wrap-raw-key.html
1390                crypto/subtle/aes-gcm-import-raw-key.html
1391                crypto/workers/subtle/aes-gcm-import-key-decrypt.html
1392                crypto/workers/subtle/aes-gcm-import-key-encrypt.html
1393                crypto/workers/subtle/aes-gcm-import-key-unwrap-key.html
1394                crypto/workers/subtle/aes-gcm-import-key-wrap-key.html
1395
1396         * CMakeLists.txt:
1397         * DerivedSources.make:
1398         * PlatformGTK.cmake:
1399         * PlatformMac.cmake:
1400         Add CryptoAlgorithmAES_CFBMac.cpp as well.
1401         * WebCore.xcodeproj/project.pbxproj:
1402         * bindings/js/JSSubtleCryptoCustom.cpp:
1403         (WebCore::normalizeCryptoAlgorithmParameters):
1404         Add support for AES-GCM.
1405         * crypto/CommonCryptoUtilities.h:
1406         Include SPI header for AES-GCM support.
1407         * crypto/CryptoAlgorithmParameters.h:
1408         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp: Added.
1409         (WebCore::usagesAreInvalidForCryptoAlgorithmAES_GCM):
1410         (WebCore::tagLengthIsValid):
1411         (WebCore::CryptoAlgorithmAES_GCM::create):
1412         (WebCore::CryptoAlgorithmAES_GCM::identifier):
1413         (WebCore::CryptoAlgorithmAES_GCM::encrypt):
1414         (WebCore::CryptoAlgorithmAES_GCM::decrypt):
1415         (WebCore::CryptoAlgorithmAES_GCM::generateKey):
1416         (WebCore::CryptoAlgorithmAES_GCM::importKey):
1417         (WebCore::CryptoAlgorithmAES_GCM::exportKey):
1418         * crypto/algorithms/CryptoAlgorithmAES_GCM.h: Added.
1419         * crypto/gnutls/CryptoAlgorithmAES_GCMGnuTLS.cpp: Added.
1420         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1421         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1422         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp: Added.
1423         (WebCore::encryptAES_GCM):
1424         (WebCore::decyptAES_GCM):
1425         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1426         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1427         * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
1428         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
1429         * crypto/parameters/AesGcmParams.idl: Added.
1430         * crypto/parameters/CryptoAlgorithmAesGcmParams.h: Added.
1431
1432 2017-03-02  Alex Christensen  <achristensen@webkit.org>
1433
1434         Continue enabling WebRTC
1435         https://bugs.webkit.org/show_bug.cgi?id=169056
1436
1437         Reviewed by Jon Lee.
1438
1439         * Configurations/FeatureDefines.xcconfig:
1440
1441 2017-03-02  Ryan Haddad  <ryanhaddad@apple.com>
1442
1443         Unreviewed, rolling out r213281.
1444
1445         This change caused API test WebKit2.UserMediaBasic to time
1446         out.
1447
1448         Reverted changeset:
1449
1450         "[MediaStream] UIClient may not be notified of capture state
1451         change when leaving a page"
1452         https://bugs.webkit.org/show_bug.cgi?id=169014
1453         http://trac.webkit.org/changeset/213281
1454
1455 2017-03-02  Jon Lee  <jonlee@apple.com>
1456
1457         Improve consistency of captions rendering on Mac
1458         https://bugs.webkit.org/show_bug.cgi?id=169071
1459
1460         Reviewed by Eric Carlson.
1461
1462         * page/CaptionUserPreferencesMediaAF.h:
1463         (WebCore::CaptionUserPreferencesMediaAF::captionsEdgeColorForTextColor): Deleted.
1464         (WebCore::CaptionUserPreferencesMediaAF::cssPropertyWithTextEdgeColor): Deleted.
1465
1466         * page/CaptionUserPreferencesMediaAF.cpp:
1467         (WebCore::appendCSS): Helper function to add a CSS rule with a provided StringBuilder.
1468         (WebCore::CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS): Refactor to use
1469         appendCSS.
1470         (WebCore::CaptionUserPreferencesMediaAF::colorPropertyCSS): Ditto.
1471         (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS): Update text edge styles.
1472         - Add a blur to the shadow
1473         - Drop shadow style includes 1px text border
1474         - Always use black for the text edge color
1475         Also convert the stroke rules to using the CSS property and values instead of straight strings.
1476         (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride): Fly-by fix of a typo.
1477
1478 2017-03-02  Chris Dumez  <cdumez@apple.com>
1479
1480         Download attribute set to "*\" save file with name "example.com"
1481         https://bugs.webkit.org/show_bug.cgi?id=169066
1482         <rdar://problem/30740875>
1483
1484         Reviewed by Alex Christensen.
1485
1486         The issue is that a backslash in recognized as an escaping character in
1487         a quoted string as per RFC2616:
1488         "
1489         The backslash character ("\") MAY be used as a single-character
1490         quoting mechanism only within quoted-string and comment constructs.
1491         "
1492
1493         We therefore need to escape the backslashes in the filename before
1494         using it in the Content-Disposition header, inside the quoted string.
1495
1496         Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash.html
1497
1498         * platform/network/ResourceResponseBase.cpp:
1499         (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
1500
1501 2017-03-02  Youenn Fablet  <youenn@apple.com>
1502
1503         [WebRTC] Activate ICE candidate privacy policy
1504         https://bugs.webkit.org/show_bug.cgi?id=168975
1505
1506         Reviewed by Alex Christensen.
1507
1508         Test: webrtc/datachannel/filter-ice-candidate.html
1509
1510         * testing/Internals.cpp:
1511         (WebCore::Internals::Internals): Disabling ICE candidate filtering by default for rwt.
1512         (WebCore::Internals::setICECandidateFiltering):
1513         * testing/Internals.h:
1514         * testing/Internals.idl:
1515
1516 2017-03-02  Eric Carlson  <eric.carlson@apple.com>
1517
1518         [MediaStream] UIClient may not be notified of capture state change when leaving a page
1519         https://bugs.webkit.org/show_bug.cgi?id=169014
1520         <rdar://problem/30632267>
1521
1522         Reviewed by Youenn Fablet.
1523
1524         Enable and update the WebKit API test WebKit2.UserMedia.
1525
1526         * dom/Document.cpp:
1527         (WebCore::Document::prepareForDestruction): Always call page.updateIsPlayingMedia() if there
1528         is active media in the document because it won't be possible when the state changes later
1529         because the frame will have been cleared.
1530
1531 2017-03-02  Tomas Popela  <tpopela@redhat.com>
1532
1533         [WK2] Keyboard menu key should show context menu
1534         https://bugs.webkit.org/show_bug.cgi?id=72099
1535
1536         Reviewed by Carlos Garcia Campos.
1537
1538         Show the context menu when the GtkWidget::popup-menu signal is
1539         emitted. This signal is triggered by pressing a key (usually
1540         the Menu key or the Shift + F10 shortcut) or it could be emitted on
1541         WebKitWebView.
1542
1543         Test: fast/events/context-activated-by-key-event.html
1544
1545         Also could be tested by:
1546
1547         ManualTests/keyboard-menukey-event.html
1548         ManualTests/win/contextmenu-key.html
1549         ManualTests/win/contextmenu-key2.html
1550
1551         * page/EventHandler.cpp:
1552         (WebCore::EventHandler::sendContextMenuEventForKey):
1553         Correctly send the mouse event that used for showing the context menu.
1554         Previously the event was immediately dispatched as it is, but this was
1555         only the right way if some element was focused on the page. If there
1556         was no focused element or non-empty text range then the event lacked
1557         the right node, where it was supposed to be shown. The correct node
1558         is determined and added to the event in the sendContextMenuEvent() so
1559         we have to use this function to send the event.
1560
1561         Also use absoluteBoundingBoxRect() instead of
1562         pixelSnappedAbsoluteClippedOverflowRect() when determining
1563         a coordinate where to show the context menu for the currently focus
1564         element. The latter is not returning a right box (it is bigger) which
1565         could lead to the situation that no menu will be displayed at all,
1566         because the HitTest won't contain the right element as the
1567         determined coordinates could be outside of the element.
1568         * page/EventHandler.h:
1569
1570 2017-03-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1571
1572         [GTK] Crash in WebCore::CoordinatedGraphicsLayer::notifyFlushRequired
1573         https://bugs.webkit.org/show_bug.cgi?id=166420
1574
1575         Reviewed by Žan Doberšek.
1576
1577         This is happening when closing a page that is being inspected. When CoordinatedGraphicsLayer::removeFromParent()
1578         is called, the coordinator has already been invalidated, so all its layers were set a nullptr coordinator. I
1579         think it's safe to simply handle m_coordinator being nullptr in notifyFlushRequired().
1580
1581         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1582         (WebCore::CoordinatedGraphicsLayer::notifyFlushRequired): Return early if the coordinator is nullptr.
1583
1584 2017-03-02  Andreas Kling  <akling@apple.com>
1585
1586         Don't keep dead resources in MemoryCache while under memory pressure.
1587         <https://webkit.org/b/169070>
1588
1589         Reviewed by Antti Koivisto.
1590
1591         Have CachedResource::deleteIfPossible() remove the resource from the MemoryCache
1592         if we're under memory pressure and that was the only thing keeping it alive.
1593
1594         This is consistent with the policy where dead resources are evicted from the cache
1595         as we come under pressure.
1596
1597         * loader/cache/CachedResource.cpp:
1598         (WebCore::CachedResource::deleteIfPossible):
1599
1600 2017-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1601
1602         REGRESSION(r213062): [SOUP] UTF-8 filename in Content-Disposition header incorrectly handled since r213062
1603         https://bugs.webkit.org/show_bug.cgi?id=169024
1604
1605         Reviewed by Youenn Fablet.
1606
1607         This made test http/tests/download/literal-utf-8.html to start failing. The problem is that I removed the
1608         conversion made by String::fromUTF8WithLatin1Fallback that was added in r176930. I removed it because that made
1609         fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html to timeout. This patch brings back
1610         the String::fromUTF8WithLatin1Fallback call but only when the header string is 8 bit one.
1611
1612         Fixes: http/tests/download/literal-utf-8.html
1613
1614         * platform/network/soup/ResourceResponseSoup.cpp:
1615         (WebCore::ResourceResponse::platformSuggestedFilename):
1616
1617 2017-03-01  Alex Christensen  <achristensen@webkit.org>
1618
1619         Actually fix Windows build.
1620
1621         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
1622         Win32Handle is now in WTF namespace.
1623
1624 2017-03-01  Alex Christensen  <achristensen@webkit.org>
1625
1626         Fix WinCairo build after r213214
1627         https://bugs.webkit.org/show_bug.cgi?id=168908
1628
1629         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
1630
1631 2017-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
1632
1633         Implement font-stretch for installed fonts
1634         https://bugs.webkit.org/show_bug.cgi?id=168888
1635
1636         Reviewed by Darin Adler and Dave Hyatt.
1637
1638         This patch implements the font-stretch property. Both parsing and the implementation is
1639         implemented. Contrary to the name, this property doesn't actually stretch fonts; instead,
1640         it provides one more input to the font selection routine.
1641
1642         The mapping from Core Text's [-1, 1] width values to font-stretch's percentage-based
1643         values is not perfect. For now, I've implemented a piecewise linear curve mapping the
1644         two. However, I expect to be able to improve this transfer function soon.
1645
1646         This patch does not implement the font-stretch descriptor in @font-face, and therefore
1647         does not work with web fonts. I will add this support in
1648         https://bugs.webkit.org/show_bug.cgi?id=168892. The reason it isn't done in this patch is
1649         it requires some architectural changes to our CSSFontFace classes which are large enough
1650         they should be separated into their own patch.
1651
1652         This patch lays the groundwork for implementing the 'wdth' variation axis. It does this
1653         by adding a floating-point value to RenderStyle instead of just an enum. The font-stretch
1654         keywords get converted to these floating-point numbers in accordance with the Fonts spec.
1655         This patch doesn't actually implement the variations piece of font-stretch, because that
1656         piece also requires some architectural changes. This patch just implements the installed
1657         font selection piece.
1658
1659         This patch also fixes the regression introduced in r213163 with Helvetica Neue. Now that
1660         our font selection algorithm has a concept of font stretch, weights 800 and 900 of
1661         Helvetica Neue are rendered as expected. (And this patch updates the tests to make sure.)
1662
1663         Tests: fast/text/font-stretch-parse.html
1664                fast/text/font-stretch-shorthand.html
1665                FontCacheTest.FontLookupFromFamilyName
1666
1667         * css/CSSComputedStyleDeclaration.cpp:
1668         (WebCore::fontStretchFromStyle): Map style values to CSS keywords.
1669         (WebCore::ComputedStyleExtractor::propertyValue): Call the above function.
1670         * css/CSSFontValue.cpp:
1671         (WebCore::CSSFontValue::customCSSText): Used in getComputedStyle() for the "font"
1672         shorthand.
1673         (WebCore::CSSFontValue::equals):
1674         * css/CSSFontValue.h:
1675         * css/CSSProperties.json:
1676         * css/StyleBuilderConverter.h:
1677         (WebCore::StyleBuilderConverter::convertFontStretch): Map CSS keywords to style values.
1678         * css/StyleProperties.cpp:
1679         (WebCore::StyleProperties::appendFontLonghandValueIfExplicit): Used for
1680         Element.style.font.
1681         (WebCore::StyleProperties::fontValue):
1682         * css/parser/CSSParserFastPaths.cpp:
1683         (WebCore::CSSParserFastPaths::isKeywordPropertyID): Now that variation fonts are being
1684         implemented, font-stretch is no longer a keyword property. Instead, it can also take a
1685         number or percentage.
1686         * css/parser/CSSPropertyParser.cpp:
1687         (WebCore::consumeFontStretch): Parse the value.
1688         (WebCore::CSSPropertyParser::parseSingleValue): Call the above function.
1689         (WebCore::CSSPropertyParser::consumeFont): Ditto.
1690         * platform/graphics/FontCache.h:
1691         (WebCore::FontDescriptionKey::FontDescriptionKey): Caches should be sensitive to this
1692         new value.
1693         (WebCore::FontDescriptionKey::operator==):
1694         (WebCore::FontDescriptionKey::computeHash):
1695         * platform/graphics/FontDescription.h:
1696         (WebCore::FontDescription::stretch): The parsed style value.
1697         (WebCore::FontDescription::setStretch):
1698         (WebCore::FontDescription::operator==):
1699         (WebCore::FontCascadeDescription::initialStretch):
1700         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1701         (WebCore::FontDatabase::InstalledFont::InstalledFont): Update the installed font selection
1702         algorithm to understand font-stretch.
1703         (WebCore::findClosestStretch):
1704         (WebCore::filterStretch):
1705         (WebCore::findClosestFont):
1706         (WebCore::platformFontLookupWithFamily):
1707         (WebCore::fontWithFamily):
1708         (WebCore::FontCache::createFontPlatformData):
1709
1710 2017-03-01  Antti Koivisto  <antti@apple.com>
1711
1712         Rename recalcStyle to resolveStyle and clean up the signature
1713         https://bugs.webkit.org/show_bug.cgi?id=169049
1714
1715         Reviewed by Sam Weinig.
1716
1717         Move to modern naming.
1718
1719         * dom/Document.cpp:
1720         (WebCore::Document::resolveStyle):
1721
1722             Only two of the possible values are used so pass in a two-value enum.
1723
1724         (WebCore::Document::updateStyleIfNeeded):
1725         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
1726         (WebCore::Document::createRenderTree):
1727         (WebCore::Document::finishedParsing):
1728         (WebCore::Document::webkitWillEnterFullScreenForElement):
1729         (WebCore::Document::recalcStyle): Deleted.
1730         * dom/Document.h:
1731         * inspector/InspectorOverlay.cpp:
1732         (WebCore::InspectorOverlay::update):
1733         * loader/DocumentWriter.cpp:
1734         (WebCore::DocumentWriter::reportDataReceived):
1735         * page/Frame.cpp:
1736         (WebCore::Frame::setPageAndTextZoomFactors):
1737         * page/Page.cpp:
1738         (WebCore::Page::setPageScaleFactor):
1739         * style/StyleTreeResolver.cpp:
1740         (WebCore::Style::TreeResolver::Parent::Parent):
1741         (WebCore::Style::TreeResolver::resolve):
1742
1743             Remove the argument, Document invalidates the document element if everything needs to be re-resolved.
1744
1745         * style/StyleTreeResolver.h:
1746
1747 2017-03-01  Alex Christensen  <achristensen@webkit.org>
1748
1749         Unreviewed, rolling out r213259.
1750
1751         Broke an internal build
1752
1753         Reverted changeset:
1754
1755         "Continue enabling WebRTC"
1756         https://bugs.webkit.org/show_bug.cgi?id=169056
1757         http://trac.webkit.org/changeset/213259
1758
1759 2017-03-01  Alex Christensen  <achristensen@webkit.org>
1760
1761         Continue enabling WebRTC
1762         https://bugs.webkit.org/show_bug.cgi?id=169056
1763
1764         Reviewed by Jon Lee.
1765
1766         * Configurations/FeatureDefines.xcconfig:
1767
1768 2017-03-01  Chris Dumez  <cdumez@apple.com>
1769
1770         [WK2][!NETWORK_SESSION] Failure to download when using a download attribute with no value on an anchor
1771         https://bugs.webkit.org/show_bug.cgi?id=169060
1772         <rdar://problem/30773140>
1773
1774         Reviewed by Darin Adler.
1775
1776         Make sure we never set the suggested filename to the empty string when
1777         the download attribute is present but has no value.
1778
1779         Test: http/tests/download/anchor-download-no-value.html
1780
1781         * loader/PolicyChecker.cpp:
1782         (WebCore::PolicyChecker::checkNavigationPolicy):
1783
1784 2017-03-01  Antoine Quint  <graouts@apple.com>
1785
1786         [ios-simulator] Unskip media/modern-media-controls/audio/audio-controls-metrics.html
1787         https://bugs.webkit.org/show_bug.cgi?id=167258
1788         <rdar://problem/30282740>
1789
1790         We weren't enforcing the min-width to be 200px as well as the default width, and the
1791         UA stylesheet would override it. Setting a default min-width that trumps the UA
1792         stylesheet makes the test work correctly on iOS and we can safely unskip this test.
1793
1794         Reviewed by Jon Lee.
1795
1796         * Modules/modern-media-controls/controls/media-controls.css:
1797         (:host(audio)):
1798
1799 2017-03-01  Javier Fernandez  <jfernandez@igalia.com>
1800
1801         Missing 'specification' section in the place-content shorthand
1802         https://bugs.webkit.org/show_bug.cgi?id=169052
1803
1804         Reviewed by Darin Adler.
1805
1806         Added 'specification' section in the place-content shorthand.
1807
1808         No new tests, no new functionality.
1809
1810         * css/CSSProperties.json:
1811
1812 2017-02-28  Matt Rajca  <mrajca@apple.com>
1813
1814         Media: notify clients when autoplayed media is muted
1815         https://bugs.webkit.org/show_bug.cgi?id=168987
1816
1817         Reviewed by Alex Christensen.
1818
1819         Added API tests.
1820
1821         * html/HTMLMediaElement.cpp:
1822         (WebCore::HTMLMediaElement::setMuted):
1823         (WebCore::HTMLMediaElement::pageMutedStateDidChange):
1824         * page/AutoplayEvent.h:
1825
1826 2017-03-01  Commit Queue  <commit-queue@webkit.org>
1827
1828         Unreviewed, rolling out r213226.
1829         https://bugs.webkit.org/show_bug.cgi?id=169051
1830
1831         Speculative rollout, might be causing several failures and
1832         crashes in WebKitGTK+ (Requested by lajava on #webkit).
1833
1834         Reverted changeset:
1835
1836         "REGRESSION(r213062): [SOUP] UTF-8 filename in Content-
1837         Disposition header incorrectly handled since r213062"
1838         https://bugs.webkit.org/show_bug.cgi?id=169024
1839         http://trac.webkit.org/changeset/213226
1840
1841 2017-03-01  James Craig  <jcraig@apple.com>
1842
1843         AX: add role aliases for ARIA DPUB module
1844         https://bugs.webkit.org/show_bug.cgi?id=168978
1845         <rdar://problem/30762724>
1846
1847         Reviewed by Chris Fleizach.
1848
1849         Added role aliases for ARIA DPUB module, and updated existing tests.
1850
1851         Test: accessibility/roles-exposed.html
1852         Test: inspector/dom/getAccessibilityPropertiesForNode.html
1853
1854         * accessibility/AccessibilityObject.cpp:
1855         (WebCore::initializeRoleMap): 
1856
1857 2017-03-01  Alex Christensen  <achristensen@webkit.org>
1858
1859         Don't call libwebrtc functions if libwebrtc.dylib doesn't exist while testing
1860         https://bugs.webkit.org/show_bug.cgi?id=169045
1861         <rdar://problem/30735413>
1862
1863         Reviewed by Youenn Fablet.
1864
1865         WebRTC tests fail instead of crashing now if libwebrtc.dylib is missing.
1866         All other tests pass instead of crashing immediately when creating an Internals object.
1867
1868         * Modules/mediastream/RTCController.cpp:
1869         (WebCore::RTCController::disableICECandidateFiltering):
1870         (WebCore::RTCController::enableICECandidateFiltering):
1871         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1872         (WebCore::createLibWebRTCPeerConnectionBackend):
1873         * testing/Internals.cpp:
1874         (WebCore::Internals::enableMockMediaEndpoint):
1875         (WebCore::Internals::emulateRTCPeerConnectionPlatformEvent):
1876         (WebCore::Internals::useMockRTCPeerConnectionFactory):
1877         * testing/Internals.h:
1878
1879 2017-03-01  Javier Fernandez  <jfernandez@igalia.com>
1880
1881         [css-align] Implement the place-content shorthand
1882         https://bugs.webkit.org/show_bug.cgi?id=168771
1883
1884         Reviewed by Manuel Rego Casasnovas.
1885
1886         The CSS Box Alignment specification defines a new shorthand to set the
1887         Content Alignment properties (align-content and justify-content) at the
1888         same time.
1889
1890         This patch provides the implementation of the CSS parsing logic and the
1891         required regression tests.
1892
1893         Test: css3/parse-place-content.html
1894
1895         * css/CSSComputedStyleDeclaration.cpp:
1896         (WebCore::ComputedStyleExtractor::propertyValue):
1897         * css/CSSProperties.json:
1898         * css/StyleProperties.cpp:
1899         (WebCore::StyleProperties::getPropertyValue):
1900         * css/parser/CSSPropertyParser.cpp:
1901         (WebCore::consumeSimplifiedContentPosition):
1902         (WebCore::CSSPropertyParser::consumePlaceContentShorthand):
1903         (WebCore::CSSPropertyParser::parseShorthand):
1904         * css/parser/CSSPropertyParser.h:
1905
1906 2017-03-01  Simon Fraser  <simon.fraser@apple.com>
1907
1908         Try to fix Windows build after r213191.
1909
1910         * platform/spi/win/CoreTextSPIWin.h:
1911
1912 2017-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1913
1914         REGRESSION(r213062): [SOUP] UTF-8 filename in Content-Disposition header incorrectly handled since r213062
1915         https://bugs.webkit.org/show_bug.cgi?id=169024
1916
1917         Reviewed by Youenn Fablet.
1918
1919         This made test http/tests/download/literal-utf-8.html to start failing. The problem is that I removed the
1920         conversion made by String::fromUTF8WithLatin1Fallback that was added in r176930. I removed it because that made
1921         fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html to timeout. This patch brings back
1922         the String::fromUTF8WithLatin1Fallback call but only when the header string is 8 bit one.
1923
1924         Fixes: http/tests/download/literal-utf-8.html
1925
1926         * platform/network/soup/ResourceResponseSoup.cpp:
1927         (WebCore::ResourceResponse::platformSuggestedFilename):
1928
1929 2017-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1930
1931         [GTK] fast/canvas/canvas-createPattern-video-loading.html makes its subsequent test timeout
1932         https://bugs.webkit.org/show_bug.cgi?id=169019
1933
1934         Reviewed by Xabier Rodriguez-Calvar.
1935
1936         The timeout happens normally when the media player is deleted and the pipeline state is set to NULL. The call to
1937         gst_element_set_state() never returns because of different deadlocks with the video sink. Sometimes the deadlock
1938         happens with the sample mutex used by VideoRenderRequestScheduler. VideoRenderRequestScheduler::requestRender()
1939         calls webkitVideoSinkRepaintRequested() with the lock held, that ends up calling
1940         MediaPlayerPrivateGStreamerBase::triggerRepaint(). When rendering can't be accelerated the draw timer is
1941         scheduled and triggerRepaint blocks until the timer is fired. If the media player is destroyed before the timer
1942         is fired, when setting the pipeline state to NULL, other VideoRenderRequestScheduler methods can be called, like
1943         stop() that tries to get the sample mutex that is still held by requestRender(). So, first we need to make
1944         sure that requestRender() releases the lock before calling webkitVideoSinkRepaintRequested(). But that's not
1945         enough, we also need to ensure that the pipeline is set to NULL state after everyting has been properly
1946         stopped. This is currently done in ~MediaPlayerPrivateGStreamer that happens before
1947         ~MediaPlayerPrivateGStreamerBase, so gst_element_set_state() is hanging before allowing the
1948         MediaPlayerPrivateGStreamerBase to be cleaned up. We should move the call to the end of
1949         ~MediaPlayerPrivateGStreamerBase and ensure the draw timer and mutex are properly cleaned up before.
1950
1951         Fixes: fast/canvas/canvas-createPattern-video-loading.html
1952
1953         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1954         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): Do not reset pipeline here.
1955         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1956         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): Stop the draw mutex and notify the
1957         lock to ensure we unblock. Do the pipeline reset at the end.
1958         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1959         (VideoRenderRequestScheduler::requestRender): Release the mutex lock before calling webkitVideoSinkRepaintRequested().
1960
1961 2017-03-01  Tomas Popela  <tpopela@redhat.com>
1962
1963         Unreviewed compiler warning fix after r213218
1964
1965         * platform/gtk/PlatformKeyboardEventGtk.cpp:
1966         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1967
1968 2017-03-01  Tomas Popela  <tpopela@redhat.com>
1969
1970         [Cairo] Incorrectly determining height in GraphicsContext::roundToDevicePixels()
1971         https://bugs.webkit.org/show_bug.cgi?id=169031
1972
1973         Reviewed by Carlos Garcia Campos.
1974
1975         We should compare if height is between -1 and 0 and not mixing height
1976         and width together.
1977
1978         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1979         (WebCore::GraphicsContext::roundToDevicePixels):
1980
1981 2017-03-01  Tomas Popela  <tpopela@redhat.com>
1982
1983         [GTK] Fix problems found by Coverity scan in platform's keyboard and mouse events
1984         https://bugs.webkit.org/show_bug.cgi?id=169028
1985
1986         Reviewed by Carlos Garcia Campos.
1987
1988         * platform/gtk/PlatformKeyboardEventGtk.cpp:
1989         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Initialize
1990         the m_handledByInputMethod member.
1991         * platform/gtk/PlatformMouseEventGtk.cpp:
1992         (WebCore::PlatformMouseEvent::PlatformMouseEvent): Initialize the
1993         m_modifierFlags member.
1994
1995 2017-03-01  Andreas Kling  <akling@apple.com>
1996
1997         Move MemoryPressureHandler to WTF
1998         <https://webkit.org/b/168908>
1999
2000         Reviewed by Sam Weinig.
2001
2002         * CMakeLists.txt:
2003         * PlatformMac.cmake:
2004         * PlatformWin.cmake:
2005         * WebCore.xcodeproj/project.pbxproj:
2006         * bindings/js/ScriptController.cpp:
2007         * history/PageCache.cpp:
2008         * html/HTMLMediaElement.cpp:
2009         * inspector/InspectorInstrumentation.h:
2010         * inspector/InspectorMemoryAgent.h:
2011         * page/FrameView.cpp:
2012         * page/MemoryRelease.h:
2013         * page/linux/ResourceUsageThreadLinux.cpp:
2014         * platform/Linux.cmake:
2015         * platform/graphics/FontCache.cpp:
2016         * platform/graphics/WidthCache.h:
2017         * platform/graphics/ca/TileController.cpp:
2018         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2019         * platform/ios/LegacyTileCache.mm:
2020         * platform/ios/LegacyTileGrid.mm:
2021         * platform/ios/LegacyTileLayerPool.mm:
2022         * platform/ios/TileControllerMemoryHandlerIOS.cpp:
2023         * testing/Internals.cpp:
2024
2025 2017-03-01  Per Arne Vollan  <pvollan@apple.com>
2026
2027         [Win] Popup menus are too small in HiDPI mode.
2028         https://bugs.webkit.org/show_bug.cgi?id=168965
2029
2030         Reviewed by Brent Fulgham.
2031
2032         Scale font with device scale factor.
2033
2034         * platform/win/PopupMenuWin.cpp:
2035         (WebCore::PopupMenuWin::show):
2036         (WebCore::PopupMenuWin::calculatePositionAndSize):
2037         (WebCore::PopupMenuWin::paint):
2038         * platform/win/PopupMenuWin.h:
2039
2040 2017-03-01  Joseph Pecoraro  <pecoraro@apple.com>
2041
2042         [WebRTC] Install libwebrtc.dylib inside of WebCore.framework
2043         https://bugs.webkit.org/show_bug.cgi?id=168859
2044
2045         Reviewed by Dan Bernstein.
2046
2047         * Configurations/WebCore.xcconfig:
2048         Set library search path to find the libwebrtc.dylib inside of WebCore's Frameworks
2049         or in the WK_OVERRIDE_FRAMEWORKS_DIR.
2050
2051 2017-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
2052
2053         Addressing post-review comments on r213163
2054         https://bugs.webkit.org/show_bug.cgi?id=168678
2055
2056         Unreviewed.
2057
2058         No new tests because there is no behavior change.
2059
2060         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2061         (WebCore::platformFontLookupWithFamily):
2062
2063 2017-02-28  Simon Fraser  <simon.fraser@apple.com>
2064
2065         Don't use the LinearGlyphMask format if accelerated drawing is disabled
2066         https://bugs.webkit.org/show_bug.cgi?id=168997
2067
2068         Reviewed by Tim Horton.
2069
2070         Non-accelerated drawing doesn't work into LinearGlyphMask-format backing store,
2071         so don't use that backing store format when accelerated drawing is disabled.
2072
2073         * platform/graphics/ca/PlatformCALayer.cpp:
2074         (WebCore::PlatformCALayer::drawRepaintIndicator):
2075         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2076         (layerContentsFormat):
2077         (PlatformCALayerCocoa::updateContentsFormat):
2078
2079 2017-02-28  Simon Fraser  <simon.fraser@apple.com>
2080
2081         Make the repaint indicators show subpixel antialiased text indication a bit more clearly
2082         https://bugs.webkit.org/show_bug.cgi?id=168988
2083
2084         Reviewed by Tim Horton.
2085
2086         Put a more obvious stroke around the repaint count when subpixel-antialiased layer text is enabled.
2087
2088         * platform/graphics/ca/PlatformCALayer.cpp:
2089         (WebCore::PlatformCALayer::drawRepaintIndicator):
2090         (WebCore::PlatformCALayer::drawTextAtPoint):
2091         * platform/graphics/ca/PlatformCALayer.h:
2092         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2093         (PlatformCALayerWin::drawTextAtPoint):
2094         * platform/graphics/ca/win/PlatformCALayerWin.h:
2095
2096 2017-02-28  Alex Christensen  <achristensen@webkit.org>
2097
2098         LibWebRTCProvider should check existence of libwebrtc.dylib
2099         https://bugs.webkit.org/show_bug.cgi?id=168986
2100         <rdar://problem/30735413>
2101
2102         Reviewed by Youenn Fablet.
2103
2104         Some configurations of the webrtc tests overwrite the availability of WebRTC in order to test it
2105         with MockLibWebRTCPeerConnection.  If the dylib can not be found, we can't use it, so we want to
2106         fail these tests rather than crashing calling rtc::LogMessage::LogToDebug.
2107
2108         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2109         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
2110         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
2111         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2112         (WebCore::LibWebRTCProvider::factory):
2113         (WebCore::LibWebRTCProvider::webRTCAvailable):
2114         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2115         * testing/MockLibWebRTCPeerConnection.cpp:
2116         (WebCore::useMockRTCPeerConnectionFactory):
2117         (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
2118
2119 2017-02-28  Tim Horton  <timothy_horton@apple.com>
2120
2121         Apply a review comment that was missing in r213182
2122
2123         * loader/ios/QuickLook.mm:
2124         (WebCore::isQuickLookPreviewURL):
2125
2126 2017-02-28  Tim Horton  <timothy_horton@apple.com>
2127
2128         [iOS] Getting QLPreviewProtocol slows down first navigation in Web process
2129         https://bugs.webkit.org/show_bug.cgi?id=168940
2130         <rdar://problem/29468999>
2131
2132         Reviewed by Simon Fraser.
2133
2134         No new tests, just a performance improvement.
2135
2136         * loader/DocumentLoader.cpp:
2137         (WebCore::isRemoteWebArchive):
2138         * loader/PolicyChecker.cpp:
2139         (WebCore::PolicyChecker::checkNavigationPolicy):
2140         * loader/ResourceLoadNotifier.cpp:
2141         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
2142         Make use of isQuickLookPreviewURL.
2143
2144         * loader/ios/QuickLook.h:
2145         * loader/ios/QuickLook.mm:
2146         (WebCore::isQuickLookPreviewURL):
2147         Add isQuickLookPreviewURL, which first early-returns if the protocol
2148         of the URL is a well-known protocol, and then falls back to loading QuickLook.
2149
2150         In a microbenchmark this is a 30-40% improvement in total time spent
2151         loading an empty HTML document (wall-clock time between loadHTMLString
2152         and didFinishNavigation).
2153
2154 2017-02-28  Simon Fraser  <simon.fraser@apple.com>
2155
2156         Add Geolocation and DeviceOrientation to features.json 
2157
2158         * features.json:
2159
2160 2017-02-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2161
2162         Data interaction should support attachment elements
2163         https://bugs.webkit.org/show_bug.cgi?id=168916
2164         <rdar://problem/30664519>
2165
2166         Reviewed by Ryosuke Niwa.
2167
2168         Teaches DragController to recognize and initiate dragging on attachment elements, and also adds a new
2169         convenience method to the WebItemProviderPasteboard for block enumeration of available UIItemProviders. Covered
2170         by a new API test: DataInteractionTests.AttachmentElementItemProviders.
2171
2172         * page/DragController.cpp:
2173         (WebCore::DragController::draggableElement):
2174         (WebCore::DragController::startDrag):
2175         * platform/ios/WebItemProviderPasteboard.h:
2176         * platform/ios/WebItemProviderPasteboard.mm:
2177         (-[WebItemProviderPasteboard enumerateItemProvidersWithBlock:]):
2178
2179 2017-02-28  Mark Lam  <mark.lam@apple.com>
2180
2181         Remove setExclusiveThread() and peers from the JSLock.
2182         https://bugs.webkit.org/show_bug.cgi?id=168977
2183
2184         Reviewed by Filip Pizlo.
2185
2186         No new tests because this should already be covered by existing tests.
2187
2188         * bindings/js/CommonVM.cpp:
2189         (WebCore::commonVMSlow):
2190
2191 2017-02-28  Dave Hyatt  <hyatt@apple.com>
2192
2193         Centering text inside a button set to display flex and justify-content: center is impossible
2194         https://bugs.webkit.org/show_bug.cgi?id=148872
2195         <rdar://problem/22590086>
2196
2197         Reviewed by Simon Fraser.
2198
2199         Added new test in fast/forms.
2200
2201         * rendering/RenderButton.cpp:
2202         (WebCore::RenderButton::addChild):
2203         (WebCore::RenderButton::updateAnonymousChildStyle):
2204         (WebCore::RenderButton::styleDidChange):
2205         (WebCore::RenderButton::styleWillChange): Deleted.
2206         (WebCore::RenderButton::setupInnerStyle): Deleted.
2207         * rendering/RenderButton.h:
2208         * rendering/RenderElement.cpp:
2209         (WebCore::RenderElement::propagateStyleToAnonymousChildren):
2210         * rendering/RenderElement.h:
2211         (WebCore::RenderElement::updateAnonymousChildStyle):
2212
2213 2017-02-28  Antoine Quint  <graouts@apple.com>
2214
2215         [Modern Media Controls] Add missing compact mode assets for macOS
2216         https://bugs.webkit.org/show_bug.cgi?id=168980
2217         <rdar://problem/30763269>
2218
2219         Reviewed by Jon Lee.
2220
2221         Adding missing compact mode assets for the AirPlay, tracks, PiP and volume buttons.
2222
2223         * Modules/modern-media-controls/controls/icon-service.js:
2224         * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css:
2225         (.media-controls.mac.inline.compact button.airplay):
2226         (.media-controls.mac.inline.compact button.pip):
2227         (.media-controls.mac.inline.compact button.tracks):
2228         * Modules/modern-media-controls/images/macOS/airplay-compact@1x.png: Added.
2229         * Modules/modern-media-controls/images/macOS/airplay-compact@2x.png: Added.
2230         * Modules/modern-media-controls/images/macOS/media-selection-compact@1x.png: Added.
2231         * Modules/modern-media-controls/images/macOS/media-selection-compact@2x.png: Added.
2232         * Modules/modern-media-controls/images/macOS/pip-in-compact@1x.png: Added.
2233         * Modules/modern-media-controls/images/macOS/pip-in-compact@2x.png: Added.
2234         * Modules/modern-media-controls/images/macOS/volume-compact@1x.png:
2235         * Modules/modern-media-controls/images/macOS/volume-compact@2x.png:
2236         * Modules/modern-media-controls/images/macOS/volume-mute-compact@1x.png: Added.
2237         * Modules/modern-media-controls/images/macOS/volume-mute-compact@2x.png: Added.
2238
2239 2017-02-28  Chris Dumez  <cdumez@apple.com>
2240
2241         [iOS] Throttle requestAnimationFrame to 30fps in low power mode
2242         https://bugs.webkit.org/show_bug.cgi?id=168837
2243         <rdar://problem/30700929>
2244
2245         Reviewed by Simon Fraser.
2246
2247         Throttle requestAnimationFrame to 30fps in low power mode on iOS to save battery.
2248
2249         ScriptedAnimationController now maintains an OptionSet of throttling reasons.
2250         Throttling reasons for now are: OutsideViewport, VisuallyIdle, and LowPowerMode.
2251         The requestAnimationFrame interval is then determined based on those throttling
2252         reasons:
2253         - OutsideViewport or VisuallyIdle: 10 seconds (very aggressive throttling)
2254         - LowPowerMode: 30fps
2255         - No reasons: 60fps
2256
2257         The Page now keeps track of low power mode state using a LowPowerModeNotifier.
2258         Whenever low power mode changes, it updates the throttling reasons in all the
2259         documents' ScriptedAnimationControllers in the frame tree.
2260
2261         Tests: fast/animation/request-animation-frame-throttling-detached-iframe.html
2262                fast/animation/request-animation-frame-throttling-lowPowerMode.html
2263
2264         * dom/Document.cpp:
2265         (WebCore::Document::requestAnimationFrame):
2266         * dom/Document.h:
2267         * dom/ScriptedAnimationController.cpp:
2268         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
2269         (WebCore::throttlingReasonToString):
2270         (WebCore::throttlingReasonsToString):
2271         (WebCore::ScriptedAnimationController::addThrottlingReason):
2272         (WebCore::ScriptedAnimationController::removeThrottlingReason):
2273         (WebCore::ScriptedAnimationController::isThrottled):
2274         (WebCore::ScriptedAnimationController::interval):
2275         (WebCore::ScriptedAnimationController::page):
2276         (WebCore::ScriptedAnimationController::scheduleAnimation):
2277         * dom/ScriptedAnimationController.h:
2278         (WebCore::ScriptedAnimationController::create):
2279         * page/FrameView.cpp:
2280         (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
2281         * page/Page.cpp:
2282         (WebCore::Page::Page):
2283         (WebCore::Page::isLowPowerModeEnabled):
2284         (WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
2285         (WebCore::updateScriptedAnimationsThrottlingReason):
2286         (WebCore::Page::setIsVisuallyIdleInternal):
2287         (WebCore::Page::handleLowModePowerChange):
2288         * page/Page.h:
2289         * testing/Internals.cpp:
2290         (WebCore::Internals::resetToConsistentState):
2291         (WebCore::Internals::requestAnimationFrameInterval):
2292         (WebCore::Internals::setLowPowerModeEnabled):
2293         * testing/Internals.h:
2294         * testing/Internals.idl:
2295
2296 2017-02-28  Youenn Fablet  <youenn@apple.com>
2297
2298         [WebRTC] Limit libwebrtc logging in Debug build
2299         https://bugs.webkit.org/show_bug.cgi?id=168974
2300
2301         Reviewed by Alex Christensen.
2302
2303         Covered by manual testing..
2304
2305         * platform/Logging.h:
2306         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2307         (WebCore::LibWebRTCProvider::callOnWebRTCSignalingThread):
2308
2309 2017-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
2310
2311         [macOS] Migrate off of CTFontCreateForCSS
2312         https://bugs.webkit.org/show_bug.cgi?id=168678
2313
2314         Reviewed by David Hyatt.
2315
2316         This patch implements the Font Matching Algorithm detailed in
2317         https://drafts.csswg.org/css-fonts-4/#font-matching-algorithm
2318         Previously, this was implemented inside Core Text (via
2319         CTFontCreateForCSS()), but that implementation does not understand
2320         variation fonts. Therefore it should move to WebKit (along with
2321         the general fact that CSS algorithms should be implemented in a
2322         CSS engine, not the platform's text engine).
2323
2324         This implementation is not completely divorced from the platform,
2325         however - Core Text exposes font weights on a [-1, 1] range, but
2326         CSS operates on a [1, 999] range. In order to provide the mapping
2327         to CSS weights, Core Text infrastructure is necessary. Therefore,
2328         this new implementation of the matching algorithm is only used
2329         on certain operating systems.
2330
2331         The new implementation of the algorithm is not bug-compatible with
2332         the existing implementation; this patch does represent a behavior
2333         change. However, I have reviewed the differences manually and
2334         believe this algorithm to be a progression over the previous one
2335         (except for one case with Helvetica Neue - see
2336         LayoutTests/ChangeLog for more information about that).
2337
2338         This patch also represents a 27% performance progression on our
2339         standard page load test (just measuring the performance of the font
2340         matching algorithm, and nothing else). (Because font matching is
2341         only a small part of the entire test, the overall progression is
2342         much smaller.)
2343
2344         Tests: FontCacheTest.FontLookupFromFamilyName
2345                FontCacheTest.FontLookupFromPostScriptName
2346
2347         * platform/graphics/FontCache.h:
2348         (WebCore::FontCache::createFontPlatformDataForTesting): Allow for
2349         unit testing.
2350         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2351         (WebCore::isSystemFont): Inlined.
2352         (WebCore::FontDatabase::singleton): Cache results of Core Text
2353         lookups.
2354         (WebCore::FontDatabase::Range::Range): Because of variation fonts,
2355         fonts' weights, widths, and slopes need to be represented as a range
2356         instead of an individual value.
2357         (WebCore::FontDatabase::Range::isValid):
2358         (WebCore::FontDatabase::Range::expand):
2359         (WebCore::FontDatabase::Range::includes):
2360         (WebCore::FontDatabase::InstalledFont::InstalledFont): Represents a
2361         Font Descriptor as well as some lookup information about it.
2362         (WebCore::FontDatabase::InstalledFontCollection::InstalledFontCollection):
2363         A collection of installed fonts.
2364         (WebCore::FontDatabase::InstalledFontCollection::insertInstalledFont):
2365         Cache minima and maxima.
2366         (WebCore::FontDatabase::InstalledFontCollection::isEmpty):
2367         (WebCore::FontDatabase::InstalledFontCollection::size):
2368         (WebCore::FontDatabase::lookupFamilyName): Get all the fonts in
2369         the family.
2370         (WebCore::FontDatabase::lookupPostScriptName): Get the font with
2371         the given PostScript name.
2372         (WebCore::FontDatabase::clear):
2373         (WebCore::FontDatabase::FontDatabase): Cache.
2374         (WebCore::iterateActiveFontsWithReturn): The Font Matching Algorithm
2375         works by starting with every font in the family, and the eliminating
2376         items from the set iteratively. Instead of actually removing items
2377         from a vector or linked list, we instead want to treat the collection
2378         as immutable and keep a parallel side-table of which items have been
2379         eliminated (in order to reduce copies and allocations). This makes
2380         sense because most families only have a handful of fonts in them.
2381         This function consults with the side-table to iterate only over the
2382         fonts which have not been eliminated.
2383         (WebCore::iterateActiveFonts): Ditto.
2384         (WebCore::findClosestStretch):
2385         (WebCore::filterStretch): Eliminate fonts based on their stretch
2386         value.
2387         (WebCore::findClosestStyle):
2388         (WebCore::filterStyle): Eliminate fonts based on their style value.
2389         (WebCore::findClosestWeight):
2390         (WebCore::filterWeight): Eliminate fonts based on their weight value.
2391         (WebCore::computeTargetWeight):
2392         (WebCore::findClosestFont): If we have a set of fonts in a family,
2393         select the font in the set which best matches the criteria.
2394         (WebCore::platformFontLookupWithFamily): While findClosestFont()
2395         function satisfies the spec's notion of the font matching algorithm,
2396         WebKit actually claims to be able to look up fonts by their PostScript
2397         name. Therefore, this function has a higher-level of logic to rectify
2398         the confusion that results when the PostScript name doesn't agree with
2399         the other CSS properties (like if you say "Helvetica-Bold" but also say
2400         font-weight: 100).
2401         * platform/spi/cocoa/CoreTextSPI.h: Add signature for system CSS
2402         font weight support.
2403
2404 2017-02-24  Matt Rajca  <mrajca@apple.com>
2405
2406         Media: notify clients when autoplayed media ends without being paused
2407         https://bugs.webkit.org/show_bug.cgi?id=168852
2408
2409         Reviewed by Alex Christensen.
2410
2411         Added API tests.
2412
2413         * html/HTMLMediaElement.cpp:
2414         (WebCore::HTMLMediaElement::setReadyState):
2415          Set state accordingly if we autoplayed or if playback was prevented.
2416         (WebCore::HTMLMediaElement::play):
2417          Update state if playback was prevented.
2418         (WebCore::HTMLMediaElement::playInternal):
2419          Update state if playback began without user interaction.
2420         (WebCore::HTMLMediaElement::pauseInternal):
2421          Update state.
2422         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
2423          If playback ends and it began without user interaction, send a DidPlayMediaWithoutInterference event.
2424         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto.
2425         * html/HTMLMediaElement.h:
2426         * page/AutoplayEvent.h:
2427
2428 2017-02-27  Dave Hyatt  <hyatt@apple.com>
2429
2430         Update flexbox to Blink's tip of tree
2431         https://bugs.webkit.org/show_bug.cgi?id=168657
2432
2433         Reviewed by Zalan Bujtas.
2434
2435         Added new tests in css3/flexbox.
2436
2437         * CMakeLists.txt:
2438         * WebCore.xcodeproj/project.pbxproj:
2439         * css/CSSComputedStyleDeclaration.cpp:
2440         (WebCore::ComputedStyleExtractor::propertyValue):
2441         * rendering/FlexibleBoxAlgorithm.cpp: Added.
2442         (WebCore::FlexItem::FlexItem):
2443         (WebCore::FlexLayoutAlgorithm::FlexLayoutAlgorithm):
2444         (WebCore::FlexLayoutAlgorithm::computeNextFlexLine):
2445         * rendering/FlexibleBoxAlgorithm.h: Added.
2446         (WebCore::FlexItem::hypotheticalMainAxisMarginBoxSize):
2447         (WebCore::FlexItem::flexBaseMarginBoxSize):
2448         (WebCore::FlexItem::flexedMarginBoxSize):
2449         (WebCore::FlexLayoutAlgorithm::isMultiline):
2450         * rendering/GridTrackSizingAlgorithm.cpp:
2451         (WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize):
2452         (WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems):
2453         (WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild):
2454         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild):
2455         (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
2456         * rendering/GridTrackSizingAlgorithm.h:
2457         * rendering/OrderIterator.cpp:
2458         (WebCore::OrderIterator::next):
2459         (WebCore::OrderIterator::reset):
2460         (WebCore::OrderIteratorPopulator::~OrderIteratorPopulator):
2461         (WebCore::OrderIteratorPopulator::collectChild):
2462         (WebCore::OrderIteratorPopulator::OrderIteratorPopulator): Deleted.
2463         (WebCore::OrderIteratorPopulator::removeDuplicatedOrderValues): Deleted.
2464         * rendering/OrderIterator.h:
2465         (WebCore::OrderIteratorPopulator::OrderIteratorPopulator):
2466         * rendering/RenderBlock.cpp:
2467         (WebCore::RenderBlock::updateBlockChildDirtyBitsBeforeLayout):
2468         (WebCore::RenderBlock::layoutPositionedObject):
2469         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
2470         (WebCore::RenderBlock::computeChildPreferredLogicalWidths):
2471         (WebCore::RenderBlock::hasDefiniteLogicalHeight):
2472         (WebCore::RenderBlock::availableLogicalHeightForPercentageComputation):
2473         * rendering/RenderBlock.h:
2474         (WebCore::RenderBlock::hasPercentHeightDescendants):
2475         * rendering/RenderBlockFlow.cpp:
2476         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
2477         * rendering/RenderBox.cpp:
2478         (WebCore::RenderBox::columnFlexItemHasStretchAlignment):
2479         (WebCore::RenderBox::isStretchingColumnFlexItem):
2480         (WebCore::RenderBox::hasStretchedLogicalWidth):
2481         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
2482         (WebCore::RenderBox::computeInlineDirectionMargins):
2483         (WebCore::RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem):
2484         (WebCore::RenderBox::updateLogicalHeight):
2485         (WebCore::RenderBox::computeLogicalHeightWithoutLayout):
2486         (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation):
2487         (WebCore::RenderBox::shouldTreatChildAsReplacedInTableCells):
2488         (WebCore::tableCellShouldHaveZeroInitialSize):
2489         (WebCore::RenderBox::computePercentageLogicalHeight):
2490         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
2491         (WebCore::RenderBox::availableLogicalHeightUsing):
2492         (WebCore::RenderBox::percentageLogicalHeightIsResolvable):
2493         (WebCore::RenderBox::hasUnsplittableScrollingOverflow):
2494         (WebCore::flexItemHasStretchAlignment): Deleted.
2495         (WebCore::isStretchingColumnFlexItem): Deleted.
2496         (WebCore::logicalWidthIsResolvable): Deleted.
2497         (WebCore::RenderBox::hasDefiniteLogicalWidth): Deleted.
2498         (WebCore::percentageLogicalHeightIsResolvable): Deleted.
2499         (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock): Deleted.
2500         (WebCore::RenderBox::hasDefiniteLogicalHeight): Deleted.
2501         * rendering/RenderBox.h:
2502         (WebCore::RenderBox::isGridItem):
2503         (WebCore::RenderBox::isFlexItem):
2504         (WebCore::RenderBox::selfAlignmentNormalBehavior):
2505         * rendering/RenderBoxModelObject.cpp:
2506         (WebCore::isOutOfFlowPositionedWithImplicitHeight):
2507         (WebCore::RenderBoxModelObject::containingBlockForAutoHeightDetection):
2508         (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight):
2509         * rendering/RenderBoxModelObject.h:
2510         * rendering/RenderElement.cpp:
2511         (WebCore::RenderElement::removeChildInternal):
2512         * rendering/RenderFlexibleBox.cpp:
2513         (WebCore::RenderFlexibleBox::LineContext::LineContext):
2514         (WebCore::RenderFlexibleBox::RenderFlexibleBox):
2515         (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
2516         (WebCore::contentAlignmentNormalBehavior):
2517         (WebCore::RenderFlexibleBox::styleDidChange):
2518         (WebCore::RenderFlexibleBox::layoutBlock):
2519         (WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems):
2520         (WebCore::RenderFlexibleBox::clientLogicalBottomAfterRepositioning):
2521         (WebCore::RenderFlexibleBox::hasOrthogonalFlow):
2522         (WebCore::RenderFlexibleBox::flexBasisForChild):
2523         (WebCore::RenderFlexibleBox::crossAxisExtentForChild):
2524         (WebCore::RenderFlexibleBox::cachedChildIntrinsicContentLogicalHeight):
2525         (WebCore::RenderFlexibleBox::setCachedChildIntrinsicContentLogicalHeight):
2526         (WebCore::RenderFlexibleBox::clearCachedChildIntrinsicContentLogicalHeight):
2527         (WebCore::RenderFlexibleBox::childIntrinsicLogicalHeight):
2528         (WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth):
2529         (WebCore::RenderFlexibleBox::crossAxisIntrinsicExtentForChild):
2530         (WebCore::RenderFlexibleBox::mainAxisExtentForChild):
2531         (WebCore::RenderFlexibleBox::mainAxisContentExtentForChildIncludingScrollbar):
2532         (WebCore::RenderFlexibleBox::crossAxisExtent):
2533         (WebCore::RenderFlexibleBox::mainAxisExtent):
2534         (WebCore::RenderFlexibleBox::mainAxisContentExtent):
2535         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
2536         (WebCore::RenderFlexibleBox::transformedWritingMode):
2537         (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild):
2538         (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild):
2539         (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild):
2540         (WebCore::RenderFlexibleBox::crossAxisMarginExtentForChild):
2541         (WebCore::RenderFlexibleBox::flowAwareLocationForChild):
2542         (WebCore::RenderFlexibleBox::useChildAspectRatio):
2543         (WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing):
2544         (WebCore::RenderFlexibleBox::setFlowAwareLocationForChild):
2545         (WebCore::RenderFlexibleBox::mainAxisLengthIsDefinite):
2546         (WebCore::RenderFlexibleBox::crossAxisLengthIsDefinite):
2547         (WebCore::RenderFlexibleBox::cacheChildMainSize):
2548         (WebCore::RenderFlexibleBox::clearCachedMainSizeForChild):
2549         (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild):
2550         (WebCore::RenderFlexibleBox::layoutFlexItems):
2551         (WebCore::RenderFlexibleBox::autoMarginOffsetInMainAxis):
2552         (WebCore::RenderFlexibleBox::updateAutoMarginsInMainAxis):
2553         (WebCore::RenderFlexibleBox::hasAutoMarginsInCrossAxis):
2554         (WebCore::RenderFlexibleBox::availableAlignmentSpaceForChild):
2555         (WebCore::RenderFlexibleBox::updateAutoMarginsInCrossAxis):
2556         (WebCore::RenderFlexibleBox::marginBoxAscentForChild):
2557         (WebCore::RenderFlexibleBox::computeChildMarginValue):
2558         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
2559         (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution):
2560         (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution):
2561         (WebCore::RenderFlexibleBox::childLogicalHeightForPercentageResolution):
2562         (WebCore::RenderFlexibleBox::adjustChildSizeForAspectRatioCrossAxisMinAndMax):
2563         (WebCore::RenderFlexibleBox::constructFlexItem):
2564         (WebCore::RenderFlexibleBox::freezeViolations):
2565         (WebCore::RenderFlexibleBox::freezeInflexibleItems):
2566         (WebCore::RenderFlexibleBox::resolveFlexibleLengths):
2567         (WebCore::alignmentOffset):
2568         (WebCore::RenderFlexibleBox::setOverrideMainAxisContentSizeForChild):
2569         (WebCore::RenderFlexibleBox::staticMainAxisPositionForPositionedChild):
2570         (WebCore::RenderFlexibleBox::staticCrossAxisPositionForPositionedChild):
2571         (WebCore::RenderFlexibleBox::staticInlinePositionForPositionedChild):
2572         (WebCore::RenderFlexibleBox::staticBlockPositionForPositionedChild):
2573         (WebCore::RenderFlexibleBox::setStaticPositionForPositionedLayout):
2574         (WebCore::RenderFlexibleBox::prepareChildForPositionedLayout):
2575         (WebCore::RenderFlexibleBox::alignmentForChild):
2576         (WebCore::RenderFlexibleBox::resetAutoMarginsAndLogicalTopInCrossAxis):
2577         (WebCore::RenderFlexibleBox::needToStretchChildLogicalHeight):
2578         (WebCore::RenderFlexibleBox::childHasIntrinsicMainAxisSize):
2579         (WebCore::RenderFlexibleBox::crossAxisOverflowForChild):
2580         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
2581         (WebCore::RenderFlexibleBox::layoutColumnReverse):
2582         (WebCore::initialAlignContentOffset):
2583         (WebCore::alignContentSpaceBetweenChildren):
2584         (WebCore::RenderFlexibleBox::alignFlexLines):
2585         (WebCore::RenderFlexibleBox::adjustAlignmentForChild):
2586         (WebCore::RenderFlexibleBox::alignChildren):
2587         (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
2588         (WebCore::RenderFlexibleBox::flipForRightToLeftColumn):
2589         (WebCore::RenderFlexibleBox::flipForWrapReverse):
2590         (WebCore::RenderFlexibleBox::Violation::Violation): Deleted.
2591         (WebCore::RenderFlexibleBox::setCrossAxisExtent): Deleted.
2592         (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): Deleted.
2593         (WebCore::RenderFlexibleBox::mainAxisBorderAndPaddingExtentForChild): Deleted.
2594         (WebCore::RenderFlexibleBox::mainAxisScrollbarExtentForChild): Deleted.
2595         (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild): Deleted.
2596         (WebCore::RenderFlexibleBox::computeNextFlexLine): Deleted.
2597         (WebCore::RenderFlexibleBox::setLogicalOverrideSize): Deleted.
2598         (WebCore::RenderFlexibleBox::numberOfInFlowPositionedChildren): Deleted.
2599         (WebCore::RenderFlexibleBox::needToStretchChild): Deleted.
2600         (WebCore::contentAlignmentNormalBehaviorFlexibleBox): Deleted.
2601         * rendering/RenderFlexibleBox.h:
2602         (WebCore::RenderFlexibleBox::orderIterator):
2603         (WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
2604         * rendering/RenderFullScreen.h:
2605         * rendering/RenderGrid.cpp:
2606         (WebCore::selfAlignmentChangedToStretchInRowAxis):
2607         (WebCore::selfAlignmentChangedFromStretchInRowAxis):
2608         (WebCore::selfAlignmentChangedFromStretchInColumnAxis):
2609         (WebCore::RenderGrid::styleDidChange):
2610         (WebCore::RenderGrid::computeTrackBasedLogicalHeight):
2611         (WebCore::RenderGrid::computeTrackSizesForDefiniteSize):
2612         (WebCore::RenderGrid::gridGapForDirection):
2613         (WebCore::RenderGrid::guttersSize):
2614         (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize):
2615         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
2616         (WebCore::RenderGrid::trackSizesForComputedStyle):
2617         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
2618         (WebCore::RenderGrid::populateGridPositionsForDirection):
2619         (WebCore::RenderGrid::alignSelfForChild):
2620         (WebCore::RenderGrid::justifySelfForChild):
2621         (WebCore::RenderGrid::columnAxisPositionForChild):
2622         (WebCore::RenderGrid::rowAxisPositionForChild):
2623         (WebCore::RenderGrid::columnAxisOffsetForChild):
2624         (WebCore::RenderGrid::rowAxisOffsetForChild):
2625         (WebCore::RenderGrid::needToStretchChildLogicalHeight): Deleted.
2626         * rendering/RenderGrid.h:
2627         * rendering/RenderLayer.cpp:
2628         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
2629         * rendering/RenderListBox.cpp:
2630         (WebCore::RenderListBox::computeLogicalHeight):
2631         * rendering/RenderTable.cpp:
2632         (WebCore::RenderTable::layout):
2633         * rendering/RenderTableCell.cpp:
2634         (WebCore::RenderTableCell::layout):
2635         * rendering/RenderTableSection.cpp:
2636         (WebCore::shouldFlexCellChild):
2637         (WebCore::RenderTableSection::relayoutCellIfFlexed):
2638         (WebCore::RenderTableSection::layoutRows):
2639         * rendering/RenderTableSection.h:
2640         * rendering/RenderTextControl.cpp:
2641         (WebCore::RenderTextControl::computeLogicalHeight):
2642         * rendering/style/RenderStyle.cpp:
2643         (WebCore::resolvedSelfAlignment):
2644         (WebCore::RenderStyle::resolvedAlignSelf):
2645         (WebCore::RenderStyle::resolvedJustifySelf):
2646         * rendering/style/RenderStyle.h:
2647         * style/RenderTreeUpdater.cpp:
2648         (WebCore::textRendererIsNeeded):
2649
2650 2017-02-28  Alex Christensen  <achristensen@webkit.org>
2651
2652         Main resource requests need cachePartition
2653         https://bugs.webkit.org/show_bug.cgi?id=168806
2654         <rdar://30639764>
2655
2656         Reviewed by Brady Eidson.
2657
2658         Test: http/tests/security/credentials-main-resource.html
2659
2660         r211751 caused an unintended regression on pages whose main resource is protected
2661         by basic authentication.  We were not setting the cache partition for main resource
2662         requests, and we use the cache partition now for credentials, so the credentials for
2663         the main resource were not being put into a partition in the CredentialStorage that
2664         would not be used for subresources of the page, whose requests had the correct partition
2665         for the domain of the page.  This caused users to have to enter their credentials twice,
2666         once for the main resource and once for any subresources.  This is fixed by using the
2667         domain from the main resource request as the cache partition.  Elsewhere the Document is
2668         used to get the cache partition, but there is no Document yet when requesting the main resource.
2669
2670         * loader/DocumentLoader.cpp:
2671         (WebCore::DocumentLoader::startLoadingMainResource):
2672         Set the cache partition for the main resource loads based on the SecurityOrigin of the
2673         initial request if we are loading the main resource for a new top document.  If the main resource
2674         request is redirected, then we will still use the partition of the initial request because that is
2675         what the user requested and that is where the user entered the credentials.
2676         * loader/cache/CachedResourceLoader.h:
2677         * loader/cache/CachedResourceRequest.cpp:
2678         (WebCore::CachedResourceRequest::setDomainForCachePartition):
2679         * loader/cache/CachedResourceRequest.h:
2680
2681 2017-02-28  Alex Christensen  <achristensen@webkit.org>
2682
2683         REGRESSION: LayoutTest http/tests/security/credentials-iframes.html is failing on ios-simulator
2684         https://bugs.webkit.org/show_bug.cgi?id=167967
2685
2686         Reviewed by Brady Eidson.
2687
2688         XHR credentials have a persistence of CredentialPersistenceNone because we keep
2689         them in the WebCore::CredentialStorage.  We were storing them to CFNetwork's NSURLCredentialStorage
2690         on iOS and then they were being given as the proposedCredential in
2691         NetworkDataTaskCocoa::tryPasswordBasedAuthentication even though we set CredentialPersistenceNone.
2692
2693         This fixes http/tests/security/credentials-iframes.html
2694
2695         * platform/network/CredentialStorage.cpp:
2696         (WebCore::CredentialStorage::set):
2697         * platform/network/CredentialStorage.h:
2698         * platform/network/cf/CredentialStorageCFNet.cpp:
2699         (WebCore::CredentialStorage::saveToPersistentStorage): Deleted.
2700         * platform/network/mac/CredentialStorageMac.mm:
2701         (WebCore::CredentialStorage::saveToPersistentStorage): Deleted.
2702
2703 2017-02-27  Alex Christensen  <achristensen@webkit.org>
2704
2705         Fix WinCairo build.
2706
2707         * PlatformWinCairo.cmake:
2708
2709 2017-02-27  Alex Christensen  <achristensen@webkit.org>
2710
2711         Begin enabling WebRTC on 64-bit
2712         https://bugs.webkit.org/show_bug.cgi?id=168915
2713
2714         Reviewed by Eric Carlson.
2715
2716         * Configurations/FeatureDefines.xcconfig:
2717
2718 2017-02-27  Antoine Quint  <graouts@apple.com>
2719
2720         [Modern Media Controls] Use compact mode by default on macOS
2721         https://bugs.webkit.org/show_bug.cgi?id=168958
2722         <rdar://problem/30748638>
2723
2724         Reviewed by Jon Lee.
2725
2726         We now use the compact layout mode by default on macOS.
2727
2728         * Modules/modern-media-controls/controls/layout-item.js: Remove the ReducedPadding trait.
2729         * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css: 
2730         (.media-controls.mac.inline.compact .time-label,): Vertically align the time label with
2731         the scrubber in compact mode.
2732         (.media-controls.mac.inline.compact .scrubber.slider): Correctly position the scrubber in
2733         compact mode so that it's vertically aligned.
2734         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
2735         (MacOSInlineMediaControls.prototype.layoutTraitsDidChange): Remove handling of tight and
2736         reduced padding traits since these do not apply to macOS anymore. We also notify the
2737         scrubber of a layout trait change so that it may adjust its height.
2738         * Modules/modern-media-controls/controls/scrubber.js:
2739         (Scrubber):
2740         (Scrubber.prototype.layoutTraitsDidChange): Adjust the height of the scrubber to match
2741         compact layout traits.
2742         * Modules/modern-media-controls/controls/time-control.js:
2743         (TimeControl.prototype.get isSufficientlyWide): Adjust the minimum scrubber width for
2744         TimeControl visibility to match compact layout traits.
2745         * Modules/modern-media-controls/media/media-controller.js:
2746         (MediaController.prototype.get layoutTraits): Use the compact layout trait by default
2747         on macOS and make the tight padding specific to iOS.
2748
2749 2017-02-27  Antoine Quint  <graouts@apple.com>
2750
2751         [Modern Media Controls] Adhere to tight padding on iOS
2752         https://bugs.webkit.org/show_bug.cgi?id=168949
2753         <rdar://problem/30746164>
2754
2755         Reviewed by Jon Lee.
2756
2757         We used to only support custom margins on macOS, to support this on iOS as
2758         well, we promote the notification when the layoutTraits property is set to
2759         MediaControls and expose a new protected method layoutTraitsDidChange() for
2760         subclasses to implement. IOSInlineMediaControls now implements that method
2761         and will use tighter margins for the TightPadding layout trait.
2762
2763         Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-tight-padding.html
2764
2765         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
2766         (IOSInlineMediaControls.prototype.layoutTraitsDidChange):
2767         (IOSInlineMediaControls):
2768         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
2769         (MacOSInlineMediaControls.prototype.get layoutTraits): Deleted.
2770         (MacOSInlineMediaControls.prototype.set layoutTraits): Deleted.
2771         (MacOSInlineMediaControls.prototype._matchLayoutTraits): Deleted.
2772         * Modules/modern-media-controls/controls/media-controls.js:
2773         (MediaControls.prototype.get layoutTraits):
2774         (MediaControls.prototype.set layoutTraits):
2775         (MediaControls.prototype.layoutTraitsDidChange):
2776
2777 2017-02-27  Youenn Fablet  <youenn@apple.com>
2778
2779         [WebRTC] Support modern RTCStatsReport
2780         https://bugs.webkit.org/show_bug.cgi?id=166916
2781         <rdar://problem/30293780>
2782
2783         Reviewed by Alex Christensen.
2784
2785         Updating binding generator and IDL parser to handle maplike.
2786         Covered by binding tests.
2787
2788         Added support for maplike binding from JS wrapper to DOM class.
2789         The principle is to have the JSXX wrapper having a @backingMap slot containing a Map.
2790         All maplike methods are forwarded to the corresponding Map methods.
2791         The XX object is responsible to add key/value pairs using a helper routine.
2792         The creation of the Map is done at creation of the JSXX wrapper.
2793
2794         DOM class is interacting with the map through DOMMapLike.
2795         Extracted DOMGuarded from DOM promise implementation.
2796         This allows reusing this code for DOMMapLike.
2797
2798         Covered by binding tests and manual tests.
2799
2800         * CMakeLists.txt:
2801         * DerivedSources.make:
2802         * Modules/mediastream/RTCStatsReport.h:
2803         (WebCore::RTCStatsReport::InboundRTPStreamStats::InboundRTPStreamStats):
2804         (WebCore::RTCStatsReport::OutboundRTPStreamStats::OutboundRTPStreamStats):
2805         (WebCore::RTCStatsReport::create):
2806         (WebCore::RTCStatsReport::synchronizeBackingMap):
2807         (WebCore::RTCStatsReport::backingMap):
2808         (WebCore::RTCStatsReport::addStats):
2809         * Modules/mediastream/RTCStatsReport.idl:
2810         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2811         (WebCore::fromStdString):
2812         (WebCore::fillRTCStats):
2813         (WebCore::fillRTCRTPStreamStats):
2814         (WebCore::fillInboundRTPStreamStats):
2815         (WebCore::fillOutboundRTPStreamStats):
2816         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
2817         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
2818         * WebCore.xcodeproj/project.pbxproj:
2819         * bindings/js/JSDOMBindingInternals.js: Added.
2820         (mapLikeForEach):
2821         * bindings/js/JSDOMGlobalObject.cpp:
2822         (WebCore::JSDOMGlobalObject::visitChildren):
2823         * bindings/js/JSDOMGlobalObject.h:
2824         * bindings/js/JSDOMGuardedObject.cpp: Added.
2825         (WebCore::DOMGuardedObject::DOMGuardedObject):
2826         (WebCore::DOMGuardedObject::~DOMGuardedObject):
2827         (WebCore::DOMGuardedObject::clear):
2828         (WebCore::DOMGuardedObject::contextDestroyed):
2829         * bindings/js/JSDOMGuardedObject.h: Added.
2830         (WebCore::DOMGuardedObject::isSuspended):
2831         (WebCore::DOMGuardedObject::visitAggregate):
2832         (WebCore::DOMGuardedObject::guardedObject):
2833         (WebCore::DOMGuardedObject::globalObject):
2834         (WebCore::DOMGuardedObject::isEmpty):
2835         (WebCore::DOMGuarded::DOMGuarded):
2836         (WebCore::DOMGuarded::guarded):
2837         * bindings/js/JSDOMMapLike.cpp: Added.
2838         (WebCore::getBackingMap):
2839         (WebCore::initializeBackingMap):
2840         (WebCore::createBackingMap):
2841         (WebCore::forwardAttributeGetterToBackingMap):
2842         (WebCore::forwardFunctionCallToBackingMap):
2843         (WebCore::forwardForEachCallToBackingMap):
2844         * bindings/js/JSDOMMapLike.h: Added.
2845         (WebCore::DOMMapLike::set):
2846         (WebCore::synchronizeBackingMap):
2847         (WebCore::forwardSizeToMapLike):
2848         (WebCore::forwardEntriesToMapLike):
2849         (WebCore::forwardKeysToMapLike):
2850         (WebCore::forwardValuesToMapLike):
2851         (WebCore::forwardClearToMapLike):
2852         (WebCore::forwardForEachToMapLike):
2853         (WebCore::forwardHasToMapLike):
2854         (WebCore::forwardAddToMapLike):
2855         (WebCore::forwardDeleteToMapLike):
2856         * bindings/js/JSDOMPromise.cpp:
2857         (WebCore::DeferredPromise::promise):
2858         (WebCore::DeferredPromise::reject):
2859         * bindings/js/JSDOMPromise.h:
2860         (WebCore::DeferredPromise::resolve):
2861         (WebCore::DeferredPromise::resolveWithNewlyCreated):
2862         (WebCore::DeferredPromise::reject):
2863         (WebCore::DeferredPromise::resolveWithCallback):
2864         (WebCore::DeferredPromise::rejectWithCallback):
2865         (WebCore::DeferredPromise::DeferredPromise):
2866         (WebCore::DeferredPromise::deferred):
2867         * bindings/js/WebCoreBuiltinNames.h:
2868         * bindings/scripts/CodeGeneratorJS.pm:
2869         (PrototypeFunctionCount):
2870         (GeneratePropertiesHashTable):
2871         (InterfaceNeedsIterator):
2872         (GenerateImplementation):
2873         (GenerateParametersCheck):
2874         * bindings/scripts/IDLParser.pm:
2875         (assert):
2876         (parseAttributeOrOperationOrIterator):
2877         (parseSerializer):
2878         (parseAttributeOrOperationRest):
2879         (parseAttribute):
2880         (parseAttributeRest):
2881         (parseOperationOrIterator):
2882         (parseOptionalIterableInterface):
2883         (parseMapLikeRest):
2884         (parseMapLikeProperties):
2885         (parseOperationRest):
2886         (applyMemberList):
2887         * bindings/scripts/test/JS/JSMapLike.cpp: Added.
2888         * bindings/scripts/test/JS/JSMapLike.h: Added.
2889         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: Added.
2890         * bindings/scripts/test/JS/JSReadOnlyMapLike.h: Added.
2891         * bindings/scripts/test/TestMapLike.idl: Added.
2892         * bindings/scripts/test/TestReadOnlyMapLike.idl: Added.
2893
2894 2017-02-27  Mark Lam  <mark.lam@apple.com>
2895
2896         Introduce a VM Traps mechanism and refactor Watchdog to use it.
2897         https://bugs.webkit.org/show_bug.cgi?id=168842
2898
2899         Reviewed by Filip Pizlo.
2900
2901         No new tests needed because this is a re-implementation of existing functionality.
2902
2903         * bindings/js/WorkerScriptController.cpp:
2904         (WebCore::WorkerScriptController::WorkerScriptController):
2905         (WebCore::WorkerScriptController::scheduleExecutionTermination):
2906
2907 2017-02-27  Andy Estes  <aestes@apple.com>
2908
2909         [Cocoa] Rename FileMac.mm to FileCocoa.mm
2910         https://bugs.webkit.org/show_bug.cgi?id=168947
2911
2912         Reviewed by Zalan Bujtas.
2913
2914         * PlatformMac.cmake:
2915         * WebCore.xcodeproj/project.pbxproj:
2916         * fileapi/FileCocoa.mm: Renamed from Source/WebCore/fileapi/FileMac.mm.
2917
2918 2017-02-27  Andy Estes  <aestes@apple.com>
2919
2920         [iOS] Enable file replacement
2921         https://bugs.webkit.org/show_bug.cgi?id=168907
2922         <rdar://problem/22258242>
2923
2924         Reviewed by David Kilzer.
2925
2926         Covered by existing tests.
2927
2928         * fileapi/FileMac.mm:
2929         (WebCore::File::shouldReplaceFile): Stop using Carbon and AppKit API for determining if a
2930         file path is a file package. Use NSURL and CoreServices instead, which exist on Mac and iOS.
2931
2932 2017-02-27  Antoine Quint  <graouts@apple.com>
2933
2934         [Modern Media Controls] Use a solid background for <audio> controls on macOS
2935         https://bugs.webkit.org/show_bug.cgi?id=168941
2936         <rdar://problem/30744316>
2937
2938         Reviewed by Dean Jackson.
2939
2940         Use a solid background for <audio> elements on macOS, the same way we do on iOS.
2941
2942         Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-audio-background.html
2943
2944         * Modules/modern-media-controls/controls/macos-media-controls.css:
2945         (:host(audio) .media-controls.mac.inline > .controls-bar):
2946         (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint):
2947
2948 2017-02-27  Antoine Quint  <graouts@apple.com>
2949
2950         [Modern Media Controls] StatusLabel should use similar properties to TimeLabel
2951         https://bugs.webkit.org/show_bug.cgi?id=168938
2952         <rdar://problem/30743185>
2953
2954         Reviewed by Dean Jackson.
2955
2956         Ensure we use the same styling properties for StatusLabel and TimeLabel.
2957
2958         Tests: media/modern-media-controls/status-label/status-label-ios.html
2959                media/modern-media-controls/status-label/status-label-macos.html
2960
2961         * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
2962         (.media-controls.ios.inline .time-label,):
2963         (.media-controls.ios.inline .time-label): Deleted.
2964         * Modules/modern-media-controls/controls/macos-media-controls.css:
2965         (.media-controls.mac > .controls-bar .time-label,):
2966         (.media-controls.mac > .controls-bar .time-label): Deleted.
2967         * Modules/modern-media-controls/controls/status-label.css:
2968         (.status-label):
2969
2970 2017-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
2971
2972         Rename ICU cursor iterator to caret iterator
2973         https://bugs.webkit.org/show_bug.cgi?id=168206
2974
2975         Reviewed by Simon Fraser.
2976
2977         Mechanical find/replace.
2978
2979         No new tests because there is no behavior change.
2980
2981         * platform/graphics/ComplexTextController.cpp:
2982         (WebCore::ComplexTextController::offsetForPosition):
2983         * rendering/RenderText.cpp:
2984         (WebCore::RenderText::previousOffset):
2985         (WebCore::RenderText::nextOffset):
2986
2987 2017-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
2988
2989         Unprefix -webkit-line-break
2990         https://bugs.webkit.org/show_bug.cgi?id=168213
2991
2992         Reviewed by Darin Adler.
2993
2994         We support the property as specced.
2995
2996         Test: fast/text/line-break-unprefixed.html
2997
2998         * css/CSSComputedStyleDeclaration.cpp:
2999         (WebCore::ComputedStyleExtractor::propertyValue):
3000         * css/CSSProperties.json:
3001         * css/parser/CSSParserFastPaths.cpp:
3002         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3003         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
3004         * editing/Editor.cpp:
3005         (WebCore::Editor::applyEditingStyleToElement):
3006         * html/HTMLElement.cpp:
3007         (WebCore::HTMLElement::collectStyleForPresentationAttribute):
3008
3009 2017-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
3010
3011         Use RAII for ICU breaking iterators
3012         https://bugs.webkit.org/show_bug.cgi?id=168203
3013
3014         Reviewed by Simon Fraser.
3015
3016         No new tests because there is no behavior change.
3017
3018         * platform/graphics/ComplexTextController.cpp:
3019         (WebCore::ComplexTextController::offsetForPosition):
3020         * rendering/RenderText.cpp:
3021         (WebCore::RenderText::previousOffset):
3022         (WebCore::RenderText::nextOffset):
3023
3024 2017-02-27  Basuke Suzuki  <Basuke.Suzuki@am.sony.com>
3025
3026         [WinCairo][MiniBrowser] Add ca-bundle to display secure pages
3027         https://bugs.webkit.org/show_bug.cgi?id=168486
3028
3029         Reviewed by Alex Christensen.
3030
3031         change the order of path location search to make it possible to 
3032         configure with environment variable because bundled ca-bundle is
3033         always available now.
3034
3035         * platform/network/curl/ResourceHandleManager.cpp:
3036         (WebCore::certificatePath):
3037
3038 2017-02-27  Antoine Quint  <graouts@apple.com>
3039
3040         [Modern Media Controls] Status text does not appear on iOS
3041         https://bugs.webkit.org/show_bug.cgi?id=168918
3042         <rdar://problem/30737644>
3043
3044         Reviewed by Dean Jackson.
3045
3046         We refactor the layout code out of MacOSInlineMediaControls and into a new
3047         InlineLayoutSupport class which IOSInlineMediaControls uses as well. Now
3048         both the macOS and iOS inline media controls run the same layout logic to
3049         control whether the status label or scrubber should be displayed, and which
3050         controls should be dropped due to space constraints.
3051
3052         Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-status-label.html
3053
3054         * Modules/modern-media-controls/controls/inline-layout-support.js: Added.
3055         (InlineLayoutSupport):
3056         (InlineLayoutSupport.prototype.childrenAfterPerformingLayout):
3057         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
3058         (IOSInlineMediaControls.prototype.layout):
3059         (IOSInlineMediaControls):
3060         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
3061         (MacOSInlineMediaControls.prototype.layout):
3062         * Modules/modern-media-controls/js-files:
3063
3064 2017-02-27  Simon Fraser  <simon.fraser@apple.com>
3065
3066         Add specification and status metadata to CSSProperties.json, and validate it
3067         https://bugs.webkit.org/show_bug.cgi?id=168901
3068
3069         Reviewed by Darin Adler.
3070
3071         Annotate CSS properties with data about the WebKit development status, and
3072         where they are specified. A property has a canonical specification reference,
3073         but individual values may have a reference to a more recent spec.
3074
3075         Add a list of specifications to the JSON that properties reference by key.
3076
3077         Enhance check-webkit-style to validate the status and spec data.
3078
3079         * css/CSSProperties.json:
3080
3081 2017-02-27  Jiewen Tan  <jiewen_tan@apple.com>
3082
3083         [CredentialManagement] Add IDL definitions for Credential, SiteBoundCredential, and PasswordCredential
3084         https://bugs.webkit.org/show_bug.cgi?id=168616
3085         <rdar://problem/30167149>
3086
3087         Reviewed by Daniel Bates.
3088
3089         This patch adds IDL definitions for:
3090         1. Credential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-credential),
3091         2. SiteBoundCredential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-siteboundcredential), and
3092         3. PasswordCredential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-passwordcredential).
3093
3094         Test: credentials/idlharness.html
3095
3096         * CMakeLists.txt:
3097         * DerivedSources.make:
3098         * Modules/credentials/BasicCredential.cpp: Added.
3099         (WebCore::BasicCredential::BasicCredential):
3100         (WebCore::BasicCredential::~BasicCredential):
3101         (WebCore::BasicCredential::type):
3102         * Modules/credentials/BasicCredential.h: Added.
3103         (WebCore::BasicCredential::id):
3104         * Modules/credentials/BasicCredential.idl: Added.
3105         * Modules/credentials/CredentialData.h: Added.
3106         * Modules/credentials/CredentialData.idl: Added.
3107         * Modules/credentials/PasswordCredential.cpp: Added.
3108         (WebCore::PasswordCredential::PasswordCredential):
3109         (WebCore::PasswordCredential::PasswordCredential):
3110         Dummy constructors for now.
3111         * Modules/credentials/PasswordCredential.h: Added.
3112         (WebCore::PasswordCredential::create):
3113         (WebCore::PasswordCredential::create):
3114         (WebCore::PasswordCredential::setIdName):
3115         (WebCore::PasswordCredential::idName):
3116         (WebCore::PasswordCredential::setPasswordName):
3117         (WebCore::PasswordCredential::passwordName):
3118         (WebCore::PasswordCredential::setAdditionalData):
3119         (WebCore::PasswordCredential::additionalData):
3120         * Modules/credentials/PasswordCredential.idl: Added.
3121         * Modules/credentials/SiteBoundCredential.cpp: Added.
3122         (WebCore::SiteBoundCredential::SiteBoundCredential):
3123         (WebCore::SiteBoundCredential::~SiteBoundCredential):
3124         * Modules/credentials/SiteBoundCredential.h: Added.
3125         (WebCore::SiteBoundCredential::name):
3126         (WebCore::SiteBoundCredential::iconURL):
3127         (WebCore::SiteBoundCredential::setOrigin):
3128         (WebCore::SiteBoundCredential::origin):
3129         * Modules/credentials/SiteBoundCredential.idl: Added.
3130         * Modules/credentials/SiteBoundCredentialData.h: Added.
3131         * Modules/credentials/SiteBoundCredentialData.idl: Added.
3132         * WebCore.xcodeproj/project.pbxproj:
3133
3134 2017-02-27  Jer Noble  <jer.noble@apple.com>
3135
3136         [WebRTC] Fix remote audio rendering
3137         https://bugs.webkit.org/show_bug.cgi?id=168898
3138
3139         Reviewed by Eric Carlson.
3140
3141         Test: webrtc/audio-peer-connection-webaudio.html
3142
3143         Fix MediaStreamAudioSourceNode by not bailing out early if the input sample rate doesn't match
3144         the AudioContext's sample rate; there's code in setFormat() to do the sample rate conversion
3145         correctly.
3146
3147         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
3148         (WebCore::MediaStreamAudioSourceNode::setFormat):
3149
3150         Fix AudioSampleBufferList by making the AudioConverter input proc a free function, and passing
3151         its refCon a struct containing only the information it needs to perform its task. Because the
3152         conversion may result in a different number of output samples than input ones, just ask to
3153         generate the entire capacity of the scratch buffer, and signal that the input buffer was fully
3154         converted with a special return value.
3155
3156         * platform/audio/mac/AudioSampleBufferList.cpp:
3157         (WebCore::audioConverterFromABLCallback):
3158         (WebCore::AudioSampleBufferList::copyFrom):
3159         (WebCore::AudioSampleBufferList::convertInput): Deleted.
3160         (WebCore::AudioSampleBufferList::audioConverterCallback): Deleted.
3161         * platform/audio/mac/AudioSampleBufferList.h:
3162
3163         Fix AudioSampleDataSource by updating both the sampleCount and the sampleTime after doing
3164         a sample rate conversion to take into account that both the number of samples may have changed,
3165         as well as the timeScale of the sampleTime. This may result in small off-by-one rounding errors
3166         due to the sample rate conversion of sampleTime, so remember what the next expected sampleTime
3167         should be, and correct sampleTime if it is indeed off-by-one. If the pull operation has gotten
3168         ahead of the push operation, delay the next pull by the empty amount by rolling back the
3169         m_outputSampleOffset. Introduce the same offset behavior during pull operations.
3170
3171         * platform/audio/mac/AudioSampleDataSource.h:
3172         * platform/audio/mac/AudioSampleDataSource.mm:
3173         (WebCore::AudioSampleDataSource::pushSamplesInternal):
3174         (WebCore::AudioSampleDataSource::pullSamplesInternal):
3175         (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
3176
3177         Fix MediaPlayerPrivateMediaStreamAVFObjC by obeying the m_muted property.
3178
3179         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3180         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume):
3181         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted):
3182
3183         Fix LibWebRTCAudioModule by sleeping for the correct amount after emitting frames. Previously,
3184         LibWebRTCAudioModule would sleep for a fixed amount of time, which meant it would get slowly out
3185         of sync when emitting frames took a non-zero amount of time. Now, the amount of time before the
3186         next cycle starts is correctly calculated, and then LibWebRTCAudioModule sleeps for a dynamic amount
3187         of time in order to wake up correctly at the beginning of the next cycle.
3188
3189         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp:
3190         (WebCore::LibWebRTCAudioModule::StartPlayoutOnAudioThread):
3191
3192         Fix AudioTrackPrivateMediaStreamCocoa by just using the output unit's preferred format
3193         description (with the current system sample rate), rather than whatever is the current
3194         input description.
3195
3196         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
3197         (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
3198         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
3199         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
3200
3201         Fix RealtimeIncomingAudioSource by actually creating an AudioSourceProvider when asked.
3202
3203         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
3204         (WebCore::RealtimeIncomingAudioSource::OnData):
3205         (WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
3206         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
3207
3208         Fix RealtimeOutgoingAudioSource by using the outgoing format description rather than the
3209         incoming one to determine the sample rate, channel count, sample byte size, etc., to use
3210         when delivering data upstream to libWebRTC.
3211
3212         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
3213         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
3214         (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
3215         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
3216
3217         Fix WebAudioSourceProviderAVFObjC by using a AudioSampleDataSource to do format and sample
3218         rate conversion rather than trying to duplicate all that code and use a CARingBuffer and 
3219         AudioConverter directly.
3220
3221         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
3222         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
3223         (WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
3224         (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
3225         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
3226         (WebCore::WebAudioSourceProviderAVFObjC::unprepare):
3227         (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
3228
3229         Fix the MockLibWebRTCAudioTrack by passing along the AddSink() sink to its AudioSourceInterface,
3230         allowing the RealtimeOutgoingAudioSource to push data into the libWebRTC network stack. Also,
3231         make sure m_enabled is initialized to a good value.
3232
3233         * testing/MockLibWebRTCPeerConnection.h:
3234
3235 2017-02-21  Jer Noble  <jer.noble@apple.com>
3236
3237         AudioSampleDataSource should not exclusively lock its read and write threads.
3238         https://bugs.webkit.org/show_bug.cgi?id=168646
3239
3240         Reviewed by Eric Carlson.
3241
3242         Locking the write thread causes the read thread to drop audio samples and generates audible
3243         glitches, and the realtime audio thread backing the read thread should never block. There's
3244         no real reason to lock these threads against one another here; they both rely on the
3245         CARingBuffer to safely and simultaneously read and write data.
3246
3247         * platform/audio/mac/AudioSampleDataSource.cpp:
3248         (WebCore::AudioSampleDataSource::setPaused):
3249         (WebCore::AudioSampleDataSource::pushSamplesInternal):
3250         (WebCore::AudioSampleDataSource::pushSamples):
3251         (WebCore::AudioSampleDataSource::pullSamplesInternal):
3252         (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
3253         (WebCore::AudioSampleDataSource::pullSamples):
3254         * platform/audio/mac/AudioSampleDataSource.h:
3255
3256 2017-02-21  Jer Noble  <jer.noble@apple.com>
3257
3258         AudioTrackPrivateMediaStreamCocoa should not exclusively lock its read and write threads.
3259         https://bugs.webkit.org/show_bug.cgi?id=168643
3260
3261         Reviewed by Eric Carlson.
3262
3263         Locking the write thread causes the read thread to drop audio samples and generates audible
3264         glitches, and the realtime audio thread backing the read thread should never block. There's
3265         no real reason to lock these threads against one another here; they both rely on the
3266         AudioSampleDataSource and it's CARingBuffer to safely and simultaneously read and write
3267         data.
3268
3269         The one piece which locks previously protected against unsafe access was during creation of
3270         the audio unit.  Without a lock, the audio unit could begin playback after the unit was
3271         created and assigned to m_remoteIOUnit but before the ring buffer was created. To protect
3272         against this possibility, create the unit, set the input and output descriptions, but only
3273         assign the new audio unit to m_remoteIOUnit after the ring buffer has been created and
3274         initialized.
3275
3276         * platform/audio/mac/CAAudioStreamDescription.h:
3277         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
3278         (WebCore::AudioTrackPrivateMediaStreamCocoa::~AudioTrackPrivateMediaStreamCocoa):
3279         (WebCore::AudioTrackPrivateMediaStreamCocoa::playInternal):
3280         (WebCore::AudioTrackPrivateMediaStreamCocoa::play):
3281         (WebCore::AudioTrackPrivateMediaStreamCocoa::pause):
3282         (WebCore::AudioTrackPrivateMediaStreamCocoa::setVolume):
3283         (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
3284         (WebCore::AudioTrackPrivateMediaStreamCocoa::setupAudioUnit): Renamed to createAudioUnit()
3285         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
3286         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
3287
3288 2017-02-27  Youenn Fablet  <youenn@apple.com>
3289
3290         [WebRTC] RealtimOutgoingVideoSource should not need to do image conversion
3291         https://bugs.webkit.org/show_bug.cgi?id=168802
3292
3293         Reviewed by Jon Lee.
3294
3295         Covered by manual testing as mock sources do not hit the same code path.
3296
3297         * platform/mediastream/mac/AVVideoCaptureSource.h:
3298         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3299         (WebCore::AVVideoCaptureSource::currentFrameCGImage):
3300         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
3301         (WebCore::RealtimeOutgoingVideoSource::sendFrame):
3302         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
3303         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
3304
3305 2017-02-27  Carlos Garcia Campos  <cgarcia@igalia.com>
3306
3307         [GTK] Downloads attributes tests are failing
3308         https://bugs.webkit.org/show_bug.cgi?id=168871
3309
3310         Reviewed by Michael Catanzaro.
3311
3312         Use libsoup to get the suggested filename from the Content-Disposition header instead of buggy
3313         filenameFromHTTPContentDisposition().
3314
3315         Fixes: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html
3316                fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html
3317
3318         * platform/network/soup/ResourceResponseSoup.cpp:
3319         (WebCore::ResourceResponse::platformSuggestedFilename):
3320
3321 2017-02-27  Antoine Quint  <graouts@apple.com>
3322
3323         [Modern Media Controls] Dragging controls in fullscreen on macOS prevents scrubbing or interacting with controls
3324         https://bugs.webkit.org/show_bug.cgi?id=168820
3325         <rdar://problem/30690281>
3326
3327         Reviewed by Jon Lee.
3328
3329         We broke this in https://bugs.webkit.org/show_bug.cgi?id=168755. We restore the check that the
3330         event target when initiating a drag is the controls bar itself and not some of its content.
3331
3332         Since this wasn't caught by our existing tests, we add a test that attemps to initiate a drag
3333         starting over one of the controls and notice that no dragging occurs.
3334
3335         We also fix an issue where we wouldn't update the layout of the left container as its icon
3336         buttons would load, which would cause the layout width of the left container to be incorrect
3337         and the related tests to time out.
3338
3339         Test: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html
3340
3341         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
3342         (MacOSFullscreenMediaControls.prototype.layout):
3343         (MacOSFullscreenMediaControls.prototype._handleMousedown):
3344
3345 2017-02-27  Alex Christensen  <achristensen@webkit.org>
3346
3347         [libwebrtc] Enable WebRTC in some Production Builds
3348         https://bugs.webkit.org/show_bug.cgi?id=168858
3349
3350         * Configurations/FeatureDefines.xcconfig:
3351
3352 2017-02-27  Zan Dobersek  <zdobersek@igalia.com>
3353
3354         [TextureMapper] Clean up BitmapTextureGL construction
3355         https://bugs.webkit.org/show_bug.cgi?id=168909
3356
3357         Reviewed by Carlos Garcia Campos.
3358
3359         Have the BitmapTextureGL constructor accept an rvalue reference pointer
3360         to the GraphicsContext3D object. A static create() method is also added
3361         to help with constructing these objects. Construction sites are updated
3362         appropriately.
3363
3364         The BitmapTextureGL constructor is further cleaned up by moving default
3365         member initializations together with the member declarations.
3366
3367         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3368         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
3369         * platform/graphics/texmap/BitmapTextureGL.cpp:
3370         (WebCore::BitmapTextureGL::BitmapTextureGL):
3371         * platform/graphics/texmap/BitmapTextureGL.h:
3372         * platform/graphics/texmap/BitmapTexturePool.cpp:
3373         (WebCore::BitmapTexturePool::createTexture):
3374         * platform/graphics/texmap/TextureMapperGL.cpp:
3375         (WebCore::TextureMapperGL::createTexture):
3376
3377 2017-02-27  Zan Dobersek  <zdobersek@igalia.com>
3378
3379         [TextureMapper] Remove InterpolationQuality, TextDrawingModeFlags member variables
3380         https://bugs.webkit.org/show_bug.cgi?id=168906
3381
3382         Reviewed by Carlos Garcia Campos.
3383
3384         Remove the InterpolationQuality and TextDrawingModeFlags member variables from the
3385         TextureMapper class. These weren't modified anywhere in the code.
3386
3387         BitmapTexture::updateContents() still sets the image interpolation quality and
3388         drawing mode on the ImageBuffer's GraphicsContext, but now uses the default
3389         InterpolationDefault and TextModeFill values.
3390
3391         * platform/graphics/texmap/BitmapTexture.cpp:
3392         (WebCore::BitmapTexture::updateContents):
3393         * platform/graphics/texmap/TextureMapper.cpp:
3394         (WebCore::TextureMapper::TextureMapper): Deleted.
3395         (WebCore::TextureMapper::~TextureMapper): Deleted.
3396         * platform/graphics/texmap/TextureMapper.h:
3397         (WebCore::TextureMapper::setImageInterpolationQuality): Deleted.
3398         (WebCore::TextureMapper::setTextDrawingMode): Deleted.
3399         (WebCore::TextureMapper::imageInterpolationQuality): Deleted.
3400         (WebCore::TextureMapper::textDrawingMode): Deleted.
3401
3402 2017-02-26  Zan Dobersek  <zdobersek@igalia.com>
3403
3404         [CoordinatedGraphics] Remove CoordinatedGraphicsScene::paintToGraphicsContext()
3405         https://bugs.webkit.org/show_bug.cgi?id=168903
3406
3407         Reviewed by Carlos Garcia Campos.
3408
3409         Remove the GraphicsContext pointer member from the TextureMapper class
3410         since the getter and setter methods are not used anywhere.
3411