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