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