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