[GTK] fast/canvas/canvas-createPattern-video-loading.html makes its subsequent test...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         [GTK] fast/canvas/canvas-createPattern-video-loading.html makes its subsequent test timeout
4         https://bugs.webkit.org/show_bug.cgi?id=169019
5
6         Reviewed by Xabier Rodriguez-Calvar.
7
8         The timeout happens normally when the media player is deleted and the pipeline state is set to NULL. The call to
9         gst_element_set_state() never returns because of different deadlocks with the video sink. Sometimes the deadlock
10         happens with the sample mutex used by VideoRenderRequestScheduler. VideoRenderRequestScheduler::requestRender()
11         calls webkitVideoSinkRepaintRequested() with the lock held, that ends up calling
12         MediaPlayerPrivateGStreamerBase::triggerRepaint(). When rendering can't be accelerated the draw timer is
13         scheduled and triggerRepaint blocks until the timer is fired. If the media player is destroyed before the timer
14         is fired, when setting the pipeline state to NULL, other VideoRenderRequestScheduler methods can be called, like
15         stop() that tries to get the sample mutex that is still held by requestRender(). So, first we need to make
16         sure that requestRender() releases the lock before calling webkitVideoSinkRepaintRequested(). But that's not
17         enough, we also need to ensure that the pipeline is set to NULL state after everyting has been properly
18         stopped. This is currently done in ~MediaPlayerPrivateGStreamer that happens before
19         ~MediaPlayerPrivateGStreamerBase, so gst_element_set_state() is hanging before allowing the
20         MediaPlayerPrivateGStreamerBase to be cleaned up. We should move the call to the end of
21         ~MediaPlayerPrivateGStreamerBase and ensure the draw timer and mutex are properly cleaned up before.
22
23         Fixes: fast/canvas/canvas-createPattern-video-loading.html
24
25         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
26         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): Do not reset pipeline here.
27         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
28         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): Stop the draw mutex and notify the
29         lock to ensure we unblock. Do the pipeline reset at the end.
30         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
31         (VideoRenderRequestScheduler::requestRender): Release the mutex lock before calling webkitVideoSinkRepaintRequested().
32
33 2017-03-01  Tomas Popela  <tpopela@redhat.com>
34
35         Unreviewed compiler warning fix after r213218
36
37         * platform/gtk/PlatformKeyboardEventGtk.cpp:
38         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
39
40 2017-03-01  Tomas Popela  <tpopela@redhat.com>
41
42         [Cairo] Incorrectly determining height in GraphicsContext::roundToDevicePixels()
43         https://bugs.webkit.org/show_bug.cgi?id=169031
44
45         Reviewed by Carlos Garcia Campos.
46
47         We should compare if height is between -1 and 0 and not mixing height
48         and width together.
49
50         * platform/graphics/cairo/GraphicsContextCairo.cpp:
51         (WebCore::GraphicsContext::roundToDevicePixels):
52
53 2017-03-01  Tomas Popela  <tpopela@redhat.com>
54
55         [GTK] Fix problems found by Coverity scan in platform's keyboard and mouse events
56         https://bugs.webkit.org/show_bug.cgi?id=169028
57
58         Reviewed by Carlos Garcia Campos.
59
60         * platform/gtk/PlatformKeyboardEventGtk.cpp:
61         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Initialize
62         the m_handledByInputMethod member.
63         * platform/gtk/PlatformMouseEventGtk.cpp:
64         (WebCore::PlatformMouseEvent::PlatformMouseEvent): Initialize the
65         m_modifierFlags member.
66
67 2017-03-01  Andreas Kling  <akling@apple.com>
68
69         Move MemoryPressureHandler to WTF
70         <https://webkit.org/b/168908>
71
72         Reviewed by Sam Weinig.
73
74         * CMakeLists.txt:
75         * PlatformMac.cmake:
76         * PlatformWin.cmake:
77         * WebCore.xcodeproj/project.pbxproj:
78         * bindings/js/ScriptController.cpp:
79         * history/PageCache.cpp:
80         * html/HTMLMediaElement.cpp:
81         * inspector/InspectorInstrumentation.h:
82         * inspector/InspectorMemoryAgent.h:
83         * page/FrameView.cpp:
84         * page/MemoryRelease.h:
85         * page/linux/ResourceUsageThreadLinux.cpp:
86         * platform/Linux.cmake:
87         * platform/graphics/FontCache.cpp:
88         * platform/graphics/WidthCache.h:
89         * platform/graphics/ca/TileController.cpp:
90         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
91         * platform/ios/LegacyTileCache.mm:
92         * platform/ios/LegacyTileGrid.mm:
93         * platform/ios/LegacyTileLayerPool.mm:
94         * platform/ios/TileControllerMemoryHandlerIOS.cpp:
95         * testing/Internals.cpp:
96
97 2017-03-01  Per Arne Vollan  <pvollan@apple.com>
98
99         [Win] Popup menus are too small in HiDPI mode.
100         https://bugs.webkit.org/show_bug.cgi?id=168965
101
102         Reviewed by Brent Fulgham.
103
104         Scale font with device scale factor.
105
106         * platform/win/PopupMenuWin.cpp:
107         (WebCore::PopupMenuWin::show):
108         (WebCore::PopupMenuWin::calculatePositionAndSize):
109         (WebCore::PopupMenuWin::paint):
110         * platform/win/PopupMenuWin.h:
111
112 2017-03-01  Joseph Pecoraro  <pecoraro@apple.com>
113
114         [WebRTC] Install libwebrtc.dylib inside of WebCore.framework
115         https://bugs.webkit.org/show_bug.cgi?id=168859
116
117         Reviewed by Dan Bernstein.
118
119         * Configurations/WebCore.xcconfig:
120         Set library search path to find the libwebrtc.dylib inside of WebCore's Frameworks
121         or in the WK_OVERRIDE_FRAMEWORKS_DIR.
122
123 2017-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
124
125         Addressing post-review comments on r213163
126         https://bugs.webkit.org/show_bug.cgi?id=168678
127
128         Unreviewed.
129
130         No new tests because there is no behavior change.
131
132         * platform/graphics/cocoa/FontCacheCoreText.cpp:
133         (WebCore::platformFontLookupWithFamily):
134
135 2017-02-28  Simon Fraser  <simon.fraser@apple.com>
136
137         Don't use the LinearGlyphMask format if accelerated drawing is disabled
138         https://bugs.webkit.org/show_bug.cgi?id=168997
139
140         Reviewed by Tim Horton.
141
142         Non-accelerated drawing doesn't work into LinearGlyphMask-format backing store,
143         so don't use that backing store format when accelerated drawing is disabled.
144
145         * platform/graphics/ca/PlatformCALayer.cpp:
146         (WebCore::PlatformCALayer::drawRepaintIndicator):
147         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
148         (layerContentsFormat):
149         (PlatformCALayerCocoa::updateContentsFormat):
150
151 2017-02-28  Simon Fraser  <simon.fraser@apple.com>
152
153         Make the repaint indicators show subpixel antialiased text indication a bit more clearly
154         https://bugs.webkit.org/show_bug.cgi?id=168988
155
156         Reviewed by Tim Horton.
157
158         Put a more obvious stroke around the repaint count when subpixel-antialiased layer text is enabled.
159
160         * platform/graphics/ca/PlatformCALayer.cpp:
161         (WebCore::PlatformCALayer::drawRepaintIndicator):
162         (WebCore::PlatformCALayer::drawTextAtPoint):
163         * platform/graphics/ca/PlatformCALayer.h:
164         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
165         (PlatformCALayerWin::drawTextAtPoint):
166         * platform/graphics/ca/win/PlatformCALayerWin.h:
167
168 2017-02-28  Alex Christensen  <achristensen@webkit.org>
169
170         LibWebRTCProvider should check existence of libwebrtc.dylib
171         https://bugs.webkit.org/show_bug.cgi?id=168986
172         <rdar://problem/30735413>
173
174         Reviewed by Youenn Fablet.
175
176         Some configurations of the webrtc tests overwrite the availability of WebRTC in order to test it
177         with MockLibWebRTCPeerConnection.  If the dylib can not be found, we can't use it, so we want to
178         fail these tests rather than crashing calling rtc::LogMessage::LogToDebug.
179
180         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
181         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
182         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
183         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
184         (WebCore::LibWebRTCProvider::factory):
185         (WebCore::LibWebRTCProvider::webRTCAvailable):
186         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
187         * testing/MockLibWebRTCPeerConnection.cpp:
188         (WebCore::useMockRTCPeerConnectionFactory):
189         (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
190
191 2017-02-28  Tim Horton  <timothy_horton@apple.com>
192
193         Apply a review comment that was missing in r213182
194
195         * loader/ios/QuickLook.mm:
196         (WebCore::isQuickLookPreviewURL):
197
198 2017-02-28  Tim Horton  <timothy_horton@apple.com>
199
200         [iOS] Getting QLPreviewProtocol slows down first navigation in Web process
201         https://bugs.webkit.org/show_bug.cgi?id=168940
202         <rdar://problem/29468999>
203
204         Reviewed by Simon Fraser.
205
206         No new tests, just a performance improvement.
207
208         * loader/DocumentLoader.cpp:
209         (WebCore::isRemoteWebArchive):
210         * loader/PolicyChecker.cpp:
211         (WebCore::PolicyChecker::checkNavigationPolicy):
212         * loader/ResourceLoadNotifier.cpp:
213         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
214         Make use of isQuickLookPreviewURL.
215
216         * loader/ios/QuickLook.h:
217         * loader/ios/QuickLook.mm:
218         (WebCore::isQuickLookPreviewURL):
219         Add isQuickLookPreviewURL, which first early-returns if the protocol
220         of the URL is a well-known protocol, and then falls back to loading QuickLook.
221
222         In a microbenchmark this is a 30-40% improvement in total time spent
223         loading an empty HTML document (wall-clock time between loadHTMLString
224         and didFinishNavigation).
225
226 2017-02-28  Simon Fraser  <simon.fraser@apple.com>
227
228         Add Geolocation and DeviceOrientation to features.json 
229
230         * features.json:
231
232 2017-02-28  Wenson Hsieh  <wenson_hsieh@apple.com>
233
234         Data interaction should support attachment elements
235         https://bugs.webkit.org/show_bug.cgi?id=168916
236         <rdar://problem/30664519>
237
238         Reviewed by Ryosuke Niwa.
239
240         Teaches DragController to recognize and initiate dragging on attachment elements, and also adds a new
241         convenience method to the WebItemProviderPasteboard for block enumeration of available UIItemProviders. Covered
242         by a new API test: DataInteractionTests.AttachmentElementItemProviders.
243
244         * page/DragController.cpp:
245         (WebCore::DragController::draggableElement):
246         (WebCore::DragController::startDrag):
247         * platform/ios/WebItemProviderPasteboard.h:
248         * platform/ios/WebItemProviderPasteboard.mm:
249         (-[WebItemProviderPasteboard enumerateItemProvidersWithBlock:]):
250
251 2017-02-28  Mark Lam  <mark.lam@apple.com>
252
253         Remove setExclusiveThread() and peers from the JSLock.
254         https://bugs.webkit.org/show_bug.cgi?id=168977
255
256         Reviewed by Filip Pizlo.
257
258         No new tests because this should already be covered by existing tests.
259
260         * bindings/js/CommonVM.cpp:
261         (WebCore::commonVMSlow):
262
263 2017-02-28  Dave Hyatt  <hyatt@apple.com>
264
265         Centering text inside a button set to display flex and justify-content: center is impossible
266         https://bugs.webkit.org/show_bug.cgi?id=148872
267         <rdar://problem/22590086>
268
269         Reviewed by Simon Fraser.
270
271         Added new test in fast/forms.
272
273         * rendering/RenderButton.cpp:
274         (WebCore::RenderButton::addChild):
275         (WebCore::RenderButton::updateAnonymousChildStyle):
276         (WebCore::RenderButton::styleDidChange):
277         (WebCore::RenderButton::styleWillChange): Deleted.
278         (WebCore::RenderButton::setupInnerStyle): Deleted.
279         * rendering/RenderButton.h:
280         * rendering/RenderElement.cpp:
281         (WebCore::RenderElement::propagateStyleToAnonymousChildren):
282         * rendering/RenderElement.h:
283         (WebCore::RenderElement::updateAnonymousChildStyle):
284
285 2017-02-28  Antoine Quint  <graouts@apple.com>
286
287         [Modern Media Controls] Add missing compact mode assets for macOS
288         https://bugs.webkit.org/show_bug.cgi?id=168980
289         <rdar://problem/30763269>
290
291         Reviewed by Jon Lee.
292
293         Adding missing compact mode assets for the AirPlay, tracks, PiP and volume buttons.
294
295         * Modules/modern-media-controls/controls/icon-service.js:
296         * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css:
297         (.media-controls.mac.inline.compact button.airplay):
298         (.media-controls.mac.inline.compact button.pip):
299         (.media-controls.mac.inline.compact button.tracks):
300         * Modules/modern-media-controls/images/macOS/airplay-compact@1x.png: Added.
301         * Modules/modern-media-controls/images/macOS/airplay-compact@2x.png: Added.
302         * Modules/modern-media-controls/images/macOS/media-selection-compact@1x.png: Added.
303         * Modules/modern-media-controls/images/macOS/media-selection-compact@2x.png: Added.
304         * Modules/modern-media-controls/images/macOS/pip-in-compact@1x.png: Added.
305         * Modules/modern-media-controls/images/macOS/pip-in-compact@2x.png: Added.
306         * Modules/modern-media-controls/images/macOS/volume-compact@1x.png:
307         * Modules/modern-media-controls/images/macOS/volume-compact@2x.png:
308         * Modules/modern-media-controls/images/macOS/volume-mute-compact@1x.png: Added.
309         * Modules/modern-media-controls/images/macOS/volume-mute-compact@2x.png: Added.
310
311 2017-02-28  Chris Dumez  <cdumez@apple.com>
312
313         [iOS] Throttle requestAnimationFrame to 30fps in low power mode
314         https://bugs.webkit.org/show_bug.cgi?id=168837
315         <rdar://problem/30700929>
316
317         Reviewed by Simon Fraser.
318
319         Throttle requestAnimationFrame to 30fps in low power mode on iOS to save battery.
320
321         ScriptedAnimationController now maintains an OptionSet of throttling reasons.
322         Throttling reasons for now are: OutsideViewport, VisuallyIdle, and LowPowerMode.
323         The requestAnimationFrame interval is then determined based on those throttling
324         reasons:
325         - OutsideViewport or VisuallyIdle: 10 seconds (very aggressive throttling)
326         - LowPowerMode: 30fps
327         - No reasons: 60fps
328
329         The Page now keeps track of low power mode state using a LowPowerModeNotifier.
330         Whenever low power mode changes, it updates the throttling reasons in all the
331         documents' ScriptedAnimationControllers in the frame tree.
332
333         Tests: fast/animation/request-animation-frame-throttling-detached-iframe.html
334                fast/animation/request-animation-frame-throttling-lowPowerMode.html
335
336         * dom/Document.cpp:
337         (WebCore::Document::requestAnimationFrame):
338         * dom/Document.h:
339         * dom/ScriptedAnimationController.cpp:
340         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
341         (WebCore::throttlingReasonToString):
342         (WebCore::throttlingReasonsToString):
343         (WebCore::ScriptedAnimationController::addThrottlingReason):
344         (WebCore::ScriptedAnimationController::removeThrottlingReason):
345         (WebCore::ScriptedAnimationController::isThrottled):
346         (WebCore::ScriptedAnimationController::interval):
347         (WebCore::ScriptedAnimationController::page):
348         (WebCore::ScriptedAnimationController::scheduleAnimation):
349         * dom/ScriptedAnimationController.h:
350         (WebCore::ScriptedAnimationController::create):
351         * page/FrameView.cpp:
352         (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
353         * page/Page.cpp:
354         (WebCore::Page::Page):
355         (WebCore::Page::isLowPowerModeEnabled):
356         (WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
357         (WebCore::updateScriptedAnimationsThrottlingReason):
358         (WebCore::Page::setIsVisuallyIdleInternal):
359         (WebCore::Page::handleLowModePowerChange):
360         * page/Page.h:
361         * testing/Internals.cpp:
362         (WebCore::Internals::resetToConsistentState):
363         (WebCore::Internals::requestAnimationFrameInterval):
364         (WebCore::Internals::setLowPowerModeEnabled):
365         * testing/Internals.h:
366         * testing/Internals.idl:
367
368 2017-02-28  Youenn Fablet  <youenn@apple.com>
369
370         [WebRTC] Limit libwebrtc logging in Debug build
371         https://bugs.webkit.org/show_bug.cgi?id=168974
372
373         Reviewed by Alex Christensen.
374
375         Covered by manual testing..
376
377         * platform/Logging.h:
378         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
379         (WebCore::LibWebRTCProvider::callOnWebRTCSignalingThread):
380
381 2017-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
382
383         [macOS] Migrate off of CTFontCreateForCSS
384         https://bugs.webkit.org/show_bug.cgi?id=168678
385
386         Reviewed by David Hyatt.
387
388         This patch implements the Font Matching Algorithm detailed in
389         https://drafts.csswg.org/css-fonts-4/#font-matching-algorithm
390         Previously, this was implemented inside Core Text (via
391         CTFontCreateForCSS()), but that implementation does not understand
392         variation fonts. Therefore it should move to WebKit (along with
393         the general fact that CSS algorithms should be implemented in a
394         CSS engine, not the platform's text engine).
395
396         This implementation is not completely divorced from the platform,
397         however - Core Text exposes font weights on a [-1, 1] range, but
398         CSS operates on a [1, 999] range. In order to provide the mapping
399         to CSS weights, Core Text infrastructure is necessary. Therefore,
400         this new implementation of the matching algorithm is only used
401         on certain operating systems.
402
403         The new implementation of the algorithm is not bug-compatible with
404         the existing implementation; this patch does represent a behavior
405         change. However, I have reviewed the differences manually and
406         believe this algorithm to be a progression over the previous one
407         (except for one case with Helvetica Neue - see
408         LayoutTests/ChangeLog for more information about that).
409
410         This patch also represents a 27% performance progression on our
411         standard page load test (just measuring the performance of the font
412         matching algorithm, and nothing else). (Because font matching is
413         only a small part of the entire test, the overall progression is
414         much smaller.)
415
416         Tests: FontCacheTest.FontLookupFromFamilyName
417                FontCacheTest.FontLookupFromPostScriptName
418
419         * platform/graphics/FontCache.h:
420         (WebCore::FontCache::createFontPlatformDataForTesting): Allow for
421         unit testing.
422         * platform/graphics/cocoa/FontCacheCoreText.cpp:
423         (WebCore::isSystemFont): Inlined.
424         (WebCore::FontDatabase::singleton): Cache results of Core Text
425         lookups.
426         (WebCore::FontDatabase::Range::Range): Because of variation fonts,
427         fonts' weights, widths, and slopes need to be represented as a range
428         instead of an individual value.
429         (WebCore::FontDatabase::Range::isValid):
430         (WebCore::FontDatabase::Range::expand):
431         (WebCore::FontDatabase::Range::includes):
432         (WebCore::FontDatabase::InstalledFont::InstalledFont): Represents a
433         Font Descriptor as well as some lookup information about it.
434         (WebCore::FontDatabase::InstalledFontCollection::InstalledFontCollection):
435         A collection of installed fonts.
436         (WebCore::FontDatabase::InstalledFontCollection::insertInstalledFont):
437         Cache minima and maxima.
438         (WebCore::FontDatabase::InstalledFontCollection::isEmpty):
439         (WebCore::FontDatabase::InstalledFontCollection::size):
440         (WebCore::FontDatabase::lookupFamilyName): Get all the fonts in
441         the family.
442         (WebCore::FontDatabase::lookupPostScriptName): Get the font with
443         the given PostScript name.
444         (WebCore::FontDatabase::clear):
445         (WebCore::FontDatabase::FontDatabase): Cache.
446         (WebCore::iterateActiveFontsWithReturn): The Font Matching Algorithm
447         works by starting with every font in the family, and the eliminating
448         items from the set iteratively. Instead of actually removing items
449         from a vector or linked list, we instead want to treat the collection
450         as immutable and keep a parallel side-table of which items have been
451         eliminated (in order to reduce copies and allocations). This makes
452         sense because most families only have a handful of fonts in them.
453         This function consults with the side-table to iterate only over the
454         fonts which have not been eliminated.
455         (WebCore::iterateActiveFonts): Ditto.
456         (WebCore::findClosestStretch):
457         (WebCore::filterStretch): Eliminate fonts based on their stretch
458         value.
459         (WebCore::findClosestStyle):
460         (WebCore::filterStyle): Eliminate fonts based on their style value.
461         (WebCore::findClosestWeight):
462         (WebCore::filterWeight): Eliminate fonts based on their weight value.
463         (WebCore::computeTargetWeight):
464         (WebCore::findClosestFont): If we have a set of fonts in a family,
465         select the font in the set which best matches the criteria.
466         (WebCore::platformFontLookupWithFamily): While findClosestFont()
467         function satisfies the spec's notion of the font matching algorithm,
468         WebKit actually claims to be able to look up fonts by their PostScript
469         name. Therefore, this function has a higher-level of logic to rectify
470         the confusion that results when the PostScript name doesn't agree with
471         the other CSS properties (like if you say "Helvetica-Bold" but also say
472         font-weight: 100).
473         * platform/spi/cocoa/CoreTextSPI.h: Add signature for system CSS
474         font weight support.
475
476 2017-02-24  Matt Rajca  <mrajca@apple.com>
477
478         Media: notify clients when autoplayed media ends without being paused
479         https://bugs.webkit.org/show_bug.cgi?id=168852
480
481         Reviewed by Alex Christensen.
482
483         Added API tests.
484
485         * html/HTMLMediaElement.cpp:
486         (WebCore::HTMLMediaElement::setReadyState):
487          Set state accordingly if we autoplayed or if playback was prevented.
488         (WebCore::HTMLMediaElement::play):
489          Update state if playback was prevented.
490         (WebCore::HTMLMediaElement::playInternal):
491          Update state if playback began without user interaction.
492         (WebCore::HTMLMediaElement::pauseInternal):
493          Update state.
494         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
495          If playback ends and it began without user interaction, send a DidPlayMediaWithoutInterference event.
496         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto.
497         * html/HTMLMediaElement.h:
498         * page/AutoplayEvent.h:
499
500 2017-02-27  Dave Hyatt  <hyatt@apple.com>
501
502         Update flexbox to Blink's tip of tree
503         https://bugs.webkit.org/show_bug.cgi?id=168657
504
505         Reviewed by Zalan Bujtas.
506
507         Added new tests in css3/flexbox.
508
509         * CMakeLists.txt:
510         * WebCore.xcodeproj/project.pbxproj:
511         * css/CSSComputedStyleDeclaration.cpp:
512         (WebCore::ComputedStyleExtractor::propertyValue):
513         * rendering/FlexibleBoxAlgorithm.cpp: Added.
514         (WebCore::FlexItem::FlexItem):
515         (WebCore::FlexLayoutAlgorithm::FlexLayoutAlgorithm):
516         (WebCore::FlexLayoutAlgorithm::computeNextFlexLine):
517         * rendering/FlexibleBoxAlgorithm.h: Added.
518         (WebCore::FlexItem::hypotheticalMainAxisMarginBoxSize):
519         (WebCore::FlexItem::flexBaseMarginBoxSize):
520         (WebCore::FlexItem::flexedMarginBoxSize):
521         (WebCore::FlexLayoutAlgorithm::isMultiline):
522         * rendering/GridTrackSizingAlgorithm.cpp:
523         (WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize):
524         (WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems):
525         (WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild):
526         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild):
527         (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
528         * rendering/GridTrackSizingAlgorithm.h:
529         * rendering/OrderIterator.cpp:
530         (WebCore::OrderIterator::next):
531         (WebCore::OrderIterator::reset):
532         (WebCore::OrderIteratorPopulator::~OrderIteratorPopulator):
533         (WebCore::OrderIteratorPopulator::collectChild):
534         (WebCore::OrderIteratorPopulator::OrderIteratorPopulator): Deleted.
535         (WebCore::OrderIteratorPopulator::removeDuplicatedOrderValues): Deleted.
536         * rendering/OrderIterator.h:
537         (WebCore::OrderIteratorPopulator::OrderIteratorPopulator):
538         * rendering/RenderBlock.cpp:
539         (WebCore::RenderBlock::updateBlockChildDirtyBitsBeforeLayout):
540         (WebCore::RenderBlock::layoutPositionedObject):
541         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
542         (WebCore::RenderBlock::computeChildPreferredLogicalWidths):
543         (WebCore::RenderBlock::hasDefiniteLogicalHeight):
544         (WebCore::RenderBlock::availableLogicalHeightForPercentageComputation):
545         * rendering/RenderBlock.h:
546         (WebCore::RenderBlock::hasPercentHeightDescendants):
547         * rendering/RenderBlockFlow.cpp:
548         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
549         * rendering/RenderBox.cpp:
550         (WebCore::RenderBox::columnFlexItemHasStretchAlignment):
551         (WebCore::RenderBox::isStretchingColumnFlexItem):
552         (WebCore::RenderBox::hasStretchedLogicalWidth):
553         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
554         (WebCore::RenderBox::computeInlineDirectionMargins):
555         (WebCore::RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem):
556         (WebCore::RenderBox::updateLogicalHeight):
557         (WebCore::RenderBox::computeLogicalHeightWithoutLayout):
558         (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation):
559         (WebCore::RenderBox::shouldTreatChildAsReplacedInTableCells):
560         (WebCore::tableCellShouldHaveZeroInitialSize):
561         (WebCore::RenderBox::computePercentageLogicalHeight):
562         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
563         (WebCore::RenderBox::availableLogicalHeightUsing):
564         (WebCore::RenderBox::percentageLogicalHeightIsResolvable):
565         (WebCore::RenderBox::hasUnsplittableScrollingOverflow):
566         (WebCore::flexItemHasStretchAlignment): Deleted.
567         (WebCore::isStretchingColumnFlexItem): Deleted.
568         (WebCore::logicalWidthIsResolvable): Deleted.
569         (WebCore::RenderBox::hasDefiniteLogicalWidth): Deleted.
570         (WebCore::percentageLogicalHeightIsResolvable): Deleted.
571         (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock): Deleted.
572         (WebCore::RenderBox::hasDefiniteLogicalHeight): Deleted.
573         * rendering/RenderBox.h:
574         (WebCore::RenderBox::isGridItem):
575         (WebCore::RenderBox::isFlexItem):
576         (WebCore::RenderBox::selfAlignmentNormalBehavior):
577         * rendering/RenderBoxModelObject.cpp:
578         (WebCore::isOutOfFlowPositionedWithImplicitHeight):
579         (WebCore::RenderBoxModelObject::containingBlockForAutoHeightDetection):
580         (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight):
581         * rendering/RenderBoxModelObject.h:
582         * rendering/RenderElement.cpp:
583         (WebCore::RenderElement::removeChildInternal):
584         * rendering/RenderFlexibleBox.cpp:
585         (WebCore::RenderFlexibleBox::LineContext::LineContext):
586         (WebCore::RenderFlexibleBox::RenderFlexibleBox):
587         (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
588         (WebCore::contentAlignmentNormalBehavior):
589         (WebCore::RenderFlexibleBox::styleDidChange):
590         (WebCore::RenderFlexibleBox::layoutBlock):
591         (WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems):
592         (WebCore::RenderFlexibleBox::clientLogicalBottomAfterRepositioning):
593         (WebCore::RenderFlexibleBox::hasOrthogonalFlow):
594         (WebCore::RenderFlexibleBox::flexBasisForChild):
595         (WebCore::RenderFlexibleBox::crossAxisExtentForChild):
596         (WebCore::RenderFlexibleBox::cachedChildIntrinsicContentLogicalHeight):
597         (WebCore::RenderFlexibleBox::setCachedChildIntrinsicContentLogicalHeight):
598         (WebCore::RenderFlexibleBox::clearCachedChildIntrinsicContentLogicalHeight):
599         (WebCore::RenderFlexibleBox::childIntrinsicLogicalHeight):
600         (WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth):
601         (WebCore::RenderFlexibleBox::crossAxisIntrinsicExtentForChild):
602         (WebCore::RenderFlexibleBox::mainAxisExtentForChild):
603         (WebCore::RenderFlexibleBox::mainAxisContentExtentForChildIncludingScrollbar):
604         (WebCore::RenderFlexibleBox::crossAxisExtent):
605         (WebCore::RenderFlexibleBox::mainAxisExtent):
606         (WebCore::RenderFlexibleBox::mainAxisContentExtent):
607         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
608         (WebCore::RenderFlexibleBox::transformedWritingMode):
609         (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild):
610         (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild):
611         (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild):
612         (WebCore::RenderFlexibleBox::crossAxisMarginExtentForChild):
613         (WebCore::RenderFlexibleBox::flowAwareLocationForChild):
614         (WebCore::RenderFlexibleBox::useChildAspectRatio):
615         (WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing):
616         (WebCore::RenderFlexibleBox::setFlowAwareLocationForChild):
617         (WebCore::RenderFlexibleBox::mainAxisLengthIsDefinite):
618         (WebCore::RenderFlexibleBox::crossAxisLengthIsDefinite):
619         (WebCore::RenderFlexibleBox::cacheChildMainSize):
620         (WebCore::RenderFlexibleBox::clearCachedMainSizeForChild):
621         (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild):
622         (WebCore::RenderFlexibleBox::layoutFlexItems):
623         (WebCore::RenderFlexibleBox::autoMarginOffsetInMainAxis):
624         (WebCore::RenderFlexibleBox::updateAutoMarginsInMainAxis):
625         (WebCore::RenderFlexibleBox::hasAutoMarginsInCrossAxis):
626         (WebCore::RenderFlexibleBox::availableAlignmentSpaceForChild):
627         (WebCore::RenderFlexibleBox::updateAutoMarginsInCrossAxis):
628         (WebCore::RenderFlexibleBox::marginBoxAscentForChild):
629         (WebCore::RenderFlexibleBox::computeChildMarginValue):
630         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
631         (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution):
632         (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution):
633         (WebCore::RenderFlexibleBox::childLogicalHeightForPercentageResolution):
634         (WebCore::RenderFlexibleBox::adjustChildSizeForAspectRatioCrossAxisMinAndMax):
635         (WebCore::RenderFlexibleBox::constructFlexItem):
636         (WebCore::RenderFlexibleBox::freezeViolations):
637         (WebCore::RenderFlexibleBox::freezeInflexibleItems):
638         (WebCore::RenderFlexibleBox::resolveFlexibleLengths):
639         (WebCore::alignmentOffset):
640         (WebCore::RenderFlexibleBox::setOverrideMainAxisContentSizeForChild):
641         (WebCore::RenderFlexibleBox::staticMainAxisPositionForPositionedChild):
642         (WebCore::RenderFlexibleBox::staticCrossAxisPositionForPositionedChild):
643         (WebCore::RenderFlexibleBox::staticInlinePositionForPositionedChild):
644         (WebCore::RenderFlexibleBox::staticBlockPositionForPositionedChild):
645         (WebCore::RenderFlexibleBox::setStaticPositionForPositionedLayout):
646         (WebCore::RenderFlexibleBox::prepareChildForPositionedLayout):
647         (WebCore::RenderFlexibleBox::alignmentForChild):
648         (WebCore::RenderFlexibleBox::resetAutoMarginsAndLogicalTopInCrossAxis):
649         (WebCore::RenderFlexibleBox::needToStretchChildLogicalHeight):
650         (WebCore::RenderFlexibleBox::childHasIntrinsicMainAxisSize):
651         (WebCore::RenderFlexibleBox::crossAxisOverflowForChild):
652         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
653         (WebCore::RenderFlexibleBox::layoutColumnReverse):
654         (WebCore::initialAlignContentOffset):
655         (WebCore::alignContentSpaceBetweenChildren):
656         (WebCore::RenderFlexibleBox::alignFlexLines):
657         (WebCore::RenderFlexibleBox::adjustAlignmentForChild):
658         (WebCore::RenderFlexibleBox::alignChildren):
659         (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
660         (WebCore::RenderFlexibleBox::flipForRightToLeftColumn):
661         (WebCore::RenderFlexibleBox::flipForWrapReverse):
662         (WebCore::RenderFlexibleBox::Violation::Violation): Deleted.
663         (WebCore::RenderFlexibleBox::setCrossAxisExtent): Deleted.
664         (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): Deleted.
665         (WebCore::RenderFlexibleBox::mainAxisBorderAndPaddingExtentForChild): Deleted.
666         (WebCore::RenderFlexibleBox::mainAxisScrollbarExtentForChild): Deleted.
667         (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild): Deleted.
668         (WebCore::RenderFlexibleBox::computeNextFlexLine): Deleted.
669         (WebCore::RenderFlexibleBox::setLogicalOverrideSize): Deleted.
670         (WebCore::RenderFlexibleBox::numberOfInFlowPositionedChildren): Deleted.
671         (WebCore::RenderFlexibleBox::needToStretchChild): Deleted.
672         (WebCore::contentAlignmentNormalBehaviorFlexibleBox): Deleted.
673         * rendering/RenderFlexibleBox.h:
674         (WebCore::RenderFlexibleBox::orderIterator):
675         (WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
676         * rendering/RenderFullScreen.h:
677         * rendering/RenderGrid.cpp:
678         (WebCore::selfAlignmentChangedToStretchInRowAxis):
679         (WebCore::selfAlignmentChangedFromStretchInRowAxis):
680         (WebCore::selfAlignmentChangedFromStretchInColumnAxis):
681         (WebCore::RenderGrid::styleDidChange):
682         (WebCore::RenderGrid::computeTrackBasedLogicalHeight):
683         (WebCore::RenderGrid::computeTrackSizesForDefiniteSize):
684         (WebCore::RenderGrid::gridGapForDirection):
685         (WebCore::RenderGrid::guttersSize):
686         (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize):
687         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
688         (WebCore::RenderGrid::trackSizesForComputedStyle):
689         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
690         (WebCore::RenderGrid::populateGridPositionsForDirection):
691         (WebCore::RenderGrid::alignSelfForChild):
692         (WebCore::RenderGrid::justifySelfForChild):
693         (WebCore::RenderGrid::columnAxisPositionForChild):
694         (WebCore::RenderGrid::rowAxisPositionForChild):
695         (WebCore::RenderGrid::columnAxisOffsetForChild):
696         (WebCore::RenderGrid::rowAxisOffsetForChild):
697         (WebCore::RenderGrid::needToStretchChildLogicalHeight): Deleted.
698         * rendering/RenderGrid.h:
699         * rendering/RenderLayer.cpp:
700         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
701         * rendering/RenderListBox.cpp:
702         (WebCore::RenderListBox::computeLogicalHeight):
703         * rendering/RenderTable.cpp:
704         (WebCore::RenderTable::layout):
705         * rendering/RenderTableCell.cpp:
706         (WebCore::RenderTableCell::layout):
707         * rendering/RenderTableSection.cpp:
708         (WebCore::shouldFlexCellChild):
709         (WebCore::RenderTableSection::relayoutCellIfFlexed):
710         (WebCore::RenderTableSection::layoutRows):
711         * rendering/RenderTableSection.h:
712         * rendering/RenderTextControl.cpp:
713         (WebCore::RenderTextControl::computeLogicalHeight):
714         * rendering/style/RenderStyle.cpp:
715         (WebCore::resolvedSelfAlignment):
716         (WebCore::RenderStyle::resolvedAlignSelf):
717         (WebCore::RenderStyle::resolvedJustifySelf):
718         * rendering/style/RenderStyle.h:
719         * style/RenderTreeUpdater.cpp:
720         (WebCore::textRendererIsNeeded):
721
722 2017-02-28  Alex Christensen  <achristensen@webkit.org>
723
724         Main resource requests need cachePartition
725         https://bugs.webkit.org/show_bug.cgi?id=168806
726         <rdar://30639764>
727
728         Reviewed by Brady Eidson.
729
730         Test: http/tests/security/credentials-main-resource.html
731
732         r211751 caused an unintended regression on pages whose main resource is protected
733         by basic authentication.  We were not setting the cache partition for main resource
734         requests, and we use the cache partition now for credentials, so the credentials for
735         the main resource were not being put into a partition in the CredentialStorage that
736         would not be used for subresources of the page, whose requests had the correct partition
737         for the domain of the page.  This caused users to have to enter their credentials twice,
738         once for the main resource and once for any subresources.  This is fixed by using the
739         domain from the main resource request as the cache partition.  Elsewhere the Document is
740         used to get the cache partition, but there is no Document yet when requesting the main resource.
741
742         * loader/DocumentLoader.cpp:
743         (WebCore::DocumentLoader::startLoadingMainResource):
744         Set the cache partition for the main resource loads based on the SecurityOrigin of the
745         initial request if we are loading the main resource for a new top document.  If the main resource
746         request is redirected, then we will still use the partition of the initial request because that is
747         what the user requested and that is where the user entered the credentials.
748         * loader/cache/CachedResourceLoader.h:
749         * loader/cache/CachedResourceRequest.cpp:
750         (WebCore::CachedResourceRequest::setDomainForCachePartition):
751         * loader/cache/CachedResourceRequest.h:
752
753 2017-02-28  Alex Christensen  <achristensen@webkit.org>
754
755         REGRESSION: LayoutTest http/tests/security/credentials-iframes.html is failing on ios-simulator
756         https://bugs.webkit.org/show_bug.cgi?id=167967
757
758         Reviewed by Brady Eidson.
759
760         XHR credentials have a persistence of CredentialPersistenceNone because we keep
761         them in the WebCore::CredentialStorage.  We were storing them to CFNetwork's NSURLCredentialStorage
762         on iOS and then they were being given as the proposedCredential in
763         NetworkDataTaskCocoa::tryPasswordBasedAuthentication even though we set CredentialPersistenceNone.
764
765         This fixes http/tests/security/credentials-iframes.html
766
767         * platform/network/CredentialStorage.cpp:
768         (WebCore::CredentialStorage::set):
769         * platform/network/CredentialStorage.h:
770         * platform/network/cf/CredentialStorageCFNet.cpp:
771         (WebCore::CredentialStorage::saveToPersistentStorage): Deleted.
772         * platform/network/mac/CredentialStorageMac.mm:
773         (WebCore::CredentialStorage::saveToPersistentStorage): Deleted.
774
775 2017-02-27  Alex Christensen  <achristensen@webkit.org>
776
777         Fix WinCairo build.
778
779         * PlatformWinCairo.cmake:
780
781 2017-02-27  Alex Christensen  <achristensen@webkit.org>
782
783         Begin enabling WebRTC on 64-bit
784         https://bugs.webkit.org/show_bug.cgi?id=168915
785
786         Reviewed by Eric Carlson.
787
788         * Configurations/FeatureDefines.xcconfig:
789
790 2017-02-27  Antoine Quint  <graouts@apple.com>
791
792         [Modern Media Controls] Use compact mode by default on macOS
793         https://bugs.webkit.org/show_bug.cgi?id=168958
794         <rdar://problem/30748638>
795
796         Reviewed by Jon Lee.
797
798         We now use the compact layout mode by default on macOS.
799
800         * Modules/modern-media-controls/controls/layout-item.js: Remove the ReducedPadding trait.
801         * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css: 
802         (.media-controls.mac.inline.compact .time-label,): Vertically align the time label with
803         the scrubber in compact mode.
804         (.media-controls.mac.inline.compact .scrubber.slider): Correctly position the scrubber in
805         compact mode so that it's vertically aligned.
806         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
807         (MacOSInlineMediaControls.prototype.layoutTraitsDidChange): Remove handling of tight and
808         reduced padding traits since these do not apply to macOS anymore. We also notify the
809         scrubber of a layout trait change so that it may adjust its height.
810         * Modules/modern-media-controls/controls/scrubber.js:
811         (Scrubber):
812         (Scrubber.prototype.layoutTraitsDidChange): Adjust the height of the scrubber to match
813         compact layout traits.
814         * Modules/modern-media-controls/controls/time-control.js:
815         (TimeControl.prototype.get isSufficientlyWide): Adjust the minimum scrubber width for
816         TimeControl visibility to match compact layout traits.
817         * Modules/modern-media-controls/media/media-controller.js:
818         (MediaController.prototype.get layoutTraits): Use the compact layout trait by default
819         on macOS and make the tight padding specific to iOS.
820
821 2017-02-27  Antoine Quint  <graouts@apple.com>
822
823         [Modern Media Controls] Adhere to tight padding on iOS
824         https://bugs.webkit.org/show_bug.cgi?id=168949
825         <rdar://problem/30746164>
826
827         Reviewed by Jon Lee.
828
829         We used to only support custom margins on macOS, to support this on iOS as
830         well, we promote the notification when the layoutTraits property is set to
831         MediaControls and expose a new protected method layoutTraitsDidChange() for
832         subclasses to implement. IOSInlineMediaControls now implements that method
833         and will use tighter margins for the TightPadding layout trait.
834
835         Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-tight-padding.html
836
837         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
838         (IOSInlineMediaControls.prototype.layoutTraitsDidChange):
839         (IOSInlineMediaControls):
840         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
841         (MacOSInlineMediaControls.prototype.get layoutTraits): Deleted.
842         (MacOSInlineMediaControls.prototype.set layoutTraits): Deleted.
843         (MacOSInlineMediaControls.prototype._matchLayoutTraits): Deleted.
844         * Modules/modern-media-controls/controls/media-controls.js:
845         (MediaControls.prototype.get layoutTraits):
846         (MediaControls.prototype.set layoutTraits):
847         (MediaControls.prototype.layoutTraitsDidChange):
848
849 2017-02-27  Youenn Fablet  <youenn@apple.com>
850
851         [WebRTC] Support modern RTCStatsReport
852         https://bugs.webkit.org/show_bug.cgi?id=166916
853         <rdar://problem/30293780>
854
855         Reviewed by Alex Christensen.
856
857         Updating binding generator and IDL parser to handle maplike.
858         Covered by binding tests.
859
860         Added support for maplike binding from JS wrapper to DOM class.
861         The principle is to have the JSXX wrapper having a @backingMap slot containing a Map.
862         All maplike methods are forwarded to the corresponding Map methods.
863         The XX object is responsible to add key/value pairs using a helper routine.
864         The creation of the Map is done at creation of the JSXX wrapper.
865
866         DOM class is interacting with the map through DOMMapLike.
867         Extracted DOMGuarded from DOM promise implementation.
868         This allows reusing this code for DOMMapLike.
869
870         Covered by binding tests and manual tests.
871
872         * CMakeLists.txt:
873         * DerivedSources.make:
874         * Modules/mediastream/RTCStatsReport.h:
875         (WebCore::RTCStatsReport::InboundRTPStreamStats::InboundRTPStreamStats):
876         (WebCore::RTCStatsReport::OutboundRTPStreamStats::OutboundRTPStreamStats):
877         (WebCore::RTCStatsReport::create):
878         (WebCore::RTCStatsReport::synchronizeBackingMap):
879         (WebCore::RTCStatsReport::backingMap):
880         (WebCore::RTCStatsReport::addStats):
881         * Modules/mediastream/RTCStatsReport.idl:
882         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
883         (WebCore::fromStdString):
884         (WebCore::fillRTCStats):
885         (WebCore::fillRTCRTPStreamStats):
886         (WebCore::fillInboundRTPStreamStats):
887         (WebCore::fillOutboundRTPStreamStats):
888         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
889         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
890         * WebCore.xcodeproj/project.pbxproj:
891         * bindings/js/JSDOMBindingInternals.js: Added.
892         (mapLikeForEach):
893         * bindings/js/JSDOMGlobalObject.cpp:
894         (WebCore::JSDOMGlobalObject::visitChildren):
895         * bindings/js/JSDOMGlobalObject.h:
896         * bindings/js/JSDOMGuardedObject.cpp: Added.
897         (WebCore::DOMGuardedObject::DOMGuardedObject):
898         (WebCore::DOMGuardedObject::~DOMGuardedObject):
899         (WebCore::DOMGuardedObject::clear):
900         (WebCore::DOMGuardedObject::contextDestroyed):
901         * bindings/js/JSDOMGuardedObject.h: Added.
902         (WebCore::DOMGuardedObject::isSuspended):
903         (WebCore::DOMGuardedObject::visitAggregate):
904         (WebCore::DOMGuardedObject::guardedObject):
905         (WebCore::DOMGuardedObject::globalObject):
906         (WebCore::DOMGuardedObject::isEmpty):
907         (WebCore::DOMGuarded::DOMGuarded):
908         (WebCore::DOMGuarded::guarded):
909         * bindings/js/JSDOMMapLike.cpp: Added.
910         (WebCore::getBackingMap):
911         (WebCore::initializeBackingMap):
912         (WebCore::createBackingMap):
913         (WebCore::forwardAttributeGetterToBackingMap):
914         (WebCore::forwardFunctionCallToBackingMap):
915         (WebCore::forwardForEachCallToBackingMap):
916         * bindings/js/JSDOMMapLike.h: Added.
917         (WebCore::DOMMapLike::set):
918         (WebCore::synchronizeBackingMap):
919         (WebCore::forwardSizeToMapLike):
920         (WebCore::forwardEntriesToMapLike):
921         (WebCore::forwardKeysToMapLike):
922         (WebCore::forwardValuesToMapLike):
923         (WebCore::forwardClearToMapLike):
924         (WebCore::forwardForEachToMapLike):
925         (WebCore::forwardHasToMapLike):
926         (WebCore::forwardAddToMapLike):
927         (WebCore::forwardDeleteToMapLike):
928         * bindings/js/JSDOMPromise.cpp:
929         (WebCore::DeferredPromise::promise):
930         (WebCore::DeferredPromise::reject):
931         * bindings/js/JSDOMPromise.h:
932         (WebCore::DeferredPromise::resolve):
933         (WebCore::DeferredPromise::resolveWithNewlyCreated):
934         (WebCore::DeferredPromise::reject):
935         (WebCore::DeferredPromise::resolveWithCallback):
936         (WebCore::DeferredPromise::rejectWithCallback):
937         (WebCore::DeferredPromise::DeferredPromise):
938         (WebCore::DeferredPromise::deferred):
939         * bindings/js/WebCoreBuiltinNames.h:
940         * bindings/scripts/CodeGeneratorJS.pm:
941         (PrototypeFunctionCount):
942         (GeneratePropertiesHashTable):
943         (InterfaceNeedsIterator):
944         (GenerateImplementation):
945         (GenerateParametersCheck):
946         * bindings/scripts/IDLParser.pm:
947         (assert):
948         (parseAttributeOrOperationOrIterator):
949         (parseSerializer):
950         (parseAttributeOrOperationRest):
951         (parseAttribute):
952         (parseAttributeRest):
953         (parseOperationOrIterator):
954         (parseOptionalIterableInterface):
955         (parseMapLikeRest):
956         (parseMapLikeProperties):
957         (parseOperationRest):
958         (applyMemberList):
959         * bindings/scripts/test/JS/JSMapLike.cpp: Added.
960         * bindings/scripts/test/JS/JSMapLike.h: Added.
961         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: Added.
962         * bindings/scripts/test/JS/JSReadOnlyMapLike.h: Added.
963         * bindings/scripts/test/TestMapLike.idl: Added.
964         * bindings/scripts/test/TestReadOnlyMapLike.idl: Added.
965
966 2017-02-27  Mark Lam  <mark.lam@apple.com>
967
968         Introduce a VM Traps mechanism and refactor Watchdog to use it.
969         https://bugs.webkit.org/show_bug.cgi?id=168842
970
971         Reviewed by Filip Pizlo.
972
973         No new tests needed because this is a re-implementation of existing functionality.
974
975         * bindings/js/WorkerScriptController.cpp:
976         (WebCore::WorkerScriptController::WorkerScriptController):
977         (WebCore::WorkerScriptController::scheduleExecutionTermination):
978
979 2017-02-27  Andy Estes  <aestes@apple.com>
980
981         [Cocoa] Rename FileMac.mm to FileCocoa.mm
982         https://bugs.webkit.org/show_bug.cgi?id=168947
983
984         Reviewed by Zalan Bujtas.
985
986         * PlatformMac.cmake:
987         * WebCore.xcodeproj/project.pbxproj:
988         * fileapi/FileCocoa.mm: Renamed from Source/WebCore/fileapi/FileMac.mm.
989
990 2017-02-27  Andy Estes  <aestes@apple.com>
991
992         [iOS] Enable file replacement
993         https://bugs.webkit.org/show_bug.cgi?id=168907
994         <rdar://problem/22258242>
995
996         Reviewed by David Kilzer.
997
998         Covered by existing tests.
999
1000         * fileapi/FileMac.mm:
1001         (WebCore::File::shouldReplaceFile): Stop using Carbon and AppKit API for determining if a
1002         file path is a file package. Use NSURL and CoreServices instead, which exist on Mac and iOS.
1003
1004 2017-02-27  Antoine Quint  <graouts@apple.com>
1005
1006         [Modern Media Controls] Use a solid background for <audio> controls on macOS
1007         https://bugs.webkit.org/show_bug.cgi?id=168941
1008         <rdar://problem/30744316>
1009
1010         Reviewed by Dean Jackson.
1011
1012         Use a solid background for <audio> elements on macOS, the same way we do on iOS.
1013
1014         Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-audio-background.html
1015
1016         * Modules/modern-media-controls/controls/macos-media-controls.css:
1017         (:host(audio) .media-controls.mac.inline > .controls-bar):
1018         (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint):
1019
1020 2017-02-27  Antoine Quint  <graouts@apple.com>
1021
1022         [Modern Media Controls] StatusLabel should use similar properties to TimeLabel
1023         https://bugs.webkit.org/show_bug.cgi?id=168938
1024         <rdar://problem/30743185>
1025
1026         Reviewed by Dean Jackson.
1027
1028         Ensure we use the same styling properties for StatusLabel and TimeLabel.
1029
1030         Tests: media/modern-media-controls/status-label/status-label-ios.html
1031                media/modern-media-controls/status-label/status-label-macos.html
1032
1033         * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
1034         (.media-controls.ios.inline .time-label,):
1035         (.media-controls.ios.inline .time-label): Deleted.
1036         * Modules/modern-media-controls/controls/macos-media-controls.css:
1037         (.media-controls.mac > .controls-bar .time-label,):
1038         (.media-controls.mac > .controls-bar .time-label): Deleted.
1039         * Modules/modern-media-controls/controls/status-label.css:
1040         (.status-label):
1041
1042 2017-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
1043
1044         Rename ICU cursor iterator to caret iterator
1045         https://bugs.webkit.org/show_bug.cgi?id=168206
1046
1047         Reviewed by Simon Fraser.
1048
1049         Mechanical find/replace.
1050
1051         No new tests because there is no behavior change.
1052
1053         * platform/graphics/ComplexTextController.cpp:
1054         (WebCore::ComplexTextController::offsetForPosition):
1055         * rendering/RenderText.cpp:
1056         (WebCore::RenderText::previousOffset):
1057         (WebCore::RenderText::nextOffset):
1058
1059 2017-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
1060
1061         Unprefix -webkit-line-break
1062         https://bugs.webkit.org/show_bug.cgi?id=168213
1063
1064         Reviewed by Darin Adler.
1065
1066         We support the property as specced.
1067
1068         Test: fast/text/line-break-unprefixed.html
1069
1070         * css/CSSComputedStyleDeclaration.cpp:
1071         (WebCore::ComputedStyleExtractor::propertyValue):
1072         * css/CSSProperties.json:
1073         * css/parser/CSSParserFastPaths.cpp:
1074         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1075         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
1076         * editing/Editor.cpp:
1077         (WebCore::Editor::applyEditingStyleToElement):
1078         * html/HTMLElement.cpp:
1079         (WebCore::HTMLElement::collectStyleForPresentationAttribute):
1080
1081 2017-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
1082
1083         Use RAII for ICU breaking iterators
1084         https://bugs.webkit.org/show_bug.cgi?id=168203
1085
1086         Reviewed by Simon Fraser.
1087
1088         No new tests because there is no behavior change.
1089
1090         * platform/graphics/ComplexTextController.cpp:
1091         (WebCore::ComplexTextController::offsetForPosition):
1092         * rendering/RenderText.cpp:
1093         (WebCore::RenderText::previousOffset):
1094         (WebCore::RenderText::nextOffset):
1095
1096 2017-02-27  Basuke Suzuki  <Basuke.Suzuki@am.sony.com>
1097
1098         [WinCairo][MiniBrowser] Add ca-bundle to display secure pages
1099         https://bugs.webkit.org/show_bug.cgi?id=168486
1100
1101         Reviewed by Alex Christensen.
1102
1103         change the order of path location search to make it possible to 
1104         configure with environment variable because bundled ca-bundle is
1105         always available now.
1106
1107         * platform/network/curl/ResourceHandleManager.cpp:
1108         (WebCore::certificatePath):
1109
1110 2017-02-27  Antoine Quint  <graouts@apple.com>
1111
1112         [Modern Media Controls] Status text does not appear on iOS
1113         https://bugs.webkit.org/show_bug.cgi?id=168918
1114         <rdar://problem/30737644>
1115
1116         Reviewed by Dean Jackson.
1117
1118         We refactor the layout code out of MacOSInlineMediaControls and into a new
1119         InlineLayoutSupport class which IOSInlineMediaControls uses as well. Now
1120         both the macOS and iOS inline media controls run the same layout logic to
1121         control whether the status label or scrubber should be displayed, and which
1122         controls should be dropped due to space constraints.
1123
1124         Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-status-label.html
1125
1126         * Modules/modern-media-controls/controls/inline-layout-support.js: Added.
1127         (InlineLayoutSupport):
1128         (InlineLayoutSupport.prototype.childrenAfterPerformingLayout):
1129         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
1130         (IOSInlineMediaControls.prototype.layout):
1131         (IOSInlineMediaControls):
1132         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
1133         (MacOSInlineMediaControls.prototype.layout):
1134         * Modules/modern-media-controls/js-files:
1135
1136 2017-02-27  Simon Fraser  <simon.fraser@apple.com>
1137
1138         Add specification and status metadata to CSSProperties.json, and validate it
1139         https://bugs.webkit.org/show_bug.cgi?id=168901
1140
1141         Reviewed by Darin Adler.
1142
1143         Annotate CSS properties with data about the WebKit development status, and
1144         where they are specified. A property has a canonical specification reference,
1145         but individual values may have a reference to a more recent spec.
1146
1147         Add a list of specifications to the JSON that properties reference by key.
1148
1149         Enhance check-webkit-style to validate the status and spec data.
1150
1151         * css/CSSProperties.json:
1152
1153 2017-02-27  Jiewen Tan  <jiewen_tan@apple.com>
1154
1155         [CredentialManagement] Add IDL definitions for Credential, SiteBoundCredential, and PasswordCredential
1156         https://bugs.webkit.org/show_bug.cgi?id=168616
1157         <rdar://problem/30167149>
1158
1159         Reviewed by Daniel Bates.
1160
1161         This patch adds IDL definitions for:
1162         1. Credential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-credential),
1163         2. SiteBoundCredential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-siteboundcredential), and
1164         3. PasswordCredential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-passwordcredential).
1165
1166         Test: credentials/idlharness.html
1167
1168         * CMakeLists.txt:
1169         * DerivedSources.make:
1170         * Modules/credentials/BasicCredential.cpp: Added.
1171         (WebCore::BasicCredential::BasicCredential):
1172         (WebCore::BasicCredential::~BasicCredential):
1173         (WebCore::BasicCredential::type):
1174         * Modules/credentials/BasicCredential.h: Added.
1175         (WebCore::BasicCredential::id):
1176         * Modules/credentials/BasicCredential.idl: Added.
1177         * Modules/credentials/CredentialData.h: Added.
1178         * Modules/credentials/CredentialData.idl: Added.
1179         * Modules/credentials/PasswordCredential.cpp: Added.
1180         (WebCore::PasswordCredential::PasswordCredential):
1181         (WebCore::PasswordCredential::PasswordCredential):
1182         Dummy constructors for now.
1183         * Modules/credentials/PasswordCredential.h: Added.
1184         (WebCore::PasswordCredential::create):
1185         (WebCore::PasswordCredential::create):
1186         (WebCore::PasswordCredential::setIdName):
1187         (WebCore::PasswordCredential::idName):
1188         (WebCore::PasswordCredential::setPasswordName):
1189         (WebCore::PasswordCredential::passwordName):
1190         (WebCore::PasswordCredential::setAdditionalData):
1191         (WebCore::PasswordCredential::additionalData):
1192         * Modules/credentials/PasswordCredential.idl: Added.
1193         * Modules/credentials/SiteBoundCredential.cpp: Added.
1194         (WebCore::SiteBoundCredential::SiteBoundCredential):
1195         (WebCore::SiteBoundCredential::~SiteBoundCredential):
1196         * Modules/credentials/SiteBoundCredential.h: Added.
1197         (WebCore::SiteBoundCredential::name):
1198         (WebCore::SiteBoundCredential::iconURL):
1199         (WebCore::SiteBoundCredential::setOrigin):
1200         (WebCore::SiteBoundCredential::origin):
1201         * Modules/credentials/SiteBoundCredential.idl: Added.
1202         * Modules/credentials/SiteBoundCredentialData.h: Added.
1203         * Modules/credentials/SiteBoundCredentialData.idl: Added.
1204         * WebCore.xcodeproj/project.pbxproj:
1205
1206 2017-02-27  Jer Noble  <jer.noble@apple.com>
1207
1208         [WebRTC] Fix remote audio rendering
1209         https://bugs.webkit.org/show_bug.cgi?id=168898
1210
1211         Reviewed by Eric Carlson.
1212
1213         Test: webrtc/audio-peer-connection-webaudio.html
1214
1215         Fix MediaStreamAudioSourceNode by not bailing out early if the input sample rate doesn't match
1216         the AudioContext's sample rate; there's code in setFormat() to do the sample rate conversion
1217         correctly.
1218
1219         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
1220         (WebCore::MediaStreamAudioSourceNode::setFormat):
1221
1222         Fix AudioSampleBufferList by making the AudioConverter input proc a free function, and passing
1223         its refCon a struct containing only the information it needs to perform its task. Because the
1224         conversion may result in a different number of output samples than input ones, just ask to
1225         generate the entire capacity of the scratch buffer, and signal that the input buffer was fully
1226         converted with a special return value.
1227
1228         * platform/audio/mac/AudioSampleBufferList.cpp:
1229         (WebCore::audioConverterFromABLCallback):
1230         (WebCore::AudioSampleBufferList::copyFrom):
1231         (WebCore::AudioSampleBufferList::convertInput): Deleted.
1232         (WebCore::AudioSampleBufferList::audioConverterCallback): Deleted.
1233         * platform/audio/mac/AudioSampleBufferList.h:
1234
1235         Fix AudioSampleDataSource by updating both the sampleCount and the sampleTime after doing
1236         a sample rate conversion to take into account that both the number of samples may have changed,
1237         as well as the timeScale of the sampleTime. This may result in small off-by-one rounding errors
1238         due to the sample rate conversion of sampleTime, so remember what the next expected sampleTime
1239         should be, and correct sampleTime if it is indeed off-by-one. If the pull operation has gotten
1240         ahead of the push operation, delay the next pull by the empty amount by rolling back the
1241         m_outputSampleOffset. Introduce the same offset behavior during pull operations.
1242
1243         * platform/audio/mac/AudioSampleDataSource.h:
1244         * platform/audio/mac/AudioSampleDataSource.mm:
1245         (WebCore::AudioSampleDataSource::pushSamplesInternal):
1246         (WebCore::AudioSampleDataSource::pullSamplesInternal):
1247         (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
1248
1249         Fix MediaPlayerPrivateMediaStreamAVFObjC by obeying the m_muted property.
1250
1251         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1252         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume):
1253         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted):
1254
1255         Fix LibWebRTCAudioModule by sleeping for the correct amount after emitting frames. Previously,
1256         LibWebRTCAudioModule would sleep for a fixed amount of time, which meant it would get slowly out
1257         of sync when emitting frames took a non-zero amount of time. Now, the amount of time before the
1258         next cycle starts is correctly calculated, and then LibWebRTCAudioModule sleeps for a dynamic amount
1259         of time in order to wake up correctly at the beginning of the next cycle.
1260
1261         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp:
1262         (WebCore::LibWebRTCAudioModule::StartPlayoutOnAudioThread):
1263
1264         Fix AudioTrackPrivateMediaStreamCocoa by just using the output unit's preferred format
1265         description (with the current system sample rate), rather than whatever is the current
1266         input description.
1267
1268         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
1269         (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
1270         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
1271         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
1272
1273         Fix RealtimeIncomingAudioSource by actually creating an AudioSourceProvider when asked.
1274
1275         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
1276         (WebCore::RealtimeIncomingAudioSource::OnData):
1277         (WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
1278         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
1279
1280         Fix RealtimeOutgoingAudioSource by using the outgoing format description rather than the
1281         incoming one to determine the sample rate, channel count, sample byte size, etc., to use
1282         when delivering data upstream to libWebRTC.
1283
1284         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
1285         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
1286         (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
1287         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
1288
1289         Fix WebAudioSourceProviderAVFObjC by using a AudioSampleDataSource to do format and sample
1290         rate conversion rather than trying to duplicate all that code and use a CARingBuffer and 
1291         AudioConverter directly.
1292
1293         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
1294         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
1295         (WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
1296         (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
1297         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
1298         (WebCore::WebAudioSourceProviderAVFObjC::unprepare):
1299         (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
1300
1301         Fix the MockLibWebRTCAudioTrack by passing along the AddSink() sink to its AudioSourceInterface,
1302         allowing the RealtimeOutgoingAudioSource to push data into the libWebRTC network stack. Also,
1303         make sure m_enabled is initialized to a good value.
1304
1305         * testing/MockLibWebRTCPeerConnection.h:
1306
1307 2017-02-21  Jer Noble  <jer.noble@apple.com>
1308
1309         AudioSampleDataSource should not exclusively lock its read and write threads.
1310         https://bugs.webkit.org/show_bug.cgi?id=168646
1311
1312         Reviewed by Eric Carlson.
1313
1314         Locking the write thread causes the read thread to drop audio samples and generates audible
1315         glitches, and the realtime audio thread backing the read thread should never block. There's
1316         no real reason to lock these threads against one another here; they both rely on the
1317         CARingBuffer to safely and simultaneously read and write data.
1318
1319         * platform/audio/mac/AudioSampleDataSource.cpp:
1320         (WebCore::AudioSampleDataSource::setPaused):
1321         (WebCore::AudioSampleDataSource::pushSamplesInternal):
1322         (WebCore::AudioSampleDataSource::pushSamples):
1323         (WebCore::AudioSampleDataSource::pullSamplesInternal):
1324         (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
1325         (WebCore::AudioSampleDataSource::pullSamples):
1326         * platform/audio/mac/AudioSampleDataSource.h:
1327
1328 2017-02-21  Jer Noble  <jer.noble@apple.com>
1329
1330         AudioTrackPrivateMediaStreamCocoa should not exclusively lock its read and write threads.
1331         https://bugs.webkit.org/show_bug.cgi?id=168643
1332
1333         Reviewed by Eric Carlson.
1334
1335         Locking the write thread causes the read thread to drop audio samples and generates audible
1336         glitches, and the realtime audio thread backing the read thread should never block. There's
1337         no real reason to lock these threads against one another here; they both rely on the
1338         AudioSampleDataSource and it's CARingBuffer to safely and simultaneously read and write
1339         data.
1340
1341         The one piece which locks previously protected against unsafe access was during creation of
1342         the audio unit.  Without a lock, the audio unit could begin playback after the unit was
1343         created and assigned to m_remoteIOUnit but before the ring buffer was created. To protect
1344         against this possibility, create the unit, set the input and output descriptions, but only
1345         assign the new audio unit to m_remoteIOUnit after the ring buffer has been created and
1346         initialized.
1347
1348         * platform/audio/mac/CAAudioStreamDescription.h:
1349         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
1350         (WebCore::AudioTrackPrivateMediaStreamCocoa::~AudioTrackPrivateMediaStreamCocoa):
1351         (WebCore::AudioTrackPrivateMediaStreamCocoa::playInternal):
1352         (WebCore::AudioTrackPrivateMediaStreamCocoa::play):
1353         (WebCore::AudioTrackPrivateMediaStreamCocoa::pause):
1354         (WebCore::AudioTrackPrivateMediaStreamCocoa::setVolume):
1355         (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
1356         (WebCore::AudioTrackPrivateMediaStreamCocoa::setupAudioUnit): Renamed to createAudioUnit()
1357         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
1358         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
1359
1360 2017-02-27  Youenn Fablet  <youenn@apple.com>
1361
1362         [WebRTC] RealtimOutgoingVideoSource should not need to do image conversion
1363         https://bugs.webkit.org/show_bug.cgi?id=168802
1364
1365         Reviewed by Jon Lee.
1366
1367         Covered by manual testing as mock sources do not hit the same code path.
1368
1369         * platform/mediastream/mac/AVVideoCaptureSource.h:
1370         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1371         (WebCore::AVVideoCaptureSource::currentFrameCGImage):
1372         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
1373         (WebCore::RealtimeOutgoingVideoSource::sendFrame):
1374         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
1375         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
1376
1377 2017-02-27  Carlos Garcia Campos  <cgarcia@igalia.com>
1378
1379         [GTK] Downloads attributes tests are failing
1380         https://bugs.webkit.org/show_bug.cgi?id=168871
1381
1382         Reviewed by Michael Catanzaro.
1383
1384         Use libsoup to get the suggested filename from the Content-Disposition header instead of buggy
1385         filenameFromHTTPContentDisposition().
1386
1387         Fixes: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html
1388                fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html
1389
1390         * platform/network/soup/ResourceResponseSoup.cpp:
1391         (WebCore::ResourceResponse::platformSuggestedFilename):
1392
1393 2017-02-27  Antoine Quint  <graouts@apple.com>
1394
1395         [Modern Media Controls] Dragging controls in fullscreen on macOS prevents scrubbing or interacting with controls
1396         https://bugs.webkit.org/show_bug.cgi?id=168820
1397         <rdar://problem/30690281>
1398
1399         Reviewed by Jon Lee.
1400
1401         We broke this in https://bugs.webkit.org/show_bug.cgi?id=168755. We restore the check that the
1402         event target when initiating a drag is the controls bar itself and not some of its content.
1403
1404         Since this wasn't caught by our existing tests, we add a test that attemps to initiate a drag
1405         starting over one of the controls and notice that no dragging occurs.
1406
1407         We also fix an issue where we wouldn't update the layout of the left container as its icon
1408         buttons would load, which would cause the layout width of the left container to be incorrect
1409         and the related tests to time out.
1410
1411         Test: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html
1412
1413         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
1414         (MacOSFullscreenMediaControls.prototype.layout):
1415         (MacOSFullscreenMediaControls.prototype._handleMousedown):
1416
1417 2017-02-27  Alex Christensen  <achristensen@webkit.org>
1418
1419         [libwebrtc] Enable WebRTC in some Production Builds
1420         https://bugs.webkit.org/show_bug.cgi?id=168858
1421
1422         * Configurations/FeatureDefines.xcconfig:
1423
1424 2017-02-27  Zan Dobersek  <zdobersek@igalia.com>
1425
1426         [TextureMapper] Clean up BitmapTextureGL construction
1427         https://bugs.webkit.org/show_bug.cgi?id=168909
1428
1429         Reviewed by Carlos Garcia Campos.
1430
1431         Have the BitmapTextureGL constructor accept an rvalue reference pointer
1432         to the GraphicsContext3D object. A static create() method is also added
1433         to help with constructing these objects. Construction sites are updated
1434         appropriately.
1435
1436         The BitmapTextureGL constructor is further cleaned up by moving default
1437         member initializations together with the member declarations.
1438
1439         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1440         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
1441         * platform/graphics/texmap/BitmapTextureGL.cpp:
1442         (WebCore::BitmapTextureGL::BitmapTextureGL):
1443         * platform/graphics/texmap/BitmapTextureGL.h:
1444         * platform/graphics/texmap/BitmapTexturePool.cpp:
1445         (WebCore::BitmapTexturePool::createTexture):
1446         * platform/graphics/texmap/TextureMapperGL.cpp:
1447         (WebCore::TextureMapperGL::createTexture):
1448
1449 2017-02-27  Zan Dobersek  <zdobersek@igalia.com>
1450
1451         [TextureMapper] Remove InterpolationQuality, TextDrawingModeFlags member variables
1452         https://bugs.webkit.org/show_bug.cgi?id=168906
1453
1454         Reviewed by Carlos Garcia Campos.
1455
1456         Remove the InterpolationQuality and TextDrawingModeFlags member variables from the
1457         TextureMapper class. These weren't modified anywhere in the code.
1458
1459         BitmapTexture::updateContents() still sets the image interpolation quality and
1460         drawing mode on the ImageBuffer's GraphicsContext, but now uses the default
1461         InterpolationDefault and TextModeFill values.
1462
1463         * platform/graphics/texmap/BitmapTexture.cpp:
1464         (WebCore::BitmapTexture::updateContents):
1465         * platform/graphics/texmap/TextureMapper.cpp:
1466         (WebCore::TextureMapper::TextureMapper): Deleted.
1467         (WebCore::TextureMapper::~TextureMapper): Deleted.
1468         * platform/graphics/texmap/TextureMapper.h:
1469         (WebCore::TextureMapper::setImageInterpolationQuality): Deleted.
1470         (WebCore::TextureMapper::setTextDrawingMode): Deleted.
1471         (WebCore::TextureMapper::imageInterpolationQuality): Deleted.
1472         (WebCore::TextureMapper::textDrawingMode): Deleted.
1473
1474 2017-02-26  Zan Dobersek  <zdobersek@igalia.com>
1475
1476         [CoordinatedGraphics] Remove CoordinatedGraphicsScene::paintToGraphicsContext()
1477         https://bugs.webkit.org/show_bug.cgi?id=168903
1478
1479         Reviewed by Carlos Garcia Campos.
1480
1481         Remove the GraphicsContext pointer member from the TextureMapper class
1482         since the getter and setter methods are not used anywhere.
1483
1484         * platform/graphics/texmap/TextureMapper.cpp:
1485         (WebCore::TextureMapper::TextureMapper):
1486         * platform/graphics/texmap/TextureMapper.h:
1487         (WebCore::TextureMapper::setGraphicsContext): Deleted.
1488         (WebCore::TextureMapper::graphicsContext): Deleted.
1489
1490 2017-02-26  Myles C. Maxfield  <mmaxfield@apple.com>
1491
1492         Stop compiling our own cursorMovementIterator()
1493         https://bugs.webkit.org/show_bug.cgi?id=168211
1494
1495         Reviewed by David Hyatt.
1496
1497         Covered by existing tests.
1498
1499         Hook up the caret iterator.
1500
1501         * platform/graphics/ComplexTextController.cpp:
1502         (WebCore::ComplexTextController::offsetForPosition):
1503         * rendering/RenderText.cpp:
1504         (WebCore::RenderText::previousOffset):
1505         (WebCore::RenderText::nextOffset):
1506         * rendering/RenderText.h:
1507
1508 2017-02-26  Commit Queue  <commit-queue@webkit.org>
1509
1510         Unreviewed, rolling out r212942.
1511         https://bugs.webkit.org/show_bug.cgi?id=168882
1512
1513         Made EWS very flaky (Requested by ap on #webkit).
1514
1515         Reverted changeset:
1516
1517         "[Modern Media Controls] Dragging controls in fullscreen on
1518         macOS prevents scrubbing or interacting with controls"
1519         https://bugs.webkit.org/show_bug.cgi?id=168820
1520         http://trac.webkit.org/changeset/212942
1521
1522 2017-02-26  Chris Dumez  <cdumez@apple.com>
1523
1524         HitTestResult's linkSuggestedFilename should sanitize download attribute
1525         https://bugs.webkit.org/show_bug.cgi?id=168856
1526         <rdar://problem/30683109>
1527
1528         Reviewed by Antti Koivisto.
1529
1530         HitTestResult's linkSuggestedFilename should sanitize download attribute.
1531         This is used by the context menu's "Download Linked File" & "Download Linked
1532         File As..." actions.
1533
1534         * rendering/HitTestResult.cpp:
1535         (WebCore::HitTestResult::linkSuggestedFilename):
1536         * rendering/HitTestResult.h:
1537
1538 2017-02-25  Zalan Bujtas  <zalan@apple.com>
1539
1540         Simple line layout: Move coverage functions out of SimpleLineLayout.cpp
1541         https://bugs.webkit.org/show_bug.cgi?id=168872
1542         
1543         Reviewed by Simon Fraser.
1544
1545         SimpleLineLayout.cpp is for core functions only.
1546
1547         No change in functionality.
1548
1549         * CMakeLists.txt:
1550         * WebCore.xcodeproj/project.pbxproj:
1551         * rendering/RenderingAllInOne.cpp:
1552         * rendering/SimpleLineLayout.cpp:
1553         (WebCore::SimpleLineLayout::canUseForWithReason):
1554         (WebCore::SimpleLineLayout::printReason): Deleted.
1555         (WebCore::SimpleLineLayout::printReasons): Deleted.
1556         (WebCore::SimpleLineLayout::printTextForSubtree): Deleted.
1557         (WebCore::SimpleLineLayout::textLengthForSubtree): Deleted.
1558         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows): Deleted.
1559         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage): Deleted.
1560         (WebCore::SimpleLineLayout::toggleSimpleLineLayout): Deleted.
1561         (WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList): Deleted.
1562         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage): Deleted.
1563         * rendering/SimpleLineLayout.h:
1564         * rendering/SimpleLineLayoutCoverage.cpp: Added.
1565         (WebCore::SimpleLineLayout::printReason):
1566         (WebCore::SimpleLineLayout::printReasons):
1567         (WebCore::SimpleLineLayout::printTextForSubtree):
1568         (WebCore::SimpleLineLayout::textLengthForSubtree):
1569         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows):
1570         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):
1571         (WebCore::SimpleLineLayout::toggleSimpleLineLayout):
1572         (WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList):
1573         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
1574         * rendering/SimpleLineLayoutCoverage.h: Added.
1575
1576 2017-02-25  Zalan Bujtas  <zalan@apple.com>
1577
1578         Text might wrap when its preferred logical width is used for sizing the containing block.
1579         https://bugs.webkit.org/show_bug.cgi?id=168864
1580         <rdar://problem/30690734>
1581
1582         Reviewed by Antti Koivisto.
1583
1584         In certain cases we end up measuring a text run in 2 different ways.
1585         1. preferred width computation -> slow path FontCascade::width() 
1586         2. line breaking logic -> fast path FontCascade::widthForSimpleText()
1587  
1588         FontCascade::width() and ::widthForSimpleText() might return different results for the same run even when
1589         the individual glyph widths are measured to be the same. It's because they run diffrent set of
1590         arithmetics on the float values and for certain values these arithmetics produce different results due to the floating point
1591         precision.
1592         Since RenderText::computePreferredLogicalWidths() currently forces us to use the slow path
1593         (to retrieve fontfallback and glyph overflow information) the only alternative solution is to turn off the fast path
1594         for all runs that have been already measured using the slow path (which would be just wasteful).
1595
1596         Test: fast/text/fast-run-width-vs-slow-run-width.html
1597
1598         * platform/graphics/FontCascade.cpp:
1599         (WebCore::FontCascade::widthForSimpleText): Mimics WidthIterator::applyFontTransforms. Use the same set of arithmetics here.  
1600
1601 2017-02-24  Simon Fraser  <simon.fraser@apple.com>
1602
1603         Improve how multiple codegen-properties are handled in CSSProperties.json
1604         https://bugs.webkit.org/show_bug.cgi?id=168867
1605
1606         Reviewed by Zalan Bujtas.
1607
1608         To make upcoming metadata storage easier, it's better if property entries in CSSProperties.json
1609         are always hashes. One property (line-height) used an array, in order to represent settings for
1610         two different build flags (ENABLE_TEXT_AUTOSIZING and !ENABLE_TEXT_AUTOSIZING).
1611
1612         Fix by making "codegen-properties" optionally be an array. The relevant item is selected in
1613         removeInactiveCodegenProperties() and used to replace the array.
1614
1615         Sort @internalProprerties when generating code, otherwise the contents of isInternalCSSProperty()
1616         are unstable (the order in @allNames is not stable because it's the keys in a hash).
1617
1618         * css/CSSProperties.json:
1619         * css/makeprop.pl:
1620         (matchEnableFlags):
1621         (removeInactiveCodegenProperties):
1622         (isPropertyEnabled):
1623
1624 2017-02-24  Joseph Pecoraro  <pecoraro@apple.com>
1625
1626         [Resource Timing] Media elements initiated loads should set the initiatorType to their element name (video/audio)
1627         https://bugs.webkit.org/show_bug.cgi?id=168680
1628
1629         Reviewed by Youenn Fablet.
1630
1631         * html/HTMLMediaElement.cpp:
1632         (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
1633         Pass in the element so it may be used as the initiator.
1634
1635         * html/HTMLVideoElement.h:
1636         Export create() for TestWebKitAPI to use.
1637
1638         * loader/MediaResourceLoader.cpp:
1639         (WebCore::MediaResourceLoader::MediaResourceLoader):
1640         (WebCore::MediaResourceLoader::contextDestroyed):
1641         (WebCore::MediaResourceLoader::requestResource):
1642         * loader/MediaResourceLoader.h:
1643         Include the HTMLMediaElement as the initiator.
1644
1645 2017-02-24  Joseph Pecoraro  <pecoraro@apple.com>
1646
1647         [Resource Timing] Gather timing information with reliable responseEnd time
1648         https://bugs.webkit.org/show_bug.cgi?id=168351
1649
1650         Reviewed by Alex Christensen.
1651
1652         This patch replaces the unused `double finishTime` in ResourceLoader's
1653         didFinishLoad with a complete WebCore::NetworkLoadMetrics object. This
1654         allows the NetworkProcess to give complete timing information, and more
1655         final metrics about the load, to WebCore. Currently this is only used
1656         by ResourceTiming, but it will soon be used by Web Inspector as well.
1657         We may also end up extending this to the didFail path as well, since it
1658         is possible that we have some metrics for load failures.
1659
1660         At the same time we want to start moving away from the legacy path that
1661         populated a subset of this information in ResourceResponse's NetworkLoadMetrics.
1662         It doesn't make sense to store this information on the ResourceResponse
1663         for a few reasons: We don't want to store the metrics in our Network Cache and
1664         not all of the load timing metrics have been populated yet (responseEnd).
1665         In an effort to move off of this data we've renamed the accessor to
1666         "deprecatedNetworkLoadMetrics". There are a few remaining clients
1667         (ResourceHandle, PerformanceTiming, InspectorNetworkAgent) which can be
1668         migrated separately from this patch.
1669
1670         Having both the legacy and new code paths adds a little bit of complexity.
1671         One advantage of the new path is that the complete load timing data
1672         (fetchStart -> dns -> connect -> request -> response -> responseEnd) can
1673         be packaged together. The legacy path could not include a responseEnd, so
1674         WebCore faked that value with its own timestamp. Having the fake responseEnd
1675         caused issues as timestamps / clocks are different between processes. In order
1676         for PerformanceResponseTiming to know whether or not the NetworkLoadMetrics
1677         has the complete network timing metrics it checks isComplete(). If true
1678         it knows it can use the responseEnd time from NetworkLoadMetrics, otherwise
1679         it must fallback to the legacy value from LoadTiming. Once all of the
1680         deprecatedNetworkLoadMetrics clients go away, we should always have the
1681         complete data and this can be eliminated.
1682
1683         Tests: imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.html
1684                imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.worker.html
1685
1686         * PlatformMac.cmake:
1687         * WebCore.xcodeproj/project.pbxproj:
1688         Rename NetworkLoadTiming -> NetworkLoadMetrics.
1689
1690         * page/PerformanceResourceTiming.cpp:
1691         (WebCore::entryStartTime):
1692         (WebCore::entryEndTime):
1693         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
1694         (WebCore::PerformanceResourceTiming::nextHopProtocol):
1695         (WebCore::PerformanceResourceTiming::domainLookupStart):
1696         (WebCore::PerformanceResourceTiming::domainLookupEnd):
1697         (WebCore::PerformanceResourceTiming::connectStart):
1698         (WebCore::PerformanceResourceTiming::connectEnd):
1699         (WebCore::PerformanceResourceTiming::secureConnectionStart):
1700         (WebCore::PerformanceResourceTiming::requestStart):
1701         (WebCore::PerformanceResourceTiming::responseStart):
1702         (WebCore::PerformanceResourceTiming::responseEnd):
1703         (WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
1704         * page/PerformanceResourceTiming.h:
1705         Mostly just updating names and types. This does however need to get the
1706         correct endTime based on whether the NetworkLoadMetrics are complete
1707         (meaning includes responseEnd) or not (legacy, use LoadTiming value).
1708
1709         * page/PerformanceResourceTiming.idl:
1710         Add nextHopProtocol.
1711
1712         * page/PerformanceTiming.cpp:
1713         (WebCore::PerformanceTiming::domainLookupStart):
1714         (WebCore::PerformanceTiming::domainLookupEnd):
1715         (WebCore::PerformanceTiming::connectStart):
1716         (WebCore::PerformanceTiming::connectEnd):
1717         (WebCore::PerformanceTiming::secureConnectionStart):
1718         (WebCore::PerformanceTiming::requestStart):
1719         (WebCore::PerformanceTiming::responseStart):
1720         (WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart):
1721         * page/PerformanceTiming.h:
1722         Navigation Timing values still uses the NetworkLoadTiming values stored on
1723         the DocumentLoader. This should be moved off of the deprecated path separately.
1724
1725         * platform/network/NetworkLoadMetrics.h: Renamed from Source/WebCore/platform/network/NetworkLoadTiming.h.
1726         (WebCore::NetworkLoadMetrics::NetworkLoadMetrics):
1727         (WebCore::NetworkLoadMetrics::isolatedCopy):
1728         (WebCore::NetworkLoadMetrics::reset):
1729         (WebCore::NetworkLoadMetrics::operator==):
1730         (WebCore::NetworkLoadMetrics::operator!=):
1731         (WebCore::NetworkLoadMetrics::isComplete):
1732         (WebCore::NetworkLoadMetrics::markComplete):
1733         (WebCore::NetworkLoadMetrics::encode):
1734         (WebCore::NetworkLoadMetrics::decode):
1735         Re-introduce a reset() method (for NetworkLoadSoup to reset between redirects).
1736         Add protocolName and "complete" boolean.
1737
1738         * platform/network/cocoa/NetworkLoadMetrics.mm: Renamed from Source/WebCore/platform/network/cocoa/NetworkLoadTiming.mm.
1739         (WebCore::timingValue):
1740         (WebCore::copyTimingData):
1741         (WebCore::setCollectsTimingData):
1742         Use this opportunity to convert NetworkLoadTiming timestamps to WTF::Seconds.
1743         Since we already have to modify all the clients this moves us to use the more
1744         strongly typed units that are less ambiguous then "double". The rest of the
1745         Performance API has already moved to these units.
1746
1747         * inspector/InspectorNetworkAgent.cpp:
1748         (WebCore::InspectorNetworkAgent::buildObjectForTiming):
1749         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
1750         (WebCore::InspectorNetworkAgent::didFinishLoading):
1751         * inspector/InspectorNetworkAgent.h:
1752         Inspector was the only client of the finishTime, and since the value was
1753         erratically coming from clients in different ways it was almost certainly
1754         inaccurate. Simplify this in preparation for using NetworkLoadMetrics.
1755
1756         * Modules/fetch/FetchLoader.cpp:
1757         (WebCore::FetchLoader::didFinishLoading):
1758         * Modules/fetch/FetchLoader.h:
1759         * fileapi/FileReaderLoader.cpp:
1760         (WebCore::FileReaderLoader::didFinishLoading):
1761         * fileapi/FileReaderLoader.h:
1762         * html/MediaFragmentURIParser.cpp:
1763         (WebCore::MediaFragmentURIParser::parseNPTTime):
1764         * inspector/InspectorInstrumentation.cpp:
1765         (WebCore::InspectorInstrumentation::didFinishLoadingImpl):
1766         * inspector/InspectorInstrumentation.h:
1767         (WebCore::InspectorInstrumentation::didFinishLoading):
1768         * loader/CrossOriginPreflightChecker.cpp:
1769         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
1770         * loader/DocumentLoader.cpp:
1771         (WebCore::DocumentLoader::notifyFinished):
1772         (WebCore::DocumentLoader::finishedLoading):
1773         (WebCore::DocumentLoader::continueAfterContentPolicy):
1774         (WebCore::DocumentLoader::maybeLoadEmpty):
1775         * loader/DocumentLoader.h:
1776         * loader/DocumentThreadableLoader.cpp:
1777         (WebCore::DocumentThreadableLoader::didReceiveResponse):
1778         (WebCore::DocumentThreadableLoader::notifyFinished):
1779         (WebCore::DocumentThreadableLoader::didFinishLoading):
1780         (WebCore::DocumentThreadableLoader::loadRequest):
1781         * loader/DocumentThreadableLoader.h:
1782         * loader/NetscapePlugInStreamLoader.cpp:
1783         (WebCore::NetscapePlugInStreamLoader::didFinishLoading):
1784         * loader/NetscapePlugInStreamLoader.h:
1785         * loader/ResourceLoadNotifier.cpp:
1786         (WebCore::ResourceLoadNotifier::didFinishLoad):
1787         (WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
1788         (WebCore::ResourceLoadNotifier::sendRemainingDelegateMessages):
1789         * loader/ResourceLoadNotifier.h:
1790         * loader/ResourceLoader.cpp:
1791         (WebCore::ResourceLoader::deliverResponseAndData):
1792         (WebCore::ResourceLoader::loadDataURL):
1793         (WebCore::ResourceLoader::didFinishLoading):
1794         (WebCore::ResourceLoader::didFinishLoadingOnePart):
1795         * loader/ResourceLoader.h:
1796         * loader/ResourceTiming.cpp:
1797         (WebCore::ResourceTiming::fromLoad):
1798         (WebCore::ResourceTiming::fromSynchronousLoad):
1799         (WebCore::ResourceTiming::ResourceTiming):
1800         (WebCore::ResourceTiming::isolatedCopy):
1801         * loader/ResourceTiming.h:
1802         (WebCore::ResourceTiming::networkLoadMetrics):
1803         (WebCore::ResourceTiming::ResourceTiming):
1804         (WebCore::ResourceTiming::networkLoadTiming): Deleted.
1805         * loader/SubresourceLoader.cpp:
1806         (WebCore::SubresourceLoader::SubresourceLoader):
1807         (WebCore::SubresourceLoader::willSendRequestInternal):
1808         (WebCore::SubresourceLoader::didReceiveResponse):
1809         (WebCore::SubresourceLoader::didFinishLoading):
1810         (WebCore::SubresourceLoader::reportResourceTiming):
1811         * loader/SubresourceLoader.h:
1812         * loader/ThreadableLoaderClient.h:
1813         (WebCore::ThreadableLoaderClient::didFinishLoading):
1814         * loader/ThreadableLoaderClientWrapper.h:
1815         (WebCore::ThreadableLoaderClientWrapper::didFinishLoading):
1816         * loader/WorkerThreadableLoader.cpp:
1817         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
1818         * loader/WorkerThreadableLoader.h:
1819         * loader/appcache/ApplicationCacheGroup.cpp:
1820         (WebCore::ApplicationCacheGroup::didFinishLoading):
1821         * loader/appcache/ApplicationCacheGroup.h:
1822         * loader/cache/CachedResource.h:
1823         (WebCore::CachedResource::setLoadFinishTime):
1824         * loader/ios/QuickLook.mm:
1825         (-[WebPreviewLoader connectionDidFinishLoading:]):
1826         * page/EventSource.cpp:
1827         (WebCore::EventSource::didFinishLoading):
1828         * page/EventSource.h:
1829         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1830         (ResourceHandleStreamingClient::didFinishLoading):
1831         * platform/network/BlobResourceHandle.cpp:
1832         (WebCore::doNotifyFinish):
1833         * platform/network/PingHandle.h:
1834         * platform/network/ResourceHandle.h:
1835         * platform/network/ResourceHandleClient.h:
1836         (WebCore::ResourceHandleClient::didFinishLoading):
1837         * platform/network/ResourceResponseBase.cpp:
1838         (WebCore::ResourceResponseBase::crossThreadData):
1839         (WebCore::ResourceResponseBase::fromCrossThreadData):
1840         (WebCore::ResourceResponseBase::compare):
1841         * platform/network/ResourceResponseBase.h:
1842         (WebCore::ResourceResponseBase::deprecatedNetworkLoadMetrics):
1843         (WebCore::ResourceResponseBase::encode):
1844         (WebCore::ResourceResponseBase::decode):
1845         (WebCore::ResourceResponseBase::networkLoadTiming): Deleted.
1846         * platform/network/SynchronousLoaderClient.cpp:
1847         (WebCore::SynchronousLoaderClient::didFinishLoading):
1848         * platform/network/SynchronousLoaderClient.h:
1849         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1850         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
1851         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
1852         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
1853         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
1854         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading):
1855         * platform/network/curl/ResourceHandleCurl.cpp:
1856         (WebCore::WebCoreSynchronousLoader::didFinishLoading):
1857         * platform/network/curl/ResourceHandleManager.cpp:
1858         (WebCore::calculateWebTimingInformations):
1859         (WebCore::ResourceHandleManager::downloadTimerCallback):
1860         (WebCore::handleDataURL):
1861         (WebCore::milisecondsSinceRequest): Deleted.
1862         * platform/network/mac/ResourceHandleMac.mm:
1863         (WebCore::ResourceHandle::getConnectionTimingData):
1864         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
1865         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
1866         (-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]):
1867         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1868         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
1869         (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
1870         * platform/network/soup/ResourceHandleSoup.cpp:
1871         (WebCore::restartedCallback):
1872         (WebCore::nextMultipartResponsePartCallback):
1873         (WebCore::sendRequestCallback):
1874         (WebCore::ResourceHandle::didStartRequest):
1875         (WebCore::networkEventCallback):
1876         (WebCore::ResourceHandle::sendPendingRequest):
1877         (WebCore::readCallback):
1878         (WebCore::milisecondsSinceRequest): Deleted.
1879         * workers/WorkerScriptLoader.cpp:
1880         (WebCore::WorkerScriptLoader::didFinishLoading):
1881         * workers/WorkerScriptLoader.h:
1882         * xml/XMLHttpRequest.cpp:
1883         (WebCore::XMLHttpRequest::didFinishLoading):
1884         * xml/XMLHttpRequest.h:
1885         Eliminate the unused finishTime double.
1886
1887 2017-02-24  Chris Dumez  <cdumez@apple.com>
1888
1889         Unreviewed GTK build fix after r212965
1890
1891         * CMakeLists.txt:
1892
1893 2017-02-24  Chris Dumez  <cdumez@apple.com>
1894
1895         Unreviewed, rolling out r212944.
1896
1897         Caused a lot of failures on the debug bots
1898
1899         Reverted changeset:
1900
1901         "[Resource Timing] Gather timing information with reliable
1902         responseEnd time"
1903         https://bugs.webkit.org/show_bug.cgi?id=168351
1904         http://trac.webkit.org/changeset/212944
1905
1906 2017-02-24  Chris Dumez  <cdumez@apple.com>
1907
1908         Unreviewed, follow-up fix after r212972.
1909
1910         Fixes a few assertions on the debug build bots.
1911         URL needs to be exactly the same as the parsed one given
1912         that we are calling the ParsedURLString constructor.
1913
1914         * platform/network/ResourceResponseBase.cpp:
1915         (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
1916
1917 2017-02-24  Zalan Bujtas  <zalan@apple.com>
1918
1919         Simple line layout: Re-adjust paginated lines when block height changes.
1920         https://bugs.webkit.org/show_bug.cgi?id=168838
1921         <rdar://problem/30701233>
1922
1923         Reviewed by Antti Koivisto.
1924
1925         When the estimated block height is wrong, we issue an additional layout on the inline children
1926         so that we get the pagination right (this layout is setChildNeedsLayout(MarkOnlyThis) only).
1927         Since the height change only affects the struts and page breaks (and again, the relayoutChildren flag is false)
1928         we don't need to re-layout the content, but instead we just need to re-adjust the pagination for the simple lines. 
1929         This patch also moves the pagination logic to SimpleLineLayoutPagination.cpp.
1930
1931         Not enabled yet.
1932
1933         * CMakeLists.txt:
1934         * WebCore.xcodeproj/project.pbxproj:
1935         * rendering/RenderBlockFlow.cpp:
1936         (WebCore::RenderBlockFlow::layoutSimpleLines):
1937         * rendering/RenderingAllInOne.cpp:
1938         * rendering/SimpleLineLayout.cpp:
1939         (WebCore::SimpleLineLayout::canUseForWithReason):
1940         (WebCore::SimpleLineLayout::create):
1941         (WebCore::SimpleLineLayout::Layout::create):
1942         (WebCore::SimpleLineLayout::Layout::Layout):
1943         (WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow): Deleted.
1944         (WebCore::SimpleLineLayout::computeLineBreakIndex): Deleted.
1945         (WebCore::SimpleLineLayout::computeOffsetAfterLineBreak): Deleted.
1946         (WebCore::SimpleLineLayout::setPageBreakForLine): Deleted.
1947         (WebCore::SimpleLineLayout::updateMinimumPageHeight): Deleted.
1948         (WebCore::SimpleLineLayout::adjustLinePositionsForPagination): Deleted.
1949         * rendering/SimpleLineLayout.h:
1950         (WebCore::SimpleLineLayout::Layout::setIsPaginated):
1951         (WebCore::SimpleLineLayout::Layout::setLineStruts):
1952         * rendering/SimpleLineLayoutPagination.cpp: Added.
1953         (WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow):
1954         (WebCore::SimpleLineLayout::computeLineBreakIndex):
1955         (WebCore::SimpleLineLayout::computeOffsetAfterLineBreak):
1956         (WebCore::SimpleLineLayout::setPageBreakForLine):
1957         (WebCore::SimpleLineLayout::updateMinimumPageHeight):
1958         (WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
1959         * rendering/SimpleLineLayoutPagination.h: Added.
1960
1961 2017-02-24  Jon Lee  <jonlee@apple.com>
1962
1963         Alias "system-ui" for the System font name
1964         https://bugs.webkit.org/show_bug.cgi?id=151493
1965
1966         Reviewed by Tim Horton and Joseph Pecoraro.
1967
1968         Updated existing tests.
1969
1970         * WebCore.xcodeproj/project.pbxproj: Add WebKitFontFamilyNames.in for
1971         convenience.
1972         * css/CSSValueKeywords.in: Add system-ui as a keyword.
1973         * css/WebKitFontFamilyNames.in: Add system-ui.
1974
1975         * platform/graphics/ios/FontCacheIOS.mm:
1976         (WebCore::platformFontWithFamilySpecialCase): Include "system-ui" as an
1977         alias.
1978         * platform/graphics/mac/FontCacheMac.mm:
1979         (WebCore::platformFontWithFamilySpecialCase): Ditto.
1980
1981         * rendering/RenderThemeMac.mm:
1982         (WebCore::RenderThemeMac::updateCachedSystemFontDescription): Update
1983         serialization to "system-ui" from "-apple-system".
1984
1985         * css/CSSComputedStyleDeclaration.cpp:
1986         (WebCore::identifierForFamily):
1987         * css/CSSFontFaceSet.cpp:
1988         (WebCore::CSSFontFaceSet::familyNameFromPrimitive):
1989         * css/StyleBuilderCustom.h:
1990         (WebCore::StyleBuilderCustom::applyValueFontFamily):
1991
1992 2017-02-24  Matt Rajca  <mrajca@apple.com>
1993
1994         Media: notify clients when autoplay is denied
1995         https://bugs.webkit.org/show_bug.cgi?id=168840
1996
1997         Reviewed by Alex Christensen.
1998
1999         Added API tests.
2000
2001         * WebCore.xcodeproj/project.pbxproj:
2002         * html/HTMLMediaElement.cpp:
2003         (WebCore::HTMLMediaElement::setReadyState):
2004         (WebCore::HTMLMediaElement::play):
2005         (WebCore::HTMLMediaElement::playInternal):
2006         * page/AutoplayEvent.h: Added.
2007         * page/ChromeClient.h:
2008
2009 2017-02-24  Basuke Suzuki  <Basuke.Suzuki@am.sony.com>
2010
2011         curl: Improve errors by including the domain
2012         https://bugs.webkit.org/show_bug.cgi?id=134340
2013
2014         Reviewed by Alex Christensen.
2015
2016         Added proper error domain to ResourceError created by
2017         Curl problem.
2018
2019         * platform/network/curl/ResourceHandleManager.cpp:
2020         (WebCore::ResourceHandleManager::downloadTimerCallback):
2021         (WebCore::ResourceHandleManager::dispatchSynchronousJob):
2022
2023 2017-02-24  Antoine Quint  <graouts@apple.com>
2024
2025         [Modern Media Controls] <audio> controls should center in their container when the page is scaled
2026         https://bugs.webkit.org/show_bug.cgi?id=168841
2027         <rdar://problem/28612794>
2028
2029         Reviewed by Eric Carlson.
2030
2031         When dealing with <audio> elements, we vertically center the controls relative to their containing
2032         media element such that if the controls visually overflow, they overflow equally above and below
2033         to minimize the likelihood of overlap with surrounding elements.
2034
2035         Test: media/modern-media-controls/media-controller/media-controller-scale-factor-audio.html
2036
2037         * Modules/modern-media-controls/controls/media-controls.js:
2038         (MediaControls.prototype.get shouldCenterControlsVertically):
2039         (MediaControls.prototype.set shouldCenterControlsVertically):
2040         (MediaControls.prototype.commitProperty):
2041         * Modules/modern-media-controls/media/media-controller.js:
2042         (MediaController.prototype.get isAudio):
2043         (MediaController.prototype.get layoutTraits):
2044         (MediaController.prototype._updateControlsSize):
2045
2046 2017-02-24  Alex Christensen  <achristensen@webkit.org>
2047
2048         Non-special relative URLs should not ignore extra slashes
2049         https://bugs.webkit.org/show_bug.cgi?id=168834
2050
2051         Reviewed by Sam Weinig.
2052
2053         Special authority ignore slashes state should, as its name implies,
2054         only be reached by special URLs.  See https://url.spec.whatwg.org/#relative-slash-state
2055
2056         Covered by newly passing web platform tests.
2057
2058         * platform/URLParser.cpp:
2059         (WebCore::URLParser::parse):
2060
2061 2017-02-24  Alexey Proskuryakov  <ap@apple.com>
2062
2063         Build fix for newer clang
2064         https://bugs.webkit.org/show_bug.cgi?id=168849
2065         rdar://problem/30638741
2066
2067         Reviewed by Ryosuke Niwa.
2068
2069         * dom/Range.cpp: (WebCore::Range::toString): std::max(0, <unsigned>) is not meaningful,
2070         and now triggers a warning.
2071
2072 2017-02-24  Chris Dumez  <cdumez@apple.com>
2073
2074         Download attribute should be sanitized before being used as suggested filename
2075         https://bugs.webkit.org/show_bug.cgi?id=168839
2076         <rdar://problem/30683109>
2077
2078         Reviewed by Darin Adler.
2079
2080         Sanitize Download attribute before using it as a suggested filename for the download.
2081         We rely on ResourceResponse's sanitizing of the suggested filename to do so, which has
2082         the benefit of being consistent with downloads without the download attribute.
2083
2084         Tests: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html
2085                fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-slashes.html
2086                fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html
2087
2088         * html/HTMLAnchorElement.cpp:
2089         (WebCore::HTMLAnchorElement::handleClick):
2090         * platform/network/ResourceResponseBase.cpp:
2091         (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
2092         * platform/network/ResourceResponseBase.h:
2093
2094 2017-02-24  Miguel Gomez  <magomez@igalia.com>
2095
2096         [GTK] WebkitWebProcess crashes on exit on nvidia if threaded compositing is enabled
2097         https://bugs.webkit.org/show_bug.cgi?id=165522
2098
2099         Reviewed by Carlos Garcia Campos.
2100
2101         Before destrying a GLContextGLX we need to set the default framebufer to avoid a bug
2102         in some nvidia drivers. Ensure that we set the context as current before performing
2103         that operation, and set the appropriate current context after doing so.
2104
2105         No new tests.
2106
2107         * platform/graphics/glx/GLContextGLX.cpp:
2108         (WebCore::GLContextGLX::~GLContextGLX):
2109
2110 2017-02-24  Chris Dumez  <cdumez@apple.com>
2111
2112         [iOS][WK2] Disable network cache speculative revalidation / loading in low power mode
2113         https://bugs.webkit.org/show_bug.cgi?id=168832
2114         <rdar://problem/30697911>
2115
2116         Reviewed by Antti Koivisto.
2117
2118         Add LowPowerModeNotifier class to monitor low power mode state on iOS.
2119
2120         * WebCore.xcodeproj/project.pbxproj:
2121         * platform/LowPowerModeNotifier.cpp: Added.
2122         (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
2123         (WebCore::LowPowerModeNotifier::isLowPowerModeEnabled):
2124         * platform/LowPowerModeNotifier.h: Added.
2125         * platform/ios/LowPowerModeNotifierIOS.mm: Added.
2126         (-[WebLowPowerModeObserver initWithNotifier:]):
2127         (-[WebLowPowerModeObserver dealloc]):
2128         (-[WebLowPowerModeObserver _didReceiveLowPowerModeChange]):
2129         (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
2130         (WebCore::LowPowerModeNotifier::isLowPowerModeEnabled):
2131         (WebCore::LowPowerModeNotifier::notifyLowPowerModeChanged):
2132         (WebCore::notifyLowPowerModeChanged):
2133
2134 2017-02-24  Chris Dumez  <cdumez@apple.com>
2135
2136         [Mac] Report domains using abnormally high memory usage via enhanced privacy logging
2137         https://bugs.webkit.org/show_bug.cgi?id=168797
2138         <rdar://problem/29964017>
2139
2140         Reviewed by Andreas Kling.
2141
2142         Report domains using abnormally high memory usage (> 2GB) via enhanced privacy
2143         logging on Mac.
2144
2145         * page/DiagnosticLoggingKeys.cpp:
2146         (WebCore::DiagnosticLoggingKeys::domainCausingJetsamKey):
2147         * page/DiagnosticLoggingKeys.h:
2148         * page/PerformanceMonitor.cpp:
2149         (WebCore::reportPageOverPostLoadResourceThreshold):
2150         (WebCore::PerformanceMonitor::measurePostLoadCPUUsage):
2151         (WebCore::PerformanceMonitor::measurePostLoadMemoryUsage):
2152         (WebCore::reportPageOverPostLoadCPUUsageThreshold): Deleted.
2153
2154 2017-02-24  Alex Christensen  <achristensen@webkit.org>
2155
2156         .. should not remove windows drive letters in paths of file URLs
2157         https://bugs.webkit.org/show_bug.cgi?id=168824
2158
2159         Reviewed by Youenn Fablet.
2160
2161         It's specified in https://url.spec.whatwg.org/#shorten-a-urls-path and helps behavior for browsers on Windows.
2162         It can't hurt to pass a few more web platform tests, though.
2163
2164         * platform/URLParser.cpp:
2165         (WebCore::URLParser::copyURLPartsUntil):
2166         (WebCore::URLParser::shouldPopPath):
2167         (WebCore::URLParser::popPath):
2168         (WebCore::URLParser::parse):
2169         * platform/URLParser.h:
2170
2171 2017-02-24  Csaba Osztrogon√°c  <ossy@webkit.org>
2172
2173         [Mac][cmake] Unreviewed buildfix after r212736.
2174
2175         * PlatformMac.cmake:
2176
2177 2017-02-24  John Wilander  <wilander@apple.com>
2178
2179         Resource Load Statistics: Add alternate classification method
2180         https://bugs.webkit.org/show_bug.cgi?id=168347
2181         <rdar://problem/30352793>
2182         <rdar://problem/30646710>
2183         <rdar://problem/30660708>
2184
2185         Reviewed by Alex Christensen.
2186
2187         This patch only adds test infrastructure in WebCore.
2188
2189         Tests: http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html
2190                http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html
2191                http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html
2192                http/tests/loading/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html
2193                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html
2194                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html
2195                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html
2196                http/tests/loading/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html
2197
2198         * loader/ResourceLoadObserver.cpp:
2199         (WebCore::ResourceLoadObserver::setSubframeUnderTopFrameOrigin):
2200         (WebCore::ResourceLoadObserver::setSubresourceUnderTopFrameOrigin):
2201         (WebCore::ResourceLoadObserver::setSubresourceUniqueRedirectTo):
2202         * loader/ResourceLoadObserver.h:
2203
2204 2017-02-23  Antoine Quint  <graouts@apple.com>
2205
2206         [Modern Media Controls] No controls are shown for <audio preload="none">
2207         https://bugs.webkit.org/show_bug.cgi?id=168800
2208         <rdar://problem/30652142>
2209
2210         Reviewed by Eric Carlson.
2211
2212         A media element's currentSrc property will only be set when data has started
2213         to load. In the case where preload="none" is used, regardless of whether a
2214         source is specified, currentSrc would be the empty string and we wouldn't
2215         show controls at all. Identifying whether a source is specified is a little
2216         tricky because it could be specified in a variety of ways and dynamically
2217         as well.
2218
2219         So instead we optimistically show controls always provided the "controls"
2220         attribute is set.
2221
2222         * Modules/modern-media-controls/media/controls-visibility-support.js:
2223         (ControlsVisibilitySupport.prototype._updateControls):
2224         (ControlsVisibilitySupport):
2225         * Modules/modern-media-controls/media/start-support.js:
2226         (StartSupport.prototype._shouldShowStartButton):
2227         (StartSupport):
2228
2229 2017-02-23  Joseph Pecoraro  <pecoraro@apple.com>
2230
2231         [Resource Timing] Gather timing information with reliable responseEnd time
2232         https://bugs.webkit.org/show_bug.cgi?id=168351
2233
2234         Reviewed by Alex Christensen.
2235
2236         This patch replaces the unused `double finishTime` in ResourceLoader's
2237         didFinishLoad with a complete WebCore::NetworkLoadMetrics object. This
2238         allows the NetworkProcess to give complete timing information, and more
2239         final metrics about the load, to WebCore. Currently this is only used
2240         by ResourceTiming, but it will soon be used by Web Inspector as well.
2241         We may also end up extending this to the didFail path as well, since it
2242         is possible that we have some metrics for load failures.
2243
2244         At the same time we want to start moving away from the legacy path that
2245         populated a subset of this information in ResourceResponse's NetworkLoadMetrics.
2246         It doesn't make sense to store this information on the ResourceResponse
2247         for a few reasons: We don't want to store the metrics in our Network Cache and
2248         not all of the load timing metrics have been populated yet (responseEnd).
2249         In an effort to move off of this data we've renamed the accessor to
2250         "deprecatedNetworkLoadMetrics". There are a few remaining clients
2251         (ResourceHandle, PerformanceTiming, InspectorNetworkAgent) which can be
2252         migrated separately from this patch.
2253
2254         Having both the legacy and new code paths adds a little bit of complexity.
2255         One advantage of the new path is that the complete load timing data
2256         (fetchStart -> dns -> connect -> request -> response -> responseEnd) can
2257         be packaged together. The legacy path could not include a responseEnd, so
2258         WebCore faked that value with its own timestamp. Having the fake responseEnd
2259         caused issues as timestamps / clocks are different between processes. In order
2260         for PerformanceResponseTiming to know whether or not the NetworkLoadMetrics
2261         has the complete network timing metrics it checks isComplete(). If true
2262         it knows it can use the responseEnd time from NetworkLoadMetrics, otherwise
2263         it must fallback to the legacy value from LoadTiming. Once all of the
2264         deprecatedNetworkLoadMetrics clients go away, we should always have the
2265         complete data and this can be eliminated.
2266
2267         Tests: imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.html
2268                imported/w3c/web-platform-tests/resource-timing/rt-nextHopProtocol.worker.html
2269
2270         * PlatformMac.cmake:
2271         * WebCore.xcodeproj/project.pbxproj:
2272         Rename NetworkLoadTiming -> NetworkLoadMetrics.
2273
2274         * page/PerformanceResourceTiming.cpp:
2275         (WebCore::entryStartTime):
2276         (WebCore::entryEndTime):
2277         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
2278         (WebCore::PerformanceResourceTiming::nextHopProtocol):
2279         (WebCore::PerformanceResourceTiming::domainLookupStart):
2280         (WebCore::PerformanceResourceTiming::domainLookupEnd):
2281         (WebCore::PerformanceResourceTiming::connectStart):
2282         (WebCore::PerformanceResourceTiming::connectEnd):
2283         (WebCore::PerformanceResourceTiming::secureConnectionStart):
2284         (WebCore::PerformanceResourceTiming::requestStart):
2285         (WebCore::PerformanceResourceTiming::responseStart):
2286         (WebCore::PerformanceResourceTiming::responseEnd):
2287         (WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
2288         * page/PerformanceResourceTiming.h:
2289         Mostly just updating names and types. This does however need to get the
2290         correct endTime based on whether the NetworkLoadMetrics are complete
2291         (meaning includes responseEnd) or not (legacy, use LoadTiming value).
2292
2293         * page/PerformanceResourceTiming.idl:
2294         Add nextHopProtocol.
2295
2296         * page/PerformanceTiming.cpp:
2297         (WebCore::PerformanceTiming::domainLookupStart):
2298         (WebCore::PerformanceTiming::domainLookupEnd):
2299         (WebCore::PerformanceTiming::connectStart):
2300         (WebCore::PerformanceTiming::connectEnd):
2301         (WebCore::PerformanceTiming::secureConnectionStart):
2302         (WebCore::PerformanceTiming::requestStart):
2303         (WebCore::PerformanceTiming::responseStart):
2304         (WebCore::PerformanceTiming::resourceLoadTimeRelativeToFetchStart):
2305         * page/PerformanceTiming.h:
2306         Navigation Timing values still uses the NetworkLoadTiming values stored on
2307         the DocumentLoader. This should be moved off of the deprecated path separately.
2308
2309         * platform/network/NetworkLoadMetrics.h: Renamed from Source/WebCore/platform/network/NetworkLoadTiming.h.
2310         (WebCore::NetworkLoadMetrics::NetworkLoadMetrics):
2311         (WebCore::NetworkLoadMetrics::isolatedCopy):
2312         (WebCore::NetworkLoadMetrics::reset):
2313         (WebCore::NetworkLoadMetrics::operator==):
2314         (WebCore::NetworkLoadMetrics::operator!=):
2315         (WebCore::NetworkLoadMetrics::isComplete):
2316         (WebCore::NetworkLoadMetrics::markComplete):
2317         (WebCore::NetworkLoadMetrics::encode):
2318         (WebCore::NetworkLoadMetrics::decode):
2319         Re-introduce a reset() method (for NetworkLoadSoup to reset between redirects).
2320         Add protocolName and "complete" boolean.
2321
2322         * platform/network/cocoa/NetworkLoadMetrics.mm: Renamed from Source/WebCore/platform/network/cocoa/NetworkLoadTiming.mm.
2323         (WebCore::timingValue):
2324         (WebCore::copyTimingData):
2325         (WebCore::setCollectsTimingData):
2326         Use this opportunity to convert NetworkLoadTiming timestamps to WTF::Seconds.
2327         Since we already have to modify all the clients this moves us to use the more
2328         strongly typed units that are less ambiguous then "double". The rest of the
2329         Performance API has already moved to these units.
2330
2331         * inspector/InspectorNetworkAgent.cpp:
2332         (WebCore::InspectorNetworkAgent::buildObjectForTiming):
2333         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
2334         (WebCore::InspectorNetworkAgent::didFinishLoading):
2335         * inspector/InspectorNetworkAgent.h:
2336         Inspector was the only client of the finishTime, and since the value was
2337         erratically coming from clients in different ways it was almost certainly
2338         inaccurate. Simplify this in preparation for using NetworkLoadMetrics.
2339
2340         * Modules/fetch/FetchLoader.cpp:
2341         (WebCore::FetchLoader::didFinishLoading):
2342         * Modules/fetch/FetchLoader.h:
2343         * fileapi/FileReaderLoader.cpp:
2344         (WebCore::FileReaderLoader::didFinishLoading):
2345         * fileapi/FileReaderLoader.h:
2346         * html/MediaFragmentURIParser.cpp:
2347         (WebCore::MediaFragmentURIParser::parseNPTTime):
2348         * inspector/InspectorInstrumentation.cpp:
2349         (WebCore::InspectorInstrumentation::didFinishLoadingImpl):
2350         * inspector/InspectorInstrumentation.h:
2351         (WebCore::InspectorInstrumentation::didFinishLoading):
2352         * loader/CrossOriginPreflightChecker.cpp:
2353         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
2354         * loader/DocumentLoader.cpp:
2355         (WebCore::DocumentLoader::notifyFinished):
2356         (WebCore::DocumentLoader::finishedLoading):
2357         (WebCore::DocumentLoader::continueAfterContentPolicy):
2358         (WebCore::DocumentLoader::maybeLoadEmpty):
2359         * loader/DocumentLoader.h:
2360         * loader/DocumentThreadableLoader.cpp:
2361         (WebCore::DocumentThreadableLoader::didReceiveResponse):
2362         (WebCore::DocumentThreadableLoader::notifyFinished):
2363         (WebCore::DocumentThreadableLoader::didFinishLoading):
2364         (WebCore::DocumentThreadableLoader::loadRequest):
2365         * loader/DocumentThreadableLoader.h:
2366         * loader/NetscapePlugInStreamLoader.cpp:
2367         (WebCore::NetscapePlugInStreamLoader::didFinishLoading):
2368         * loader/NetscapePlugInStreamLoader.h:
2369         * loader/ResourceLoadNotifier.cpp:
2370         (WebCore::ResourceLoadNotifier::didFinishLoad):
2371         (WebCore::ResourceLoadNotifier::dispatchDidFinishLoading):
2372         (WebCore::ResourceLoadNotifier::sendRemainingDelegateMessages):
2373         * loader/ResourceLoadNotifier.h:
2374         * loader/ResourceLoader.cpp:
2375         (WebCore::ResourceLoader::deliverResponseAndData):
2376         (WebCore::ResourceLoader::loadDataURL):
2377         (WebCore::ResourceLoader::didFinishLoading):
2378         (WebCore::ResourceLoader::didFinishLoadingOnePart):
2379         * loader/ResourceLoader.h:
2380         * loader/ResourceTiming.cpp:
2381         (WebCore::ResourceTiming::fromLoad):
2382         (WebCore::ResourceTiming::fromSynchronousLoad):
2383         (WebCore::ResourceTiming::ResourceTiming):
2384         (WebCore::ResourceTiming::isolatedCopy):
2385         * loader/ResourceTiming.h:
2386         (WebCore::ResourceTiming::networkLoadMetrics):
2387         (WebCore::ResourceTiming::ResourceTiming):
2388         (WebCore::ResourceTiming::networkLoadTiming): Deleted.
2389         * loader/SubresourceLoader.cpp:
2390         (WebCore::SubresourceLoader::SubresourceLoader):
2391         (WebCore::SubresourceLoader::willSendRequestInternal):
2392         (WebCore::SubresourceLoader::didReceiveResponse):
2393         (WebCore::SubresourceLoader::didFinishLoading):
2394         (WebCore::SubresourceLoader::reportResourceTiming):
2395         * loader/SubresourceLoader.h:
2396         * loader/ThreadableLoaderClient.h:
2397         (WebCore::ThreadableLoaderClient::didFinishLoading):
2398         * loader/ThreadableLoaderClientWrapper.h:
2399         (WebCore::ThreadableLoaderClientWrapper::didFinishLoading):
2400         * loader/WorkerThreadableLoader.cpp:
2401         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishLoading):
2402         * loader/WorkerThreadableLoader.h:
2403         * loader/appcache/ApplicationCacheGroup.cpp:
2404         (WebCore::ApplicationCacheGroup::didFinishLoading):
2405         * loader/appcache/ApplicationCacheGroup.h:
2406         * loader/cache/CachedResource.h:
2407         (WebCore::CachedResource::setLoadFinishTime):
2408         * loader/ios/QuickLook.mm:
2409         (-[WebPreviewLoader connectionDidFinishLoading:]):
2410         * page/EventSource.cpp:
2411         (WebCore::EventSource::didFinishLoading):
2412         * page/EventSource.h:
2413         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2414         (ResourceHandleStreamingClient::didFinishLoading):
2415         * platform/network/BlobResourceHandle.cpp:
2416         (WebCore::doNotifyFinish):
2417         * platform/network/PingHandle.h:
2418         * platform/network/ResourceHandle.h:
2419         * platform/network/ResourceHandleClient.h:
2420         (WebCore::ResourceHandleClient::didFinishLoading):
2421         * platform/network/ResourceResponseBase.cpp:
2422         (WebCore::ResourceResponseBase::crossThreadData):
2423         (WebCore::ResourceResponseBase::fromCrossThreadData):
2424         (WebCore::ResourceResponseBase::compare):
2425         * platform/network/ResourceResponseBase.h:
2426         (WebCore::ResourceResponseBase::deprecatedNetworkLoadMetrics):
2427         (WebCore::ResourceResponseBase::encode):
2428         (WebCore::ResourceResponseBase::decode):
2429         (WebCore::ResourceResponseBase::networkLoadTiming): Deleted.
2430         * platform/network/SynchronousLoaderClient.cpp:
2431         (WebCore::SynchronousLoaderClient::didFinishLoading):
2432         * platform/network/SynchronousLoaderClient.h:
2433         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2434         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
2435         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didFinishLoading):
2436         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
2437         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
2438         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didFinishLoading):
2439         * platform/network/curl/ResourceHandleCurl.cpp:
2440         (WebCore::WebCoreSynchronousLoader::didFinishLoading):
2441         * platform/network/curl/ResourceHandleManager.cpp:
2442         (WebCore::calculateWebTimingInformations):
2443         (WebCore::ResourceHandleManager::downloadTimerCallback):
2444         (WebCore::handleDataURL):
2445         (WebCore::milisecondsSinceRequest): Deleted.
2446         * platform/network/mac/ResourceHandleMac.mm:
2447         (WebCore::ResourceHandle::getConnectionTimingData):
2448         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
2449         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
2450         (-[WebCoreResourceHandleAsDelegate connectionDidFinishLoading:]):
2451         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2452         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
2453         (-[WebCoreResourceHandleAsOperationQueueDelegate connectionDidFinishLoading:]):
2454         * platform/network/soup/ResourceHandleSoup.cpp:
2455         (WebCore::restartedCallback):
2456         (WebCore::nextMultipartResponsePartCallback):
2457         (WebCore::sendRequestCallback):
2458         (WebCore::ResourceHandle::didStartRequest):
2459         (WebCore::networkEventCallback):
2460         (WebCore::ResourceHandle::sendPendingRequest):
2461         (WebCore::readCallback):
2462         (WebCore::milisecondsSinceRequest): Deleted.
2463         * workers/WorkerScriptLoader.cpp:
2464         (WebCore::WorkerScriptLoader::didFinishLoading):
2465         * workers/WorkerScriptLoader.h:
2466         * xml/XMLHttpRequest.cpp:
2467         (WebCore::XMLHttpRequest::didFinishLoading):
2468         * xml/XMLHttpRequest.h:
2469         Eliminate the unused finishTime double.
2470
2471 2017-02-23  Antoine Quint  <graouts@apple.com>
2472
2473         [Modern Media Controls] Controls overflow when media element has border or padding
2474         https://bugs.webkit.org/show_bug.cgi?id=168818
2475         <rdar://problem/30689780>
2476
2477         Reviewed by Jon Lee.
2478
2479         We used to query the media element's layout size to compute the size of the media controls,
2480         which would account for border and padding. Instead, we should use the size of the container,
2481         at the root of the ShadowRoot, which will always match the size of the media.
2482
2483         Test: media/modern-media-controls/media-controller/media-controller-controls-sizing-with-border-and-padding.html
2484
2485         * Modules/modern-media-controls/controls/media-controls.css:
2486         (.media-controls-container,):
2487         * Modules/modern-media-controls/media/media-controller.js:
2488         (MediaController.prototype._updateControlsSize):
2489         (MediaController.prototype._controlsWidth):
2490
2491 2017-02-23  Antoine Quint  <graouts@apple.com>
2492
2493         [Modern Media Controls] Dragging controls in fullscreen on macOS prevents scrubbing or interacting with controls
2494         https://bugs.webkit.org/show_bug.cgi?id=168820
2495         <rdar://problem/30690281>
2496
2497         Reviewed by Jon Lee.
2498
2499         We broke this in https://bugs.webkit.org/show_bug.cgi?id=168755. We restore the check that the
2500         event target when initiating a drag is the controls bar itself and not some of its content.
2501
2502         Since this wasn't caught by our existing tests, we add a test that attemps to initiate a drag
2503         starting over one of the controls and notice that no dragging occurs.
2504
2505         Test: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html
2506
2507         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
2508         (MacOSFullscreenMediaControls.prototype._handleMousedown):
2509
2510 2017-02-23  Simon Fraser  <simon.fraser@apple.com>
2511
2512         REGRESSION (r211305): Masks on composited elements with preserve-3d broken
2513         https://bugs.webkit.org/show_bug.cgi?id=168815
2514         rdar://problem/30676846
2515
2516         Reviewed by Jon Lee.
2517
2518         r211305 moved the mask layer to be on the structural layer if there is one, to fix
2519         masking backdrops. However, with preserve-3d the structural layer can be a CATransformLayer,
2520         which doesn't take a mask, so limit the previous change to backdrops only.
2521
2522         Test: compositing/masks/mask-with-preserve-3d.html
2523
2524         * platform/graphics/ca/GraphicsLayerCA.cpp:
2525         (WebCore::GraphicsLayerCA::updateMaskLayer):
2526
2527 2017-02-23  Antoine Quint  <graouts@apple.com>
2528
2529         [Modern Media Controls] Show "Loading" until playback starts
2530         https://bugs.webkit.org/show_bug.cgi?id=168809
2531         <rdar://problem/30687468>
2532
2533         Reviewed by Jon Lee.
2534
2535         We now display the "Loading" status as soon as we've started loading and
2536         until we've obtained enough data to play. No test provided since we don't
2537         have a way to specifically set networkState and readyState to the satisfactory
2538         values.
2539
2540         * Modules/modern-media-controls/media/status-support.js:
2541         (StatusSupport.prototype.syncControl):
2542         (StatusSupport):
2543
2544 2017-02-23  Antoine Quint  <graouts@apple.com>
2545
2546         [Modern Media Controls] Enforce a minimum layout height of 50pt for <audio>
2547         https://bugs.webkit.org/show_bug.cgi?id=168801
2548         <rdar://problem/30683453>
2549
2550         Reviewed by Eric Carlson.
2551
2552         We enforce a 50pt minimum layout height for <audio> elements. There is no way
2553         for the page author to override this value since the min-height property is set
2554         as !important in a <style> element contained in a ShadowRoot.
2555
2556         * Modules/modern-media-controls/controls/media-controls.css:
2557         (:host(audio)):
2558
2559 2017-02-23  Youenn Fablet  <youenn@apple.com>
2560
2561         [WebRTC] Outgoing video quality is poor
2562         https://bugs.webkit.org/show_bug.cgi?id=168778
2563         <rdar://problem/30674673>
2564
2565         Reviewed by Eric Carlson.
2566
2567         Covered by manually ensuring the voice process thread is not spinning.
2568
2569         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h: Setting the next call to max was not a good idea since the thread process is adding some value to it, making it a negative value.
2570
2571 2017-02-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2572
2573         Data interaction with a URL should navigate the page if the operation is not handled
2574         https://bugs.webkit.org/show_bug.cgi?id=168798
2575         <rdar://problem/30665969>
2576
2577         Reviewed by Tim Horton.
2578
2579         Refactors some drag and drop code on the Mac, and implements PlatformPasteboard::stringForType.
2580
2581         * page/DragController.cpp:
2582         (WebCore::DragController::performDragOperation):
2583         * platform/ios/PlatformPasteboardIOS.mm:
2584         (WebCore::PlatformPasteboard::stringForType):
2585         * platform/mac/DragDataMac.mm:
2586
2587 2017-02-23  Youenn Fablet  <youenn@apple.com>
2588
2589         [WebRTC] RealtimeOutgoingAudioSource does not need to upsample audio buffers
2590         https://bugs.webkit.org/show_bug.cgi?id=168796
2591
2592         Reviewed by Jer Noble.
2593
2594         Covered by manual testing.
2595         Limiting RealtimeOutgoingAudioSource conversion to interleaving and float-to-integer.
2596         Removed the sample rate conversion.
2597
2598         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
2599         (WebCore::libwebrtcAudioFormat):
2600         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
2601         (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
2602
2603 2017-02-23  Alex Christensen  <achristensen@webkit.org>
2604
2605         Re-soft-link CoreVideo after r212906
2606         https://bugs.webkit.org/show_bug.cgi?id=168803
2607
2608         Reviewed by Jer Noble.
2609
2610         CoreVideo should be soft linked to reduce startup time.
2611         Linking against the framework just for a few symbols used in one file was the wrong solution.
2612
2613         * Configurations/WebCore.xcconfig:
2614         * platform/cocoa/CoreVideoSoftLink.cpp:
2615         * platform/cocoa/CoreVideoSoftLink.h:
2616         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
2617
2618 2017-02-23  Chris Dumez  <cdumez@apple.com>
2619
2620         Report domains using abnormally high CPU usage via enhanced privacy logging
2621         https://bugs.webkit.org/show_bug.cgi?id=168794
2622         <rdar://problem/29964018>
2623
2624         Reviewed by Ryosuke Niwa.
2625
2626         Report domains using abnormally high CPU usage (> 20%) via enhanced privacy
2627         logging.
2628
2629         * page/DiagnosticLoggingKeys.cpp:
2630         (WebCore::DiagnosticLoggingKeys::domainCausingEnergyDrainKey):
2631         * page/DiagnosticLoggingKeys.h:
2632         * page/PerformanceMonitor.cpp:
2633         (WebCore::reportPageOverPostLoadCPUUsageThreshold):
2634         (WebCore::PerformanceMonitor::measurePostLoadCPUUsage):
2635
2636 2017-02-23  Zalan Bujtas  <zalan@apple.com>
2637
2638         Simple line layout: Adjust RunResolver::lineIndexForHeight with line struts.
2639         https://bugs.webkit.org/show_bug.cgi?id=168783
2640         <rdar://problem/30676449>
2641
2642         Reviewed by Antti Koivisto.
2643
2644         When there's a pagination gap between lines the simple lineIndex = y / lineHeight formula does not work anymore.
2645         This patch takes the line gaps into account by offsetting the y position accordingly.
2646
2647         Not enabled yet.
2648
2649         * rendering/SimpleLineLayoutResolver.cpp:
2650         (WebCore::SimpleLineLayout::RunResolver::lineIndexForHeight):
2651
2652 2017-02-23  Alex Christensen  <achristensen@webkit.org>
2653
2654         Fix iOS WebRTC build after r212812
2655         https://bugs.webkit.org/show_bug.cgi?id=168790
2656
2657         Reviewed by Tim Horton.
2658
2659         * Configurations/WebCore.xcconfig:
2660
2661 2017-02-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2662
2663         [GStreamer] Several layout tests trigger GStreamer-CRITICAL **: gst_bin_get_by_name: assertion 'GST_IS_BIN (bin)' failed
2664         https://bugs.webkit.org/show_bug.cgi?id=167016
2665
2666         Reviewed by Xabier Rodriguez-Calvar.
2667
2668         This is because we create AudioSourceProviderGStreamer objects that are never loaded. In the destructor the
2669         AudioSourceProviderGStreamer calls gst_bin_get_by_name() on its m_audioSinkBin that is nullptr. We could simply
2670         check m_audioSinkBin in the destructor, but I think it's better to simply not create
2671         AudioSourceProviderGStreamer for nothing. MediaPlayerPrivateGStreamer should create the AudioSourceProvider on demand.
2672
2673         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2674         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer): Do not create the AudioSourceProvider.
2675         (WebCore::MediaPlayerPrivateGStreamer::createAudioSink): Call ensureAudioSourceProvider() before using m_audioSourceProvider.
2676         (WebCore::MediaPlayerPrivateGStreamer::ensureAudioSourceProvider): Create the AudioSourceProvider if needed.
2677         (WebCore::MediaPlayerPrivateGStreamer::audioSourceProvider): Ensure and return the m_audioSourceProvider.
2678         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2679
2680 2017-02-23  Tomas Popela  <tpopela@redhat.com>
2681
2682         [GTK] Drag and drop is always moving the content even if copy is requested
2683         https://bugs.webkit.org/show_bug.cgi?id=168424
2684
2685         Reviewed by Carlos Garcia Campos.
2686
2687         Drag and drop is always moving the content around even if the copy is
2688         requested (i.e. by pressing the Control key).
2689
2690         Test: editing/pasteboard/drag-drop-copy-content.html
2691
2692         * page/gtk/DragControllerGtk.cpp:
2693         (WebCore::DragController::isCopyKeyDown):
2694
2695 2017-02-22  Myles C. Maxfield  <mmaxfield@apple.com>
2696
2697         [Cocoa] Remove Yosemite-specific font lookup code
2698         https://bugs.webkit.org/show_bug.cgi?id=168682
2699
2700         Reviewed by Zalan Bujtas.
2701
2702         No new tests because there is no behavior change.
2703
2704         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2705         (WebCore::platformFontLookupWithFamily):
2706         (WebCore::fontWithFamily):
2707         * platform/graphics/mac/FontCacheMac.mm:
2708         (WebCore::platformInvalidateFontCache):
2709         (WebCore::acceptableChoice): Deleted.
2710         (WebCore::betterChoice): Deleted.
2711         (WebCore::desiredFamilyToAvailableFamilyMap): Deleted.
2712         (WebCore::hasDesiredFamilyToAvailableFamilyMapping): Deleted.
2713         (WebCore::rememberDesiredFamilyToAvailableFamilyMapping): Deleted.
2714         (WebCore::toAppKitFontWeight): Deleted.
2715         (WebCore::appkitWeightToFontWeight): Deleted.
2716         (WebCore::toNSFontTraits): Deleted.
2717         (WebCore::platformFontWithFamily): Deleted.
2718
2719 2017-02-22  Antoine Quint  <graouts@apple.com>
2720
2721         [Modern Media Controls] Clicking on the video doesn't toggle playback state in fullscreen on macOS
2722         https://bugs.webkit.org/show_bug.cgi?id=168755
2723         <rdar://problem/30664484>
2724
2725         Reviewed by Dean Jackson.
2726
2727         We now call super in the handleEvent() method of MacOSFullscreenMediaControls if we're not dealing
2728         with an event type and target combination that was specifically registered in this class's scope.
2729         We had mistakenly added the call to super.handleEvent(event) in the wrong method when fixing
2730         https://bugs.webkit.org/show_bug.cgi?id=168515.
2731
2732         Test: media/modern-media-controls/media-controller/media-controller-click-on-video-background-should-pause-fullscreen.html
2733
2734         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
2735         (MacOSFullscreenMediaControls.prototype.handleEvent):
2736         (MacOSFullscreenMediaControls.prototype._handleMousedown):
2737         * Modules/modern-media-controls/controls/macos-media-controls.js:
2738         (MacOSMediaControls.prototype.handleEvent):
2739         (MacOSMediaControls):
2740
2741 2017-02-22  Antoine Quint  <graouts@apple.com>
2742
2743         [Modern Media Controls] Scrubber stops moving while scrubbing on macOS
2744         https://bugs.webkit.org/show_bug.cgi?id=168518
2745         <rdar://problem/30577637>
2746
2747         Reviewed by Dean Jackson.
2748
2749         As we start to scrub, controlValueWillStartChanging() is called on
2750         ScrubberSupport and pauses the media if it's not already paused. This
2751         causes the play/pause button to change icon and for layout() to be
2752         called on MacOSInlineMediaControls. This in turns sets the .children
2753         property on the .controlsBar and eventually yields a DOM manipulation
2754         which re-inserts the scrubber's DOM hierarchy, causing stutters during
2755         user interaction.
2756
2757         Our solution is to make the .children setter smarter about identifying
2758         that the children list hasn't changed and that no DOM invalidation is
2759         necessary.
2760
2761         * Modules/modern-media-controls/controls/layout-node.js:
2762         (LayoutNode.prototype.set children):
2763
2764 2017-02-22  Antoine Quint  <graouts@apple.com>
2765
2766         [Modern Media Controls] Controls bar may disappear while captions menu is visible
2767         https://bugs.webkit.org/show_bug.cgi?id=168751
2768         <rdar://problem/30663411>
2769
2770         Reviewed by Dean Jackson.
2771
2772         We now prevent the controls bar from fading out due to the auto-hide timer firing
2773         when the tracks panel is up, and wait until the track panel is hidden before fading
2774         the controls bar.
2775
2776         Test: media/modern-media-controls/tracks-panel/tracks-panel-prevent-controls-bar-from-fading.html
2777
2778         * Modules/modern-media-controls/controls/controls-bar.js:
2779         (ControlsBar.prototype.set userInteractionEnabled):
2780         (ControlsBar.prototype._autoHideTimerFired):
2781
2782 2017-02-22  Antoine Quint  <graouts@apple.com>
2783
2784         [Modern Media Controls] Can't set the volume slider with macOS inline controls
2785         https://bugs.webkit.org/show_bug.cgi?id=168747
2786         <rdar://problem/30605528>
2787
2788         Reviewed by Dean Jackson.
2789
2790         Only call super for events we haven't registered specifically in the context
2791         of this class. Otherwise we'd invalidate the volume container visibility for
2792         a "mousedown" event registered by the MacOSMediaControls, the super class.
2793
2794         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
2795         (MacOSInlineMediaControls.prototype.handleEvent):
2796
2797 2017-02-22  Antti Koivisto  <antti@apple.com>
2798
2799         Replace SimpleLineLayout::Range by WTF::IteratorRange
2800         https://bugs.webkit.org/show_bug.cgi?id=168742
2801
2802         Reviewed by Zalan Bujtas.
2803
2804         Kill a redundant custom type.
2805
2806         * rendering/SimpleLineLayoutResolver.cpp:
2807         (WebCore::SimpleLineLayout::RunResolver::rangeForRect):
2808         (WebCore::SimpleLineLayout::RunResolver::rangeForRenderer):
2809         (WebCore::SimpleLineLayout::RunResolver::rangeForRendererWithOffsets):
2810         * rendering/SimpleLineLayoutResolver.h:
2811         (WebCore::SimpleLineLayout::LineResolver::rangeForRect):
2812         (WebCore::SimpleLineLayout::Range::Range): Deleted.
2813         (WebCore::SimpleLineLayout::Range::begin): Deleted.
2814         (WebCore::SimpleLineLayout::Range::end): Deleted.
2815
2816 2017-02-22  Simon Fraser  <simon.fraser@apple.com>
2817
2818         Add the Web Authentication API as "Under Consideration".
2819
2820         * features.json:
2821
2822 2017-02-22  Zalan Bujtas  <zalan@apple.com>
2823
2824         Simple line layout: Set the pagination strut on the flow when the first line does not fit the page.
2825         https://bugs.webkit.org/show_bug.cgi?id=168738
2826         <rdar://problem/30659469>
2827
2828         Reviewed by Antti Koivisto.
2829
2830         The pagination strut for the first line is tracked by the parent RenderBlockFlow and not by
2831         the line itself (see RenderBlockFlow::adjustLinePositionForPagination()). Also renamed *PaginationStrut* to
2832         *LineStrut* to make sure we don't confuse it with the block level strut.
2833
2834         Not enabled yet.
2835
2836         * rendering/SimpleLineLayout.cpp:
2837         (WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow):
2838         (WebCore::SimpleLineLayout::computeLineBreakIndex):
2839         (WebCore::SimpleLineLayout::setPageBreakForLine):
2840         (WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
2841         (WebCore::SimpleLineLayout::create):
2842         (WebCore::SimpleLineLayout::Layout::create):
2843         (WebCore::SimpleLineLayout::Layout::Layout):
2844         * rendering/SimpleLineLayout.h:
2845         (WebCore::SimpleLineLayout::Layout::hasLineStruts):
2846         (WebCore::SimpleLineLayout::Layout::struts):
2847         (WebCore::SimpleLineLayout::Layout::hasPaginationStruts): Deleted.
2848         * rendering/SimpleLineLayoutFunctions.cpp:
2849         (WebCore::SimpleLineLayout::paintFlow):
2850         * rendering/SimpleLineLayoutFunctions.h:
2851         (WebCore::SimpleLineLayout::computeFlowHeight):
2852         * rendering/SimpleLineLayoutResolver.h:
2853         (WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition):
2854
2855 2017-02-22  Youenn Fablet  <youenn@apple.com>
2856
2857         [WebRTC] Disable libwebrtc stderr logging in release mode
2858         https://bugs.webkit.org/show_bug.cgi?id=168734
2859
2860         Reviewed by Tim Horton.
2861
2862         No change of behavior.
2863
2864         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2865         (WebCore::initializePeerConnectionFactoryAndThreads):
2866
2867 2017-02-22  Jer Noble  <jer.noble@apple.com>
2868
2869         MediaStreamSourceNode never receives audio from MockRealtimeAudioSourceMac.
2870         https://bugs.webkit.org/show_bug.cgi?id=168731
2871
2872         Reviewed by Eric Carlson.
2873
2874         Test: fast/mediastream/mock-media-source-webaudio.html
2875
2876         Because the audioSourceProvider can be created before the mock source is configured, explicitly configure the
2877         source if necessary after creating the audioSourceProvider.
2878
2879         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
2880         (WebCore::MockRealtimeAudioSourceMac::audioSourceProvider):
2881
2882 2017-02-22  Chris Dumez  <cdumez@apple.com>
2883
2884         Do not aggressively throttle DOM timers until they've reached their max nesting level
2885         https://bugs.webkit.org/show_bug.cgi?id=168700
2886         <rdar://problem/29808005>
2887
2888         Reviewed by Simon Fraser.
2889
2890         Do not aggressively throttle DOM timers until they've actually areached their max
2891         nesting level (5). This overly aggressive throttling of non-nested timers is what
2892         was causing Google Maps to use 100% CPU in background tabs for several minutes.
2893
2894         Test: fast/dom/timer-throttling-hidden-page-non-nested.html
2895
2896         * dom/Document.cpp:
2897         (WebCore::Document::timerAlignmentInterval):
2898
2899 2017-02-22  Eric Carlson  <eric.carlson@apple.com>
2900
2901         [MediaStream iOS] Respond to capture interruptions and notifications
2902         https://bugs.webkit.org/show_bug.cgi?id=168610
2903
2904         Reviewed by Jer Noble.
2905
2906         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2907         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Drive-by cleanup: don't create
2908         a sample buffer display layer unless there is an active video track.
2909
2910         * platform/mediastream/mac/AVMediaCaptureSource.h:
2911         * platform/mediastream/mac/AVMediaCaptureSource.mm:
2912         (WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Add static_asserts to ensure that
2913         WebCore::InterruptionReason values map directly to AVCaptureSessionInterruptionReason values.
2914         (WebCore::AVMediaCaptureSource::~AVMediaCaptureSource): Minor cleanup.
2915         (WebCore::AVMediaCaptureSource::startProducingData): Start listening for notifications before
2916         starting the session.
2917         (WebCore::AVMediaCaptureSource::stopProducingData): Remove the notification observers before
2918         stopping the session.
2919         (WebCore::AVMediaCaptureSource::setupSession): Minor style cleanup.
2920         (WebCore::AVMediaCaptureSource::captureSessionRuntimeError): New. When the error is AVErrorMediaServicesWereReset,
2921         sometimes caused by a mediaserverd crash, try to restart the session one time.
2922         (WebCore::AVMediaCaptureSource::captureSessionBeginInterruption): Store the interruption reason.
2923         (WebCore::AVMediaCaptureSource::captureSessionEndInterruption): Try to restart the session if
2924         it was interrupted because the app went into multi-app layout mode.
2925         (WebCore::sessionKVOProperties): Drive-by cleanup.
2926         (-[WebCoreAVMediaCaptureSourceObserver initWithCallback:]):
2927         (-[WebCoreAVMediaCaptureSourceObserver disconnect]):
2928         (-[WebCoreAVMediaCaptureSourceObserver addNotificationObservers]):
2929         (-[WebCoreAVMediaCaptureSourceObserver removeNotificationObservers]):
2930         (-[WebCoreAVMediaCaptureSourceObserver sessionRuntimeError:]):
2931         (-[WebCoreAVMediaCaptureSourceObserver beginSessionInterrupted:]):
2932         (-[WebCoreAVMediaCaptureSourceObserver endSessionInterrupted:]):
2933
2934         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2935         (WebCore::AVVideoCaptureSource::initializeCapabilities): Not all AVCaptureSession preset strings
2936         are available on all platforms so load with SOFT_LINK_POINTER_OPTIONAL and NULL check before use.
2937         (WebCore::sizeForPreset): Ditto.
2938         (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions): Ditto.
2939
2940 2017-02-22  Zalan Bujtas  <zalan@apple.com>
2941
2942         Simple line layout: ensureLineBoxes for paginated content.
2943         https://bugs.webkit.org/show_bug.cgi?id=168729
2944         <rdar://problem/30654400>
2945
2946         Reviewed by Antti Koivisto.
2947
2948         This patch sets the layout state bits for paginated subtree layout, when we are switching
2949         over from simple line runs to inline tree. 
2950
2951         Not enabled yet.
2952
2953         * rendering/RenderBlockFlow.cpp:
2954         (WebCore::RenderBlockFlow::ensureLineBoxes):
2955         * rendering/RenderView.cpp:
2956         (WebCore::RenderView::pushLayoutStateForPagination): LayoutUnit(1) is not the real height, it's just
2957         an indicator that we've got paginated content.
2958         * rendering/RenderView.h:
2959         * rendering/SimpleLineLayout.cpp:
2960         (WebCore::SimpleLineLayout::create):
2961         (WebCore::SimpleLineLayout::Layout::create):
2962         (WebCore::SimpleLineLayout::Layout::Layout):
2963         * rendering/SimpleLineLayout.h:
2964         (WebCore::SimpleLineLayout::Layout::isPaginated):
2965         (WebCore::SimpleLineLayout::Layout::hasPaginationStruts):
2966         * rendering/SimpleLineLayoutFunctions.h:
2967         (WebCore::SimpleLineLayout::computeFlowHeight):
2968         * rendering/SimpleLineLayoutResolver.h:
2969         (WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition):
2970
2971 2017-02-22  Per Arne Vollan  <pvollan@apple.com>
2972
2973         [Win] Compile fix.
2974         https://bugs.webkit.org/show_bug.cgi?id=168713
2975
2976         Reviewed by Brent Fulgham.
2977
2978         The include file <ANGLE/ShaderLang.h> is not found.
2979
2980         * testing/Internals.cpp:
2981
2982 2017-02-22  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2983
2984         [GStreamer][EME] Fix issue with allowed systems extraction
2985         https://bugs.webkit.org/show_bug.cgi?id=168717
2986
2987         Reviewed by Carlos Garcia Campos.
2988
2989         The allowed systems were not being extracted from the need-context
2990         message because the loop was not stopping on the right condition.
2991
2992         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2993         (WebCore::extractEventsAndSystemsFromMessage): Fix wrong
2994         condition.
2995         (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent):
2996         Add better debug category.
2997
2998 2017-02-22  Antti Koivisto  <antti@apple.com>
2999
3000         REGRESSION(r207669): Crash after mutating selector text
3001         https://bugs.webkit.org/show_bug.cgi?id=168655
3002         <rdar://problem/30632111>
3003
3004         Reviewed by Andreas Kling.
3005
3006         Test: fast/css/selector-text-mutation-crash.html
3007
3008         * style/StyleScope.cpp:
3009         (WebCore::Style::Scope::resolver):
3010         (WebCore::Style::Scope::updateStyleResolver):
3011
3012         Protect against entering scheduleUpdate and wiping style resolver while updating it.
3013         Extension stylesheets can trigger this.
3014
3015         (WebCore::Style::Scope::scheduleUpdate):
3016
3017         Clear the style resolver immediately if style sheet content changes. The resolver may
3018         have data structures that point to the old sheet contents.
3019
3020         The resolver would get wiped anyway when the scheduled update actually occurs.
3021
3022         * style/StyleScope.h:
3023
3024 2017-02-08  Sergio Villar Senin  <svillar@igalia.com>
3025
3026         [css-grid] Move the track sizing algorithm to its own class
3027         https://bugs.webkit.org/show_bug.cgi?id=167988
3028
3029         Reviewed by Manuel Rego Casasnovas.
3030
3031         This is about moving the track sizing algorithm code out of RenderGrid to a new class
3032         GridTrackSizingAlgorithm, making RenderGrid more compact and easy to maintain. A nice side
3033         effect of this patch is the removal of the GridSizingData structure as it is no longer
3034         needed. All the data structures in that class were transferred to GridTrackSizingAlgorithm
3035         as private attribute members. The GridTrack class was also moved to the new file.
3036
3037         The algorithm execution starts with the call to run(). It's mandatory to call setup() before
3038         any call to run() in order to properly configure the behaviour of the algorithm. You can
3039         call setup() & run() multiple times for a single layout operation (normally twice, one for
3040         columns and another one for rows). The algorithm uses a state machine to verify that the
3041         client issues the calls in the proper order (i.e. first columns and then rows). After
3042         finishing the layout, the client should call reset() to allow the algorithm to perform
3043         cleanups and to prepare itself for another round of calls.
3044
3045         In order to implement the different behaviours of the algorithm depending on whether the
3046         available size is definite or not, a strategy pattern was implemented in the
3047         GridTrackSizingAlgorithmStrategy class. It has two subclasses, one for definite sizes and
3048         another one for indefinite ones.
3049
3050         We took advantage of this change to perform some renames of the track sizing algorithm
3051         methods that were still using the names from the first versions of the specs. Not only that,
3052         the original track sizing algorithm method (computeUsedBreadthOfGridTracks) was split in 4
3053         different parts representing the 4 steps of the algorithm.
3054
3055         No new tests as this is about moving code and refactoring.
3056
3057         * CMakeLists.txt:
3058         * WebCore.xcodeproj/project.pbxproj:
3059         * rendering/GridTrackSizingAlgorithm.cpp: Added.
3060         (WebCore::GridTrack::baseSize):
3061         (WebCore::GridTrack::growthLimit):
3062         (WebCore::GridTrack::setBaseSize):
3063         (WebCore::GridTrack::setGrowthLimit):
3064         (WebCore::GridTrack::growthLimitIfNotInfinite):
3065         (WebCore::GridTrack::setTempSize):
3066         (WebCore::GridTrack::growTempSize):
3067         (WebCore::GridTrack::setGrowthLimitCap):
3068         (WebCore::GridTrack::ensureGrowthLimitIsBiggerThanBaseSize):
3069         (WebCore::shouldClearOverrideContainingBlockContentSizeForChild):
3070         (WebCore::hasOverrideContainingBlockContentSizeForChild):
3071         (WebCore::setOverrideContainingBlockContentSizeForChild):
3072         (WebCore::flowAwareDirectionForChild):
3073         (WebCore::overrideContainingBlockContentSizeForChild):
3074         (WebCore::computeMarginLogicalSizeForChild):
3075         (WebCore::marginIntrinsicLogicalWidthForChild):
3076         (WebCore::GridTrackSizingAlgorithm::setFreeSpace):
3077         (WebCore::GridTrackSizingAlgorithm::rawGridTrackSize):
3078         (WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize):
3079         (WebCore::GridTrackSizingAlgorithm::initialBaseSize):
3080         (WebCore::GridTrackSizingAlgorithm::initialGrowthLimit):
3081         (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
3082         (WebCore::GridTrackSizingAlgorithm::spanningItemCrossesFlexibleSizedTracks):
3083         (WebCore::GridItemWithSpan::GridItemWithSpan):
3084         (WebCore::GridItemWithSpan::gridItem):
3085         (WebCore::GridItemWithSpan::span):
3086         (WebCore::GridItemWithSpan::operator<):
3087         (WebCore::GridTrackSizingAlgorithm::itemSizeForTrackSizeComputationPhase):
3088         (WebCore::shouldProcessTrackForTrackSizeComputationPhase):
3089         (WebCore::trackSizeForTrackSizeComputationPhase):
3090         (WebCore::updateTrackSizeForTrackSizeComputationPhase):
3091         (WebCore::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase):
3092         (WebCore::markAsInfinitelyGrowableForTrackSizeComputationPhase):
3093         (WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems):
3094         (WebCore::sortByGridTrackGrowthPotential):
3095         (WebCore::clampGrowthShareIfNeeded):
3096         (WebCore::GridTrackSizingAlgorithm::distributeSpaceToTracks):
3097         (WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild):
3098         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild):
3099         (WebCore::GridTrackSizingAlgorithm::gridTrackSize):
3100         (WebCore::GridTrackSizingAlgorithm::computeFlexFactorUnitSize):
3101         (WebCore::GridTrackSizingAlgorithm::computeFlexSizedTracksGrowth):
3102         (WebCore::GridTrackSizingAlgorithm::findFrUnitSize):
3103         (WebCore::GridTrackSizingAlgorithm::computeGridContainerIntrinsicSizes):
3104         (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild):
3105         (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild):
3106         (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild):
3107         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild):
3108         (WebCore::GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild):
3109         (WebCore::IndefiniteSizeStrategy::minLogicalWidthForChild):
3110         (WebCore::IndefiniteSizeStrategy::layoutGridItemForMinSizeComputation):
3111         (WebCore::IndefiniteSizeStrategy::maximizeTracks):
3112         (WebCore::normalizedFlexFraction):
3113         (WebCore::IndefiniteSizeStrategy::findUsedFlexFraction):
3114         (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
3115         (WebCore::DefiniteSizeStrategy::minLogicalWidthForChild):
3116         (WebCore::DefiniteSizeStrategy::maximizeTracks):
3117         (WebCore::DefiniteSizeStrategy::layoutGridItemForMinSizeComputation):
3118         (WebCore::DefiniteSizeStrategy::findUsedFlexFraction):
3119         (WebCore::DefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
3120         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
3121         (WebCore::GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes):
3122         (WebCore::GridTrackSizingAlgorithm::stretchFlexibleTracks):
3123         (WebCore::GridTrackSizingAlgorithm::advanceNextState):
3124         (WebCore::GridTrackSizingAlgorithm::isValidTransition):
3125         (WebCore::GridTrackSizingAlgorithm::setup):
3126         (WebCore::GridTrackSizingAlgorithm::run):
3127         (WebCore::GridTrackSizingAlgorithm::reset):
3128         (WebCore::GridTrackSizingAlgorithm::tracksAreWiderThanMinTrackBreadth):
3129         (WebCore::GridTrackSizingAlgorithm::StateMachine::StateMachine):
3130         (WebCore::GridTrackSizingAlgorithm::StateMachine::~StateMachine):
3131         * rendering/GridTrackSizingAlgorithm.h: Added.
3132         (WebCore::GridTrack::GridTrack):
3133         (WebCore::GridTrack::infiniteGrowthPotential):
3134         (WebCore::GridTrack::plannedSize):
3135         (WebCore::GridTrack::setPlannedSize):
3136         (WebCore::GridTrack::tempSize):
3137         (WebCore::GridTrack::infinitelyGrowable):
3138         (WebCore::GridTrack::setInfinitelyGrowable):
3139         (WebCore::GridTrack::growthLimitCap):
3140         (WebCore::GridTrack::growthLimitIsInfinite):
3141         (WebCore::GridTrack::isGrowthLimitBiggerThanBaseSize):
3142         (WebCore::GridTrackSizingAlgorithmStrategy::GridTrackSizingAlgorithmStrategy):
3143         (WebCore::GridTrackSizingAlgorithmStrategy::computeTrackBasedSize):
3144         (WebCore::GridTrackSizingAlgorithmStrategy::direction):
3145         (WebCore::GridTrackSizingAlgorithmStrategy::findFrUnitSize):
3146         (WebCore::GridTrackSizingAlgorithmStrategy::distributeSpaceToTracks):
3147         (WebCore::GridTrackSizingAlgorithmStrategy::renderGrid):
3148         * rendering/RenderGrid.cpp:
3149         (WebCore::RenderGrid::RenderGrid):
3150         (WebCore::RenderGrid::computeTrackBasedLogicalHeight):
3151         (WebCore::RenderGrid::computeTrackSizesForDefiniteSize):
3152         (WebCore::RenderGrid::repeatTracksSizingIfNeeded):
3153         (WebCore::RenderGrid::layoutBlock):
3154         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
3155         (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize):
3156         (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
3157         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
3158         (WebCore::RenderGrid::layoutGridItems):
3159         (WebCore::RenderGrid::gridAreaBreadthForChildIncludingAlignmentOffsets):
3160         (WebCore::RenderGrid::populateGridPositionsForDirection):
3161         (WebCore::RenderGrid::columnAxisOffsetForChild):
3162         (WebCore::RenderGrid::rowAxisOffsetForChild):
3163         (WebCore::RenderGrid::findChildLogicalPosition):
3164         (WebCore::GridTrack::GridTrack): Deleted.
3165         (WebCore::GridTrack::baseSize): Deleted.
3166         (WebCore::GridTrack::growthLimit): Deleted.
3167         (WebCore::GridTrack::setBaseSize): Deleted.
3168         (WebCore::GridTrack::setGrowthLimit): Deleted.
3169         (WebCore::GridTrack::infiniteGrowthPotential): Deleted.
3170         (WebCore::GridTrack::growthLimitIfNotInfinite): Deleted.
3171         (WebCore::GridTrack::plannedSize): Deleted.
3172         (WebCore::GridTrack::setPlannedSize): Deleted.
3173         (WebCore::GridTrack::tempSize): Deleted.
3174         (WebCore::GridTrack::setTempSize): Deleted.
3175         (WebCore::GridTrack::growTempSize): Deleted.
3176         (WebCore::GridTrack::infinitelyGrowable): Deleted.
3177         (WebCore::GridTrack::setInfinitelyGrowable): Deleted.
3178         (WebCore::GridTrack::setGrowthLimitCap): Deleted.
3179         (WebCore::GridTrack::growthLimitCap): Deleted.
3180         (WebCore::GridTrack::growthLimitIsInfinite): Deleted.
3181         (WebCore::GridTrack::isGrowthLimitBiggerThanBaseSize): Deleted.
3182         (WebCore::GridTrack::ensureGrowthLimitIsBiggerThanBaseSize): Deleted.
3183         (WebCore::RenderGrid::GridSizingData::GridSizingData): Deleted.
3184         (WebCore::RenderGrid::GridSizingData::freeSpace): Deleted.
3185         (WebCore::RenderGrid::GridSizingData::availableSpace): Deleted.
3186         (WebCore::RenderGrid::GridSizingData::setAvailableSpace): Deleted.
3187         (WebCore::RenderGrid::GridSizingData::advanceNextState): Deleted.
3188         (WebCore::RenderGrid::GridSizingData::isValidTransition): Deleted.
3189         (WebCore::RenderGrid::GridSizingData::grid): Deleted.
3190         (WebCore::RenderGrid::GridSizingData::setFreeSpace): Deleted.
3191         (WebCore::RenderGrid::computeTrackSizesForDirection): Deleted.
3192         (WebCore::RenderGrid::computeIntrinsicLogicalHeight): Deleted.
3193         (WebCore::normalizedFlexFraction): Deleted.
3194         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks): Deleted.
3195         (WebCore::RenderGrid::computeFlexSizedTracksGrowth): Deleted.
3196         (WebCore::RenderGrid::computeUsedBreadthOfMinLength): Deleted.
3197         (WebCore::RenderGrid::computeUsedBreadthOfMaxLength): Deleted.
3198         (WebCore::RenderGrid::computeFlexFactorUnitSize): Deleted.
3199         (WebCore::RenderGrid::findFlexFactorUnitSize): Deleted.
3200         (WebCore::hasOverrideContainingBlockContentSizeForChild): Deleted.
3201         (WebCore::setOverrideContainingBlockContentSizeForChild): Deleted.
3202         (WebCore::shouldClearOverrideContainingBlockContentSizeForChild): Deleted.
3203         (WebCore::RenderGrid::rawGridTrackSize): Deleted.
3204         (WebCore::RenderGrid::gridTrackSize): Deleted.
3205         (WebCore::RenderGrid::logicalHeightForChild): Deleted.
3206         (WebCore::RenderGrid::minSizeForChild): Deleted.
3207         (WebCore::RenderGrid::updateOverrideContainingBlockContentSizeForChild): Deleted.
3208         (WebCore::RenderGrid::minContentForChild): Deleted.
3209         (WebCore::RenderGrid::maxContentForChild): Deleted.
3210         (WebCore::GridItemWithSpan::GridItemWithSpan): Deleted.
3211         (WebCore::GridItemWithSpan::gridItem): Deleted.
3212         (WebCore::GridItemWithSpan::span): Deleted.
3213         (WebCore::GridItemWithSpan::operator<): Deleted.
3214         (WebCore::RenderGrid::spanningItemCrossesFlexibleSizedTracks): Deleted.
3215         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions): Deleted.
3216         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems): Deleted.
3217         (WebCore::trackSizeForTrackSizeComputationPhase): Deleted.
3218         (WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase): Deleted.
3219         (WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase): Deleted.
3220         (WebCore::RenderGrid::markAsInfinitelyGrowableForTrackSizeComputationPhase): Deleted.
3221         (WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase): Deleted.
3222         (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase): Deleted.
3223         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems): Deleted.
3224         (WebCore::sortByGridTrackGrowthPotential): Deleted.
3225         (WebCore::clampGrowthShareIfNeeded): Deleted.
3226         (WebCore::RenderGrid::distributeSpaceToTracks): Deleted.
3227         (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth): Deleted.
3228         (WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild): Deleted.
3229         (WebCore::RenderGrid::gridAreaBreadthForChild): Deleted.
3230         * rendering/RenderGrid.h:
3231
3232 2017-02-22  Per Arne Vollan  <pvollan@apple.com>
3233
3234         [Win] Crash under CACFLayerTreeHost::acceleratedCompositingAvailable().
3235         https://bugs.webkit.org/show_bug.cgi?id=168711
3236
3237         Reviewed by Alex Christensen.
3238
3239         Add null pointer check.
3240
3241         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
3242         (WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable):
3243
3244 2017-02-22  Carlos Garcia Campos  <cgarcia@igalia.com>
3245
3246         [GStreamer] Crash in MediaPlayerPrivateGStreamerMSE::buffered() when MEDIA_STREAM is disabled
3247         https://bugs.webkit.org/show_bug.cgi?id=168662
3248
3249         Reviewed by Michael Catanzaro.
3250
3251         When MEDIA_STREAM is disabled, if MediaPlayer::loadWithNextMediaEngine is called with a current engine and
3252         there's no type specified, the next media engine that is used is the MSE one. Since there's no actually a media
3253         stream, the engine is created but never loaded. When buffered is called it tries to use its media source that is
3254         nullptr. It doesn't happen when MEDIA_STREAM is enabled, because the next media engine returned is Owr that
3255         doesn't implement buffered and always returns an empty PlatformTimeRanges.
3256
3257         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
3258         (WebCore::MediaPlayerPrivateGStreamerMSE::buffered): Return an empty PlatformTimeRanges if m_mediaSource is nullptr.
3259
3260 2017-02-21  Youenn Fablet  <youenn@apple.com>
3261
3262         [WebRTC][Mac] Activate libwebrtc
3263         https://bugs.webkit.org/show_bug.cgi?id=167293
3264
3265         Reviewed by Alex Christensen.
3266
3267         * Configurations/WebCore.xcconfig:
3268         * Configurations/WebCoreTestSupport.xcconfig:
3269         * Configurations/FeatureDefines.xcconfig:
3270
3271 2017-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3272
3273         Unreviewed. Fix WinCairo build after r212703.
3274
3275         * platform/TextureMapper.cmake:
3276
3277 2017-02-21  Per Arne Vollan  <pvollan@apple.com>
3278
3279         Add support for CSS properties paint-order, stroke-linecap, and stroke-linejoin in text rendering.
3280         https://bugs.webkit.org/show_bug.cgi?id=168601
3281         rdar://problem/30583872
3282
3283         Reviewed by Simon Fraser.
3284
3285         Text rendering should respect the CSS properties paint-order, stroke-linecap, and stroke-linejoin,
3286         see https://drafts.fxtf.org/paint/. The text rendering changes are mainly in the TextPainter class,
3287         where text is painted in three phases (fill, stroke, markers), where the order follows the
3288         paint-order property. The linecap and linejoin properties are set on the graphics context before
3289         rendering the text.
3290
3291         Tests: fast/css/paint-order.html
3292                fast/css/paint-order-shadow.html
3293
3294         * css/CSSComputedStyleDeclaration.cpp:
3295         (WebCore::paintOrder):
3296         * css/StyleBuilderConverter.h:
3297         (WebCore::StyleBuilderConverter::convertPaintOrder):
3298         * rendering/TextPaintStyle.cpp:
3299         (WebCore::computeTextPaintStyle):
3300         (WebCore::updateGraphicsContext):
3301         * rendering/TextPaintStyle.h:
3302         * rendering/TextPainter.cpp:
3303         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
3304         * rendering/style/RenderStyle.cpp:
3305         (WebCore::RenderStyle::paintTypesForPaintOrder):
3306         * rendering/style/RenderStyle.h:
3307         (WebCore::RenderStyle::setPaintOrder):
3308         (WebCore::RenderStyle::initialPaintOrder):
3309         * rendering/style/RenderStyleConstants.h:
3310         * rendering/style/SVGRenderStyleDefs.h:
3311         * rendering/style/StyleRareInheritedData.cpp:
3312         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
3313         * rendering/svg/RenderSVGShape.cpp:
3314         (WebCore::RenderSVGShape::fillStrokeMarkers):
3315         * rendering/svg/SVGInlineTextBox.cpp:
3316         (WebCore::SVGInlineTextBox::paint):
3317
3318 2017-02-21  Joseph Pecoraro  <pecoraro@apple.com>
3319
3320         [User Timing] Throw a SyntaxError for performance.measure if mark name is not found
3321         https://bugs.webkit.org/show_bug.cgi?id=168707
3322
3323         Reviewed by Ryosuke Niwa.
3324
3325         Test: performance-api/performance-measure-name.html
3326
3327         * page/PerformanceUserTiming.cpp:
3328         (WebCore::UserTiming::findExistingMarkStartTime):
3329         Instead of returning zero, throw a SyntaxError. This is more in line
3330         with User Timing Level 1 and behavior in Window. This is an issue with
3331         the Level 2 spec: https://github.com/w3c/user-timing/issues/21
3332
3333 2017-02-21  Ryan Haddad  <ryanhaddad@apple.com>
3334
3335         Unreviewed attempt to fix the Windows build.
3336
3337         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3338         (PlatformCALayerWin::supportsSubpixelAntialiasedText):
3339
3340 2017-02-21  Ryan Haddad  <ryanhaddad@apple.com>
3341
3342         Unreviewed, rolling out r212737.
3343
3344         This change caused an existing LayoutTest to crash.
3345
3346         Reverted changeset:
3347
3348         "REGRESSION(r207669): Crash after mutating selector text"
3349         https://bugs.webkit.org/show_bug.cgi?id=168655
3350         http://trac.webkit.org/changeset/212737
3351
3352 2017-02-21  Chris Dumez  <cdumez@apple.com>
3353
3354         REGRESSION (r207720): /more/conformance/conformance/quickCheckAPI-S_V.html test fails
3355         https://bugs.webkit.org/show_bug.cgi?id=168632
3356         <rdar://problem/30620129>
3357
3358         Reviewed by Darin Adler.
3359
3360         After r207720, the following WebGL conformance tests started failing:
3361         - /more/conformance/conformance/quickCheckAPI-S_V.html
3362         - /context/context-lost.html
3363
3364         We started throwing security errors in case where we did not before.
3365         Chrome and Firefox are both passing these tests so our new behavior was not interoperable.
3366
3367         This patch reverts part of r207720 to restore our previous behavior.
3368
3369         * html/canvas/WebGLRenderingContextBase.cpp:
3370         (WebCore::WebGLRenderingContextBase::texSubImage2D):
3371         (WebCore::WebGLRenderingContextBase::texImage2D):
3372         (WebCore::WebGLRenderingContextBase::validateHTMLImageElement):
3373         (WebCore::WebGLRenderingContextBase::validateHTMLCanvasElement):
3374         (WebCore::WebGLRenderingContextBase::validateHTMLVideoElement):
3375         * html/canvas/WebGLRenderingContextBase.h:
3376
3377 2017-02-21  Dean Jackson  <dino@apple.com>
3378
3379         No need for static attributes when creating a pixel format
3380         https://bugs.webkit.org/show_bug.cgi?id=168688
3381         <rdar://problem/30642256>
3382
3383         Reviewed by Myles Maxfield.
3384
3385         Just create the attributes when needed.
3386
3387         * platform/graphics/mac/GraphicsContext3DMac.mm:
3388         (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
3389
3390 2017-02-20  Filip Pizlo  <fpizlo@apple.com>
3391
3392         The collector thread should only start when the mutator doesn't have heap access
3393         https://bugs.webkit.org/show_bug.cgi?id=167737
3394
3395         Reviewed by Keith Miller.
3396
3397         Added new tests in JSTests.
3398         
3399         The WebCore changes involve:
3400         
3401         - Refactoring around new header discipline.
3402         
3403         - Adding crazy GC APIs to window.internals to enable us to test the GC's runloop discipline.
3404
3405         * ForwardingHeaders/heap/GCFinalizationCallback.h: Added.
3406         * ForwardingHeaders/heap/IncrementalSweeper.h: Added.
3407         * ForwardingHeaders/heap/MachineStackMarker.h: Added.
3408         * ForwardingHeaders/heap/RunningScope.h: Added.
3409         * bindings/js/CommonVM.cpp:
3410         * testing/Internals.cpp:
3411         (WebCore::Internals::parserMetaData):
3412         (WebCore::Internals::isReadableStreamDisturbed):
3413         (WebCore::Internals::isGCRunning):
3414         (WebCore::Internals::addGCFinalizationCallback):
3415         (WebCore::Internals::stopSweeping):
3416         (WebCore::Internals::startSweeping):
3417         * testing/Internals.h:
3418         * testing/Internals.idl:
3419
3420 2017-02-20  Simon Fraser  <simon.fraser@apple.com>
3421
3422         Add support to PlatformCALayer/GraphicsLayerCA for subpixel-antialiased text, with a Setting and a MiniBrowser switch
3423         https://bugs.webkit.org/show_bug.cgi?id=168620
3424         <rdar://problem/30617772>
3425
3426         Reviewed by Tim Horton.
3427
3428         Add a Setting for subpixel-antialiased layer text. Plumb this through GraphicsLayerCA and
3429         PlatformCALayer, where it ultimately affects the layer contents format.
3430         
3431         TileControllers are slightly special because we communicate with them via an Obj-C
3432         WebTiledBackingLayer.
3433
3434         Test: compositing/contents-format/subpixel-antialiased-text-enabled.html
3435
3436         * page/Settings.in:
3437         * platform/graphics/GraphicsLayer.cpp:
3438         (WebCore::GraphicsLayer::GraphicsLayer):
3439         (WebCore::GraphicsLayer::dumpProperties):
3440         * platform/graphics/GraphicsLayer.h:
3441         (WebCore::GraphicsLayer::supportsSubpixelAntialiasedText):
3442         (WebCore::GraphicsLayer::setSupportsSubpixelAntialiasedText):
3443         * platform/graphics/ca/GraphicsLayerCA.cpp:
3444         (WebCore::GraphicsLayerCA::setSupportsSubpixelAntialiasedText):
3445         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
3446         (WebCore::GraphicsLayerCA::updateSupportsSubpixelAntialiasedText):
3447         * platform/graphics/ca/GraphicsLayerCA.h:
3448         * platform/graphics/ca/PlatformCALayer.cpp:
3449         (WebCore::PlatformCALayer::drawRepaintIndicator):
3450         * platform/graphics/ca/PlatformCALayer.h:
3451         * platform/graphics/ca/TileController.cpp:
3452         (WebCore::TileController::setWantsDeepColorBackingStore):
3453         (WebCore::TileController::setSupportsSubpixelAntialiasedText):
3454         (WebCore::TileController::setTilesOpaque):
3455         * platform/graphics/ca/TileController.h:
3456         * platform/graphics/ca/TileGrid.cpp:
3457         (WebCore::TileGrid::updateTileLayerProperties):
3458         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
3459         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3460         (PlatformCALayerCocoa::supportsSubpixelAntialiasedText):
3461         (PlatformCALayerCocoa::setSupportsSubpixelAntialiasedText):
3462         (layerContentsFormat):
3463         (PlatformCALayerCocoa::updateContentsFormat):
3464         (PlatformCALayer::drawLayerContents):
3465         * platform/graphics/ca/cocoa/WebTiledBackingLayer.h:
3466         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
3467         (-[WebTiledBackingLayer drawsAsynchronously]):
3468         (-[WebTiledBackingLayer setSupportsSubpixelAntialiasedText:]):
3469         (-[WebTiledBackingLayer supportsSubpixelAntialiasedText]):
3470         * platform/spi/cocoa/QuartzCoreSPI.h:
3471         * rendering/RenderLayerBacking.cpp:
3472         (WebCore::RenderLayerBacking::createGraphicsLayer):
3473
3474 2017-02-21  Chris Dumez  <cdumez@apple.com>
3475
3476         REGRESSION (203941): iAd Producer: Clicking buttons in Preview does not work
3477         https://bugs.webkit.org/show_bug.cgi?id=168677
3478         <rdar://problem/30640101>
3479
3480         Reviewed by Ryosuke Niwa.
3481
3482         Add quirk to initMouseEvent to unbreak iAd Producer.
3483
3484         * dom/MouseEvent.cpp:
3485         (WebCore::MouseEvent::initMouseEventQuirk):
3486         * dom/MouseEvent.h:
3487         * dom/MouseEvent.idl:
3488         * platform/RuntimeApplicationChecks.h:
3489         * platform/RuntimeApplicationChecks.mm:
3490         (WebCore::MacApplication::isIADProducer):
3491
3492 2017-02-21  Jer Noble  <jer.noble@apple.com>
3493
3494         AudioSampleDataSource doesn't need to use the m_scratchBuffer on the pulling thread
3495         https://bugs.webkit.org/show_bug.cgi?id=168640
3496
3497         Reviewed by Eric Carlson.
3498
3499         Rather than copying the pulled data into a scratch buffer, applying a volume transformation
3500         and then copying back out, just do the volume transformation in-place in the destination
3501         buffer.
3502
3503         * platform/audio/mac/AudioSampleDataSource.cpp:
3504         (WebCore::AudioSampleDataSource::pullSamplesInternal):
3505
3506 2017-02-21  Youenn Fablet  <youenn@apple.com>
3507
3508         [WebRTC] Implement Incoming libwebrtc audio source support.
3509         https://bugs.webkit.org/show_bug.cgi?id=167961
3510
3511         Reviewed by Eric Carlson.
3512
3513         Hook libwebrtc incoming audio source into WebCore audio rendering path.
3514         Manually testing that muted sources produce data with zeros and unmuted sources provide data with non zeros.
3515
3516         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
3517         (WebCore::RealtimeIncomingAudioSource::create):
3518         (WebCore::streamDescription):
3519         (WebCore::RealtimeIncomingAudioSource::OnData):
3520         (WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
3521         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
3522
3523 2017-02-21  Simon Fraser  <simon.fraser@apple.com>
3524
3525         Fix ImageBitmap comment to not insert a <canvas>.
3526
3527         * features.json:
3528
3529 2017-02-21  Alex Christensen  <achristensen@webkit.org>
3530
3531         Fix CMake build.
3532
3533         * PlatformMac.cmake:
3534
3535 2017-02-21  Simon Fraser  <simon.fraser@apple.com>
3536
3537         Add Media Streams and Capture to features.json.
3538
3539         * features.json:
3540
3541 2017-02-21  Jiewen Tan  <jiewen_tan@apple.com>
3542
3543         Clarify the status of 'webkitSubtle' and 'subtle' attributes on the WebCrypto API.
3544
3545         * features.json:
3546
3547 2017-02-21  Romain Bellessort  <romain.bellessort@crf.canon.fr>
3548
3549         [Readable Streams API] Add ReadableStreamBYOBRequest view getter
3550         https://bugs.webkit.org/show_bug.cgi?id=168652
3551
3552         Reviewed by Youenn Fablet.
3553
3554         Implemented getter for ReadableStreamBYOBRequest view attribute.
3555         
3556         Added 1 test checking that view length corresponds to autoAllocateChunkSize.
3557         Also updated test expectations for W3C imported tests.
3558
3559         * Modules/streams/ReadableByteStreamInternals.js:
3560         (isReadableStreamBYOBRequest): Added.
3561         * Modules/streams/ReadableStreamBYOBRequest.js:
3562         (view): Added.
3563
3564 2017-02-21  Simon Fraser  <simon.fraser@apple.com>
3565
3566         Clarify the status of 'webkitSubtle' and 'subtle' attributes on the WebCrypto API.
3567
3568         * features.json:
3569
3570 2017-02-21  Youenn Fablet  <youenn@apple.com>
3571
3572         [WebRTC] ICE candidates should be filtered according a policy
3573         https://bugs.webkit.org/show_bug.cgi?id=168348
3574
3575         Reviewed by Alex Christensen.
3576
3577         Covered by manual tests. Should be covered in the future by layout tests with dedicated internals API.
3578
3579         Adding support for ICE candidate filtering at RTCPeerConnection level.
3580         If ICE candidate filtering is on (by default), host candidates are stored and not sent immediately.
3581         Reflexive candidates are purged from raddr information to not leak the host IP address.
3582
3583         Stored candidates may be advertised to the JS layer if RTCController is notified of a change of filtering policy.
3584         To implement that, PeerConnectionBackend stores all filtered out candidates and RTCPeerConnection register
3585         themselves to RTCController to get notifications of filtering policy changes.
3586
3587         Making RTCPeerConnection use setPendingActivity throughout its lifetime.
3588         This ensures it does not get collected until the page is off or close() is called on the object.
3589
3590         Adding support for enumerating or not all interfaces at libwebrtc level.
3591         This choice is done at creation of the peer connection.
3592
3593         * Modules/mediastream/PeerConnectionBackend.cpp:
3594         (WebCore::PeerConnectionBackend::enableICECandidateFiltering):
3595         (WebCore::PeerConnectionBackend::disableICECandidateFiltering):
3596         (WebCore::filterICECandidate):
3597         (WebCore::PeerConnectionBackend::newICECandidate):
3598         * Modules/mediastream/PeerConnectionBackend.h:
3599         * Modules/mediastream/RTCController.cpp: Added.
3600         (WebCore::RTCController::remove):
3601         (WebCore::RTCController::add):
3602         (WebCore::RTCController::disableICECandidateFiltering):
3603         (WebCore::RTCController::enableICECandidateFiltering):
3604         * Modules/mediastream/RTCController.h: Added.
3605         * Modules/mediastream/RTCPeerConnection.cpp:
3606         (WebCore::RTCPeerConnection::create):
3607         (WebCore::RTCPeerConnection::close):
3608         (WebCore::RTCPeerConnection::rtcController):
3609         (WebCore::RTCPeerConnection::registerToController):
3610         (WebCore::RTCPeerConnection::unregisterFromController):
3611         * Modules/mediastream/RTCPeerConnection.h:
3612         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3613         (WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
3614         * WebCore.xcodeproj/project.pbxproj:
3615         * page/Page.h:
3616         (WebCore::Page::rtcController):
3617         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3618         (WebCore::LibWebRTCProvider::createPeerConnection):
3619         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3620
3621 2017-02-21  Jiewen Tan  <jiewen_tan@apple.com>
3622
3623         Unreviewed, update WebCrypto API feature status.
3624
3625         * features.json:
3626
3627 2017-02-21  Simon Fraser  <simon.fraser@apple.com>
3628
3629         Fix the bad JSON.
3630
3631         * features.json:
3632
3633 2017-02-21  Andreas Kling  <akling@apple.com>
3634
3635         [iOS] WebKit1 should use shared memory pressure handler code.
3636         <https://webkit.org/b/168653>
3637
3638         Reviewed by Antti Koivisto.
3639
3640         Remove iOS WebKit1 specific members and code from MemoryPressureHandler in favor
3641         of using the same code that iOS WebKit2 and macOS WebKit uses.
3642
3643         * page/cocoa/MemoryReleaseCocoa.mm:
3644         (WebCore::platformReleaseMemory): Add two cleanup calls that were only in the iOS WebView code.
3645         * platform/MemoryPressureHandler.h:
3646         (WebCore::MemoryPressureHandler::m_releaseMemoryBlock): Deleted.
3647         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
3648         (WebCore::respondToMemoryPressureCallback): Deleted.
3649         (WebCore::MemoryPressureHandler::installMemoryReleaseBlock): Deleted.
3650         (WebCore::MemoryPressureHandler::setReceivedMemoryPressure): Deleted.
3651         (WebCore::MemoryPressureHandler::clearMemoryPressure): Deleted.
3652         (WebCore::MemoryPressureHandler::shouldWaitForMemoryClearMessage): Deleted.
3653         (WebCore::MemoryPressureHandler::respondToMemoryPressureIfNeeded): Deleted.
3654
3655 2017-02-21  Anders Carlsson  <andersca@apple.com>
3656
3657         Fix two failing WebKit legacy tests
3658         https://bugs.webkit.org/show_bug.cgi?id=168667
3659
3660         Reviewed by Tim Horton.
3661
3662         Handle the NSPasteboardTypeString type.
3663
3664         * platform/mac/PasteboardMac.mm:
3665         (WebCore::Pasteboard::read):
3666         (WebCore::addHTMLClipboardTypesForCocoaType):
3667
3668 2017-02-21  Simon Fraser  <simon.fraser@apple.com>
3669
3670         Add Web Audio and Web MIDI to features.json.
3671
3672         * features.json:
3673
3674 2017-02-21  Antti Koivisto  <antti@apple.com>
3675
3676         REGRESSION(r207669): Crash after mutating selector text
3677         https://bugs.webkit.org/show_bug.cgi?id=168655
3678         <rdar://problem/30632111>
3679
3680         Reviewed by Brent Fulgham.
3681
3682         Test: fast/css/selector-text-mutation-crash.html
3683
3684         * style/StyleScope.cpp:
3685         (WebCore::Style::Scope::scheduleUpdate):
3686
3687         Clear the style resolver immediately if style sheet content changes. The resolver may
3688         have data structures that point to the old sheet contents.
3689
3690         The resolver would get wiped anyway when the scheduled update actually occurs.
3691
3692 2017-02-21  Jiewen Tan  <jiewen_tan@apple.com>
3693
3694         [WebCrypto] Add support for AES-CFB
3695         https://bugs.webkit.org/show_bug.cgi?id=168344
3696         <rdar://problem/20940221>
3697
3698         Reviewed by Brent Fulgham.
3699
3700         This patch adds support for AES-CFB. Operations of AES-CFB include: encrypt, decrypt, generateKey,
3701         importKey, exportKey, wrapKey, and unwrapKey. This implementation follows a slightly old version
3702         of WebCryptoAPI spec: https://www.w3.org/TR/2014/CR-WebCryptoAPI-20141211/#aes-cfb.
3703
3704         Tests: crypto/subtle/aes-cbc-cfb-decrypt-malformed-parameters.html
3705                crypto/subtle/aes-cbc-cfb-encrypt-malformed-parameters.html
3706                crypto/subtle/aes-cbc-import-key-unwrap-jwk-rsa-key-public.html
3707                crypto/subtle/aes-cfb-generate-export-key-jwk-length-128.html
3708                crypto/subtle/aes-cfb-generate-export-key-jwk-length-192.html
3709                crypto/subtle/aes-cfb-generate-export-key-jwk-length-256.html
3710                crypto/subtle/aes-cfb-generate-export-raw-key.html
3711                crypto/subtle/aes-cfb-generate-key-encrypt-decrypt.html
3712                crypto/subtle/aes-cfb-generate-key.html
3713                crypto/subtle/aes-cfb-import-jwk-key-length-128.html
3714                crypto/subtle/aes-cfb-import-jwk-key-length-192.html
3715                crypto/subtle/aes-cfb-import-jwk-key-length-256.html
3716                crypto/subtle/aes-cfb-import-key-decrypt.html
3717                crypto/subtle/aes-cfb-import-key-encrypt.html
3718                crypto/subtle/aes-cfb-import-key-unwrap-jwk-key.html
3719                crypto/subtle/aes-cfb-import-key-unwrap-raw-key.html
3720                crypto/subtle/aes-cfb-import-key-wrap-jwk-key.html
3721                crypto/subtle/aes-cfb-import-key-wrap-raw-key.html
3722                crypto/subtle/aes-cfb-import-raw-key.html
3723                crypto/workers/subtle/aes-cfb-import-key-decrypt.html
3724                crypto/workers/subtle/aes-cfb-import-key-encrypt.html
3725                crypto/workers/subtle/aes-cfb-import-key-unwrap-key.html
3726                crypto/workers/subtle/aes-cfb-import-key-wrap-key.html
3727
3728         * CMakeLists.txt:
3729         * DerivedSources.make:
3730         * PlatformGTK.cmake:
3731         * PlatformMac.cmake:
3732         * WebCore.xcodeproj/project.pbxproj:
3733         Add CryptoAlgorithmAES_CFB.cpp,
3734         change AesCbcParams.idl to AesCbcCfbParams.idl.
3735         * bindings/js/JSSubtleCryptoCustom.cpp:
3736         (WebCore::normalizeCryptoAlgorithmParameters):
3737         Add support for AES-CFB.
3738         * crypto/CryptoAlgorithm.h:
3739         Include <wtf/Variant.h>.
3740         * crypto/CryptoAlgorithmParameters.h:
3741         Add support for AES-CFB.
3742         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
3743         (WebCore::CryptoAlgorithmAES_CBC::encrypt):
3744         (WebCore::CryptoAlgorithmAES_CBC::decrypt):
3745         Rename CryptoAlgorithmAesCbcParams to CryptoAlgorithmAesCbcCfbParams.
3746         * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp: Added.
3747         (WebCore::usagesAreInvalidForCryptoAlgorithmAES_CFB):
3748         (WebCore::CryptoAlgorithmAES_CFB::create):
3749         (WebCore::CryptoAlgorithmAES_CFB::identifier):
3750         (WebCore::CryptoAlgorithmAES_CFB::encrypt):
3751         (WebCore::CryptoAlgorithmAES_CFB::decrypt):
3752         (WebCore::CryptoAlgorithmAES_CFB::generateKey):
3753         (WebCore::CryptoAlgorithmAES_CFB::importKey):
3754         (WebCore::CryptoAlgorithmAES_CFB::exportKey):
3755         * crypto/algorithms/CryptoAlgorithmAES_CFB.h: Added.
3756         * crypto/gnutls/CryptoAlgorithmAES_CFBGnuTLS.cpp: Added.
3757         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
3758         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
3759         Add dummy support of AES_CFB for GTK+.
3760         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
3761         (WebCore::transformAES_CBC):
3762         Drop conditional PLATFORM(COCOA).
3763         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
3764         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
3765         Rename CryptoAlgorithmAesCbcParams to CryptoAlgorithmAesCbcCfbParams.
3766         * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp: Added.
3767         (WebCore::transformAES_CFB):
3768         (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
3769         (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
3770         * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
3771         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
3772         Add support for AES-CFB.
3773         * crypto/parameters/AesCbcCfbParams.idl: Renamed from Source/WebCore/crypto/parameters/AesCbcParams.idl.
3774         * crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h: Renamed from Source/WebCore/crypto/parameters/CryptoAlgorithmAesCbcParams.h.
3775         Since dictionaries AesCbcParams and AesCfbParams are essentially the same, I combine them together in our implementations.
3776
3777 2017-02-21  Wenson Hsieh  <wenson_hsieh@apple.com>
3778
3779         Unreviewed, fix the ToT iOS build
3780
3781         Adopt updated UIKit SPI and remove calls to the deprecated version.
3782
3783         * platform/ios/WebItemProviderPasteboard.mm:
3784         (-[WebItemProviderPasteboard setItems:]):
3785
3786 2017-02-21  Per Arne Vollan  <pvollan@apple.com>
3787
3788         [Win] WebView is not painting in accelerated compositing mode.
3789         https://bugs.webkit.org/show_bug.cgi?id=168654
3790
3791         Reviewed by Brent Fulgham.
3792
3793         Initializing the uncommitted layer change flags to CoverageRectChanged in GraphicsLayerCA,
3794         stops WebView painting in accelerated mode.
3795
3796         Covered by existing tests.
3797
3798         * platform/graphics/ca/GraphicsLayerCA.h:
3799
3800 2017-02-21  Jer Noble  <jer.noble@apple.com>
3801
3802         Make logging in high-priority audio threads less expensive
3803         https://bugs.webkit.org/show_bug.cgi?id=168639
3804
3805         Reviewed by Jon Lee.
3806
3807         Logging from inside a high-priority audio thread will make a number of calls to malloc, block, and
3808         therefore cause audio glitches. Make this logging less expensive by dispatching to the main thread
3809         before creating and outputting the log string.
3810
3811         * WebCore.xcodeproj/project.pbxproj:
3812         * platform/audio/mac/AudioSampleDataSource.mm: Renamed from Source/WebCore/platform/audio/mac/AudioSampleDataSource.cpp.
3813         (WebCore::AudioSampleDataSource::pushSamplesInternal):
3814         (WebCore::AudioSampleDataSource::pullSamplesInternal):
3815
3816 2017-02-21  Jer Noble  <jer.noble@apple.com>
3817
3818         Give the Mock audio input a "hum" to make drop-outs more detectable
3819         https://bugs.webkit.org/show_bug.cgi?id=168641
3820
3821         Reviewed by Eric Carlson.
3822
3823         Add two helper functions to generate waveforms: addHum() and writeHum(). Use these methods
3824         to create a bip-bop audio buffer which can be used to "blit" a portion the waveform into the
3825         destination buffer during rendering. The background hum must be seamless across multiple
3826         pull operations, so add the hum sound during rendering.
3827
3828         To ensure the waveform buffer is created, initialize the sampleRate to zero, then call
3829         applySampleRate() with the desired default rate, 44.1kHz.
3830
3831         * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
3832         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
3833         (WebCore::writeHum):
3834         (WebCore::addHum):
3835         (WebCore::MockRealtimeAudioSource::create):
3836         (WebCore::MockRealtimeAudioSourceMac::render):
3837         (WebCore::MockRealtimeAudioSourceMac::applySampleRate):
3838
3839 2017-02-21  Jer Noble  <jer.noble@apple.com>
3840
3841         Make TrackPrivateBase ThreadSafeRefCounted, so that it can be retained in non-main threads
3842         https://bugs.webkit.org/show_bug.cgi?id=168642
3843
3844         Reviewed by Eric Carlson.
3845
3846         AudioTrackPrivateMediaStreamCocoa has two entry points from background threads:
3847         audioSamplesAvailable() and render(). Protect against being destroyed mid-execution by
3848         retaining this for the duration of those methods.
3849
3850         * platform/graphics/TrackPrivateBase.h:
3851         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
3852         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
3853         (WebCore::AudioTrackPrivateMediaStreamCocoa::render):
3854
3855 2017-02-21  Jer Noble  <jer.noble@apple.com>
3856
3857         Pulling too quickly from an AudioSampleDataSource should increase the pre-buffer amount
3858         https://bugs.webkit.org/show_bug.cgi?id=168645
3859
3860         Reviewed by Eric Carlson.
3861
3862         If a pull operation runs past the end of the buffered range of a CARingBuffer, the underrun
3863         is zero-filled, causing an audible glitch.  In this case, bias m_outputSampleOffset by the
3864         amount of the underrun, which should keep the underrun from reoccurring.
3865
3866         * platform/audio/mac/AudioSampleDataSource.cpp:
3867         (WebCore::AudioSampleDataSource::pullSamplesInternal):
3868
3869 2017-02-21  Jer Noble  <jer.noble@apple.com>
3870
3871         AudioSampleBufferList::zeroABL() takes a byte-count, not a sample-count.
3872         https://bugs.webkit.org/show_bug.cgi?id=168635
3873
3874         Reviewed by Jon Lee.
3875
3876         * platform/audio/mac/AudioSampleDataSource.cpp:
3877         (WebCore::AudioSampleDataSource::pullSamplesInternal):
3878         (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
3879
3880 2017-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3881
3882         REGRESSION(r212681): Crash when dragging links without a drag image
3883         https://bugs.webkit.org/show_bug.cgi?id=168648
3884
3885         Reviewed by Tim Horton.
3886
3887         This happens in GTK+ port, because we don't use a drag image for links.
3888
3889         Fixes: editing/pasteboard/drop-link.html
3890                editing/pasteboard/drop-text-without-selection.html
3891                editing/pasteboard/files-during-page-drags.html
3892                fast/events/content-changed-during-drop.html
3893                fast/events/drag-and-drop-link-fast-multiple-times-does-not-crash.html
3894                fast/events/drag-and-drop-link-into-focused-contenteditable.html
3895                fast/events/drag-and-drop-link.html
3896                fast/events/drag-in-frames.html
3897                fast/events/drag-parent-node.html
3898                fast/events/shift-drag-selection-on-link-triggers-drag-n-drop.html
3899
3900         * page/DragController.cpp:
3901         (WebCore::DragController::startDrag): Do not try to use drag image and its size when createDragImageForLink
3902         returns nullptr.
3903
3904 2017-02-21  Alex Christensen  <achristensen@webkit.org>
3905
3906         Unreviewed, rolling out r212699.
3907
3908         Internal build not ready
3909
3910         Reverted changeset:
3911
3912         "[WebRTC][Mac] Activate libwebrtc"
3913         https://bugs.webkit.org/show_bug.cgi?id=167293
3914         http://trac.webkit.org/changeset/212699
3915
3916 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3917
3918         Remove ENABLE_THREADED_COMPOSITOR build option
3919         https://bugs.webkit.org/show_bug.cgi?id=168606
3920
3921         Reviewed by Michael Catanzaro.
3922
3923         * platform/TextureMapper.cmake:
3924
3925 2017-02-20  Alex Christensen  <achristensen@webkit.org>
3926
3927         Fix some 32-bit builds after r212699
3928
3929         * platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
3930         (WebCore::RealtimeIncomingVideoSource::OnFrame):
3931         Explicitly cast OSStatus to int for logging.
3932
3933 2017-02-20  Joseph Pecoraro  <pecoraro@apple.com>
3934
3935         Remove unnecessary PerformanceEntry virtual methods
3936         https://bugs.webkit.org/show_bug.cgi?id=168633
3937
3938         Reviewed by Ryosuke Niwa.
3939
3940         * page/PerformanceEntry.h:
3941         (WebCore::PerformanceEntry::isResource):
3942         (WebCore::PerformanceEntry::isMark):
3943         (WebCore::PerformanceEntry::isMeasure):
3944         Implement based on the Type.
3945
3946         * page/PerformanceMark.h:
3947         * page/PerformanceMeasure.h:
3948         * page/PerformanceResourceTiming.h:
3949         Remove virtual overrides.
3950
3951 2017-02-20  Youenn Fablet  <youenn@apple.com>
3952
3953         [WebRTC][Mac] Activate libwebrtc
3954         https://bugs.webkit.org/show_bug.cgi?id=167293
3955
3956         Reviewed by Alex Christensen.
3957
3958         * Configurations/WebCore.xcconfig:
3959         * Configurations/WebCoreTestSupport.xcconfig:
3960
3961 2017-02-20  Joseph Pecoraro  <pecoraro@apple.com>
3962
3963         ASSERTION FAILED: m_normalWorld->hasOneRef() under WorkerThread::stop
3964         https://bugs.webkit.org/show_bug.cgi?id=168356
3965         <rdar://problem/30592486>
3966
3967         Reviewed by Ryosuke Niwa.
3968
3969         * page/DOMWindow.cpp:
3970         (WebCore::DOMWindow::removeAllEventListeners):
3971         Remove Performance object EventListeners.
3972
3973         * workers/WorkerGlobalScope.cpp:
3974         (WebCore::WorkerGlobalScope::~WorkerGlobalScope):
3975         (WebCore::WorkerGlobalScope::removeAllEventListeners):