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