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