LayoutTest fast/dom/timer-throttling-hidden-page.html is a flaky failure
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-03-06  Chris Dumez  <cdumez@apple.com>
2
3         LayoutTest fast/dom/timer-throttling-hidden-page.html is a flaky failure
4         https://bugs.webkit.org/show_bug.cgi?id=168927
5
6         Reviewed by Simon Fraser.
7
8         Update internals.isTimerThrottled() to return true for any kind of throttling.
9         It used to only account only for specific timers that do not cause changes
10         inside the viewport. It now accounts for all kind of throttling, such as
11         timer alignment due to the page being hidden.
12
13         * page/DOMTimer.h:
14         * testing/Internals.cpp:
15         (WebCore::Internals::isTimerThrottled):
16
17 2017-03-06  Dave Hyatt  <hyatt@apple.com>
18
19         Enable fieldsets to be flexboxes, grids and multicolumn.
20         https://bugs.webkit.org/show_bug.cgi?id=169082
21
22         Reviewed by Simon Fraser .
23
24         Added new tests in fast/forms/fieldset.
25
26         This patch eliminates RenderFieldset and moves the functionality into RenderBlock so that
27         derived classes can also be fieldsets.
28
29         * CMakeLists.txt:
30         * WebCore.xcodeproj/project.pbxproj:
31         Remove RenderFieldset from the project.
32
33         * accessibility/AccessibilityRenderObject.cpp:
34         (WebCore::AccessibilityRenderObject::titleUIElement):
35         Call in to RenderBlock now instead of RenderFieldset.
36
37         * html/HTMLFieldSetElement.cpp:
38         (WebCore::HTMLFieldSetElement::createElementRenderer):
39         * html/HTMLFieldSetElement.h:
40         The fieldset DOM element now uses RenderElement::createFor to make renderers so that multiple display types
41         can be supported. A special flag has been added that indicates only to make flexbox and block-related
42         renderers (not table display types).
43
44         * rendering/OrderIterator.cpp:
45         (WebCore::OrderIterator::shouldSkipChild):
46         (WebCore::OrderIteratorPopulator::collectChild):
47         * rendering/OrderIterator.h:
48         Streamline child collection for flexboxes and grids to indicate whether the child should be skipped as a return
49         value from collectChild. Add a shouldSkipChild method that skips both out of flow positioned objects and
50         excluded children like the legends of fieldsets.
51
52         * rendering/RenderBlock.cpp:
53         (WebCore::RenderBlockRareData::RenderBlockRareData):
54         When the legend is taller than the fieldset's borderBefore(), intrinsic border is added to the CSS border width.
55         This intrinsic border being factored in ensures that the padding and content boxes of fieldsets are correct
56         across any layout system, since the legend is now just treated as part of the border.
57
58         (WebCore::RenderBlock::computePreferredLogicalWidths):
59         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
60         Call the new computePreferredWidthsForExcludedChildren to ensure that excluded children contribute to
61         preferred width in their own way and not as part of a specific layout system.
62
63         (WebCore::RenderBlock::renderName):
64         Hacked to still return RenderFieldSet for RenderBlockFlow-backed fieldsets for layout test compatibility.
65
66         (WebCore::RenderBlock::layoutExcludedChildren):
67         Renamed from layoutSpecialExcludedChild to more accurately reflect the fact that multiple excluded children
68         can be included here (e.g., both a multicolumn flow thread and a legend). The RenderBlock base class handles
69         the layout of legends by both placing them and setting the correct intrinsic border before amount on the
70         block.
71
72         (WebCore::RenderBlock::findFieldsetLegend):
73         Moved from RenderFieldset.
74
75         (WebCore::RenderBlock::adjustBorderBoxRectForPainting):
76         (WebCore::RenderBlock::paintRectToClipOutFromBorder):
77         These methods are used when painting to shrink the border box as needed to account for the legend and to
78         provide the portion of the border that needs to be clipped out. These methods have been enhanced to
79         properly support all writing modes.
80
81         (WebCore::RenderBlock::intrinsicBorderForFieldset):
82         (WebCore::RenderBlock::setIntrinsicBorderForFieldset):
83         (WebCore::RenderBlock::borderTop):
84         (WebCore::RenderBlock::borderLeft):
85         (WebCore::RenderBlock::borderBottom):
86         (WebCore::RenderBlock::borderRight):
87         (WebCore::RenderBlock::borderBefore):
88         These methods are overridden for border to ensure that the intrinsic border added by a tall legend is
89         properly factored in.
90
91         (WebCore::RenderBlock::computePreferredWidthsForExcludedChildren):
92         * rendering/RenderBlock.h:
93         This method computes the preferred widths for legend children in order to ensure that the legend properly
94         grows the width of the fieldset when it is the widest item.
95
96         (WebCore::RenderBlock::adjustBorderBoxLogicalHeightForBoxSizing):
97         (WebCore::RenderBlock::adjustContentBoxLogicalHeightForBoxSizing):
98         Preserve the behavior of fieldsets in that the available content size includes the space lost accounting
99         for the legend. I don't think this makes much sense, but it matches the behavior of other browsers
100         (and our old behavior).
101
102         (WebCore::RenderBlock::paintExcludedChildrenInBorder):
103         Method for painting the excluded children that might be present in our border. We only do this if the
104         paint phase is a box decoration painting phase and if the legend isn't self-painting.
105
106         * rendering/RenderBlockFlow.cpp:
107         (WebCore::RenderBlockFlow::willCreateColumns):
108         Allow fieldsets to create columns now.
109
110         (WebCore::RenderBlockFlow::layoutBlockChildren):
111         (WebCore::RenderBlockFlow::layoutExcludedChildren):
112         Renamed this method and change it to call the base class to ensure that legends in multicolumn fieldsets
113         get handled properly.
114
115         (WebCore::RenderBlockFlow::addChild):
116         Patched to make sure legends don't get put into the multicolumn flow thread, as they need to
117         remain outside of it.
118
119         (WebCore::RenderBlockFlow::layoutSpecialExcludedChild): Deleted.
120         Renamed to layoutExcludedChildren.
121
122         * rendering/RenderBlockFlow.h:
123         * rendering/RenderBox.cpp:
124         (WebCore::RenderBox::paintBoxDecorations):
125         (WebCore::RenderBox::paintMask):
126         Patched to call the new adjustBorderBoxRectForPainting and paintRectToClipOutFromBorder methods in
127         order to properly shrink the border box rect for painting and to clip out the portion of the border
128         covered by the legend.
129
130         (WebCore::RenderBox::avoidsFloats):
131         Add fieldsets as avoiding floats. RenderFieldset used to subclass this method to return true, but with
132         its removal, we need to put this in the base class along with legends.
133
134         * rendering/RenderBox.h:
135         (WebCore::RenderBox::isGridItem):
136         (WebCore::RenderBox::isFlexItem):
137         Patched to exclude legends so that they don't try to size like they are really in the grid or flexbox.
138
139         (WebCore::RenderBox::adjustBorderBoxRectForPainting):
140         This method is overridden by RenderBLock to handle adjusting fieldset border rects for painting.
141
142         * rendering/RenderBoxModelObject.cpp:
143         (WebCore::RenderBoxModelObject::paintBorder):
144         * rendering/RenderBoxModelObject.h:
145         (WebCore::RenderBoxModelObject::paintRectToClipOutFromBorder):
146         Patched to properly paint fieldsets using the new helpers.
147
148         * rendering/RenderDeprecatedFlexibleBox.cpp:
149         (WebCore::FlexBoxIterator::next):
150         (WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
151         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
152         Make sure deprecated flexible boxes lay out their legends properly by calling layoutExcludedChildren.
153
154         * rendering/RenderElement.cpp:
155         (WebCore::RenderElement::createFor):
156         * rendering/RenderElement.h:
157         Patched to take a flag that limits what renderers can be created so that fieldsets don't make table
158         display types.
159
160         * rendering/RenderFieldset.cpp: Removed.
161         * rendering/RenderFieldset.h: Removed.
162         Remove RenderFieldset files from the tree.
163
164         * rendering/RenderFlexibleBox.cpp:
165         (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
166         (WebCore::RenderFlexibleBox::firstLineBaseline):
167         (WebCore::RenderFlexibleBox::layoutBlock):
168         (WebCore::RenderFlexibleBox::layoutFlexItems):
169         (WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins):
170         Make sure flexible boxes lay out their legends properly by calling layoutExcludedChildren.
171         Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't
172         part of the flexible box layout.
173
174         * rendering/RenderGrid.cpp:
175         (WebCore::RenderGrid::layoutBlock):
176         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
177         (WebCore::RenderGrid::placeItemsOnGrid):
178         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
179         (WebCore::RenderGrid::layoutGridItems):
180         Make sure grids lay out their legends properly by calling layoutExcludedChildren.
181         Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't
182         part of the grid's layout.
183
184         * rendering/RenderMultiColumnFlowThread.cpp:
185         (WebCore::RenderMultiColumnFlowThread::populate):
186         Pull legends back up into the block and don't let them be part of the flow thread.
187
188         * rendering/RenderMultiColumnSet.cpp:
189         (WebCore::RenderMultiColumnSet::requiresBalancing):
190         Fix an assert to allow legends to exist as siblings of multicolumn sets.
191
192         * rendering/RenderObject.cpp:
193         (WebCore::RenderObject::isFieldset):
194         Changed to examine the HTML element rather than RenderFieldset.
195
196         * rendering/RenderObject.h:
197         (WebCore::RenderObject::isExcludedFromNormalLayout):
198         (WebCore::RenderObject::setIsExcludedFromNormalLayout):
199         (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
200         RenderObjects now have a new bit that is set for excluded objects like legends, flow threads,
201         placeholders, and ruby text. This bit lets code easily detect that an object is excluded from
202         the layout system and can be skipped.
203
204         (WebCore::RenderObject::isExcludedAndPlacedInBorder):
205         Helper method for asking if an object is painting inside the border. Used to know we
206         need to factor it into preferred width calculations outside of any one layout system
207         and also to know that we need to paint it when we paint the fieldset's border instead of
208         later (after we might have scrolled or clipped the child painting area).
209
210         * rendering/RenderRubyRun.cpp:
211         (WebCore::RenderRubyRun::layoutExcludedChildren):
212         (WebCore::RenderRubyRun::layoutSpecialExcludedChild): Deleted.
213         * rendering/RenderRubyRun.h:
214         Rename layoutSpecialExcludedChild to layoutExcludedChildren.
215
216         * rendering/RenderTable.cpp:
217         (WebCore::RenderTable::adjustBorderBoxRectForPainting):
218         (WebCore::RenderTable::paintBoxDecorations):
219         (WebCore::RenderTable::paintMask):
220         (WebCore::RenderTable::subtractCaptionRect): Deleted.
221         * rendering/RenderTable.h:
222         Patched tables to share the same border box rect adjustment used by fieldsets when subtracting
223         out captions. This is prep work to allow tables to be fieldsets, but for now I didn't go all the
224         way.
225
226         * rendering/RenderTableCell.cpp:
227         (WebCore::RenderTableCell::paintBoxDecorations):
228         (WebCore::RenderTableCell::paintMask):
229         Make sure table cells adjust their border box rects for painting. Again this is prep work for
230         cells potentially being fieldsets, but not supported yet.
231
232         * rendering/RenderTextControl.cpp:
233         (WebCore::RenderTextControl::layoutExcludedChildren):
234         (WebCore::RenderTextControl::layoutSpecialExcludedChild): Deleted.
235         * rendering/RenderTextControl.h:
236         * rendering/RenderTextControlMultiLine.cpp:
237         (WebCore::RenderTextControlMultiLine::layoutExcludedChildren):
238         (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild): Deleted.
239         * rendering/RenderTextControlMultiLine.h:
240         Renamed the methods for doing the excluded child layout.
241
242         * rendering/RenderTreeAsText.cpp:
243         (WebCore::RenderTreeAsText::writeRenderObject):
244         Make sure to dump the original fieldset border and not the border with the extra legend stuff in it.
245
246 2017-03-06  Antoine Quint  <graouts@apple.com>
247
248         [Modern Media Controls] Tracks panel should clip and scroll content when numerous tracks are available
249         https://bugs.webkit.org/show_bug.cgi?id=169201
250         <rdar://problem/30867979>
251
252         Reviewed by Eric Carlson.
253
254         We now position and size the tracks panel dynamically and ensure a max-height is applied
255         to the panel so that it allows a margin of 10px above it within the media controls. We also
256         apply that same max-height to a new intermediary scrollable container for the track lists,
257         so that it scrolls independently of the container and the background tint.
258
259         Test: media/modern-media-controls/tracks-panel/tracks-panel-position-and-size.html
260
261         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
262         (MacOSFullscreenMediaControls.prototype.showTracksPanel): Deleted.
263         * Modules/modern-media-controls/controls/macos-inline-media-controls.css:
264         (.media-controls.mac.inline .volume.slider):
265         (.media-controls.mac.inline .tracks-panel): Deleted.
266         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
267         (MacOSInlineMediaControls.prototype.showTracksPanel): Deleted.
268         * Modules/modern-media-controls/controls/macos-media-controls.js:
269         (MacOSMediaControls.prototype.showTracksPanel):
270         * Modules/modern-media-controls/controls/tracks-panel.css:
271         (.tracks-panel > .background-tint > div,):
272         (.tracks-panel > .scrollable-container):
273         (.tracks-panel section):
274         (.tracks-panel section:first-of-type):
275         (.tracks-panel section > h3):
276         (.tracks-panel section > ul):
277         (.tracks-panel section > ul > li):
278         (.tracks-panel section > ul > li:focus):
279         (.tracks-panel section > ul > li.selected:before):
280         (.tracks-panel section > ul > li.animated):
281         (.tracks-panel > .background-tint > div): Deleted.
282         (.tracks-panel > section): Deleted.
283         (.tracks-panel > section:first-of-type): Deleted.
284         (.tracks-panel > section > h3): Deleted.
285         (.tracks-panel > section > ul): Deleted.
286         (.tracks-panel > section > ul > li): Deleted.
287         (.tracks-panel > section > ul > li:focus): Deleted.
288         (.tracks-panel > section > ul > li.selected:before): Deleted.
289         (.tracks-panel > section > ul > li.animated): Deleted.
290         * Modules/modern-media-controls/controls/tracks-panel.js:
291         (TracksPanel.prototype.presentInParent):
292         (TracksPanel.prototype.get maxHeight):
293         (TracksPanel.prototype.set maxHeight):
294         (TracksPanel.prototype.commitProperty):
295         (TracksPanel.prototype._childrenFromDataSource):
296
297 2017-03-06  Manuel Rego Casasnovas  <rego@igalia.com>
298
299         [css-grid] Stretch should grow and shrink items to fit its grid area
300         https://bugs.webkit.org/show_bug.cgi?id=163200
301
302         Reviewed by Darin Adler.
303
304         After some discussions the CSS WG agreed that stretch should not only
305         grow items, but also shrink them to fit its grid area.
306         That way the "min-width|height: auto" is somehow ignored for grid items.
307         More info at: https://github.com/w3c/csswg-drafts/issues/283
308
309         The good part is that this allows us to remove some ugly code we've
310         in RenderBox that was only used by Grid Layout.
311
312         For images, we'll be stretching on both axis right now, so the aspect
313         ratio won't be preserved. The default behavior might change in those
314         cases, but that should be implemented in a different patch.
315
316         * rendering/RenderBox.cpp:
317         (WebCore::RenderBox::computeLogicalWidthInRegion):
318         (WebCore::RenderBox::computeLogicalHeight):
319
320 2017-03-06  Miguel Gomez  <magomez@igalia.com>
321
322         [GTK] WebProcess from WebKitGtk+ 2.15.x SIGSEVs in GIFLZWContext::doLZW(unsigned char const*, unsigned long) at Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp:303
323         https://bugs.webkit.org/show_bug.cgi?id=167304
324
325         Reviewed by Carlos Garcia Campos.
326
327         Add a lock to ensure that the GIFImageReader that we are using for decoding is not deleted while
328         the decoding thread is using it.
329
330         No new tests.
331
332         * platform/image-decoders/gif/GIFImageDecoder.cpp:
333         (WebCore::GIFImageDecoder::clearFrameBufferCache):
334
335 2017-03-06  Antti Koivisto  <antti@apple.com>
336
337         Allow render tree building before loading stylesheet elements
338         https://bugs.webkit.org/show_bug.cgi?id=169079
339         <rdar://problem/30865709>
340
341         Reviewed by Andreas Kling.
342
343         Currently we don't resolve style or construct renderers if there are any pending
344         stylesheet loads. This patch enables style and renderer constuction up to the
345         first encountered loading style element.
346
347         This is a step toward allowing incremental rendering for in-body stylesheets.
348
349         * dom/Document.cpp:
350         (WebCore::Document::needsStyleRecalc):
351
352             Ensure scrolling to anchor eventually happens.
353
354         * dom/Document.h:
355         (WebCore::Document::isIgnoringPendingStylesheets):
356         * dom/InlineStyleSheetOwner.cpp:
357         (WebCore::InlineStyleSheetOwner::createSheet):
358         (WebCore::InlineStyleSheetOwner::sheetLoaded):
359         (WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
360         * dom/ProcessingInstruction.cpp:
361         (WebCore::ProcessingInstruction::checkStyleSheet):
362         (WebCore::ProcessingInstruction::sheetLoaded):
363         (WebCore::ProcessingInstruction::removedFrom):
364         * html/HTMLLinkElement.cpp:
365         (WebCore::HTMLLinkElement::addPendingSheet):
366         (WebCore::HTMLLinkElement::removePendingSheet):
367         * style/StyleScope.cpp:
368         (WebCore::Style::Scope::addPendingSheet):
369         (WebCore::Style::Scope::removePendingSheet):
370
371             Track pending sheet nodes in a map so we can test if a given node has a pending sheet.
372             This is also more robust in general.
373
374         (WebCore::Style::Scope::hasProcessingInstructionWithPendingSheet):
375         (WebCore::Style::Scope::updateActiveStyleSheets):
376         * style/StyleScope.h:
377         (WebCore::Style::Scope::hasPendingSheet):
378         (WebCore::Style::Scope::hasPendingSheets):
379         (WebCore::Style::Scope::addPendingSheet): Deleted.
380         * style/StyleTreeResolver.cpp:
381         (WebCore::Style::TreeResolver::styleForElement):
382
383             Instead of global test for placeholder construction check the status of the pending sheet flag.
384
385         (WebCore::Style::hasLoadingStylesheet):
386         (WebCore::Style::TreeResolver::resolveComposedTree):
387
388             Set a flag when encountering a pending top level sheet during DOM traversal.
389
390         (WebCore::Style::TreeResolver::resolve):
391         * style/StyleTreeResolver.h:
392         * svg/graphics/SVGImage.cpp:
393         (WebCore::SVGImage::dataChanged):
394
395             Ensure SVG images have layout before getting the size.
396
397 2017-03-06  Vanessa Chipirrás Navalón  <vchipirras@igalia.com>
398
399         [GStreamer] Adopt nullptr
400         https://bugs.webkit.org/show_bug.cgi?id=123438
401
402         Reviewed by Xabier Rodriguez-Calvar.
403
404         To adapt the code to the C++11 standard, all NULL or 0 pointers have been changed to nullptr.
405
406         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
407         (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
408         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
409         (WebCore::AudioFileReader::handleNewDeinterleavePad):
410         (WebCore::AudioFileReader::plugDeinterleave):
411         (WebCore::AudioFileReader::decodeAudioForBusCreation):
412         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
413         (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
414         (WebCore::AudioSourceProviderGStreamer::configureAudioBin):
415         (WebCore::AudioSourceProviderGStreamer::setClient):
416         (WebCore::AudioSourceProviderGStreamer::handleNewDeinterleavePad):
417         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
418         (webkit_web_audio_src_init):
419         (webKitWebAudioSrcLoop):
420         (webKitWebAudioSrcChangeState):
421         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
422         (WebCore::AudioTrackPrivateGStreamer::setEnabled):
423         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
424         (WebCore::initializeGStreamer):
425         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
426         (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
427         (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
428         (WebCore::initializeGStreamerAndRegisterWebKitElements):
429         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
430         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
431         (WebCore::MediaPlayerPrivateGStreamer::newTextSample):
432         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
433         (WebCore::MediaPlayerPrivateGStreamer::processTableOfContents):
434         Removed the unused second argument on processTableOfContentsEntry function.
435         (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry):
436         Removed the unused second argument on this function.
437         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
438         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
439         (WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
440         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
441         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
442         Removed the unused second argument on processTableOfContentsEntry function.
443         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
444         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
445         (WebCore::MediaPlayerPrivateGStreamerBase::setMuted):
446         (WebCore::MediaPlayerPrivateGStreamerBase::muted):
447         (WebCore::MediaPlayerPrivateGStreamerBase::notifyPlayerOfMute):
448         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
449         (WebCore::MediaPlayerPrivateGStreamerBase::decodedFrameCount):
450         (WebCore::MediaPlayerPrivateGStreamerBase::droppedFrameCount):
451         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
452         (WebCore::MediaPlayerPrivateGStreamerOwr::registerMediaEngine):
453         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
454         (webkit_text_combiner_init):
455         (webkitTextCombinerPadEvent):
456         (webkitTextCombinerRequestNewPad):
457         (webkitTextCombinerNew):
458         * platform/graphics/gstreamer/TextSinkGStreamer.cpp:
459         (webkitTextSinkNew):
460         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
461         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
462         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged):
463         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
464         (webkit_video_sink_init):
465         (webkitVideoSinkProposeAllocation):
466         (webkitVideoSinkNew):
467         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
468         (WebCore::VideoTrackPrivateGStreamer::setSelected):
469         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
470         (webkit_web_src_init):
471         (webKitWebSrcDispose):
472         (webKitWebSrcSetProperty):
473         (webKitWebSrcStop):
474         (webKitWebSrcChangeState):
475         (webKitWebSrcQueryWithParent):
476         (webKitWebSrcGetProtocols):
477         (StreamingClient::handleResponseReceived):
478         (StreamingClient::handleDataReceived):
479         (ResourceHandleStreamingClient::didFail):
480         (ResourceHandleStreamingClient::wasBlocked):
481         (ResourceHandleStreamingClient::cannotShowURL):
482         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
483         (webKitMediaSrcGetProtocols):
484
485 2017-03-06  Andreas Kling  <akling@apple.com>
486
487         [iOS] Report domains crashing under memory pressure via enhanced privacy logging.
488         <https://webkit.org/b/169133>
489         <rdar://problem/29964017>
490
491         Reviewed by Antti Koivisto.
492
493         * page/DiagnosticLoggingKeys.h:
494
495 2017-03-05  Simon Fraser  <simon.fraser@apple.com>
496
497         Avoid backing store for layers with empty text nodes in a few more cases
498         https://bugs.webkit.org/show_bug.cgi?id=169185
499
500         Reviewed by Dan Bernstein.
501
502         In hasPaintingNonLayerDescendants() we can check whether the RenderText's linesBoundingBox()
503         is empty to avoid backing store in a few more cases. Also use containsOnlyWhitespace() rather
504         than isAllCollapsibleWhitespace(), because there's no need for backing store for non-selectable
505         whitespace text.
506
507         Covered by existing tests.
508
509         * rendering/RenderLayer.cpp:
510         (WebCore::RenderLayer::calculateClipRects):
511
512 2017-03-05  Chris Dumez  <cdumez@apple.com>
513
514         Drop unnecessary backslash in ResourceResponse::sanitizeSuggestedFilename()
515         https://bugs.webkit.org/show_bug.cgi?id=169066
516
517         Reviewed by Sam Weinig.
518
519         Drop unnecessary backslash in ResourceResponse::sanitizeSuggestedFilename().
520
521         * platform/network/ResourceResponseBase.cpp:
522         (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
523
524 2017-03-05  Chris Dumez  <cdumez@apple.com>
525
526         Using <form> in <template> causes following <form> to get swallowed
527         https://bugs.webkit.org/show_bug.cgi?id=163552
528
529         Reviewed by Sam Weinig.
530
531         As per the HTML specification [1], when finding a "form" tag in the "in body"
532         insertion mode, we should insert an HTML element for the token, and, if there
533         is no template element on the stack of open elements, set the form element
534         pointer to point to the element created.
535
536         We were missing the "if there is no template element on the stack of open
537         elements" check and setting the form element pointer unconditionally.
538         This patch fixes the issue.
539
540         [1] https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody:form-element-pointer-2
541
542         Test: fast/parser/form-after-template.html
543
544         * html/parser/HTMLConstructionSite.cpp:
545         (WebCore::HTMLConstructionSite::insertHTMLFormElement):
546
547 2017-03-04  Myles C. Maxfield  <mmaxfield@apple.com>
548
549         Update CSSFontSelector's matching algorithm to understand ranges
550         https://bugs.webkit.org/show_bug.cgi?id=168892
551
552         Reviewed by Jon Lee.
553
554         This patch migrates the font selection algorithm out of FontCacheCoreText and into its own file which can be shared
555         among all ports. It then migrates our web font selection algorithm to use it.
556
557         This patch doesn't actually change the parsing rules; it just changes the internal machinery for how fonts get
558         selected. Therefore, this patch simply makes zero-length ranges from the discrete values the parser emits, and passes
559         those zero-length ranges to the range-based font selection routine. This means that this patch doesn't actually
560         change the results of the font selection algorithm.
561
562         One of the inputs to the new font selection algorithm is font-stretch, which previously was not parsed inside
563         @font-face blocks or the CSS Font Loading API. This patch therefore adds parsing support and modifies the existing
564         tests for these pieces to expect parsing to work. Because the font selection algorithm itself is shared between
565         installed fonts and webfonts, this patch doesn't add any additional tests for it (because it is already covered under
566         existing tests).
567
568         No new tests because there is no behavior change.
569
570         * CMakeLists.txt:
571         * WebCore.xcodeproj/project.pbxproj: Add new file for the font selection algorithm.
572         * css/CSSFontFace.cpp:
573         (WebCore::CSSFontFace::calculateStretch): Used on @font-face blocks and the CSS Font Loading API.
574         (WebCore::CSSFontFace::setStretch): Fill out the previously stubbed function.
575         * css/CSSFontFace.h: Add the range member variable to CSSFontFaces.
576         * css/CSSFontFaceSet.cpp:
577         (WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered): Now that we care about font-stretch, we need to
578         look it up for local fonts too. This current approach of an extra FontSelectionValue hanging around with a
579         FontTraitsMask is very ugly and will be removed soon (https://bugs.webkit.org/show_bug.cgi?id=168889 and
580         https://bugs.webkit.org/show_bug.cgi?id=168890).
581         (WebCore::computeFontStretch): Used on @font-face blocks and the CSS Font Loading API.
582         (WebCore::CSSFontFaceSet::matchingFaces): Educate about font-stretch.
583         (WebCore::CSSFontFaceSet::fontFace): Migrate to the new font-selection algorithm.
584         (WebCore::fontFaceComparator): Deleted.
585         * css/CSSFontFaceSet.h:
586         * css/CSSFontSelector.cpp:
587         (WebCore::CSSFontSelector::addFontFaceRule): Educate about font-stretch.
588         (WebCore::CSSFontSelector::fontRangesForFamily): Ditto.
589         * css/FontFace.cpp:
590         (WebCore::FontFace::setStretch): Ditto.
591         (WebCore::FontFace::stretch): Ditto.
592         * css/parser/CSSPropertyParser.cpp:
593         (WebCore::CSSPropertyParser::parseFontFaceDescriptor): Ditto.
594         * platform/graphics/FontCache.h: Ditto.
595         * platform/graphics/FontDescription.h:
596         * platform/graphics/FontSelectionAlgorithm.cpp: Added.
597         (WebCore::FontSelectionAlgorithm::filterCapability):
598         (WebCore::FontSelectionAlgorithm::indexOfBestCapabilities):
599         (WebCore::fontSelectionRequestForTraitsMask):
600         (WebCore::initialFontSelectionCapabilitiesForTraitsMask):
601         (WebCore::fontSelectionCapabilitiesForTraitsMask):
602         * platform/graphics/FontSelectionAlgorithm.h: Added. Taken from FontCacheCoreText.cpp.
603         (WebCore::FontSelectionValue::FontSelectionValue):
604         (WebCore::FontSelectionValue::operator float):
605         (WebCore::FontSelectionValue::rawValue):
606         (WebCore::FontSelectionValue::maximumValue):
607         (WebCore::FontSelectionValue::minimumValue):
608         (WebCore::FontSelectionValue::operator+):
609         (WebCore::FontSelectionValue::operator-):
610         (WebCore::FontSelectionValue::operator*):
611         (WebCore::FontSelectionValue::operator/):
612         (WebCore::FontSelectionValue::operator==):
613         (WebCore::FontSelectionValue::operator!=):
614         (WebCore::FontSelectionValue::operator<):
615         (WebCore::FontSelectionValue::operator<=):
616         (WebCore::FontSelectionValue::operator>):
617         (WebCore::FontSelectionValue::operator>=):
618         (WebCore::FontSelectionRange::isValid):
619         (WebCore::FontSelectionRange::expand):
620         (WebCore::FontSelectionRange::includes):
621         (WebCore::FontSelectionRequest::operator==):
622         (WebCore::FontSelectionRequest::operator!=):
623         (WebCore::FontSelectionRequestKey::FontSelectionRequestKey):
624         (WebCore::FontSelectionRequestKey::isHashTableDeletedValue):
625         (WebCore::FontSelectionRequestKey::operator==):
626         (WebCore::FontSelectionRequestKeyHash::hash):
627         (WebCore::FontSelectionRequestKeyHash::equal):
628         (WebCore::FontSelectionCapabilities::expand):
629         (WebCore::FontSelectionAlgorithm::FontSelectionAlgorithm):
630         (WebCore::FontSelectionAlgorithm::iterateActiveCapabilitiesWithReturn):
631         (WebCore::FontSelectionAlgorithm::iterateActiveCapabilities):
632         * platform/graphics/cocoa/FontCacheCoreText.cpp: Moved to FontSelectionAlgorithm.
633         (WebCore::stretchFromCoreTextTraits):
634         (WebCore::FontDatabase::capabilitiesForFontDescriptor):
635         (WebCore::findClosestFont):
636         (WebCore::calculateFontSelectionRequest):
637         (WebCore::platformFontLookupWithFamily):
638         (WebCore::FontCache::getTraitsInFamily): Deleted.
639         (WebCore::iterateActiveFontsWithReturn): Deleted.
640         (WebCore::iterateActiveFonts): Deleted.
641         (WebCore::findClosestStretch): Deleted.
642         (WebCore::filterStretch): Deleted.
643         (WebCore::findClosestStyle): Deleted.
644         (WebCore::filterStyle): Deleted.
645         (WebCore::findClosestWeight): Deleted.
646         (WebCore::filterWeight): Deleted.
647         (WebCore::computeTargetWeight): Deleted.
648         * platform/text/TextFlags.h: Moved to FontSelectionAlgorithm.
649         (WebCore::FontSelectionValue::FontSelectionValue): Deleted.
650         (WebCore::FontSelectionValue::operator float): Deleted.
651         (WebCore::FontSelectionValue::operator+): Deleted.
652         (WebCore::FontSelectionValue::operator-): Deleted.
653         (WebCore::FontSelectionValue::operator*): Deleted.
654         (WebCore::FontSelectionValue::operator/): Deleted.
655         (WebCore::FontSelectionValue::operator==): Deleted.
656         (WebCore::FontSelectionValue::operator!=): Deleted.
657         (WebCore::FontSelectionValue::operator<): Deleted.
658         (WebCore::FontSelectionValue::operator<=): Deleted.
659         (WebCore::FontSelectionValue::operator>): Deleted.
660         (WebCore::FontSelectionValue::operator>=): Deleted.
661         (WebCore::FontSelectionValue::rawValue): Deleted.
662         (WebCore::FontSelectionValue::maximumValue): Deleted.
663         (WebCore::FontSelectionValue::minimumValue): Deleted.
664         (WebCore::FontSelectionRange::isValid): Deleted.
665         (WebCore::FontSelectionRange::expand): Deleted.
666         (WebCore::FontSelectionRange::includes): Deleted.
667         (WebCore::FontSelectionCapabilities::expand): Deleted.
668
669 2017-03-05  Simon Fraser  <simon.fraser@apple.com>
670
671         Make some RenderLayer tree traversal in RenderLayerBacking more generic
672         https://bugs.webkit.org/show_bug.cgi?id=169177
673
674         Reviewed by Zalan Bujtas.
675
676         The real goal of this patch is reduce the number of callers of
677         RenderLayerBacking::isPaintDestinationForDescendantLayers() to one. To achieve that,
678         have the setContentsVisible() logic (which is really just about the CSS 'visibility' property)
679         do its own tree traversal which just consults layer.hasVisibleContent(). So
680         make descendantLayerPaintsIntoAncestor() a generic traversal function which walks
681         descendant layers which may paint into the target layer. The "Visible" in the name
682         reflects the fact that it can bypass a subtree for a layer with !hasVisibleDescendant().
683
684         * rendering/RenderLayerBacking.cpp:
685         (WebCore::RenderLayerBacking::updateAfterDescendants):
686         (WebCore::traverseVisibleNonCompositedDescendantLayers):
687         (WebCore::RenderLayerBacking::isPaintDestinationForDescendantLayers):
688         (WebCore::RenderLayerBacking::hasVisibleNonCompositedDescendants):
689         (WebCore::descendantLayerPaintsIntoAncestor): Deleted.
690         * rendering/RenderLayerBacking.h:
691
692 2017-03-04  Simon Fraser  <simon.fraser@apple.com>
693
694         Clarify some terminology in RenderLayerBacking
695         https://bugs.webkit.org/show_bug.cgi?id=169174
696
697         Reviewed by Zalan Bujtas.
698
699         Rename some functions related to directly-composited background images and
700         box decorations for clarify.
701
702         Only behavior change is for canDirectlyCompositeBackgroundBackgroundImage() to check
703         GraphicsLayer::supportsContentsTiling(), which means that RenderLayerBacking::contentChanged()
704         will no longer trigger a updateGeometry() when it gets BackgroundImageChanged on non-
705         CoordinateGraphics platforms.
706
707         * rendering/RenderLayerBacking.cpp:
708         (WebCore::RenderLayerBacking::updateConfiguration):
709         (WebCore::RenderLayerBacking::updateAfterDescendants):
710         (WebCore::RenderLayerBacking::updateDirectlyCompositedBoxDecorations):
711         (WebCore::canDirectlyCompositeBackgroundBackgroundImage):
712         (WebCore::hasPaintedBoxDecorationsOrBackgroundImage):
713         (WebCore::supportsDirectlyCompositedBoxDecorations):
714         (WebCore::RenderLayerBacking::paintsBoxDecorations):
715         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
716         (WebCore::RenderLayerBacking::contentChanged):
717         (WebCore::RenderLayerBacking::updateDirectlyCompositedContents): Deleted.
718         (WebCore::canCreateTiledImage): Deleted.
719         (WebCore::hasVisibleBoxDecorationsOrBackgroundImage): Deleted.
720         (WebCore::supportsDirectBoxDecorationsComposition): Deleted.
721         * rendering/RenderLayerBacking.h:
722
723 2017-03-04  Alex Christensen  <achristensen@webkit.org>
724
725         Cleanup after r213418
726         https://bugs.webkit.org/show_bug.cgi?id=169165
727
728         Reviewed by Youenn Fablet.
729
730         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
731         (WebCore::RealtimeIncomingAudioSource::OnData):
732         Restore the assertion I removed.
733
734 2017-03-04  Commit Queue  <commit-queue@webkit.org>
735
736         Unreviewed, rolling out r213379.
737         https://bugs.webkit.org/show_bug.cgi?id=169169
738
739         broke GTK+ and Windows builds (Requested by mcatanzaro on
740         #webkit).
741
742         Reverted changeset:
743
744         "Enable fieldsets to be flexboxes, grids and multicolumn."
745         https://bugs.webkit.org/show_bug.cgi?id=169082
746         http://trac.webkit.org/changeset/213379
747
748 2017-03-03  Youenn Fablet  <youenn@apple.com>
749
750         [WebRTC] Update libwebrtc source code
751         https://bugs.webkit.org/show_bug.cgi?id=168599
752
753         Reviewed by Alex Christensen.
754
755         * Modules/mediastream/RTCStatsReport.h:
756         * Modules/mediastream/RTCStatsReport.idl:
757         Update to match the latest spec, which matches the new structures in libwebrtc.
758         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
759         (WebCore::fillRTCRTPStreamStats):
760         (WebCore::fillOutboundRTPStreamStats):
761         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
762         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
763         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
764         (WebCore::RealtimeIncomingAudioSource::OnData):
765         Comment out an assertion that was failing.  We should revisit this.
766         * testing/MockLibWebRTCPeerConnection.h:
767
768 2017-03-03  Commit Queue  <commit-queue@webkit.org>
769
770         Unreviewed, rolling out r213400.
771         https://bugs.webkit.org/show_bug.cgi?id=169163
772
773         Caused frequent assertion failures (Requested by ap on
774         #webkit).
775
776         Reverted changeset:
777
778         "[Modern Media Controls] Improve media documents across macOS,
779         iPhone and iPad"
780         https://bugs.webkit.org/show_bug.cgi?id=169145
781         http://trac.webkit.org/changeset/213400
782
783 2017-03-03  Andy Estes  <aestes@apple.com>
784
785         Add support for canvas.toBlob
786         https://bugs.webkit.org/show_bug.cgi?id=148878
787
788         Reviewed by Tim Horton.
789
790         Address additional review feedback received after r213412 landed.
791
792         * html/HTMLCanvasElement.cpp:
793         (WebCore::HTMLCanvasElement::toBlob): Passed null to the blob callback if blob conversion
794         fails for any reason.
795         * platform/graphics/cg/ImageBufferCG.cpp:
796         (WebCore::cgImage): Removed an unnecessary local variable.
797
798 2017-03-03  Andy Estes  <aestes@apple.com>
799
800         Add support for canvas.toBlob
801         https://bugs.webkit.org/show_bug.cgi?id=148878
802         <rdar://problem/22590406>
803
804         Reviewed by Tim Horton.
805
806         These tests now pass:
807         imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.jpeg.html
808         imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.png.html
809
810         * CMakeLists.txt:
811         * DerivedSources.make:
812         * WebCore.xcodeproj/project.pbxproj:
813         * fileapi/BlobCallback.cpp: Added.
814         (WebCore::BlobCallback::scheduleCallback):
815         * fileapi/BlobCallback.h: Added.
816         (WebCore::BlobCallback::~BlobCallback):
817         * fileapi/BlobCallback.idl: Added.
818         * html/HTMLCanvasElement.cpp:
819         (WebCore::HTMLCanvasElement::toBlob):
820         * html/HTMLCanvasElement.h:
821         * html/HTMLCanvasElement.idl:
822         * platform/graphics/ImageBuffer.h:
823         * platform/graphics/cairo/ImageBufferCairo.cpp:
824         (WebCore::writeFunction):
825         (WebCore::encodeImage):
826         (WebCore::ImageBuffer::toDataURL):
827         (WebCore::ImageBuffer::toData):
828         * platform/graphics/cg/ImageBufferCG.cpp:
829         (WebCore::data):
830         (WebCore::ImageBuffer::toDataURL):
831         (WebCore::ImageBuffer::toData):
832         (WebCore::ImageBuffer::toCGImage):
833         (WebCore::cgImage):
834         (WebCore::dataURL):
835         * platform/graphics/gtk/ImageBufferGtk.cpp:
836         (WebCore::ImageBuffer::toDataURL):
837         (WebCore::ImageBuffer::toData):
838         * platform/graphics/win/ImageBufferDirect2D.cpp:
839         (WebCore::ImageBuffer::toData):
840
841 2017-03-03  Dean Jackson  <dino@apple.com>
842
843         Add WebGPU compile flag and experimental feature flag
844         https://bugs.webkit.org/show_bug.cgi?id=169161
845         <rdar://problem/30846689>
846
847         Reviewed by Tim Horton.
848
849         Add ENABLE_WEBGPU, an experimental feature flag, a RuntimeEnabledFeature,
850         and an InternalSetting.
851
852         * Configurations/FeatureDefines.xcconfig:
853         * page/RuntimeEnabledFeatures.h:
854         (WebCore::RuntimeEnabledFeatures::setWebGPUEnabled):
855         (WebCore::RuntimeEnabledFeatures::webGPUEnabled):
856         * testing/InternalSettings.cpp:
857         (WebCore::InternalSettings::Backup::Backup):
858         (WebCore::InternalSettings::Backup::restoreTo):
859         (WebCore::InternalSettings::setWebGPUEnabled):
860         * testing/InternalSettings.h:
861         * testing/InternalSettings.idl:
862
863 2017-03-03  Simon Fraser  <simon.fraser@apple.com>
864
865         Clean up some RenderLayerBacking code
866         https://bugs.webkit.org/show_bug.cgi?id=169160
867
868         Reviewed by Dean Jackson.
869
870         Modern loops in descendantLayerPaintsIntoAncestor().
871
872         Rename RenderLayerBacking::paintsChildren() to RenderLayerBacking::paintsChildRenderers() to clarify that
873         it refers to renderers, not RenderLayers.
874
875         Rename RenderLayerBacking::paintsNonDirectCompositedBoxDecoration() to RenderLayerBacking::paintsBoxDecorations().
876         "Paints" already implies non-composited.
877
878         No behavior change.
879
880         * rendering/RenderLayerBacking.cpp:
881         (WebCore::RenderLayerBacking::updateDrawsContent):
882         (WebCore::RenderLayerBacking::paintsBoxDecorations):
883         (WebCore::RenderLayerBacking::paintsChildRenderers):
884         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
885         (WebCore::descendantLayerPaintsIntoAncestor):
886         (WebCore::RenderLayerBacking::paintsNonDirectCompositedBoxDecoration): Deleted.
887         (WebCore::RenderLayerBacking::paintsChildren): Deleted.
888         * rendering/RenderLayerBacking.h:
889
890 2017-03-03  Simon Fraser  <simon.fraser@apple.com>
891
892         Clean up RenderImage and a RenderImageResource function
893         https://bugs.webkit.org/show_bug.cgi?id=169153
894
895         Reviewed by Zalan Bujtas.
896         
897         Change all calls to imageResource().cachedImage() in RenderImage to use the inline
898         cachedImage() function.
899
900         In RenderImage::paintReplaced(), early return after the broken image block (and no need
901         to test imageResource().hasImage() again in the second condition). Convert height/width to size,
902         which also forces us to be explicit about using flooredIntSize() when fetching the image
903         (perhaps this should be a roundedIntSize, but I didn't want to change behavior).
904
905         Change RenderImageResource::image() to take an IntSize, rather than int height and width.
906
907         No behavior change.
908
909         * rendering/RenderImage.cpp:
910         (WebCore::RenderImage::styleDidChange):
911         (WebCore::RenderImage::imageChanged):
912         (WebCore::RenderImage::notifyFinished):
913         (WebCore::RenderImage::paintReplaced):
914         (WebCore::RenderImage::paintIntoRect):
915         (WebCore::RenderImage::foregroundIsKnownToBeOpaqueInRect):
916         (WebCore::RenderImage::embeddedContentBox):
917         * rendering/RenderImageResource.cpp:
918         (WebCore::RenderImageResource::image):
919         * rendering/RenderImageResource.h:
920         (WebCore::RenderImageResource::image):
921         * rendering/RenderImageResourceStyleImage.cpp:
922         (WebCore::RenderImageResourceStyleImage::image):
923         * rendering/RenderImageResourceStyleImage.h:
924
925 2017-03-03  Antoine Quint  <graouts@apple.com>
926
927         [Modern Media Controls] Improve media documents across macOS, iPhone and iPad
928         https://bugs.webkit.org/show_bug.cgi?id=169145
929         <rdar://problem/17048858>
930
931         Reviewed by Dean Jackson.
932
933         There were a variety of issues with media documents, some longstanding, and some specifically
934         about modern media controls.
935
936         One issue was that fullscreen and picture-in-picture buttons would show for audio media documents,
937         due to using a <video> element to load the audio file. We now have additional logic in MediaController
938         to identify if the loaded media is really an audio file, and using this information to hide the
939         fullscreen and picture-in-picture buttons.
940
941         Another issue was that we would inject style in MediaDocument.cpp that was specific to modern media
942         controls when we could have the modern-media-controls module injected CSS handle this styling. We now
943         use the injected style in the shadow root to size media documents based on the device characteristics
944         and ensuring that page styles are overridden.
945
946         We also simplify how MediaDocument.cpp sets the source of the media element to simply use the "src"
947         attribute and not a <source> element.
948
949         Finally, we introduce a MediaDocumentController class that is instantiated when we're dealing with
950         a media document to hide the controls while we determine the type of media we're loading (audio vs.
951         video) in order to apply the appropriate styling without flashes.
952
953         As a result of the new styles applied by the modern-media-controls module, media documents have a
954         similar behavior on macOS and iPad, where we only enforce a min-width for video allowing them
955         to play at their natural size otherwise, and enforcing a fixed width for audio. On iPhone however,
956         we want to always play the media at full width, with some padding in the case of audio.
957
958         Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html
959                media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing.html
960                media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing.html
961                media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html
962                media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html
963                media/modern-media-controls/media-documents/media-document-video-ios-sizing.html
964                media/modern-media-controls/media-documents/media-document-video-mac-sizing.html
965                media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html
966
967         * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
968         (:host(audio) .media-controls.ios.inline > .controls-bar:before,):
969         (:host(audio) .media-controls.ios.inline > .controls-bar:before): Deleted.
970         * Modules/modern-media-controls/controls/macos-media-controls.css:
971         (:host(audio) .media-controls.mac.inline > .controls-bar,):
972         (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint,):
973         (:host(audio) .media-controls.mac.inline > .controls-bar): Deleted.
974         (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint): Deleted.
975         * Modules/modern-media-controls/controls/media-document.css: Added.
976         (:host(.media-document)):
977         (:host(.media-document.ready)):
978         (:host(.media-document.audio.mac)):
979         (:host(.media-document.audio.ipad)):
980         (:host(.media-document.audio.iphone)):
981         (:host(.media-document.video.mac)):
982         (:host(.media-document.video.ipad)):
983         (:host(.media-document.video.iphone)):
984         * Modules/modern-media-controls/js-files:
985         * Modules/modern-media-controls/media/fullscreen-support.js:
986         (FullscreenSupport.prototype.syncControl):
987         (FullscreenSupport):
988         * Modules/modern-media-controls/media/media-controller.js:
989         (MediaController):
990         (MediaController.prototype.get isAudio):
991         * Modules/modern-media-controls/media/media-document-controller.js: Added.
992         (MediaDocumentController):
993         (MediaDocumentController.prototype.handleEvent):
994         (MediaDocumentController.prototype._mediaDocumentHasMetadata):
995         (MediaDocumentController.prototype._mediaDocumentHasSize):
996         * Modules/modern-media-controls/media/pip-support.js:
997         (PiPSupport.prototype.syncControl):
998         (PiPSupport):
999         * html/MediaDocument.cpp:
1000         (WebCore::MediaDocumentParser::createDocumentStructure):
1001
1002 2017-03-03  Chris Dumez  <cdumez@apple.com>
1003
1004         [iOS] Throttle SVG SMIL animations to 30fps in low power mode
1005         https://bugs.webkit.org/show_bug.cgi?id=169137
1006         <rdar://problem/30833754>
1007
1008         Reviewed by Simon Fraser.
1009
1010         Throttle SVG SMIL animations to 30fps in low power mode on iOS to save
1011         battery.
1012
1013         Test: svg/animations/animations-lowPowerMode-throttling.html
1014
1015         * svg/SVGSVGElement.cpp:
1016         (WebCore::SVGSVGElement::SVGSVGElement):
1017         * svg/SVGSVGElement.idl:
1018         * svg/animation/SMILTime.h:
1019         (WebCore::SMILTime::SMILTime):
1020         * svg/animation/SMILTimeContainer.cpp:
1021         (WebCore::SMILTimeContainer::SMILTimeContainer):
1022         (WebCore::SMILTimeContainer::animationFrameDelay):
1023         (WebCore::SMILTimeContainer::updateDocumentOrderIndexes):
1024         (WebCore::SMILTimeContainer::updateAnimations):
1025         * svg/animation/SMILTimeContainer.h:
1026         * svg/animation/SVGSMILElement.cpp:
1027         (WebCore::SVGSMILElement::calculateNextProgressTime):
1028         * testing/Internals.cpp:
1029         (WebCore::Internals::svgAnimationsInterval):
1030         * testing/Internals.h:
1031         * testing/Internals.idl:
1032
1033 2017-03-03  Joseph Pecoraro  <pecoraro@apple.com>
1034
1035         [Mac] WebCore.framework is missing a symlink from Frameworks to Versions/Current/Frameworks when the latter exists
1036         https://bugs.webkit.org/show_bug.cgi?id=169067
1037
1038         Reviewed by Dan Bernstein.
1039
1040         * WebCore.xcodeproj/project.pbxproj:
1041
1042 2017-03-03  Sam Weinig  <sam@webkit.org>
1043
1044         REGRESSION (r209760): Apple Pay doesn't work on casper.com, shopspring.com, maybe other sites
1045         <rdar://problem/30313445>
1046         https://bugs.webkit.org/show_bug.cgi?id=169149
1047
1048         Reviewed by Simon Fraser.
1049
1050         Relax restriction that the ApplePayShippingMethod sequence must not be empty. This
1051         was incorrect.
1052
1053         * Modules/applepay/ApplePaySession.cpp:
1054         (WebCore::convertAndValidate):
1055
1056 2017-03-03  Alex Christensen  <achristensen@webkit.org>
1057
1058         [URLParser] Fix file: as a relative file URL
1059         https://bugs.webkit.org/show_bug.cgi?id=169122
1060
1061         Reviewed by Tim Horton.
1062
1063         This is clearly defined in https://url.spec.whatwg.org/#file-state with the EOF code point.
1064         I got it wrong and didn't test it.  It's been added to the web platform tests since we last updated.
1065
1066         * platform/URLParser.cpp:
1067         (WebCore::URLParser::parse):
1068
1069 2017-03-03  Dave Hyatt  <hyatt@apple.com>
1070
1071         Enable fieldsets to be flexboxes, grids and multicolumn.
1072         https://bugs.webkit.org/show_bug.cgi?id=169082
1073
1074         Reviewed by Simon Fraser.
1075
1076         Added new tests in fast/forms/fieldset.
1077
1078         This patch eliminates RenderFieldset and moves the functionality into RenderBlock so that
1079         derived classes can also be fieldsets.
1080
1081         * CMakeLists.txt:
1082         * WebCore.xcodeproj/project.pbxproj:
1083         Remove RenderFieldset from the project.
1084
1085         * accessibility/AccessibilityRenderObject.cpp:
1086         (WebCore::AccessibilityRenderObject::titleUIElement):
1087         Call in to RenderBlock now instead of RenderFieldset.
1088
1089         * html/HTMLFieldSetElement.cpp:
1090         (WebCore::HTMLFieldSetElement::createElementRenderer):
1091         * html/HTMLFieldSetElement.h:
1092         The fieldset DOM element now uses RenderElement::createFor to make renderers so that multiple display types
1093         can be supported. A special flag has been added that indicates only to make flexbox and block-related
1094         renderers (not table display types).
1095
1096         * rendering/OrderIterator.cpp:
1097         (WebCore::OrderIterator::shouldSkipChild):
1098         (WebCore::OrderIteratorPopulator::collectChild):
1099         * rendering/OrderIterator.h:
1100         Streamline child collection for flexboxes and grids to indicate whether the child should be skipped as a return
1101         value from collectChild. Add a shouldSkipChild method that skips both out of flow positioned objects and
1102         excluded children like the legends of fieldsets.
1103
1104         * rendering/RenderBlock.cpp:
1105         (WebCore::RenderBlockRareData::RenderBlockRareData):
1106         When the legend is taller than the fieldset's borderBefore(), intrinsic border is added to the CSS border width.
1107         This intrinsic border being factored in ensures that the padding and content boxes of fieldsets are correct
1108         across any layout system, since the legend is now just treated as part of the border.
1109
1110         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
1111         Call the new computePreferredWidthsForExcludedChildren to ensure that excluded children contribute to
1112         preferred width in their own way and not as part of a specific layout system.
1113
1114         (WebCore::RenderBlock::renderName):
1115         Hacked to still return RenderFieldSet for RenderBlockFlow-backed fieldsets for layout test compatibility.
1116
1117         (WebCore::RenderBlock::layoutExcludedChildren):
1118         Renamed from layoutSpecialExcludedChild to more accurately reflect the fact that multiple excluded children
1119         can be included here (e.g., both a multicolumn flow thread and a legend). The RenderBlock base class handles
1120         the layout of legends by both placing them and setting the correct intrinsic border before amount on the
1121         block.
1122
1123         (WebCore::RenderBlock::findFieldsetLegend):
1124         Moved from RenderFieldset.
1125
1126         (WebCore::RenderBlock::adjustBorderBoxRectForPainting):
1127         (WebCore::RenderBlock::paintRectToClipOutFromBorder):
1128         These methods are used when painting to shrink the border box as needed to account for the legend and to
1129         provide the portion of the border that needs to be clipped out. These methods have been enhanced to
1130         properly support all writing modes.
1131
1132         (WebCore::RenderBlock::intrinsicBorderForFieldset):
1133         (WebCore::RenderBlock::setIntrinsicBorderForFieldset):
1134         (WebCore::RenderBlock::borderTop):
1135         (WebCore::RenderBlock::borderLeft):
1136         (WebCore::RenderBlock::borderBottom):
1137         (WebCore::RenderBlock::borderRight):
1138         (WebCore::RenderBlock::borderBefore):
1139         These methods are overridden for border to ensure that the intrinsic border added by a tall legend is
1140         properly factored in.
1141
1142         (WebCore::RenderBlock::computePreferredWidthsForExcludedChildren):
1143         * rendering/RenderBlock.h:
1144         This method computes the preferred widths for legend children in order to ensure that the legend properly
1145         grows the width of the fieldset when it is the widest item.
1146
1147         (WebCore::RenderBlock::adjustBorderBoxLogicalHeightForBoxSizing):
1148         (WebCore::RenderBlock::adjustContentBoxLogicalHeightForBoxSizing):
1149         Preserve the behavior of fieldsets in that the available content size includes the space lost accounting
1150         for the legend. I don't think this makes much sense, but it matches the behavior of other browsers
1151         (and our old behavior).
1152
1153         (WebCore::RenderBlock::paintExcludedChildrenInBorder):
1154         Method for painting the excluded children that might be present in our border. We only do this if the
1155         paint phase is a box decoration painting phase and if the legend isn't self-painting.
1156
1157         * rendering/RenderBlockFlow.cpp:
1158         (WebCore::RenderBlockFlow::willCreateColumns):
1159         Allow fieldsets to create columns now.
1160
1161         (WebCore::RenderBlockFlow::layoutBlockChildren):
1162         (WebCore::RenderBlockFlow::layoutExcludedChildren):
1163         Renamed this method and change it to call the base class to ensure that legends in multicolumn fieldsets
1164         get handled properly.
1165
1166         (WebCore::RenderBlockFlow::addChild):
1167         Patched to make sure legends don't get put into the multicolumn flow thread, as they need to
1168         remain outside of it.
1169
1170         (WebCore::RenderBlockFlow::layoutSpecialExcludedChild): Deleted.
1171         Renamed to layoutExcludedChildren.
1172
1173         * rendering/RenderBlockFlow.h:
1174         * rendering/RenderBox.cpp:
1175         (WebCore::RenderBox::paintBoxDecorations):
1176         (WebCore::RenderBox::paintMask):
1177         Patched to call the new adjustBorderBoxRectForPainting and paintRectToClipOutFromBorder methods in
1178         order to properly shrink the border box rect for painting and to clip out the portion of the border
1179         covered by the legend.
1180
1181         (WebCore::RenderBox::avoidsFloats):
1182         Add fieldsets as avoiding floats. RenderFieldset used to subclass this method to return true, but with
1183         its removal, we need to put this in the base class along with legends.
1184
1185         * rendering/RenderBox.h:
1186         (WebCore::RenderBox::isGridItem):
1187         (WebCore::RenderBox::isFlexItem):
1188         Patched to exclude legends so that they don't try to size like they are really in the grid or flexbox.
1189
1190         (WebCore::RenderBox::adjustBorderBoxRectForPainting):
1191         This method is overridden by RenderBLock to handle adjusting fieldset border rects for painting.
1192
1193         * rendering/RenderBoxModelObject.cpp:
1194         (WebCore::RenderBoxModelObject::paintBorder):
1195         * rendering/RenderBoxModelObject.h:
1196         (WebCore::RenderBoxModelObject::paintRectToClipOutFromBorder):
1197         Patched to properly paint fieldsets using the new helpers.
1198
1199         * rendering/RenderDeprecatedFlexibleBox.cpp:
1200         (WebCore::FlexBoxIterator::next):
1201         (WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
1202         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
1203         Make sure deprecated flexible boxes lay out their legends properly by calling layoutExcludedChildren.
1204
1205         * rendering/RenderElement.cpp:
1206         (WebCore::RenderElement::createFor):
1207         * rendering/RenderElement.h:
1208         Patched to take a flag that limits what renderers can be created so that fieldsets don't make table
1209         display types.
1210
1211         * rendering/RenderFieldset.cpp: Removed.
1212         * rendering/RenderFieldset.h: Removed.
1213         Remove RenderFieldset files from the tree.
1214
1215         * rendering/RenderFlexibleBox.cpp:
1216         (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
1217         (WebCore::RenderFlexibleBox::firstLineBaseline):
1218         (WebCore::RenderFlexibleBox::layoutBlock):
1219         (WebCore::RenderFlexibleBox::layoutFlexItems):
1220         (WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins):
1221         Make sure flexible boxes lay out their legends properly by calling layoutExcludedChildren.
1222         Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't
1223         part of the flexible box layout.
1224
1225         * rendering/RenderGrid.cpp:
1226         (WebCore::RenderGrid::layoutBlock):
1227         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
1228         (WebCore::RenderGrid::placeItemsOnGrid):
1229         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
1230         (WebCore::RenderGrid::layoutGridItems):
1231         Make sure grids lay out their legends properly by calling layoutExcludedChildren.
1232         Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't
1233         part of the grid's layout.
1234
1235         * rendering/RenderMultiColumnFlowThread.cpp:
1236         (WebCore::RenderMultiColumnFlowThread::populate):
1237         Pull legends back up into the block and don't let them be part of the flow thread.
1238
1239         * rendering/RenderMultiColumnSet.cpp:
1240         (WebCore::RenderMultiColumnSet::requiresBalancing):
1241         Fix an assert to allow legends to exist as siblings of multicolumn sets.
1242
1243         * rendering/RenderObject.cpp:
1244         (WebCore::RenderObject::isFieldset):
1245         Changed to examine the HTML element rather than RenderFieldset.
1246
1247         * rendering/RenderObject.h:
1248         (WebCore::RenderObject::isExcludedFromNormalLayout):
1249         (WebCore::RenderObject::setIsExcludedFromNormalLayout):
1250         (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
1251         RenderObjects now have a new bit that is set for excluded objects like legends, flow threads,
1252         placeholders, and ruby text. This bit lets code easily detect that an object is excluded from
1253         the layout system and can be skipped.
1254
1255         (WebCore::RenderObject::isExcludedAndPlacedInBorder):
1256         Helper method for asking if an object is painting inside the border. Used to know we
1257         need to factor it into preferred width calculations outside of any one layout system
1258         and also to know that we need to paint it when we paint the fieldset's border instead of
1259         later (after we might have scrolled or clipped the child painting area).
1260
1261         * rendering/RenderRubyRun.cpp:
1262         (WebCore::RenderRubyRun::layoutExcludedChildren):
1263         (WebCore::RenderRubyRun::layoutSpecialExcludedChild): Deleted.
1264         * rendering/RenderRubyRun.h:
1265         Rename layoutSpecialExcludedChild to layoutExcludedChildren.
1266
1267         * rendering/RenderTable.cpp:
1268         (WebCore::RenderTable::adjustBorderBoxRectForPainting):
1269         (WebCore::RenderTable::paintBoxDecorations):
1270         (WebCore::RenderTable::paintMask):
1271         (WebCore::RenderTable::subtractCaptionRect): Deleted.
1272         * rendering/RenderTable.h:
1273         Patched tables to share the same border box rect adjustment used by fieldsets when subtracting
1274         out captions. This is prep work to allow tables to be fieldsets, but for now I didn't go all the
1275         way.
1276
1277         * rendering/RenderTableCell.cpp:
1278         (WebCore::RenderTableCell::paintBoxDecorations):
1279         (WebCore::RenderTableCell::paintMask):
1280         Make sure table cells adjust their border box rects for painting. Again this is prep work for
1281         cells potentially being fieldsets, but not supported yet.
1282
1283         * rendering/RenderTextControl.cpp:
1284         (WebCore::RenderTextControl::layoutExcludedChildren):
1285         (WebCore::RenderTextControl::layoutSpecialExcludedChild): Deleted.
1286         * rendering/RenderTextControl.h:
1287         * rendering/RenderTextControlMultiLine.cpp:
1288         (WebCore::RenderTextControlMultiLine::layoutExcludedChildren):
1289         (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild): Deleted.
1290         * rendering/RenderTextControlMultiLine.h:
1291         Renamed the methods for doing the excluded child layout.
1292
1293         * rendering/RenderTreeAsText.cpp:
1294         (WebCore::RenderTreeAsText::writeRenderObject):
1295         Make sure to dump the original fieldset border and not the border with the extra legend stuff in it.
1296
1297 2017-03-03  Ryan Haddad  <ryanhaddad@apple.com>
1298
1299         Unreviewed, rolling out r213344.
1300
1301         This changed caused LayoutTest crashes under GuardMalloc.
1302
1303         Reverted changeset:
1304
1305         "Add support for canvas.toBlob"
1306         https://bugs.webkit.org/show_bug.cgi?id=148878
1307         http://trac.webkit.org/changeset/213344
1308
1309 2017-03-03  Konstantin Tokarev  <annulen@yandex.ru>
1310
1311         Unreviewed typo fix
1312
1313         * features.json:
1314
1315 2017-03-03  Eric Carlson  <eric.carlson@apple.com>
1316
1317         [MediaStream] Remove #if USE(VIDEOTOOLBOX) from AVVideoCaptureSource
1318         https://bugs.webkit.org/show_bug.cgi?id=169131
1319
1320         Reviewed by Youenn Fablet.
1321
1322         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1323         (WebCore::AVVideoCaptureSource::currentFrameCGImage):
1324
1325 2017-03-03  Chris Dumez  <cdumez@apple.com>
1326
1327         Add assertion in Frame::setView() to make sure associated document has no living render tree
1328         https://bugs.webkit.org/show_bug.cgi?id=169134
1329
1330         Reviewed by Brent Fulgham.
1331
1332         Add assertion in Frame::setView() to make sure associated document has no living render tree.
1333         This is not supposed to happen and r213311 fixed one case where this could happen. We need
1334         to find out if it can still happen.
1335
1336         * page/Frame.cpp:
1337         (WebCore::Frame::setView):
1338
1339 2017-03-02  Sam Weinig  <sam@webkit.org>
1340
1341         Rename htmlediting.h/cpp to Editing.h/cpp
1342         https://bugs.webkit.org/show_bug.cgi?id=169103
1343
1344         Reviewed by Alex Christensen.
1345
1346         * CMakeLists.txt:
1347         * WebCore.xcodeproj/project.pbxproj:
1348         * accessibility/AXObjectCache.cpp:
1349         * accessibility/AccessibilityNodeObject.cpp:
1350         * accessibility/AccessibilityObject.cpp:
1351         * accessibility/AccessibilityRenderObject.cpp:
1352         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
1353         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
1354         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1355         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1356         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1357         * dom/Document.cpp:
1358         * dom/Element.cpp:
1359         * dom/Node.h:
1360         * dom/Position.cpp:
1361         * dom/PositionIterator.cpp:
1362         * dom/Range.cpp:
1363         * editing/AlternativeTextController.cpp:
1364         * editing/AppendNodeCommand.cpp:
1365         * editing/ApplyBlockElementCommand.cpp:
1366         * editing/ApplyStyleCommand.cpp:
1367         * editing/BreakBlockquoteCommand.cpp:
1368         * editing/CompositeEditCommand.cpp:
1369         * editing/CreateLinkCommand.cpp:
1370         (WebCore::CreateLinkCommand::CreateLinkCommand):
1371         * editing/DeleteFromTextNodeCommand.cpp:
1372         * editing/DeleteSelectionCommand.cpp:
1373         * editing/EditCommand.cpp:
1374         * editing/Editing.cpp: Copied from Source/WebCore/editing/htmlediting.cpp.
1375         * editing/Editing.h: Copied from Source/WebCore/editing/htmlediting.h.
1376         * editing/EditingAllInOne.cpp:
1377         * editing/EditingStyle.cpp:
1378         * editing/Editor.cpp:
1379         * editing/EditorCommand.cpp:
1380         * editing/FormatBlockCommand.cpp:
1381         * editing/FrameSelection.cpp:
1382         * editing/HTMLInterchange.cpp:
1383         * editing/IndentOutdentCommand.cpp:
1384         * editing/InsertLineBreakCommand.cpp:
1385         * editing/InsertListCommand.cpp:
1386         * editing/InsertNodeBeforeCommand.cpp:
1387         * editing/InsertParagraphSeparatorCommand.cpp:
1388         * editing/InsertTextCommand.cpp:
1389         * editing/ModifySelectionListLevel.cpp:
1390         * editing/RemoveNodeCommand.cpp:
1391         * editing/ReplaceNodeWithSpanCommand.cpp:
1392         * editing/ReplaceSelectionCommand.cpp:
1393         * editing/SpellChecker.cpp:
1394         * editing/TextIterator.cpp:
1395         * editing/TypingCommand.cpp:
1396         * editing/VisiblePosition.cpp:
1397         * editing/VisibleSelection.cpp:
1398         * editing/VisibleUnits.cpp:
1399         * editing/cocoa/DataDetection.mm:
1400         * editing/cocoa/EditorCocoa.mm:
1401         * editing/htmlediting.cpp: Removed.
1402         * editing/htmlediting.h: Removed.
1403         * editing/ios/EditorIOS.mm:
1404         * editing/mac/DictionaryLookup.mm:
1405         * editing/mac/EditorMac.mm:
1406         * editing/markup.cpp:
1407         * html/HTMLTextFormControlElement.cpp:
1408         * inspector/InspectorDOMAgent.cpp:
1409         * page/DOMSelection.cpp:
1410         * page/DragController.cpp:
1411         * page/EventHandler.cpp:
1412         * page/FocusController.cpp:
1413         * page/Frame.cpp:
1414         * platform/ios/PasteboardIOS.mm:
1415         * platform/mac/PasteboardMac.mm:
1416         * rendering/RenderBox.cpp:
1417         * rendering/RenderObject.cpp:
1418
1419 2017-03-02  Matt Baker  <mattbaker@apple.com>
1420
1421         Web Inspector: Should be able to push nodes in an iframe subtree to the frontend
1422         https://bugs.webkit.org/show_bug.cgi?id=169086
1423
1424         Reviewed by Joseph Pecoraro.
1425
1426         Test: inspector/dom/push-node-by-path-to-frontend.html
1427
1428         * inspector/InspectorDOMAgent.cpp:
1429         (WebCore::InspectorDOMAgent::nodeForPath):
1430         During top-down document traversal, descend into content document nodes
1431         when visiting an HTMLFrameOwnerElement.
1432
1433 2017-03-02  Ryan Haddad  <ryanhaddad@apple.com>
1434
1435         Unreviewed, rolling out r213274.
1436
1437         This change caused flakiness with LayoutTest memory/memory-
1438         pressure-simulation.html
1439
1440         Reverted changeset:
1441
1442         "Don't keep dead resources in MemoryCache while under memory
1443         pressure."
1444         https://bugs.webkit.org/show_bug.cgi?id=169070
1445         http://trac.webkit.org/changeset/213274
1446
1447 2017-03-02  Jiewen Tan  <jiewen_tan@apple.com>
1448
1449         WebCrypto API support for AES-GCM
1450         https://bugs.webkit.org/show_bug.cgi?id=157175
1451         <rdar://problem/27311691>
1452
1453         Reviewed by Brent Fulgham.
1454
1455         This patch adds support for AES-GCM. Operations of AES-GCM include: encrypt, decrypt, generateKey,
1456         importKey, exportKey, wrapKey, and unwrapKey. https://www.w3.org/TR/WebCryptoAPI/#aes-gcm
1457
1458         Tests: crypto/subtle/aes-gcm-decrypt-malformed-parameters.html
1459                crypto/subtle/aes-gcm-encrypt-malformed-parameters.html
1460                crypto/subtle/aes-gcm-generate-export-key-jwk-length-128.html
1461                crypto/subtle/aes-gcm-generate-export-key-jwk-length-192.html
1462                crypto/subtle/aes-gcm-generate-export-key-jwk-length-256.html
1463                crypto/subtle/aes-gcm-generate-export-raw-key.html
1464                crypto/subtle/aes-gcm-generate-key-encrypt-decrypt.html
1465                crypto/subtle/aes-gcm-generate-key.html
1466                crypto/subtle/aes-gcm-import-jwk-key-length-128.html
1467                crypto/subtle/aes-gcm-import-jwk-key-length-192.html
1468                crypto/subtle/aes-gcm-import-jwk-key-length-256.html
1469                crypto/subtle/aes-gcm-import-key-decrypt-additional-data-tag-length-32.html
1470                crypto/subtle/aes-gcm-import-key-decrypt-additional-data.html
1471                crypto/subtle/aes-gcm-import-key-decrypt-tagLengths.html
1472                crypto/subtle/aes-gcm-import-key-decrypt.html
1473                crypto/subtle/aes-gcm-import-key-encrypt-additional-data-tag-length-32.html
1474                crypto/subtle/aes-gcm-import-key-encrypt-additional-data.html
1475                crypto/subtle/aes-gcm-import-key-encrypt-tagLengths.html
1476                crypto/subtle/aes-gcm-import-key-encrypt.html
1477                crypto/subtle/aes-gcm-import-key-unwrap-jwk-key.html
1478                crypto/subtle/aes-gcm-import-key-unwrap-raw-key.html
1479                crypto/subtle/aes-gcm-import-key-wrap-jwk-key.html
1480                crypto/subtle/aes-gcm-import-key-wrap-raw-key.html
1481                crypto/subtle/aes-gcm-import-raw-key.html
1482                crypto/workers/subtle/aes-gcm-import-key-decrypt.html
1483                crypto/workers/subtle/aes-gcm-import-key-encrypt.html
1484                crypto/workers/subtle/aes-gcm-import-key-unwrap-key.html
1485                crypto/workers/subtle/aes-gcm-import-key-wrap-key.html
1486
1487         * CMakeLists.txt:
1488         * DerivedSources.make:
1489         * PlatformGTK.cmake:
1490         * PlatformMac.cmake:
1491         Add CryptoAlgorithmAES_CFBMac.cpp as well.
1492         * WebCore.xcodeproj/project.pbxproj:
1493         * bindings/js/JSSubtleCryptoCustom.cpp:
1494         (WebCore::normalizeCryptoAlgorithmParameters):
1495         Add support for AES-GCM.
1496         * crypto/CommonCryptoUtilities.h:
1497         Include SPI header for AES-GCM support. We have a mismatch SPI between different OS version.
1498         Therefore, a guardian is placed.
1499         * crypto/CryptoAlgorithmParameters.h:
1500         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp: Added.
1501         (WebCore::usagesAreInvalidForCryptoAlgorithmAES_GCM):
1502         (WebCore::tagLengthIsValid):
1503         (WebCore::CryptoAlgorithmAES_GCM::create):
1504         (WebCore::CryptoAlgorithmAES_GCM::identifier):
1505         (WebCore::CryptoAlgorithmAES_GCM::encrypt):
1506         (WebCore::CryptoAlgorithmAES_GCM::decrypt):
1507         (WebCore::CryptoAlgorithmAES_GCM::generateKey):
1508         (WebCore::CryptoAlgorithmAES_GCM::importKey):
1509         (WebCore::CryptoAlgorithmAES_GCM::exportKey):
1510         * crypto/algorithms/CryptoAlgorithmAES_GCM.h: Added.
1511         * crypto/gnutls/CryptoAlgorithmAES_GCMGnuTLS.cpp: Added.
1512         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1513         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1514         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp: Added.
1515         (WebCore::encryptAES_GCM):
1516         (WebCore::decyptAES_GCM):
1517         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1518         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1519         * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
1520         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
1521         * crypto/parameters/AesGcmParams.idl: Added.
1522         * crypto/parameters/CryptoAlgorithmAesGcmParams.h: Added.
1523
1524 2017-03-02  Andy Estes  <aestes@apple.com>
1525
1526         Add support for canvas.toBlob
1527         https://bugs.webkit.org/show_bug.cgi?id=148878
1528         <rdar://problem/22590406>
1529
1530         Reviewed by Tim Horton.
1531
1532         These tests now pass:
1533         imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.jpeg.html
1534         imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.png.html
1535
1536         * CMakeLists.txt:
1537         * DerivedSources.make:
1538         * WebCore.xcodeproj/project.pbxproj:
1539         * fileapi/BlobCallback.cpp: Added.
1540         (WebCore::BlobCallback::scheduleCallback):
1541         * fileapi/BlobCallback.h: Added.
1542         (WebCore::BlobCallback::~BlobCallback):
1543         * fileapi/BlobCallback.idl: Added.
1544         * html/HTMLCanvasElement.cpp:
1545         (WebCore::HTMLCanvasElement::toBlob):
1546         * html/HTMLCanvasElement.h:
1547         * html/HTMLCanvasElement.idl:
1548         * platform/graphics/ImageBuffer.h:
1549         * platform/graphics/cairo/ImageBufferCairo.cpp:
1550         (WebCore::writeFunction):
1551         (WebCore::encodeImage):
1552         (WebCore::ImageBuffer::toDataURL):
1553         (WebCore::ImageBuffer::toData):
1554         * platform/graphics/cg/ImageBufferCG.cpp:
1555         (WebCore::data):
1556         (WebCore::ImageBuffer::toDataURL):
1557         (WebCore::ImageBuffer::toData):
1558         (WebCore::ImageBuffer::toCGImage):
1559         (WebCore::cgImage):
1560         (WebCore::dataURL):
1561         * platform/graphics/gtk/ImageBufferGtk.cpp:
1562         (WebCore::ImageBuffer::toDataURL):
1563         (WebCore::ImageBuffer::toData):
1564         * platform/graphics/win/ImageBufferDirect2D.cpp:
1565         (WebCore::ImageBuffer::toData):
1566
1567 2017-03-02  Myles C. Maxfield  <mmaxfield@apple.com>
1568
1569         Migrate font-stretch to use fixed-point values
1570         https://bugs.webkit.org/show_bug.cgi?id=169107
1571
1572         Reviewed by Dean Jackson.
1573
1574         There are a few benefits of using fixed-point values:
1575         - Not all of the entropy of a float is necessary for font selection. In particular, values are
1576         expected to stay between around -1000 to 1000, and only need to have a few fractional bits.
1577         Therefore, the values can be represented by 16-bit fixed point numbers, which includes one sign
1578         bit and two fractional bits. This is smaller than the 32-bit floating point numbers we were
1579         using, which means FontDescription can be slimmed down. This becomes even more important when
1580         the rest of the variation font properties are implemented, since those will use these fixed-
1581         point values too.
1582         - Fixed point values have a larger distance between adjacent representable values, which means
1583         there are more collisions, which means our cache hit rates are higher.
1584
1585         No new tests because there is no behavior change.
1586
1587         * css/CSSComputedStyleDeclaration.cpp:
1588         (WebCore::fontStretchFromStyle):
1589         * css/StyleBuilderConverter.h:
1590         (WebCore::StyleBuilderConverter::convertFontStretch):
1591         * platform/graphics/FontCache.h:
1592         (WebCore::FontDescriptionKey::FontDescriptionKey):
1593         * platform/graphics/FontDescription.h:
1594         (WebCore::FontDescription::stretch):
1595         (WebCore::FontDescription::setStretch):
1596         (WebCore::FontCascadeDescription::initialStretch):
1597         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1598         (WebCore::defaultFontSelectionValues):
1599         (WebCore::preparePlatformFont):
1600         (WebCore::FontDatabase::InstalledFont::InstalledFont):
1601         (WebCore::FontDatabase::InstalledFontFamily::expand):
1602         (WebCore::FontDatabase::capabilitiesForFontDescriptor):
1603         (WebCore::FontDatabase::stretchThreshold):
1604         (WebCore::FontDatabase::italicThreshold):
1605         (WebCore::FontDatabase::weightThreshold):
1606         (WebCore::findClosestStretch):
1607         (WebCore::filterStretch):
1608         (WebCore::findClosestStyle):
1609         (WebCore::filterStyle):
1610         (WebCore::findClosestWeight):
1611         (WebCore::filterWeight):
1612         (WebCore::computeTargetWeight):
1613         (WebCore::findClosestFont):
1614         (WebCore::platformFontLookupWithFamily):
1615         (WebCore::fontWithFamily):
1616         (WebCore::defaultVariationValues): Deleted.
1617         (WebCore::FontDatabase::Range::Range): Deleted.
1618         (WebCore::FontDatabase::Range::isValid): Deleted.
1619         (WebCore::FontDatabase::Range::expand): Deleted.
1620         (WebCore::FontDatabase::Range::includes): Deleted.
1621         (): Deleted.
1622         * platform/text/TextFlags.h:
1623         (WebCore::FontSelectionValue::FontSelectionValue):
1624         (WebCore::FontSelectionValue::operator float):
1625         (WebCore::FontSelectionValue::operator+):
1626         (WebCore::FontSelectionValue::operator-):
1627         (WebCore::FontSelectionValue::operator*):
1628         (WebCore::FontSelectionValue::operator/):
1629         (WebCore::FontSelectionValue::operator==):
1630         (WebCore::FontSelectionValue::operator!=):
1631         (WebCore::FontSelectionValue::operator<):
1632         (WebCore::FontSelectionValue::operator<=):
1633         (WebCore::FontSelectionValue::operator>):
1634         (WebCore::FontSelectionValue::operator>=):
1635         (WebCore::FontSelectionValue::rawValue):
1636         (WebCore::FontSelectionRange::isValid):
1637         (WebCore::FontSelectionRange::expand):
1638         (WebCore::FontSelectionRange::includes):
1639         (WebCore::FontSelectionCapabilities::expand):
1640
1641 2017-03-02  Alex Christensen  <achristensen@webkit.org>
1642
1643         Modernize ContentExtensionParser
1644         https://bugs.webkit.org/show_bug.cgi?id=169106
1645
1646         Reviewed by Andy Estes.
1647
1648         We were returning std::error_code and passing the return value as a parameter reference.
1649         because we wrote this code before we had WTF::Expected.
1650
1651         No change in behavior, verified by many API tests.
1652
1653         * contentextensions/ContentExtensionCompiler.cpp:
1654         (WebCore::ContentExtensions::compileRuleList):
1655         * contentextensions/ContentExtensionParser.cpp:
1656         (WebCore::ContentExtensions::getDomainList):
1657         (WebCore::ContentExtensions::loadTrigger):
1658         (WebCore::ContentExtensions::loadAction):
1659         (WebCore::ContentExtensions::loadRule):
1660         (WebCore::ContentExtensions::loadEncodedRules):
1661         (WebCore::ContentExtensions::parseRuleList):
1662         * contentextensions/ContentExtensionParser.h:
1663         * contentextensions/ContentExtensionRule.cpp:
1664         (WebCore::ContentExtensions::ContentExtensionRule::ContentExtensionRule):
1665         * contentextensions/ContentExtensionRule.h:
1666
1667 2017-03-02  Ryan Haddad  <ryanhaddad@apple.com>
1668
1669         Unreviewed, rolling out r213301.
1670
1671         This change broke internal builds.
1672
1673         Reverted changeset:
1674
1675         "WebCrypto API support for AES-GCM"
1676         https://bugs.webkit.org/show_bug.cgi?id=157175
1677         http://trac.webkit.org/changeset/213301
1678
1679 2017-03-02  Aakash Jain  <aakash_jain@apple.com>
1680
1681         Move stringMatchesWildcardString from WebKit2 to WebCore
1682         https://bugs.webkit.org/show_bug.cgi?id=169065
1683
1684         Reviewed by Alexey Proskuryakov.
1685
1686         * WebCore.xcodeproj/project.pbxproj: Added StringUtilities.h and StringUtilities.mm
1687         * PlatformMac.cmake: Added StringUtilities.mm
1688         * platform/mac/StringUtilities.h: Added.
1689         * platform/mac/StringUtilities.mm: Added.
1690         (WebCore::wildcardRegexPatternString): Added.
1691         (WebCore::stringMatchesWildcardString): Added.
1692
1693 2017-02-28  Matt Rajca  <mrajca@apple.com>
1694
1695         Media: send "did interfere with playback" events when the user pauses an autoplaying element
1696         https://bugs.webkit.org/show_bug.cgi?id=169006
1697
1698         Reviewed by Alex Christensen.
1699
1700         Added API tests.
1701
1702         * html/HTMLMediaElement.cpp:
1703         (WebCore::HTMLMediaElement::pauseInternal):
1704
1705 2017-03-02  Chris Dumez  <cdumez@apple.com>
1706
1707         We should prevent load of subframes inserted during FrameTree deconstruction
1708         https://bugs.webkit.org/show_bug.cgi?id=169095
1709
1710         Reviewed by Brent Fulgham.
1711
1712         When deconstructing the FrameTree, we fire the unload event in each subframe.
1713         Such unload event handler may insert a new frame, we would previously load
1714         such new frame which was unsafe as we would end up with an attached subframe
1715         on a detached tree. To address the issue, we prevent new subframes from loading
1716         while deconstructing the FrameTree and firing the unload events. This new
1717         behavior is consistent with Chrome and should therefore be safe from a
1718         compatibility standpoint.
1719
1720         Test: fast/frames/insert-frame-unload-handler.html
1721
1722         * dom/ContainerNodeAlgorithms.cpp:
1723         (WebCore::disconnectSubframes):
1724         Update SubframeLoadingDisabler call site now that the constructor takes in
1725         a pointer instead of a reference.
1726
1727         * html/HTMLFrameOwnerElement.h:
1728         (WebCore::SubframeLoadingDisabler::SubframeLoadingDisabler):
1729         (WebCore::SubframeLoadingDisabler::~SubframeLoadingDisabler):
1730         Update SubframeLoadingDisabler constructor to take in a pointer instead
1731         of a reference, for convenience.
1732
1733         * loader/FrameLoader.cpp:
1734         (WebCore::FrameLoader::detachChildren):
1735         Prevent loads in subframes while detaching the subframes. It would be unsafe
1736         as we copy the list of frames before iterating to fire the unload events.
1737         Therefore, newly inserted frames would not get unloaded.
1738
1739 2017-03-02  Dave Hyatt  <hyatt@apple.com>
1740
1741         flex-basis should be 0% (not 0px) when omitted
1742         https://bugs.webkit.org/show_bug.cgi?id=169100
1743         rdar://problem/30429154
1744
1745         Reviewed by Dean Jackson.
1746
1747         Covered by existing tests.
1748
1749         * css/parser/CSSPropertyParser.cpp:
1750         (WebCore::CSSPropertyParser::consumeFlex):
1751
1752 2017-02-22  Jiewen Tan  <jiewen_tan@apple.com>
1753
1754         WebCrypto API support for AES-GCM
1755         https://bugs.webkit.org/show_bug.cgi?id=157175
1756         <rdar://problem/27311691>
1757
1758         Reviewed by Brent Fulgham.
1759
1760         This patch adds support for AES-GCM. Operations of AES-GCM include: encrypt, decrypt, generateKey,
1761         importKey, exportKey, wrapKey, and unwrapKey. https://www.w3.org/TR/WebCryptoAPI/#aes-gcm
1762
1763         Tests: crypto/subtle/aes-gcm-decrypt-malformed-parameters.html
1764                crypto/subtle/aes-gcm-encrypt-malformed-parameters.html
1765                crypto/subtle/aes-gcm-generate-export-key-jwk-length-128.html
1766                crypto/subtle/aes-gcm-generate-export-key-jwk-length-192.html
1767                crypto/subtle/aes-gcm-generate-export-key-jwk-length-256.html
1768                crypto/subtle/aes-gcm-generate-export-raw-key.html
1769                crypto/subtle/aes-gcm-generate-key-encrypt-decrypt.html
1770                crypto/subtle/aes-gcm-generate-key.html
1771                crypto/subtle/aes-gcm-import-jwk-key-length-128.html
1772                crypto/subtle/aes-gcm-import-jwk-key-length-192.html
1773                crypto/subtle/aes-gcm-import-jwk-key-length-256.html
1774                crypto/subtle/aes-gcm-import-key-decrypt-additional-data-tag-length-32.html
1775                crypto/subtle/aes-gcm-import-key-decrypt-additional-data.html
1776                crypto/subtle/aes-gcm-import-key-decrypt-tagLengths.html
1777                crypto/subtle/aes-gcm-import-key-decrypt.html
1778                crypto/subtle/aes-gcm-import-key-encrypt-additional-data-tag-length-32.html
1779                crypto/subtle/aes-gcm-import-key-encrypt-additional-data.html
1780                crypto/subtle/aes-gcm-import-key-encrypt-tagLengths.html
1781                crypto/subtle/aes-gcm-import-key-encrypt.html
1782                crypto/subtle/aes-gcm-import-key-unwrap-jwk-key.html
1783                crypto/subtle/aes-gcm-import-key-unwrap-raw-key.html
1784                crypto/subtle/aes-gcm-import-key-wrap-jwk-key.html
1785                crypto/subtle/aes-gcm-import-key-wrap-raw-key.html
1786                crypto/subtle/aes-gcm-import-raw-key.html
1787                crypto/workers/subtle/aes-gcm-import-key-decrypt.html
1788                crypto/workers/subtle/aes-gcm-import-key-encrypt.html
1789                crypto/workers/subtle/aes-gcm-import-key-unwrap-key.html
1790                crypto/workers/subtle/aes-gcm-import-key-wrap-key.html
1791
1792         * CMakeLists.txt:
1793         * DerivedSources.make:
1794         * PlatformGTK.cmake:
1795         * PlatformMac.cmake:
1796         Add CryptoAlgorithmAES_CFBMac.cpp as well.
1797         * WebCore.xcodeproj/project.pbxproj:
1798         * bindings/js/JSSubtleCryptoCustom.cpp:
1799         (WebCore::normalizeCryptoAlgorithmParameters):
1800         Add support for AES-GCM.
1801         * crypto/CommonCryptoUtilities.h:
1802         Include SPI header for AES-GCM support.
1803         * crypto/CryptoAlgorithmParameters.h:
1804         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp: Added.
1805         (WebCore::usagesAreInvalidForCryptoAlgorithmAES_GCM):
1806         (WebCore::tagLengthIsValid):
1807         (WebCore::CryptoAlgorithmAES_GCM::create):
1808         (WebCore::CryptoAlgorithmAES_GCM::identifier):
1809         (WebCore::CryptoAlgorithmAES_GCM::encrypt):
1810         (WebCore::CryptoAlgorithmAES_GCM::decrypt):
1811         (WebCore::CryptoAlgorithmAES_GCM::generateKey):
1812         (WebCore::CryptoAlgorithmAES_GCM::importKey):
1813         (WebCore::CryptoAlgorithmAES_GCM::exportKey):
1814         * crypto/algorithms/CryptoAlgorithmAES_GCM.h: Added.
1815         * crypto/gnutls/CryptoAlgorithmAES_GCMGnuTLS.cpp: Added.
1816         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1817         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1818         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp: Added.
1819         (WebCore::encryptAES_GCM):
1820         (WebCore::decyptAES_GCM):
1821         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
1822         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
1823         * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
1824         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
1825         * crypto/parameters/AesGcmParams.idl: Added.
1826         * crypto/parameters/CryptoAlgorithmAesGcmParams.h: Added.
1827
1828 2017-03-02  Alex Christensen  <achristensen@webkit.org>
1829
1830         Continue enabling WebRTC
1831         https://bugs.webkit.org/show_bug.cgi?id=169056
1832
1833         Reviewed by Jon Lee.
1834
1835         * Configurations/FeatureDefines.xcconfig:
1836
1837 2017-03-02  Ryan Haddad  <ryanhaddad@apple.com>
1838
1839         Unreviewed, rolling out r213281.
1840
1841         This change caused API test WebKit2.UserMediaBasic to time
1842         out.
1843
1844         Reverted changeset:
1845
1846         "[MediaStream] UIClient may not be notified of capture state
1847         change when leaving a page"
1848         https://bugs.webkit.org/show_bug.cgi?id=169014
1849         http://trac.webkit.org/changeset/213281
1850
1851 2017-03-02  Jon Lee  <jonlee@apple.com>
1852
1853         Improve consistency of captions rendering on Mac
1854         https://bugs.webkit.org/show_bug.cgi?id=169071
1855
1856         Reviewed by Eric Carlson.
1857
1858         * page/CaptionUserPreferencesMediaAF.h:
1859         (WebCore::CaptionUserPreferencesMediaAF::captionsEdgeColorForTextColor): Deleted.
1860         (WebCore::CaptionUserPreferencesMediaAF::cssPropertyWithTextEdgeColor): Deleted.
1861
1862         * page/CaptionUserPreferencesMediaAF.cpp:
1863         (WebCore::appendCSS): Helper function to add a CSS rule with a provided StringBuilder.
1864         (WebCore::CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS): Refactor to use
1865         appendCSS.
1866         (WebCore::CaptionUserPreferencesMediaAF::colorPropertyCSS): Ditto.
1867         (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS): Update text edge styles.
1868         - Add a blur to the shadow
1869         - Drop shadow style includes 1px text border
1870         - Always use black for the text edge color
1871         Also convert the stroke rules to using the CSS property and values instead of straight strings.
1872         (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride): Fly-by fix of a typo.
1873
1874 2017-03-02  Chris Dumez  <cdumez@apple.com>
1875
1876         Download attribute set to "*\" save file with name "example.com"
1877         https://bugs.webkit.org/show_bug.cgi?id=169066
1878         <rdar://problem/30740875>
1879
1880         Reviewed by Alex Christensen.
1881
1882         The issue is that a backslash in recognized as an escaping character in
1883         a quoted string as per RFC2616:
1884         "
1885         The backslash character ("\") MAY be used as a single-character
1886         quoting mechanism only within quoted-string and comment constructs.
1887         "
1888
1889         We therefore need to escape the backslashes in the filename before
1890         using it in the Content-Disposition header, inside the quoted string.
1891
1892         Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash.html
1893
1894         * platform/network/ResourceResponseBase.cpp:
1895         (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
1896
1897 2017-03-02  Youenn Fablet  <youenn@apple.com>
1898
1899         [WebRTC] Activate ICE candidate privacy policy
1900         https://bugs.webkit.org/show_bug.cgi?id=168975
1901
1902         Reviewed by Alex Christensen.
1903
1904         Test: webrtc/datachannel/filter-ice-candidate.html
1905
1906         * testing/Internals.cpp:
1907         (WebCore::Internals::Internals): Disabling ICE candidate filtering by default for rwt.
1908         (WebCore::Internals::setICECandidateFiltering):
1909         * testing/Internals.h:
1910         * testing/Internals.idl:
1911
1912 2017-03-02  Eric Carlson  <eric.carlson@apple.com>
1913
1914         [MediaStream] UIClient may not be notified of capture state change when leaving a page
1915         https://bugs.webkit.org/show_bug.cgi?id=169014
1916         <rdar://problem/30632267>
1917
1918         Reviewed by Youenn Fablet.
1919
1920         Enable and update the WebKit API test WebKit2.UserMedia.
1921
1922         * dom/Document.cpp:
1923         (WebCore::Document::prepareForDestruction): Always call page.updateIsPlayingMedia() if there
1924         is active media in the document because it won't be possible when the state changes later
1925         because the frame will have been cleared.
1926
1927 2017-03-02  Tomas Popela  <tpopela@redhat.com>
1928
1929         [WK2] Keyboard menu key should show context menu
1930         https://bugs.webkit.org/show_bug.cgi?id=72099
1931
1932         Reviewed by Carlos Garcia Campos.
1933
1934         Show the context menu when the GtkWidget::popup-menu signal is
1935         emitted. This signal is triggered by pressing a key (usually
1936         the Menu key or the Shift + F10 shortcut) or it could be emitted on
1937         WebKitWebView.
1938
1939         Test: fast/events/context-activated-by-key-event.html
1940
1941         Also could be tested by:
1942
1943         ManualTests/keyboard-menukey-event.html
1944         ManualTests/win/contextmenu-key.html
1945         ManualTests/win/contextmenu-key2.html
1946
1947         * page/EventHandler.cpp:
1948         (WebCore::EventHandler::sendContextMenuEventForKey):
1949         Correctly send the mouse event that used for showing the context menu.
1950         Previously the event was immediately dispatched as it is, but this was
1951         only the right way if some element was focused on the page. If there
1952         was no focused element or non-empty text range then the event lacked
1953         the right node, where it was supposed to be shown. The correct node
1954         is determined and added to the event in the sendContextMenuEvent() so
1955         we have to use this function to send the event.
1956
1957         Also use absoluteBoundingBoxRect() instead of
1958         pixelSnappedAbsoluteClippedOverflowRect() when determining
1959         a coordinate where to show the context menu for the currently focus
1960         element. The latter is not returning a right box (it is bigger) which
1961         could lead to the situation that no menu will be displayed at all,
1962         because the HitTest won't contain the right element as the
1963         determined coordinates could be outside of the element.
1964         * page/EventHandler.h:
1965
1966 2017-03-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1967
1968         [GTK] Crash in WebCore::CoordinatedGraphicsLayer::notifyFlushRequired
1969         https://bugs.webkit.org/show_bug.cgi?id=166420
1970
1971         Reviewed by Žan Doberšek.
1972
1973         This is happening when closing a page that is being inspected. When CoordinatedGraphicsLayer::removeFromParent()
1974         is called, the coordinator has already been invalidated, so all its layers were set a nullptr coordinator. I
1975         think it's safe to simply handle m_coordinator being nullptr in notifyFlushRequired().
1976
1977         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1978         (WebCore::CoordinatedGraphicsLayer::notifyFlushRequired): Return early if the coordinator is nullptr.
1979
1980 2017-03-02  Andreas Kling  <akling@apple.com>
1981
1982         Don't keep dead resources in MemoryCache while under memory pressure.
1983         <https://webkit.org/b/169070>
1984
1985         Reviewed by Antti Koivisto.
1986
1987         Have CachedResource::deleteIfPossible() remove the resource from the MemoryCache
1988         if we're under memory pressure and that was the only thing keeping it alive.
1989
1990         This is consistent with the policy where dead resources are evicted from the cache
1991         as we come under pressure.
1992
1993         * loader/cache/CachedResource.cpp:
1994         (WebCore::CachedResource::deleteIfPossible):
1995
1996 2017-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
1997
1998         REGRESSION(r213062): [SOUP] UTF-8 filename in Content-Disposition header incorrectly handled since r213062
1999         https://bugs.webkit.org/show_bug.cgi?id=169024
2000
2001         Reviewed by Youenn Fablet.
2002
2003         This made test http/tests/download/literal-utf-8.html to start failing. The problem is that I removed the
2004         conversion made by String::fromUTF8WithLatin1Fallback that was added in r176930. I removed it because that made
2005         fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html to timeout. This patch brings back
2006         the String::fromUTF8WithLatin1Fallback call but only when the header string is 8 bit one.
2007
2008         Fixes: http/tests/download/literal-utf-8.html
2009
2010         * platform/network/soup/ResourceResponseSoup.cpp:
2011         (WebCore::ResourceResponse::platformSuggestedFilename):
2012
2013 2017-03-01  Alex Christensen  <achristensen@webkit.org>
2014
2015         Actually fix Windows build.
2016
2017         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2018         Win32Handle is now in WTF namespace.
2019
2020 2017-03-01  Alex Christensen  <achristensen@webkit.org>
2021
2022         Fix WinCairo build after r213214
2023         https://bugs.webkit.org/show_bug.cgi?id=168908
2024
2025         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2026
2027 2017-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
2028
2029         Implement font-stretch for installed fonts
2030         https://bugs.webkit.org/show_bug.cgi?id=168888
2031
2032         Reviewed by Darin Adler and Dave Hyatt.
2033
2034         This patch implements the font-stretch property. Both parsing and the implementation is
2035         implemented. Contrary to the name, this property doesn't actually stretch fonts; instead,
2036         it provides one more input to the font selection routine.
2037
2038         The mapping from Core Text's [-1, 1] width values to font-stretch's percentage-based
2039         values is not perfect. For now, I've implemented a piecewise linear curve mapping the
2040         two. However, I expect to be able to improve this transfer function soon.
2041
2042         This patch does not implement the font-stretch descriptor in @font-face, and therefore
2043         does not work with web fonts. I will add this support in
2044         https://bugs.webkit.org/show_bug.cgi?id=168892. The reason it isn't done in this patch is
2045         it requires some architectural changes to our CSSFontFace classes which are large enough
2046         they should be separated into their own patch.
2047
2048         This patch lays the groundwork for implementing the 'wdth' variation axis. It does this
2049         by adding a floating-point value to RenderStyle instead of just an enum. The font-stretch
2050         keywords get converted to these floating-point numbers in accordance with the Fonts spec.
2051         This patch doesn't actually implement the variations piece of font-stretch, because that
2052         piece also requires some architectural changes. This patch just implements the installed
2053         font selection piece.
2054
2055         This patch also fixes the regression introduced in r213163 with Helvetica Neue. Now that
2056         our font selection algorithm has a concept of font stretch, weights 800 and 900 of
2057         Helvetica Neue are rendered as expected. (And this patch updates the tests to make sure.)
2058
2059         Tests: fast/text/font-stretch-parse.html
2060                fast/text/font-stretch-shorthand.html
2061                FontCacheTest.FontLookupFromFamilyName
2062
2063         * css/CSSComputedStyleDeclaration.cpp:
2064         (WebCore::fontStretchFromStyle): Map style values to CSS keywords.
2065         (WebCore::ComputedStyleExtractor::propertyValue): Call the above function.
2066         * css/CSSFontValue.cpp:
2067         (WebCore::CSSFontValue::customCSSText): Used in getComputedStyle() for the "font"
2068         shorthand.
2069         (WebCore::CSSFontValue::equals):
2070         * css/CSSFontValue.h:
2071         * css/CSSProperties.json:
2072         * css/StyleBuilderConverter.h:
2073         (WebCore::StyleBuilderConverter::convertFontStretch): Map CSS keywords to style values.
2074         * css/StyleProperties.cpp:
2075         (WebCore::StyleProperties::appendFontLonghandValueIfExplicit): Used for
2076         Element.style.font.
2077         (WebCore::StyleProperties::fontValue):
2078         * css/parser/CSSParserFastPaths.cpp:
2079         (WebCore::CSSParserFastPaths::isKeywordPropertyID): Now that variation fonts are being
2080         implemented, font-stretch is no longer a keyword property. Instead, it can also take a
2081         number or percentage.
2082         * css/parser/CSSPropertyParser.cpp:
2083         (WebCore::consumeFontStretch): Parse the value.
2084         (WebCore::CSSPropertyParser::parseSingleValue): Call the above function.
2085         (WebCore::CSSPropertyParser::consumeFont): Ditto.
2086         * platform/graphics/FontCache.h:
2087         (WebCore::FontDescriptionKey::FontDescriptionKey): Caches should be sensitive to this
2088         new value.
2089         (WebCore::FontDescriptionKey::operator==):
2090         (WebCore::FontDescriptionKey::computeHash):
2091         * platform/graphics/FontDescription.h:
2092         (WebCore::FontDescription::stretch): The parsed style value.
2093         (WebCore::FontDescription::setStretch):
2094         (WebCore::FontDescription::operator==):
2095         (WebCore::FontCascadeDescription::initialStretch):
2096         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2097         (WebCore::FontDatabase::InstalledFont::InstalledFont): Update the installed font selection
2098         algorithm to understand font-stretch.
2099         (WebCore::findClosestStretch):
2100         (WebCore::filterStretch):
2101         (WebCore::findClosestFont):
2102         (WebCore::platformFontLookupWithFamily):
2103         (WebCore::fontWithFamily):
2104         (WebCore::FontCache::createFontPlatformData):
2105
2106 2017-03-01  Antti Koivisto  <antti@apple.com>
2107
2108         Rename recalcStyle to resolveStyle and clean up the signature
2109         https://bugs.webkit.org/show_bug.cgi?id=169049
2110
2111         Reviewed by Sam Weinig.
2112
2113         Move to modern naming.
2114
2115         * dom/Document.cpp:
2116         (WebCore::Document::resolveStyle):
2117
2118             Only two of the possible values are used so pass in a two-value enum.
2119
2120         (WebCore::Document::updateStyleIfNeeded):
2121         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
2122         (WebCore::Document::createRenderTree):
2123         (WebCore::Document::finishedParsing):
2124         (WebCore::Document::webkitWillEnterFullScreenForElement):
2125         (WebCore::Document::recalcStyle): Deleted.
2126         * dom/Document.h:
2127         * inspector/InspectorOverlay.cpp:
2128         (WebCore::InspectorOverlay::update):
2129         * loader/DocumentWriter.cpp:
2130         (WebCore::DocumentWriter::reportDataReceived):
2131         * page/Frame.cpp:
2132         (WebCore::Frame::setPageAndTextZoomFactors):
2133         * page/Page.cpp:
2134         (WebCore::Page::setPageScaleFactor):
2135         * style/StyleTreeResolver.cpp:
2136         (WebCore::Style::TreeResolver::Parent::Parent):
2137         (WebCore::Style::TreeResolver::resolve):
2138
2139             Remove the argument, Document invalidates the document element if everything needs to be re-resolved.
2140
2141         * style/StyleTreeResolver.h:
2142
2143 2017-03-01  Alex Christensen  <achristensen@webkit.org>
2144
2145         Unreviewed, rolling out r213259.
2146
2147         Broke an internal build
2148
2149         Reverted changeset:
2150
2151         "Continue enabling WebRTC"
2152         https://bugs.webkit.org/show_bug.cgi?id=169056
2153         http://trac.webkit.org/changeset/213259
2154
2155 2017-03-01  Alex Christensen  <achristensen@webkit.org>
2156
2157         Continue enabling WebRTC
2158         https://bugs.webkit.org/show_bug.cgi?id=169056
2159
2160         Reviewed by Jon Lee.
2161
2162         * Configurations/FeatureDefines.xcconfig:
2163
2164 2017-03-01  Chris Dumez  <cdumez@apple.com>
2165
2166         [WK2][!NETWORK_SESSION] Failure to download when using a download attribute with no value on an anchor
2167         https://bugs.webkit.org/show_bug.cgi?id=169060
2168         <rdar://problem/30773140>
2169
2170         Reviewed by Darin Adler.
2171
2172         Make sure we never set the suggested filename to the empty string when
2173         the download attribute is present but has no value.
2174
2175         Test: http/tests/download/anchor-download-no-value.html
2176
2177         * loader/PolicyChecker.cpp:
2178         (WebCore::PolicyChecker::checkNavigationPolicy):
2179
2180 2017-03-01  Antoine Quint  <graouts@apple.com>
2181
2182         [ios-simulator] Unskip media/modern-media-controls/audio/audio-controls-metrics.html
2183         https://bugs.webkit.org/show_bug.cgi?id=167258
2184         <rdar://problem/30282740>
2185
2186         We weren't enforcing the min-width to be 200px as well as the default width, and the
2187         UA stylesheet would override it. Setting a default min-width that trumps the UA
2188         stylesheet makes the test work correctly on iOS and we can safely unskip this test.
2189
2190         Reviewed by Jon Lee.
2191
2192         * Modules/modern-media-controls/controls/media-controls.css:
2193         (:host(audio)):
2194
2195 2017-03-01  Javier Fernandez  <jfernandez@igalia.com>
2196
2197         Missing 'specification' section in the place-content shorthand
2198         https://bugs.webkit.org/show_bug.cgi?id=169052
2199
2200         Reviewed by Darin Adler.
2201
2202         Added 'specification' section in the place-content shorthand.
2203
2204         No new tests, no new functionality.
2205
2206         * css/CSSProperties.json:
2207
2208 2017-02-28  Matt Rajca  <mrajca@apple.com>
2209
2210         Media: notify clients when autoplayed media is muted
2211         https://bugs.webkit.org/show_bug.cgi?id=168987
2212
2213         Reviewed by Alex Christensen.
2214
2215         Added API tests.
2216
2217         * html/HTMLMediaElement.cpp:
2218         (WebCore::HTMLMediaElement::setMuted):
2219         (WebCore::HTMLMediaElement::pageMutedStateDidChange):
2220         * page/AutoplayEvent.h:
2221
2222 2017-03-01  Commit Queue  <commit-queue@webkit.org>
2223
2224         Unreviewed, rolling out r213226.
2225         https://bugs.webkit.org/show_bug.cgi?id=169051
2226
2227         Speculative rollout, might be causing several failures and
2228         crashes in WebKitGTK+ (Requested by lajava on #webkit).
2229
2230         Reverted changeset:
2231
2232         "REGRESSION(r213062): [SOUP] UTF-8 filename in Content-
2233         Disposition header incorrectly handled since r213062"
2234         https://bugs.webkit.org/show_bug.cgi?id=169024
2235         http://trac.webkit.org/changeset/213226
2236
2237 2017-03-01  James Craig  <jcraig@apple.com>
2238
2239         AX: add role aliases for ARIA DPUB module
2240         https://bugs.webkit.org/show_bug.cgi?id=168978
2241         <rdar://problem/30762724>
2242
2243         Reviewed by Chris Fleizach.
2244
2245         Added role aliases for ARIA DPUB module, and updated existing tests.
2246
2247         Test: accessibility/roles-exposed.html
2248         Test: inspector/dom/getAccessibilityPropertiesForNode.html
2249
2250         * accessibility/AccessibilityObject.cpp:
2251         (WebCore::initializeRoleMap): 
2252
2253 2017-03-01  Alex Christensen  <achristensen@webkit.org>
2254
2255         Don't call libwebrtc functions if libwebrtc.dylib doesn't exist while testing
2256         https://bugs.webkit.org/show_bug.cgi?id=169045
2257         <rdar://problem/30735413>
2258
2259         Reviewed by Youenn Fablet.
2260
2261         WebRTC tests fail instead of crashing now if libwebrtc.dylib is missing.
2262         All other tests pass instead of crashing immediately when creating an Internals object.
2263
2264         * Modules/mediastream/RTCController.cpp:
2265         (WebCore::RTCController::disableICECandidateFiltering):
2266         (WebCore::RTCController::enableICECandidateFiltering):
2267         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
2268         (WebCore::createLibWebRTCPeerConnectionBackend):
2269         * testing/Internals.cpp:
2270         (WebCore::Internals::enableMockMediaEndpoint):
2271         (WebCore::Internals::emulateRTCPeerConnectionPlatformEvent):
2272         (WebCore::Internals::useMockRTCPeerConnectionFactory):
2273         * testing/Internals.h:
2274
2275 2017-03-01  Javier Fernandez  <jfernandez@igalia.com>
2276
2277         [css-align] Implement the place-content shorthand
2278         https://bugs.webkit.org/show_bug.cgi?id=168771
2279
2280         Reviewed by Manuel Rego Casasnovas.
2281
2282         The CSS Box Alignment specification defines a new shorthand to set the
2283         Content Alignment properties (align-content and justify-content) at the
2284         same time.
2285
2286         This patch provides the implementation of the CSS parsing logic and the
2287         required regression tests.
2288
2289         Test: css3/parse-place-content.html
2290
2291         * css/CSSComputedStyleDeclaration.cpp:
2292         (WebCore::ComputedStyleExtractor::propertyValue):
2293         * css/CSSProperties.json:
2294         * css/StyleProperties.cpp:
2295         (WebCore::StyleProperties::getPropertyValue):
2296         * css/parser/CSSPropertyParser.cpp:
2297         (WebCore::consumeSimplifiedContentPosition):
2298         (WebCore::CSSPropertyParser::consumePlaceContentShorthand):
2299         (WebCore::CSSPropertyParser::parseShorthand):
2300         * css/parser/CSSPropertyParser.h:
2301
2302 2017-03-01  Simon Fraser  <simon.fraser@apple.com>
2303
2304         Try to fix Windows build after r213191.
2305
2306         * platform/spi/win/CoreTextSPIWin.h:
2307
2308 2017-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2309
2310         REGRESSION(r213062): [SOUP] UTF-8 filename in Content-Disposition header incorrectly handled since r213062
2311         https://bugs.webkit.org/show_bug.cgi?id=169024
2312
2313         Reviewed by Youenn Fablet.
2314
2315         This made test http/tests/download/literal-utf-8.html to start failing. The problem is that I removed the
2316         conversion made by String::fromUTF8WithLatin1Fallback that was added in r176930. I removed it because that made
2317         fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html to timeout. This patch brings back
2318         the String::fromUTF8WithLatin1Fallback call but only when the header string is 8 bit one.
2319
2320         Fixes: http/tests/download/literal-utf-8.html
2321
2322         * platform/network/soup/ResourceResponseSoup.cpp:
2323         (WebCore::ResourceResponse::platformSuggestedFilename):
2324
2325 2017-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2326
2327         [GTK] fast/canvas/canvas-createPattern-video-loading.html makes its subsequent test timeout
2328         https://bugs.webkit.org/show_bug.cgi?id=169019
2329
2330         Reviewed by Xabier Rodriguez-Calvar.
2331
2332         The timeout happens normally when the media player is deleted and the pipeline state is set to NULL. The call to
2333         gst_element_set_state() never returns because of different deadlocks with the video sink. Sometimes the deadlock
2334         happens with the sample mutex used by VideoRenderRequestScheduler. VideoRenderRequestScheduler::requestRender()
2335         calls webkitVideoSinkRepaintRequested() with the lock held, that ends up calling
2336         MediaPlayerPrivateGStreamerBase::triggerRepaint(). When rendering can't be accelerated the draw timer is
2337         scheduled and triggerRepaint blocks until the timer is fired. If the media player is destroyed before the timer
2338         is fired, when setting the pipeline state to NULL, other VideoRenderRequestScheduler methods can be called, like
2339         stop() that tries to get the sample mutex that is still held by requestRender(). So, first we need to make
2340         sure that requestRender() releases the lock before calling webkitVideoSinkRepaintRequested(). But that's not
2341         enough, we also need to ensure that the pipeline is set to NULL state after everyting has been properly
2342         stopped. This is currently done in ~MediaPlayerPrivateGStreamer that happens before
2343         ~MediaPlayerPrivateGStreamerBase, so gst_element_set_state() is hanging before allowing the
2344         MediaPlayerPrivateGStreamerBase to be cleaned up. We should move the call to the end of
2345         ~MediaPlayerPrivateGStreamerBase and ensure the draw timer and mutex are properly cleaned up before.
2346
2347         Fixes: fast/canvas/canvas-createPattern-video-loading.html
2348
2349         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2350         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): Do not reset pipeline here.
2351         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2352         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): Stop the draw mutex and notify the
2353         lock to ensure we unblock. Do the pipeline reset at the end.
2354         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
2355         (VideoRenderRequestScheduler::requestRender): Release the mutex lock before calling webkitVideoSinkRepaintRequested().
2356
2357 2017-03-01  Tomas Popela  <tpopela@redhat.com>
2358
2359         Unreviewed compiler warning fix after r213218
2360
2361         * platform/gtk/PlatformKeyboardEventGtk.cpp:
2362         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2363
2364 2017-03-01  Tomas Popela  <tpopela@redhat.com>
2365
2366         [Cairo] Incorrectly determining height in GraphicsContext::roundToDevicePixels()
2367         https://bugs.webkit.org/show_bug.cgi?id=169031
2368
2369         Reviewed by Carlos Garcia Campos.
2370
2371         We should compare if height is between -1 and 0 and not mixing height
2372         and width together.
2373
2374         * platform/graphics/cairo/GraphicsContextCairo.cpp:
2375         (WebCore::GraphicsContext::roundToDevicePixels):
2376
2377 2017-03-01  Tomas Popela  <tpopela@redhat.com>
2378
2379         [GTK] Fix problems found by Coverity scan in platform's keyboard and mouse events
2380         https://bugs.webkit.org/show_bug.cgi?id=169028
2381
2382         Reviewed by Carlos Garcia Campos.
2383
2384         * platform/gtk/PlatformKeyboardEventGtk.cpp:
2385         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Initialize
2386         the m_handledByInputMethod member.
2387         * platform/gtk/PlatformMouseEventGtk.cpp:
2388         (WebCore::PlatformMouseEvent::PlatformMouseEvent): Initialize the
2389         m_modifierFlags member.
2390
2391 2017-03-01  Andreas Kling  <akling@apple.com>
2392
2393         Move MemoryPressureHandler to WTF
2394         <https://webkit.org/b/168908>
2395
2396         Reviewed by Sam Weinig.
2397
2398         * CMakeLists.txt:
2399         * PlatformMac.cmake:
2400         * PlatformWin.cmake:
2401         * WebCore.xcodeproj/project.pbxproj:
2402         * bindings/js/ScriptController.cpp:
2403         * history/PageCache.cpp:
2404         * html/HTMLMediaElement.cpp:
2405         * inspector/InspectorInstrumentation.h:
2406         * inspector/InspectorMemoryAgent.h:
2407         * page/FrameView.cpp:
2408         * page/MemoryRelease.h:
2409         * page/linux/ResourceUsageThreadLinux.cpp:
2410         * platform/Linux.cmake:
2411         * platform/graphics/FontCache.cpp:
2412         * platform/graphics/WidthCache.h:
2413         * platform/graphics/ca/TileController.cpp:
2414         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2415         * platform/ios/LegacyTileCache.mm:
2416         * platform/ios/LegacyTileGrid.mm:
2417         * platform/ios/LegacyTileLayerPool.mm:
2418         * platform/ios/TileControllerMemoryHandlerIOS.cpp:
2419         * testing/Internals.cpp:
2420
2421 2017-03-01  Per Arne Vollan  <pvollan@apple.com>
2422
2423         [Win] Popup menus are too small in HiDPI mode.
2424         https://bugs.webkit.org/show_bug.cgi?id=168965
2425
2426         Reviewed by Brent Fulgham.
2427
2428         Scale font with device scale factor.
2429
2430         * platform/win/PopupMenuWin.cpp:
2431         (WebCore::PopupMenuWin::show):
2432         (WebCore::PopupMenuWin::calculatePositionAndSize):
2433         (WebCore::PopupMenuWin::paint):
2434         * platform/win/PopupMenuWin.h:
2435
2436 2017-03-01  Joseph Pecoraro  <pecoraro@apple.com>
2437
2438         [WebRTC] Install libwebrtc.dylib inside of WebCore.framework
2439         https://bugs.webkit.org/show_bug.cgi?id=168859
2440
2441         Reviewed by Dan Bernstein.
2442
2443         * Configurations/WebCore.xcconfig:
2444         Set library search path to find the libwebrtc.dylib inside of WebCore's Frameworks
2445         or in the WK_OVERRIDE_FRAMEWORKS_DIR.
2446
2447 2017-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
2448
2449         Addressing post-review comments on r213163
2450         https://bugs.webkit.org/show_bug.cgi?id=168678
2451
2452         Unreviewed.
2453
2454         No new tests because there is no behavior change.
2455
2456         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2457         (WebCore::platformFontLookupWithFamily):
2458
2459 2017-02-28  Simon Fraser  <simon.fraser@apple.com>
2460
2461         Don't use the LinearGlyphMask format if accelerated drawing is disabled
2462         https://bugs.webkit.org/show_bug.cgi?id=168997
2463
2464         Reviewed by Tim Horton.
2465
2466         Non-accelerated drawing doesn't work into LinearGlyphMask-format backing store,
2467         so don't use that backing store format when accelerated drawing is disabled.
2468
2469         * platform/graphics/ca/PlatformCALayer.cpp:
2470         (WebCore::PlatformCALayer::drawRepaintIndicator):
2471         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2472         (layerContentsFormat):
2473         (PlatformCALayerCocoa::updateContentsFormat):
2474
2475 2017-02-28  Simon Fraser  <simon.fraser@apple.com>
2476
2477         Make the repaint indicators show subpixel antialiased text indication a bit more clearly
2478         https://bugs.webkit.org/show_bug.cgi?id=168988
2479
2480         Reviewed by Tim Horton.
2481
2482         Put a more obvious stroke around the repaint count when subpixel-antialiased layer text is enabled.
2483
2484         * platform/graphics/ca/PlatformCALayer.cpp:
2485         (WebCore::PlatformCALayer::drawRepaintIndicator):
2486         (WebCore::PlatformCALayer::drawTextAtPoint):
2487         * platform/graphics/ca/PlatformCALayer.h:
2488         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2489         (PlatformCALayerWin::drawTextAtPoint):
2490         * platform/graphics/ca/win/PlatformCALayerWin.h:
2491
2492 2017-02-28  Alex Christensen  <achristensen@webkit.org>
2493
2494         LibWebRTCProvider should check existence of libwebrtc.dylib
2495         https://bugs.webkit.org/show_bug.cgi?id=168986
2496         <rdar://problem/30735413>
2497
2498         Reviewed by Youenn Fablet.
2499
2500         Some configurations of the webrtc tests overwrite the availability of WebRTC in order to test it
2501         with MockLibWebRTCPeerConnection.  If the dylib can not be found, we can't use it, so we want to
2502         fail these tests rather than crashing calling rtc::LogMessage::LogToDebug.
2503
2504         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2505         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
2506         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
2507         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2508         (WebCore::LibWebRTCProvider::factory):
2509         (WebCore::LibWebRTCProvider::webRTCAvailable):
2510         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2511         * testing/MockLibWebRTCPeerConnection.cpp:
2512         (WebCore::useMockRTCPeerConnectionFactory):
2513         (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
2514
2515 2017-02-28  Tim Horton  <timothy_horton@apple.com>
2516
2517         Apply a review comment that was missing in r213182
2518
2519         * loader/ios/QuickLook.mm:
2520         (WebCore::isQuickLookPreviewURL):
2521
2522 2017-02-28  Tim Horton  <timothy_horton@apple.com>
2523
2524         [iOS] Getting QLPreviewProtocol slows down first navigation in Web process
2525         https://bugs.webkit.org/show_bug.cgi?id=168940
2526         <rdar://problem/29468999>
2527
2528         Reviewed by Simon Fraser.
2529
2530         No new tests, just a performance improvement.
2531
2532         * loader/DocumentLoader.cpp:
2533         (WebCore::isRemoteWebArchive):
2534         * loader/PolicyChecker.cpp:
2535         (WebCore::PolicyChecker::checkNavigationPolicy):
2536         * loader/ResourceLoadNotifier.cpp:
2537         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
2538         Make use of isQuickLookPreviewURL.
2539
2540         * loader/ios/QuickLook.h:
2541         * loader/ios/QuickLook.mm:
2542         (WebCore::isQuickLookPreviewURL):
2543         Add isQuickLookPreviewURL, which first early-returns if the protocol
2544         of the URL is a well-known protocol, and then falls back to loading QuickLook.
2545
2546         In a microbenchmark this is a 30-40% improvement in total time spent
2547         loading an empty HTML document (wall-clock time between loadHTMLString
2548         and didFinishNavigation).
2549
2550 2017-02-28  Simon Fraser  <simon.fraser@apple.com>
2551
2552         Add Geolocation and DeviceOrientation to features.json 
2553
2554         * features.json:
2555
2556 2017-02-28  Wenson Hsieh  <wenson_hsieh@apple.com>
2557
2558         Data interaction should support attachment elements
2559         https://bugs.webkit.org/show_bug.cgi?id=168916
2560         <rdar://problem/30664519>
2561
2562         Reviewed by Ryosuke Niwa.
2563
2564         Teaches DragController to recognize and initiate dragging on attachment elements, and also adds a new
2565         convenience method to the WebItemProviderPasteboard for block enumeration of available UIItemProviders. Covered
2566         by a new API test: DataInteractionTests.AttachmentElementItemProviders.
2567
2568         * page/DragController.cpp:
2569         (WebCore::DragController::draggableElement):
2570         (WebCore::DragController::startDrag):
2571         * platform/ios/WebItemProviderPasteboard.h:
2572         * platform/ios/WebItemProviderPasteboard.mm:
2573         (-[WebItemProviderPasteboard enumerateItemProvidersWithBlock:]):
2574
2575 2017-02-28  Mark Lam  <mark.lam@apple.com>
2576
2577         Remove setExclusiveThread() and peers from the JSLock.
2578         https://bugs.webkit.org/show_bug.cgi?id=168977
2579
2580         Reviewed by Filip Pizlo.
2581
2582         No new tests because this should already be covered by existing tests.
2583
2584         * bindings/js/CommonVM.cpp:
2585         (WebCore::commonVMSlow):
2586
2587 2017-02-28  Dave Hyatt  <hyatt@apple.com>
2588
2589         Centering text inside a button set to display flex and justify-content: center is impossible
2590         https://bugs.webkit.org/show_bug.cgi?id=148872
2591         <rdar://problem/22590086>
2592
2593         Reviewed by Simon Fraser.
2594
2595         Added new test in fast/forms.
2596
2597         * rendering/RenderButton.cpp:
2598         (WebCore::RenderButton::addChild):
2599         (WebCore::RenderButton::updateAnonymousChildStyle):
2600         (WebCore::RenderButton::styleDidChange):
2601         (WebCore::RenderButton::styleWillChange): Deleted.
2602         (WebCore::RenderButton::setupInnerStyle): Deleted.
2603         * rendering/RenderButton.h:
2604         * rendering/RenderElement.cpp:
2605         (WebCore::RenderElement::propagateStyleToAnonymousChildren):
2606         * rendering/RenderElement.h:
2607         (WebCore::RenderElement::updateAnonymousChildStyle):
2608
2609 2017-02-28  Antoine Quint  <graouts@apple.com>
2610
2611         [Modern Media Controls] Add missing compact mode assets for macOS
2612         https://bugs.webkit.org/show_bug.cgi?id=168980
2613         <rdar://problem/30763269>
2614
2615         Reviewed by Jon Lee.
2616
2617         Adding missing compact mode assets for the AirPlay, tracks, PiP and volume buttons.
2618
2619         * Modules/modern-media-controls/controls/icon-service.js:
2620         * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css:
2621         (.media-controls.mac.inline.compact button.airplay):
2622         (.media-controls.mac.inline.compact button.pip):
2623         (.media-controls.mac.inline.compact button.tracks):
2624         * Modules/modern-media-controls/images/macOS/airplay-compact@1x.png: Added.
2625         * Modules/modern-media-controls/images/macOS/airplay-compact@2x.png: Added.
2626         * Modules/modern-media-controls/images/macOS/media-selection-compact@1x.png: Added.
2627         * Modules/modern-media-controls/images/macOS/media-selection-compact@2x.png: Added.
2628         * Modules/modern-media-controls/images/macOS/pip-in-compact@1x.png: Added.
2629         * Modules/modern-media-controls/images/macOS/pip-in-compact@2x.png: Added.
2630         * Modules/modern-media-controls/images/macOS/volume-compact@1x.png:
2631         * Modules/modern-media-controls/images/macOS/volume-compact@2x.png:
2632         * Modules/modern-media-controls/images/macOS/volume-mute-compact@1x.png: Added.
2633         * Modules/modern-media-controls/images/macOS/volume-mute-compact@2x.png: Added.
2634
2635 2017-02-28  Chris Dumez  <cdumez@apple.com>
2636
2637         [iOS] Throttle requestAnimationFrame to 30fps in low power mode
2638         https://bugs.webkit.org/show_bug.cgi?id=168837
2639         <rdar://problem/30700929>
2640
2641         Reviewed by Simon Fraser.
2642
2643         Throttle requestAnimationFrame to 30fps in low power mode on iOS to save battery.
2644
2645         ScriptedAnimationController now maintains an OptionSet of throttling reasons.
2646         Throttling reasons for now are: OutsideViewport, VisuallyIdle, and LowPowerMode.
2647         The requestAnimationFrame interval is then determined based on those throttling
2648         reasons:
2649         - OutsideViewport or VisuallyIdle: 10 seconds (very aggressive throttling)
2650         - LowPowerMode: 30fps
2651         - No reasons: 60fps
2652
2653         The Page now keeps track of low power mode state using a LowPowerModeNotifier.
2654         Whenever low power mode changes, it updates the throttling reasons in all the
2655         documents' ScriptedAnimationControllers in the frame tree.
2656
2657         Tests: fast/animation/request-animation-frame-throttling-detached-iframe.html
2658                fast/animation/request-animation-frame-throttling-lowPowerMode.html
2659
2660         * dom/Document.cpp:
2661         (WebCore::Document::requestAnimationFrame):
2662         * dom/Document.h:
2663         * dom/ScriptedAnimationController.cpp:
2664         (WebCore::ScriptedAnimationController::ScriptedAnimationController):
2665         (WebCore::throttlingReasonToString):
2666         (WebCore::throttlingReasonsToString):
2667         (WebCore::ScriptedAnimationController::addThrottlingReason):
2668         (WebCore::ScriptedAnimationController::removeThrottlingReason):
2669         (WebCore::ScriptedAnimationController::isThrottled):
2670         (WebCore::ScriptedAnimationController::interval):
2671         (WebCore::ScriptedAnimationController::page):
2672         (WebCore::ScriptedAnimationController::scheduleAnimation):
2673         * dom/ScriptedAnimationController.h:
2674         (WebCore::ScriptedAnimationController::create):
2675         * page/FrameView.cpp:
2676         (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
2677         * page/Page.cpp:
2678         (WebCore::Page::Page):
2679         (WebCore::Page::isLowPowerModeEnabled):
2680         (WebCore::Page::setLowPowerModeEnabledOverrideForTesting):
2681         (WebCore::updateScriptedAnimationsThrottlingReason):
2682         (WebCore::Page::setIsVisuallyIdleInternal):
2683         (WebCore::Page::handleLowModePowerChange):
2684         * page/Page.h:
2685         * testing/Internals.cpp:
2686         (WebCore::Internals::resetToConsistentState):
2687         (WebCore::Internals::requestAnimationFrameInterval):
2688         (WebCore::Internals::setLowPowerModeEnabled):
2689         * testing/Internals.h:
2690         * testing/Internals.idl:
2691
2692 2017-02-28  Youenn Fablet  <youenn@apple.com>
2693
2694         [WebRTC] Limit libwebrtc logging in Debug build
2695         https://bugs.webkit.org/show_bug.cgi?id=168974
2696
2697         Reviewed by Alex Christensen.
2698
2699         Covered by manual testing..
2700
2701         * platform/Logging.h:
2702         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
2703         (WebCore::LibWebRTCProvider::callOnWebRTCSignalingThread):
2704
2705 2017-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
2706
2707         [macOS] Migrate off of CTFontCreateForCSS
2708         https://bugs.webkit.org/show_bug.cgi?id=168678
2709
2710         Reviewed by David Hyatt.
2711
2712         This patch implements the Font Matching Algorithm detailed in
2713         https://drafts.csswg.org/css-fonts-4/#font-matching-algorithm
2714         Previously, this was implemented inside Core Text (via
2715         CTFontCreateForCSS()), but that implementation does not understand
2716         variation fonts. Therefore it should move to WebKit (along with
2717         the general fact that CSS algorithms should be implemented in a
2718         CSS engine, not the platform's text engine).
2719
2720         This implementation is not completely divorced from the platform,
2721         however - Core Text exposes font weights on a [-1, 1] range, but
2722         CSS operates on a [1, 999] range. In order to provide the mapping
2723         to CSS weights, Core Text infrastructure is necessary. Therefore,
2724         this new implementation of the matching algorithm is only used
2725         on certain operating systems.
2726
2727         The new implementation of the algorithm is not bug-compatible with
2728         the existing implementation; this patch does represent a behavior
2729         change. However, I have reviewed the differences manually and
2730         believe this algorithm to be a progression over the previous one
2731         (except for one case with Helvetica Neue - see
2732         LayoutTests/ChangeLog for more information about that).
2733
2734         This patch also represents a 27% performance progression on our
2735         standard page load test (just measuring the performance of the font
2736         matching algorithm, and nothing else). (Because font matching is
2737         only a small part of the entire test, the overall progression is
2738         much smaller.)
2739
2740         Tests: FontCacheTest.FontLookupFromFamilyName
2741                FontCacheTest.FontLookupFromPostScriptName
2742
2743         * platform/graphics/FontCache.h:
2744         (WebCore::FontCache::createFontPlatformDataForTesting): Allow for
2745         unit testing.
2746         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2747         (WebCore::isSystemFont): Inlined.
2748         (WebCore::FontDatabase::singleton): Cache results of Core Text
2749         lookups.
2750         (WebCore::FontDatabase::Range::Range): Because of variation fonts,
2751         fonts' weights, widths, and slopes need to be represented as a range
2752         instead of an individual value.
2753         (WebCore::FontDatabase::Range::isValid):
2754         (WebCore::FontDatabase::Range::expand):
2755         (WebCore::FontDatabase::Range::includes):
2756         (WebCore::FontDatabase::InstalledFont::InstalledFont): Represents a
2757         Font Descriptor as well as some lookup information about it.
2758         (WebCore::FontDatabase::InstalledFontCollection::InstalledFontCollection):
2759         A collection of installed fonts.
2760         (WebCore::FontDatabase::InstalledFontCollection::insertInstalledFont):
2761         Cache minima and maxima.
2762         (WebCore::FontDatabase::InstalledFontCollection::isEmpty):
2763         (WebCore::FontDatabase::InstalledFontCollection::size):
2764         (WebCore::FontDatabase::lookupFamilyName): Get all the fonts in
2765         the family.
2766         (WebCore::FontDatabase::lookupPostScriptName): Get the font with
2767         the given PostScript name.
2768         (WebCore::FontDatabase::clear):
2769         (WebCore::FontDatabase::FontDatabase): Cache.
2770         (WebCore::iterateActiveFontsWithReturn): The Font Matching Algorithm
2771         works by starting with every font in the family, and the eliminating
2772         items from the set iteratively. Instead of actually removing items
2773         from a vector or linked list, we instead want to treat the collection
2774         as immutable and keep a parallel side-table of which items have been
2775         eliminated (in order to reduce copies and allocations). This makes
2776         sense because most families only have a handful of fonts in them.
2777         This function consults with the side-table to iterate only over the
2778         fonts which have not been eliminated.
2779         (WebCore::iterateActiveFonts): Ditto.
2780         (WebCore::findClosestStretch):
2781         (WebCore::filterStretch): Eliminate fonts based on their stretch
2782         value.
2783         (WebCore::findClosestStyle):
2784         (WebCore::filterStyle): Eliminate fonts based on their style value.
2785         (WebCore::findClosestWeight):
2786         (WebCore::filterWeight): Eliminate fonts based on their weight value.
2787         (WebCore::computeTargetWeight):
2788         (WebCore::findClosestFont): If we have a set of fonts in a family,
2789         select the font in the set which best matches the criteria.
2790         (WebCore::platformFontLookupWithFamily): While findClosestFont()
2791         function satisfies the spec's notion of the font matching algorithm,
2792         WebKit actually claims to be able to look up fonts by their PostScript
2793         name. Therefore, this function has a higher-level of logic to rectify
2794         the confusion that results when the PostScript name doesn't agree with
2795         the other CSS properties (like if you say "Helvetica-Bold" but also say
2796         font-weight: 100).
2797         * platform/spi/cocoa/CoreTextSPI.h: Add signature for system CSS
2798         font weight support.
2799
2800 2017-02-24  Matt Rajca  <mrajca@apple.com>
2801
2802         Media: notify clients when autoplayed media ends without being paused
2803         https://bugs.webkit.org/show_bug.cgi?id=168852
2804
2805         Reviewed by Alex Christensen.
2806
2807         Added API tests.
2808
2809         * html/HTMLMediaElement.cpp:
2810         (WebCore::HTMLMediaElement::setReadyState):
2811          Set state accordingly if we autoplayed or if playback was prevented.
2812         (WebCore::HTMLMediaElement::play):
2813          Update state if playback was prevented.
2814         (WebCore::HTMLMediaElement::playInternal):
2815          Update state if playback began without user interaction.
2816         (WebCore::HTMLMediaElement::pauseInternal):
2817          Update state.
2818         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
2819          If playback ends and it began without user interaction, send a DidPlayMediaWithoutInterference event.
2820         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto.
2821         * html/HTMLMediaElement.h:
2822         * page/AutoplayEvent.h:
2823
2824 2017-02-27  Dave Hyatt  <hyatt@apple.com>
2825
2826         Update flexbox to Blink's tip of tree
2827         https://bugs.webkit.org/show_bug.cgi?id=168657
2828
2829         Reviewed by Zalan Bujtas.
2830
2831         Added new tests in css3/flexbox.
2832
2833         * CMakeLists.txt:
2834         * WebCore.xcodeproj/project.pbxproj:
2835         * css/CSSComputedStyleDeclaration.cpp:
2836         (WebCore::ComputedStyleExtractor::propertyValue):
2837         * rendering/FlexibleBoxAlgorithm.cpp: Added.
2838         (WebCore::FlexItem::FlexItem):
2839         (WebCore::FlexLayoutAlgorithm::FlexLayoutAlgorithm):
2840         (WebCore::FlexLayoutAlgorithm::computeNextFlexLine):
2841         * rendering/FlexibleBoxAlgorithm.h: Added.
2842         (WebCore::FlexItem::hypotheticalMainAxisMarginBoxSize):
2843         (WebCore::FlexItem::flexBaseMarginBoxSize):
2844         (WebCore::FlexItem::flexedMarginBoxSize):
2845         (WebCore::FlexLayoutAlgorithm::isMultiline):
2846         * rendering/GridTrackSizingAlgorithm.cpp:
2847         (WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize):
2848         (WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems):
2849         (WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild):
2850         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild):
2851         (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
2852         * rendering/GridTrackSizingAlgorithm.h:
2853         * rendering/OrderIterator.cpp:
2854         (WebCore::OrderIterator::next):
2855         (WebCore::OrderIterator::reset):
2856         (WebCore::OrderIteratorPopulator::~OrderIteratorPopulator):
2857         (WebCore::OrderIteratorPopulator::collectChild):
2858         (WebCore::OrderIteratorPopulator::OrderIteratorPopulator): Deleted.
2859         (WebCore::OrderIteratorPopulator::removeDuplicatedOrderValues): Deleted.
2860         * rendering/OrderIterator.h:
2861         (WebCore::OrderIteratorPopulator::OrderIteratorPopulator):
2862         * rendering/RenderBlock.cpp:
2863         (WebCore::RenderBlock::updateBlockChildDirtyBitsBeforeLayout):
2864         (WebCore::RenderBlock::layoutPositionedObject):
2865         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
2866         (WebCore::RenderBlock::computeChildPreferredLogicalWidths):
2867         (WebCore::RenderBlock::hasDefiniteLogicalHeight):
2868         (WebCore::RenderBlock::availableLogicalHeightForPercentageComputation):
2869         * rendering/RenderBlock.h:
2870         (WebCore::RenderBlock::hasPercentHeightDescendants):
2871         * rendering/RenderBlockFlow.cpp:
2872         (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
2873         * rendering/RenderBox.cpp:
2874         (WebCore::RenderBox::columnFlexItemHasStretchAlignment):
2875         (WebCore::RenderBox::isStretchingColumnFlexItem):
2876         (WebCore::RenderBox::hasStretchedLogicalWidth):
2877         (WebCore::RenderBox::sizesLogicalWidthToFitContent):
2878         (WebCore::RenderBox::computeInlineDirectionMargins):
2879         (WebCore::RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem):
2880         (WebCore::RenderBox::updateLogicalHeight):
2881         (WebCore::RenderBox::computeLogicalHeightWithoutLayout):
2882         (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation):
2883         (WebCore::RenderBox::shouldTreatChildAsReplacedInTableCells):
2884         (WebCore::tableCellShouldHaveZeroInitialSize):
2885         (WebCore::RenderBox::computePercentageLogicalHeight):
2886         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
2887         (WebCore::RenderBox::availableLogicalHeightUsing):
2888         (WebCore::RenderBox::percentageLogicalHeightIsResolvable):
2889         (WebCore::RenderBox::hasUnsplittableScrollingOverflow):
2890         (WebCore::flexItemHasStretchAlignment): Deleted.
2891         (WebCore::isStretchingColumnFlexItem): Deleted.
2892         (WebCore::logicalWidthIsResolvable): Deleted.
2893         (WebCore::RenderBox::hasDefiniteLogicalWidth): Deleted.
2894         (WebCore::percentageLogicalHeightIsResolvable): Deleted.
2895         (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock): Deleted.
2896         (WebCore::RenderBox::hasDefiniteLogicalHeight): Deleted.
2897         * rendering/RenderBox.h:
2898         (WebCore::RenderBox::isGridItem):
2899         (WebCore::RenderBox::isFlexItem):
2900         (WebCore::RenderBox::selfAlignmentNormalBehavior):
2901         * rendering/RenderBoxModelObject.cpp:
2902         (WebCore::isOutOfFlowPositionedWithImplicitHeight):
2903         (WebCore::RenderBoxModelObject::containingBlockForAutoHeightDetection):
2904         (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight):
2905         * rendering/RenderBoxModelObject.h:
2906         * rendering/RenderElement.cpp:
2907         (WebCore::RenderElement::removeChildInternal):
2908         * rendering/RenderFlexibleBox.cpp:
2909         (WebCore::RenderFlexibleBox::LineContext::LineContext):
2910         (WebCore::RenderFlexibleBox::RenderFlexibleBox):
2911         (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
2912         (WebCore::contentAlignmentNormalBehavior):
2913         (WebCore::RenderFlexibleBox::styleDidChange):
2914         (WebCore::RenderFlexibleBox::layoutBlock):
2915         (WebCore::RenderFlexibleBox::repositionLogicalHeightDependentFlexItems):
2916         (WebCore::RenderFlexibleBox::clientLogicalBottomAfterRepositioning):
2917         (WebCore::RenderFlexibleBox::hasOrthogonalFlow):
2918         (WebCore::RenderFlexibleBox::flexBasisForChild):
2919         (WebCore::RenderFlexibleBox::crossAxisExtentForChild):
2920         (WebCore::RenderFlexibleBox::cachedChildIntrinsicContentLogicalHeight):
2921         (WebCore::RenderFlexibleBox::setCachedChildIntrinsicContentLogicalHeight):
2922         (WebCore::RenderFlexibleBox::clearCachedChildIntrinsicContentLogicalHeight):
2923         (WebCore::RenderFlexibleBox::childIntrinsicLogicalHeight):
2924         (WebCore::RenderFlexibleBox::childIntrinsicLogicalWidth):
2925         (WebCore::RenderFlexibleBox::crossAxisIntrinsicExtentForChild):
2926         (WebCore::RenderFlexibleBox::mainAxisExtentForChild):
2927         (WebCore::RenderFlexibleBox::mainAxisContentExtentForChildIncludingScrollbar):
2928         (WebCore::RenderFlexibleBox::crossAxisExtent):
2929         (WebCore::RenderFlexibleBox::mainAxisExtent):
2930         (WebCore::RenderFlexibleBox::mainAxisContentExtent):
2931         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
2932         (WebCore::RenderFlexibleBox::transformedWritingMode):
2933         (WebCore::RenderFlexibleBox::flowAwareMarginStartForChild):
2934         (WebCore::RenderFlexibleBox::flowAwareMarginEndForChild):
2935         (WebCore::RenderFlexibleBox::flowAwareMarginBeforeForChild):
2936         (WebCore::RenderFlexibleBox::crossAxisMarginExtentForChild):
2937         (WebCore::RenderFlexibleBox::flowAwareLocationForChild):
2938         (WebCore::RenderFlexibleBox::useChildAspectRatio):
2939         (WebCore::RenderFlexibleBox::computeMainSizeFromAspectRatioUsing):
2940         (WebCore::RenderFlexibleBox::setFlowAwareLocationForChild):
2941         (WebCore::RenderFlexibleBox::mainAxisLengthIsDefinite):
2942         (WebCore::RenderFlexibleBox::crossAxisLengthIsDefinite):
2943         (WebCore::RenderFlexibleBox::cacheChildMainSize):
2944         (WebCore::RenderFlexibleBox::clearCachedMainSizeForChild):
2945         (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild):
2946         (WebCore::RenderFlexibleBox::layoutFlexItems):
2947         (WebCore::RenderFlexibleBox::autoMarginOffsetInMainAxis):
2948         (WebCore::RenderFlexibleBox::updateAutoMarginsInMainAxis):
2949         (WebCore::RenderFlexibleBox::hasAutoMarginsInCrossAxis):
2950         (WebCore::RenderFlexibleBox::availableAlignmentSpaceForChild):
2951         (WebCore::RenderFlexibleBox::updateAutoMarginsInCrossAxis):
2952         (WebCore::RenderFlexibleBox::marginBoxAscentForChild):
2953         (WebCore::RenderFlexibleBox::computeChildMarginValue):
2954         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
2955         (WebCore::RenderFlexibleBox::crossSizeForPercentageResolution):
2956         (WebCore::RenderFlexibleBox::mainSizeForPercentageResolution):
2957         (WebCore::RenderFlexibleBox::childLogicalHeightForPercentageResolution):
2958         (WebCore::RenderFlexibleBox::adjustChildSizeForAspectRatioCrossAxisMinAndMax):
2959         (WebCore::RenderFlexibleBox::constructFlexItem):
2960         (WebCore::RenderFlexibleBox::freezeViolations):
2961         (WebCore::RenderFlexibleBox::freezeInflexibleItems):
2962         (WebCore::RenderFlexibleBox::resolveFlexibleLengths):
2963         (WebCore::alignmentOffset):
2964         (WebCore::RenderFlexibleBox::setOverrideMainAxisContentSizeForChild):
2965         (WebCore::RenderFlexibleBox::staticMainAxisPositionForPositionedChild):
2966         (WebCore::RenderFlexibleBox::staticCrossAxisPositionForPositionedChild):
2967         (WebCore::RenderFlexibleBox::staticInlinePositionForPositionedChild):
2968         (WebCore::RenderFlexibleBox::staticBlockPositionForPositionedChild):
2969         (WebCore::RenderFlexibleBox::setStaticPositionForPositionedLayout):
2970         (WebCore::RenderFlexibleBox::prepareChildForPositionedLayout):
2971         (WebCore::RenderFlexibleBox::alignmentForChild):
2972         (WebCore::RenderFlexibleBox::resetAutoMarginsAndLogicalTopInCrossAxis):
2973         (WebCore::RenderFlexibleBox::needToStretchChildLogicalHeight):
2974         (WebCore::RenderFlexibleBox::childHasIntrinsicMainAxisSize):
2975         (WebCore::RenderFlexibleBox::crossAxisOverflowForChild):
2976         (WebCore::RenderFlexibleBox::layoutAndPlaceChildren):
2977         (WebCore::RenderFlexibleBox::layoutColumnReverse):
2978         (WebCore::initialAlignContentOffset):
2979         (WebCore::alignContentSpaceBetweenChildren):
2980         (WebCore::RenderFlexibleBox::alignFlexLines):
2981         (WebCore::RenderFlexibleBox::adjustAlignmentForChild):
2982         (WebCore::RenderFlexibleBox::alignChildren):
2983         (WebCore::RenderFlexibleBox::applyStretchAlignmentToChild):
2984         (WebCore::RenderFlexibleBox::flipForRightToLeftColumn):
2985         (WebCore::RenderFlexibleBox::flipForWrapReverse):
2986         (WebCore::RenderFlexibleBox::Violation::Violation): Deleted.
2987         (WebCore::RenderFlexibleBox::setCrossAxisExtent): Deleted.
2988         (WebCore::RenderFlexibleBox::flowAwareMarginAfterForChild): Deleted.
2989         (WebCore::RenderFlexibleBox::mainAxisBorderAndPaddingExtentForChild): Deleted.
2990         (WebCore::RenderFlexibleBox::mainAxisScrollbarExtentForChild): Deleted.
2991         (WebCore::RenderFlexibleBox::preferredMainAxisContentExtentForChild): Deleted.
2992         (WebCore::RenderFlexibleBox::computeNextFlexLine): Deleted.
2993         (WebCore::RenderFlexibleBox::setLogicalOverrideSize): Deleted.
2994         (WebCore::RenderFlexibleBox::numberOfInFlowPositionedChildren): Deleted.
2995         (WebCore::RenderFlexibleBox::needToStretchChild): Deleted.
2996         (WebCore::contentAlignmentNormalBehaviorFlexibleBox): Deleted.
2997         * rendering/RenderFlexibleBox.h:
2998         (WebCore::RenderFlexibleBox::orderIterator):
2999         (WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
3000         * rendering/RenderFullScreen.h:
3001         * rendering/RenderGrid.cpp:
3002         (WebCore::selfAlignmentChangedToStretchInRowAxis):
3003         (WebCore::selfAlignmentChangedFromStretchInRowAxis):
3004         (WebCore::selfAlignmentChangedFromStretchInColumnAxis):
3005         (WebCore::RenderGrid::styleDidChange):
3006         (WebCore::RenderGrid::computeTrackBasedLogicalHeight):
3007         (WebCore::RenderGrid::computeTrackSizesForDefiniteSize):
3008         (WebCore::RenderGrid::gridGapForDirection):
3009         (WebCore::RenderGrid::guttersSize):
3010         (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize):
3011         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
3012         (WebCore::RenderGrid::trackSizesForComputedStyle):
3013         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
3014         (WebCore::RenderGrid::populateGridPositionsForDirection):
3015         (WebCore::RenderGrid::alignSelfForChild):
3016         (WebCore::RenderGrid::justifySelfForChild):
3017         (WebCore::RenderGrid::columnAxisPositionForChild):
3018         (WebCore::RenderGrid::rowAxisPositionForChild):
3019         (WebCore::RenderGrid::columnAxisOffsetForChild):
3020         (WebCore::RenderGrid::rowAxisOffsetForChild):
3021         (WebCore::RenderGrid::needToStretchChildLogicalHeight): Deleted.
3022         * rendering/RenderGrid.h:
3023         * rendering/RenderLayer.cpp:
3024         (WebCore::RenderLayer::updateScrollbarsAfterLayout):
3025         * rendering/RenderListBox.cpp:
3026         (WebCore::RenderListBox::computeLogicalHeight):
3027         * rendering/RenderTable.cpp:
3028         (WebCore::RenderTable::layout):
3029         * rendering/RenderTableCell.cpp:
3030         (WebCore::RenderTableCell::layout):
3031         * rendering/RenderTableSection.cpp:
3032         (WebCore::shouldFlexCellChild):
3033         (WebCore::RenderTableSection::relayoutCellIfFlexed):
3034         (WebCore::RenderTableSection::layoutRows):
3035         * rendering/RenderTableSection.h:
3036         * rendering/RenderTextControl.cpp:
3037         (WebCore::RenderTextControl::computeLogicalHeight):
3038         * rendering/style/RenderStyle.cpp:
3039         (WebCore::resolvedSelfAlignment):
3040         (WebCore::RenderStyle::resolvedAlignSelf):
3041         (WebCore::RenderStyle::resolvedJustifySelf):
3042         * rendering/style/RenderStyle.h:
3043         * style/RenderTreeUpdater.cpp:
3044         (WebCore::textRendererIsNeeded):
3045
3046 2017-02-28  Alex Christensen  <achristensen@webkit.org>
3047
3048         Main resource requests need cachePartition
3049         https://bugs.webkit.org/show_bug.cgi?id=168806
3050         <rdar://30639764>
3051
3052         Reviewed by Brady Eidson.
3053
3054         Test: http/tests/security/credentials-main-resource.html
3055
3056         r211751 caused an unintended regression on pages whose main resource is protected
3057         by basic authentication.  We were not setting the cache partition for main resource
3058         requests, and we use the cache partition now for credentials, so the credentials for
3059         the main resource were not being put into a partition in the CredentialStorage that
3060         would not be used for subresources of the page, whose requests had the correct partition
3061         for the domain of the page.  This caused users to have to enter their credentials twice,
3062         once for the main resource and once for any subresources.  This is fixed by using the
3063         domain from the main resource request as the cache partition.  Elsewhere the Document is
3064         used to get the cache partition, but there is no Document yet when requesting the main resource.
3065
3066         * loader/DocumentLoader.cpp:
3067         (WebCore::DocumentLoader::startLoadingMainResource):
3068         Set the cache partition for the main resource loads based on the SecurityOrigin of the
3069         initial request if we are loading the main resource for a new top document.  If the main resource
3070         request is redirected, then we will still use the partition of the initial request because that is
3071         what the user requested and that is where the user entered the credentials.
3072         * loader/cache/CachedResourceLoader.h:
3073         * loader/cache/CachedResourceRequest.cpp:
3074         (WebCore::CachedResourceRequest::setDomainForCachePartition):
3075         * loader/cache/CachedResourceRequest.h:
3076
3077 2017-02-28  Alex Christensen  <achristensen@webkit.org>
3078
3079         REGRESSION: LayoutTest http/tests/security/credentials-iframes.html is failing on ios-simulator
3080         https://bugs.webkit.org/show_bug.cgi?id=167967
3081
3082         Reviewed by Brady Eidson.
3083
3084         XHR credentials have a persistence of CredentialPersistenceNone because we keep
3085         them in the WebCore::CredentialStorage.  We were storing them to CFNetwork's NSURLCredentialStorage
3086         on iOS and then they were being given as the proposedCredential in
3087         NetworkDataTaskCocoa::tryPasswordBasedAuthentication even though we set CredentialPersistenceNone.
3088
3089         This fixes http/tests/security/credentials-iframes.html
3090
3091         * platform/network/CredentialStorage.cpp:
3092         (WebCore::CredentialStorage::set):
3093         * platform/network/CredentialStorage.h:
3094         * platform/network/cf/CredentialStorageCFNet.cpp:
3095         (WebCore::CredentialStorage::saveToPersistentStorage): Deleted.
3096         * platform/network/mac/CredentialStorageMac.mm:
3097         (WebCore::CredentialStorage::saveToPersistentStorage): Deleted.
3098
3099 2017-02-27  Alex Christensen  <achristensen@webkit.org>
3100
3101         Fix WinCairo build.
3102
3103         * PlatformWinCairo.cmake:
3104
3105 2017-02-27  Alex Christensen  <achristensen@webkit.org>
3106
3107         Begin enabling WebRTC on 64-bit
3108         https://bugs.webkit.org/show_bug.cgi?id=168915
3109
3110         Reviewed by Eric Carlson.
3111
3112         * Configurations/FeatureDefines.xcconfig:
3113
3114 2017-02-27  Antoine Quint  <graouts@apple.com>
3115
3116         [Modern Media Controls] Use compact mode by default on macOS
3117         https://bugs.webkit.org/show_bug.cgi?id=168958
3118         <rdar://problem/30748638>
3119
3120         Reviewed by Jon Lee.
3121
3122         We now use the compact layout mode by default on macOS.
3123
3124         * Modules/modern-media-controls/controls/layout-item.js: Remove the ReducedPadding trait.
3125         * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css: 
3126         (.media-controls.mac.inline.compact .time-label,): Vertically align the time label with
3127         the scrubber in compact mode.
3128         (.media-controls.mac.inline.compact .scrubber.slider): Correctly position the scrubber in
3129         compact mode so that it's vertically aligned.
3130         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
3131         (MacOSInlineMediaControls.prototype.layoutTraitsDidChange): Remove handling of tight and
3132         reduced padding traits since these do not apply to macOS anymore. We also notify the
3133         scrubber of a layout trait change so that it may adjust its height.
3134         * Modules/modern-media-controls/controls/scrubber.js:
3135         (Scrubber):
3136         (Scrubber.prototype.layoutTraitsDidChange): Adjust the height of the scrubber to match
3137         compact layout traits.
3138         * Modules/modern-media-controls/controls/time-control.js:
3139         (TimeControl.prototype.get isSufficientlyWide): Adjust the minimum scrubber width for
3140         TimeControl visibility to match compact layout traits.
3141         * Modules/modern-media-controls/media/media-controller.js:
3142         (MediaController.prototype.get layoutTraits): Use the compact layout trait by default
3143         on macOS and make the tight padding specific to iOS.
3144
3145 2017-02-27  Antoine Quint  <graouts@apple.com>
3146
3147         [Modern Media Controls] Adhere to tight padding on iOS
3148         https://bugs.webkit.org/show_bug.cgi?id=168949
3149         <rdar://problem/30746164>
3150
3151         Reviewed by Jon Lee.
3152
3153         We used to only support custom margins on macOS, to support this on iOS as
3154         well, we promote the notification when the layoutTraits property is set to
3155         MediaControls and expose a new protected method layoutTraitsDidChange() for
3156         subclasses to implement. IOSInlineMediaControls now implements that method
3157         and will use tighter margins for the TightPadding layout trait.
3158
3159         Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-tight-padding.html
3160
3161         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
3162         (IOSInlineMediaControls.prototype.layoutTraitsDidChange):
3163         (IOSInlineMediaControls):
3164         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
3165         (MacOSInlineMediaControls.prototype.get layoutTraits): Deleted.
3166         (MacOSInlineMediaControls.prototype.set layoutTraits): Deleted.
3167         (MacOSInlineMediaControls.prototype._matchLayoutTraits): Deleted.
3168         * Modules/modern-media-controls/controls/media-controls.js:
3169         (MediaControls.prototype.get layoutTraits):
3170         (MediaControls.prototype.set layoutTraits):
3171         (MediaControls.prototype.layoutTraitsDidChange):
3172
3173 2017-02-27  Youenn Fablet  <youenn@apple.com>
3174
3175         [WebRTC] Support modern RTCStatsReport
3176         https://bugs.webkit.org/show_bug.cgi?id=166916
3177         <rdar://problem/30293780>
3178
3179         Reviewed by Alex Christensen.
3180
3181         Updating binding generator and IDL parser to handle maplike.
3182         Covered by binding tests.
3183
3184         Added support for maplike binding from JS wrapper to DOM class.
3185         The principle is to have the JSXX wrapper having a @backingMap slot containing a Map.
3186         All maplike methods are forwarded to the corresponding Map methods.
3187         The XX object is responsible to add key/value pairs using a helper routine.
3188         The creation of the Map is done at creation of the JSXX wrapper.
3189
3190         DOM class is interacting with the map through DOMMapLike.
3191         Extracted DOMGuarded from DOM promise implementation.
3192         This allows reusing this code for DOMMapLike.
3193
3194         Covered by binding tests and manual tests.
3195
3196         * CMakeLists.txt:
3197         * DerivedSources.make:
3198         * Modules/mediastream/RTCStatsReport.h:
3199         (WebCore::RTCStatsReport::InboundRTPStreamStats::InboundRTPStreamStats):
3200         (WebCore::RTCStatsReport::OutboundRTPStreamStats::OutboundRTPStreamStats):
3201         (WebCore::RTCStatsReport::create):
3202         (WebCore::RTCStatsReport::synchronizeBackingMap):
3203         (WebCore::RTCStatsReport::backingMap):
3204         (WebCore::RTCStatsReport::addStats):
3205         * Modules/mediastream/RTCStatsReport.idl:
3206         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3207         (WebCore::fromStdString):
3208         (WebCore::fillRTCStats):
3209         (WebCore::fillRTCRTPStreamStats):
3210         (WebCore::fillInboundRTPStreamStats):
3211         (WebCore::fillOutboundRTPStreamStats):
3212         (WebCore::LibWebRTCMediaEndpoint::StatsCollector::OnStatsDelivered):
3213         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
3214         * WebCore.xcodeproj/project.pbxproj:
3215         * bindings/js/JSDOMBindingInternals.js: Added.
3216         (mapLikeForEach):
3217         * bindings/js/JSDOMGlobalObject.cpp:
3218         (WebCore::JSDOMGlobalObject::visitChildren):
3219         * bindings/js/JSDOMGlobalObject.h:
3220         * bindings/js/JSDOMGuardedObject.cpp: Added.
3221         (WebCore::DOMGuardedObject::DOMGuardedObject):
3222         (WebCore::DOMGuardedObject::~DOMGuardedObject):
3223         (WebCore::DOMGuardedObject::clear):
3224         (WebCore::DOMGuardedObject::contextDestroyed):
3225         * bindings/js/JSDOMGuardedObject.h: Added.
3226         (WebCore::DOMGuardedObject::isSuspended):
3227         (WebCore::DOMGuardedObject::visitAggregate):
3228         (WebCore::DOMGuardedObject::guardedObject):
3229         (WebCore::DOMGuardedObject::globalObject):
3230         (WebCore::DOMGuardedObject::isEmpty):
3231         (WebCore::DOMGuarded::DOMGuarded):
3232         (WebCore::DOMGuarded::guarded):
3233         * bindings/js/JSDOMMapLike.cpp: Added.
3234         (WebCore::getBackingMap):
3235         (WebCore::initializeBackingMap):
3236         (WebCore::createBackingMap):
3237         (WebCore::forwardAttributeGetterToBackingMap):
3238         (WebCore::forwardFunctionCallToBackingMap):
3239         (WebCore::forwardForEachCallToBackingMap):
3240         * bindings/js/JSDOMMapLike.h: Added.
3241         (WebCore::DOMMapLike::set):
3242         (WebCore::synchronizeBackingMap):
3243         (WebCore::forwardSizeToMapLike):
3244         (WebCore::forwardEntriesToMapLike):
3245         (WebCore::forwardKeysToMapLike):
3246         (WebCore::forwardValuesToMapLike):
3247         (WebCore::forwardClearToMapLike):
3248         (WebCore::forwardForEachToMapLike):
3249         (WebCore::forwardHasToMapLike):
3250         (WebCore::forwardAddToMapLike):
3251         (WebCore::forwardDeleteToMapLike):
3252         * bindings/js/JSDOMPromise.cpp:
3253         (WebCore::DeferredPromise::promise):
3254         (WebCore::DeferredPromise::reject):
3255         * bindings/js/JSDOMPromise.h:
3256         (WebCore::DeferredPromise::resolve):
3257         (WebCore::DeferredPromise::resolveWithNewlyCreated):
3258         (WebCore::DeferredPromise::reject):
3259         (WebCore::DeferredPromise::resolveWithCallback):
3260         (WebCore::DeferredPromise::rejectWithCallback):
3261         (WebCore::DeferredPromise::DeferredPromise):
3262         (WebCore::DeferredPromise::deferred):
3263         * bindings/js/WebCoreBuiltinNames.h:
3264         * bindings/scripts/CodeGeneratorJS.pm:
3265         (PrototypeFunctionCount):
3266         (GeneratePropertiesHashTable):
3267         (InterfaceNeedsIterator):
3268         (GenerateImplementation):
3269         (GenerateParametersCheck):
3270         * bindings/scripts/IDLParser.pm:
3271         (assert):
3272         (parseAttributeOrOperationOrIterator):
3273         (parseSerializer):
3274         (parseAttributeOrOperationRest):
3275         (parseAttribute):
3276         (parseAttributeRest):
3277         (parseOperationOrIterator):
3278         (parseOptionalIterableInterface):
3279         (parseMapLikeRest):
3280         (parseMapLikeProperties):
3281         (parseOperationRest):
3282         (applyMemberList):
3283         * bindings/scripts/test/JS/JSMapLike.cpp: Added.
3284         * bindings/scripts/test/JS/JSMapLike.h: Added.
3285         * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: Added.
3286         * bindings/scripts/test/JS/JSReadOnlyMapLike.h: Added.
3287         * bindings/scripts/test/TestMapLike.idl: Added.
3288         * bindings/scripts/test/TestReadOnlyMapLike.idl: Added.
3289
3290 2017-02-27  Mark Lam  <mark.lam@apple.com>
3291
3292         Introduce a VM Traps mechanism and refactor Watchdog to use it.
3293         https://bugs.webkit.org/show_bug.cgi?id=168842
3294
3295         Reviewed by Filip Pizlo.
3296
3297         No new tests needed because this is a re-implementation of existing functionality.
3298
3299         * bindings/js/WorkerScriptController.cpp:
3300         (WebCore::WorkerScriptController::WorkerScriptController):
3301         (WebCore::WorkerScriptController::scheduleExecutionTermination):
3302
3303 2017-02-27  Andy Estes  <aestes@apple.com>
3304
3305         [Cocoa] Rename FileMac.mm to FileCocoa.mm
3306         https://bugs.webkit.org/show_bug.cgi?id=168947
3307
3308         Reviewed by Zalan Bujtas.
3309
3310         * PlatformMac.cmake:
3311         * WebCore.xcodeproj/project.pbxproj:
3312         * fileapi/FileCocoa.mm: Renamed from Source/WebCore/fileapi/FileMac.mm.
3313
3314 2017-02-27  Andy Estes  <aestes@apple.com>
3315
3316         [iOS] Enable file replacement
3317         https://bugs.webkit.org/show_bug.cgi?id=168907
3318         <rdar://problem/22258242>
3319
3320         Reviewed by David Kilzer.
3321
3322         Covered by existing tests.
3323
3324         * fileapi/FileMac.mm:
3325         (WebCore::File::shouldReplaceFile): Stop using Carbon and AppKit API for determining if a
3326         file path is a file package. Use NSURL and CoreServices instead, which exist on Mac and iOS.
3327
3328 2017-02-27  Antoine Quint  <graouts@apple.com>
3329
3330         [Modern Media Controls] Use a solid background for <audio> controls on macOS
3331         https://bugs.webkit.org/show_bug.cgi?id=168941
3332         <rdar://problem/30744316>
3333
3334         Reviewed by Dean Jackson.
3335
3336         Use a solid background for <audio> elements on macOS, the same way we do on iOS.
3337
3338         Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-audio-background.html
3339
3340         * Modules/modern-media-controls/controls/macos-media-controls.css:
3341         (:host(audio) .media-controls.mac.inline > .controls-bar):
3342         (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint):
3343
3344 2017-02-27  Antoine Quint  <graouts@apple.com>
3345
3346         [Modern Media Controls] StatusLabel should use similar properties to TimeLabel
3347         https://bugs.webkit.org/show_bug.cgi?id=168938
3348         <rdar://problem/30743185>
3349
3350         Reviewed by Dean Jackson.
3351
3352         Ensure we use the same styling properties for StatusLabel and TimeLabel.
3353
3354         Tests: media/modern-media-controls/status-label/status-label-ios.html
3355                media/modern-media-controls/status-label/status-label-macos.html
3356
3357         * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
3358         (.media-controls.ios.inline .time-label,):
3359         (.media-controls.ios.inline .time-label): Deleted.
3360         * Modules/modern-media-controls/controls/macos-media-controls.css:
3361         (.media-controls.mac > .controls-bar .time-label,):
3362         (.media-controls.mac > .controls-bar .time-label): Deleted.
3363         * Modules/modern-media-controls/controls/status-label.css:
3364         (.status-label):
3365
3366 2017-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
3367
3368         Rename ICU cursor iterator to caret iterator
3369         https://bugs.webkit.org/show_bug.cgi?id=168206
3370
3371         Reviewed by Simon Fraser.
3372
3373         Mechanical find/replace.
3374
3375         No new tests because there is no behavior change.
3376
3377         * platform/graphics/ComplexTextController.cpp:
3378         (WebCore::ComplexTextController::offsetForPosition):
3379         * rendering/RenderText.cpp:
3380         (WebCore::RenderText::previousOffset):
3381         (WebCore::RenderText::nextOffset):
3382
3383 2017-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
3384
3385         Unprefix -webkit-line-break
3386         https://bugs.webkit.org/show_bug.cgi?id=168213
3387
3388         Reviewed by Darin Adler.
3389
3390         We support the property as specced.
3391
3392         Test: fast/text/line-break-unprefixed.html
3393
3394         * css/CSSComputedStyleDeclaration.cpp:
3395         (WebCore::ComputedStyleExtractor::propertyValue):
3396         * css/CSSProperties.json:
3397         * css/parser/CSSParserFastPaths.cpp:
3398         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3399         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
3400         * editing/Editor.cpp:
3401         (WebCore::Editor::applyEditingStyleToElement):
3402         * html/HTMLElement.cpp:
3403         (WebCore::HTMLElement::collectStyleForPresentationAttribute):
3404
3405 2017-02-27  Myles C. Maxfield  <mmaxfield@apple.com>
3406
3407         Use RAII for ICU breaking iterators
3408         https://bugs.webkit.org/show_bug.cgi?id=168203
3409
3410         Reviewed by Simon Fraser.
3411
3412         No new tests because there is no behavior change.
3413
3414         * platform/graphics/ComplexTextController.cpp:
3415         (WebCore::ComplexTextController::offsetForPosition):
3416         * rendering/RenderText.cpp:
3417         (WebCore::RenderText::previousOffset):
3418         (WebCore::RenderText::nextOffset):
3419
3420 2017-02-27  Basuke Suzuki  <Basuke.Suzuki@am.sony.com>
3421
3422         [WinCairo][MiniBrowser] Add ca-bundle to display secure pages
3423         https://bugs.webkit.org/show_bug.cgi?id=168486
3424
3425         Reviewed by Alex Christensen.
3426
3427         change the order of path location search to make it possible to 
3428         configure with environment variable because bundled ca-bundle is
3429         always available now.
3430
3431         * platform/network/curl/ResourceHandleManager.cpp:
3432         (WebCore::certificatePath):
3433
3434 2017-02-27  Antoine Quint  <graouts@apple.com>
3435
3436         [Modern Media Controls] Status text does not appear on iOS
3437         https://bugs.webkit.org/show_bug.cgi?id=168918
3438         <rdar://problem/30737644>
3439
3440         Reviewed by Dean Jackson.
3441
3442         We refactor the layout code out of MacOSInlineMediaControls and into a new
3443         InlineLayoutSupport class which IOSInlineMediaControls uses as well. Now
3444         both the macOS and iOS inline media controls run the same layout logic to
3445         control whether the status label or scrubber should be displayed, and which
3446         controls should be dropped due to space constraints.
3447
3448         Test: media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-status-label.html
3449
3450         * Modules/modern-media-controls/controls/inline-layout-support.js: Added.
3451         (InlineLayoutSupport):
3452         (InlineLayoutSupport.prototype.childrenAfterPerformingLayout):
3453         * Modules/modern-media-controls/controls/ios-inline-media-controls.js:
3454         (IOSInlineMediaControls.prototype.layout):
3455         (IOSInlineMediaControls):
3456         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
3457         (MacOSInlineMediaControls.prototype.layout):
3458         * Modules/modern-media-controls/js-files:
3459
3460 2017-02-27  Simon Fraser  <simon.fraser@apple.com>
3461
3462         Add specification and status metadata to CSSProperties.json, and validate it
3463         https://bugs.webkit.org/show_bug.cgi?id=168901
3464
3465         Reviewed by Darin Adler.
3466
3467         Annotate CSS properties with data about the WebKit development status, and
3468         where they are specified. A property has a canonical specification reference,
3469         but individual values may have a reference to a more recent spec.
3470
3471         Add a list of specifications to the JSON that properties reference by key.
3472
3473         Enhance check-webkit-style to validate the status and spec data.
3474
3475         * css/CSSProperties.json:
3476
3477 2017-02-27  Jiewen Tan  <jiewen_tan@apple.com>
3478
3479         [CredentialManagement] Add IDL definitions for Credential, SiteBoundCredential, and PasswordCredential
3480         https://bugs.webkit.org/show_bug.cgi?id=168616
3481         <rdar://problem/30167149>
3482
3483         Reviewed by Daniel Bates.
3484
3485         This patch adds IDL definitions for:
3486         1. Credential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-credential),
3487         2. SiteBoundCredential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-siteboundcredential), and
3488         3. PasswordCredential(https://w3c.github.io/webappsec-credential-management/#interfaces-credential-types-passwordcredential).
3489
3490         Test: credentials/idlharness.html
3491
3492         * CMakeLists.txt:
3493         * DerivedSources.make:
3494         * Modules/credentials/BasicCredential.cpp: Added.
3495         (WebCore::BasicCredential::BasicCredential):
3496         (WebCore::BasicCredential::~BasicCredential):
3497         (WebCore::BasicCredential::type):
3498         * Modules/credentials/BasicCredential.h: Added.
3499         (WebCore::BasicCredential::id):
3500         * Modules/credentials/BasicCredential.idl: Added.
3501         * Modules/credentials/CredentialData.h: Added.
3502         * Modules/credentials/CredentialData.idl: Added.
3503         * Modules/credentials/PasswordCredential.cpp: Added.
3504         (WebCore::PasswordCredential::PasswordCredential):
3505         (WebCore::PasswordCredential::PasswordCredential):
3506         Dummy constructors for now.
3507         * Modules/credentials/PasswordCredential.h: Added.
3508         (WebCore::PasswordCredential::create):
3509         (WebCore::PasswordCredential::create):
3510         (WebCore::PasswordCredential::setIdName):
3511         (WebCore::PasswordCredential::idName):
3512         (WebCore::PasswordCredential::setPasswordName):
3513         (WebCore::PasswordCredential::passwordName):
3514         (WebCore::PasswordCredential::setAdditionalData):
3515         (WebCore::PasswordCredential::additionalData):
3516         * Modules/credentials/PasswordCredential.idl: Added.
3517         * Modules/credentials/SiteBoundCredential.cpp: Added.
3518         (WebCore::SiteBoundCredential::SiteBoundCredential):
3519         (WebCore::SiteBoundCredential::~SiteBoundCredential):
3520         * Modules/credentials/SiteBoundCredential.h: Added.
3521         (WebCore::SiteBoundCredential::name):
3522         (WebCore::SiteBoundCredential::iconURL):
3523         (WebCore::SiteBoundCredential::setOrigin):
3524         (WebCore::SiteBoundCredential::origin):
3525         * Modules/credentials/SiteBoundCredential.idl: Added.
3526         * Modules/credentials/SiteBoundCredentialData.h: Added.
3527         * Modules/credentials/SiteBoundCredentialData.idl: Added.
3528         * WebCore.xcodeproj/project.pbxproj:
3529
3530 2017-02-27  Jer Noble  <jer.noble@apple.com>
3531
3532         [WebRTC] Fix remote audio rendering
3533         https://bugs.webkit.org/show_bug.cgi?id=168898
3534
3535         Reviewed by Eric Carlson.
3536
3537         Test: webrtc/audio-peer-connection-webaudio.html
3538
3539         Fix MediaStreamAudioSourceNode by not bailing out early if the input sample rate doesn't match
3540         the AudioContext's sample rate; there's code in setFormat() to do the sample rate conversion
3541         correctly.
3542
3543         * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
3544         (WebCore::MediaStreamAudioSourceNode::setFormat):
3545
3546         Fix AudioSampleBufferList by making the AudioConverter input proc a free function, and passing
3547         its refCon a struct containing only the information it needs to perform its task. Because the
3548         conversion may result in a different number of output samples than input ones, just ask to
3549         generate the entire capacity of the scratch buffer, and signal that the input buffer was fully
3550         converted with a special return value.
3551
3552         * platform/audio/mac/AudioSampleBufferList.cpp:
3553         (WebCore::audioConverterFromABLCallback):
3554         (WebCore::AudioSampleBufferList::copyFrom):
3555         (WebCore::AudioSampleBufferList::convertInput): Deleted.
3556         (WebCore::AudioSampleBufferList::audioConverterCallback): Deleted.
3557         * platform/audio/mac/AudioSampleBufferList.h:
3558
3559         Fix AudioSampleDataSource by updating both the sampleCount and the sampleTime after doing
3560         a sample rate conversion to take into account that both the number of samples may have changed,
3561         as well as the timeScale of the sampleTime. This may result in small off-by-one rounding errors
3562         due to the sample rate conversion of sampleTime, so remember what the next expected sampleTime
3563         should be, and correct sampleTime if it is indeed off-by-one. If the pull operation has gotten
3564         ahead of the push operation, delay the next pull by the empty amount by rolling back the
3565         m_outputSampleOffset. Introduce the same offset behavior during pull operations.
3566
3567         * platform/audio/mac/AudioSampleDataSource.h:
3568         * platform/audio/mac/AudioSampleDataSource.mm:
3569         (WebCore::AudioSampleDataSource::pushSamplesInternal):
3570         (WebCore::AudioSampleDataSource::pullSamplesInternal):
3571         (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
3572
3573         Fix MediaPlayerPrivateMediaStreamAVFObjC by obeying the m_muted property.
3574
3575         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3576         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume):
3577         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted):
3578
3579         Fix LibWebRTCAudioModule by sleeping for the correct amount after emitting frames. Previously,
3580         LibWebRTCAudioModule would sleep for a fixed amount of time, which meant it would get slowly out
3581         of sync when emitting frames took a non-zero amount of time. Now, the amount of time before the
3582         next cycle starts is correctly calculated, and then LibWebRTCAudioModule sleeps for a dynamic amount
3583         of time in order to wake up correctly at the beginning of the next cycle.
3584
3585         * platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp:
3586         (WebCore::LibWebRTCAudioModule::StartPlayoutOnAudioThread):
3587
3588         Fix AudioTrackPrivateMediaStreamCocoa by just using the output unit's preferred format
3589         description (with the current system sample rate), rather than whatever is the current
3590         input description.
3591
3592         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
3593         (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
3594         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
3595         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
3596
3597         Fix RealtimeIncomingAudioSource by actually creating an AudioSourceProvider when asked.
3598
3599         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
3600         (WebCore::RealtimeIncomingAudioSource::OnData):
3601         (WebCore::RealtimeIncomingAudioSource::audioSourceProvider):
3602         * platform/mediastream/mac/RealtimeIncomingAudioSource.h:
3603
3604         Fix RealtimeOutgoingAudioSource by using the outgoing format description rather than the
3605         incoming one to determine the sample rate, channel count, sample byte size, etc., to use
3606         when delivering data upstream to libWebRTC.
3607
3608         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
3609         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
3610         (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
3611         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
3612
3613         Fix WebAudioSourceProviderAVFObjC by using a AudioSampleDataSource to do format and sample
3614         rate conversion rather than trying to duplicate all that code and use a CARingBuffer and 
3615         AudioConverter directly.
3616
3617         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.h:
3618         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
3619         (WebCore::WebAudioSourceProviderAVFObjC::~WebAudioSourceProviderAVFObjC):
3620         (WebCore::WebAudioSourceProviderAVFObjC::provideInput):
3621         (WebCore::WebAudioSourceProviderAVFObjC::prepare):
3622         (WebCore::WebAudioSourceProviderAVFObjC::unprepare):
3623         (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):
3624
3625         Fix the MockLibWebRTCAudioTrack by passing along the AddSink() sink to its AudioSourceInterface,
3626         allowing the RealtimeOutgoingAudioSource to push data into the libWebRTC network stack. Also,
3627         make sure m_enabled is initialized to a good value.
3628
3629         * testing/MockLibWebRTCPeerConnection.h:
3630
3631 2017-02-21  Jer Noble  <jer.noble@apple.com>
3632
3633         AudioSampleDataSource should not exclusively lock its read and write threads.
3634         https://bugs.webkit.org/show_bug.cgi?id=168646
3635
3636         Reviewed by Eric Carlson.
3637
3638         Locking the write thread causes the read thread to drop audio samples and generates audible
3639         glitches, and the realtime audio thread backing the read thread should never block. There's
3640         no real reason to lock these threads against one another here; they both rely on the
3641         CARingBuffer to safely and simultaneously read and write data.
3642
3643         * platform/audio/mac/AudioSampleDataSource.cpp:
3644         (WebCore::AudioSampleDataSource::setPaused):
3645         (WebCore::AudioSampleDataSource::pushSamplesInternal):
3646         (WebCore::AudioSampleDataSource::pushSamples):
3647         (WebCore::AudioSampleDataSource::pullSamplesInternal):
3648         (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
3649         (WebCore::AudioSampleDataSource::pullSamples):
3650         * platform/audio/mac/AudioSampleDataSource.h:
3651
3652 2017-02-21  Jer Noble  <jer.noble@apple.com>
3653
3654         AudioTrackPrivateMediaStreamCocoa should not exclusively lock its read and write threads.
3655         https://bugs.webkit.org/show_bug.cgi?id=168643
3656
3657         Reviewed by Eric Carlson.
3658
3659         Locking the write thread causes the read thread to drop audio samples and generates audible
3660         glitches, and the realtime audio thread backing the read thread should never block. There's
3661         no real reason to lock these threads against one another here; they both rely on the
3662         AudioSampleDataSource and it's CARingBuffer to safely and simultaneously read and write
3663         data.
3664
3665         The one piece which locks previously protected against unsafe access was during creation of
3666         the audio unit.  Without a lock, the audio unit could begin playback after the unit was
3667         created and assigned to m_remoteIOUnit but before the ring buffer was created. To protect
3668         against this possibility, create the unit, set the input and output descriptions, but only
3669         assign the new audio unit to m_remoteIOUnit after the ring buffer has been created and
3670         initialized.
3671
3672         * platform/audio/mac/CAAudioStreamDescription.h:
3673         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
3674         (WebCore::AudioTrackPrivateMediaStreamCocoa::~AudioTrackPrivateMediaStreamCocoa):
3675         (WebCore::AudioTrackPrivateMediaStreamCocoa::playInternal):
3676         (WebCore::AudioTrackPrivateMediaStreamCocoa::play):
3677         (WebCore::AudioTrackPrivateMediaStreamCocoa::pause):
3678         (WebCore::AudioTrackPrivateMediaStreamCocoa::setVolume):
3679         (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit):
3680         (WebCore::AudioTrackPrivateMediaStreamCocoa::setupAudioUnit): Renamed to createAudioUnit()
3681         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
3682         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
3683
3684 2017-02-27  Youenn Fablet  <youenn@apple.com>
3685
3686         [WebRTC] RealtimOutgoingVideoSource should not need to do image conversion
3687         https://bugs.webkit.org/show_bug.cgi?id=168802
3688
3689         Reviewed by Jon Lee.
3690
3691         Covered by manual testing as mock sources do not hit the same code path.
3692
3693         * platform/mediastream/mac/AVVideoCaptureSource.h:
3694         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3695         (WebCore::AVVideoCaptureSource::currentFrameCGImage):
3696         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
3697         (WebCore::RealtimeOutgoingVideoSource::sendFrame):
3698         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
3699         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
3700
3701 2017-02-27  Carlos Garcia Campos  <cgarcia@igalia.com>
3702
3703         [GTK] Downloads attributes tests are failing
3704         https://bugs.webkit.org/show_bug.cgi?id=168871
3705
3706         Reviewed by Michael Catanzaro.
3707
3708         Use libsoup to get the suggested filename from the Content-Disposition header instead of buggy
3709         filenameFromHTTPContentDisposition().
3710
3711         Fixes: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html
3712                fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html
3713
3714         * platform/network/soup/ResourceResponseSoup.cpp:
3715         (WebCore::ResourceResponse::platformSuggestedFilename):
3716
3717 2017-02-27  Antoine Quint  <graouts@apple.com>
3718
3719         [Modern Media Controls] Dragging controls in fullscreen on macOS prevents scrubbing or interacting with controls
3720         https://bugs.webkit.org/show_bug.cgi?id=168820
3721         <rdar://problem/30690281>
3722
3723         Reviewed by Jon Lee.
3724
3725         We broke this in https://bugs.webkit.org/show_bug.cgi?id=168755. We restore the check that the
3726         event target when initiating a drag is the controls bar itself and not some of its content.
3727
3728         Since this wasn't caught by our existing tests, we add a test that attemps to initiate a drag
3729         starting over one of the controls and notice that no dragging occurs.
3730
3731         We also fix an issue where we wouldn't update the layout of the left container as its icon
3732         buttons would load, which would cause the layout width of the left container to be incorrect
3733         and the related tests to time out.
3734
3735         Test: media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-drag-is-prevented-over-button.html
3736
3737         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
3738         (MacOSFullscreenMediaControls.prototype.layout):
3739         (MacOSFullscreenMediaControls.prototype._handleMousedown):
3740
3741 2017-02-27  Alex Christensen  <achristensen@webkit.org>
3742
3743         [libwebrtc] Enable WebRTC in some Production Builds
3744         https://bugs.webkit.org/show_bug.cgi?id=168858
3745
3746         * Configurations/FeatureDefines.xcconfig:
3747
3748 2017-02-27  Zan Dobersek  <zdobersek@igalia.com>
3749
3750         [TextureMapper] Clean up BitmapTextureGL construction
3751         https://bugs.webkit.org/show_bug.cgi?id=168909
3752
3753         Reviewed by Carlos Garcia Campos.
3754
3755         Have the BitmapTextureGL constructor accept an rvalue reference pointer
3756         to the GraphicsContext3D object. A static create() method is also added
3757         to help with constructing these objects. Construction sites are updated
3758         appropriately.
3759
3760         The BitmapTextureGL constructor is further cleaned up by moving default
3761         member initializations together with the member declarations.
3762
3763         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3764         (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
3765         * platform/graphics/texmap/BitmapTextureGL.cpp:
3766         (WebCore::BitmapTextureGL::BitmapTextureGL):
3767         * platform/graphics/texmap/BitmapTextureGL.h:
3768         * platform/graphics/texmap/BitmapTexturePool.cpp:
3769         (WebCore::BitmapTexturePool::createTexture):
3770         * platform/graphics/texmap/TextureMapperGL.cpp:
3771         (WebCore::TextureMapperGL::createTexture):
3772
3773 2017-02-27  Zan Dobersek  <zdobersek@igalia.com>
3774
3775         [TextureMapper] Remove InterpolationQuality, TextDrawingModeFlags member variables
3776         https://bugs.webkit.org/show_bug.cgi?id=168906
3777
3778         Reviewed by Carlos Garcia Campos.
3779
3780         Remove the InterpolationQuality and TextDrawingModeFlags member variables from the
3781         TextureMapper class. These weren't modified anywhere in the code.
3782
3783         BitmapTexture::updateContents() still sets the image interpolation quality and
3784         drawing mode on the ImageBuffer's GraphicsContext, but now uses the default
3785         InterpolationDefault and TextModeFill values.
3786
3787         * platform/graphics/texmap/BitmapTexture.cpp:
3788         (WebCore::BitmapTexture::updateContents):
3789         * platform/graphics/texmap/TextureMapper.cpp:
3790         (WebCore::TextureMapper::TextureMapper): Deleted.
3791         (WebCore::TextureMapper::~TextureMapper): Deleted.
3792         * platform/graphics/texmap/TextureMapper.h:
3793         (WebCore::TextureMapper::setImageInterpolationQuality): Deleted.
3794         (WebCore::TextureMapper::setTextDrawingMode): Deleted.
3795         (WebCore::TextureMapper::imageInterpolationQuality): Deleted.
3796         (WebCore::TextureMapper::textDrawingMode): Deleted.
3797
3798 2017-02-26  Zan Dobersek  <zdobersek@igalia.com>
3799
3800         [CoordinatedGraphics] Remove CoordinatedGraphicsScene::paintToGraphicsContext()
3801         https://bugs.webkit.org/show_bug.cgi?id=168903
3802
3803         Reviewed by Carlos Garcia Campos.
3804
3805         Remove the GraphicsContext pointer member from the TextureMapper class
3806         since the getter and setter methods are not used anywhere.
3807
3808         * platform/graphics/texmap/TextureMapper.cpp:
3809         (WebCore::TextureMapper::TextureMapper):
3810         * platform/graphics/texmap/TextureMapper.h:
3811         (WebCore::TextureMapper::setGraphicsContext): Deleted.
3812         (WebCore::TextureMapper::graphicsContext): Deleted.
3813
3814 2017-02-26  Myles C. Maxfield  <mmaxfield@apple.com>
3815
3816         Stop compiling our own cursorMovementIterator()
3817         https://bugs.webkit.org/show_bug.cgi?id=168211
3818
3819         Reviewed by David Hyatt.
3820
3821         Covered by existing tests.
3822
3823         Hook up the caret iterator.
3824
3825         * platform/graphics/ComplexTextController.cpp:
3826         (WebCore::ComplexTextController::offsetForPosition):
3827         * rendering/RenderText.cpp:
3828         (WebCore::RenderText::previousOffset):
3829         (WebCore::RenderText::nextOffset):
3830         * rendering/RenderText.h:
3831
3832 2017-02-26  Commit Queue  <commit-queue@webkit.org>
3833
3834         Unreviewed, rolling out r212942.
3835         https://bugs.webkit.org/show_bug.cgi?id=168882
3836
3837         Made EWS very flaky (Requested by ap on #webkit).
3838
3839         Reverted changeset:
3840
3841         "[Modern Media Controls] Dragging controls in fullscreen on
3842         macOS prevents scrubbing or interacting with controls"
3843         https://bugs.webkit.org/show_bug.cgi?id=168820
3844         http://trac.webkit.org/changeset/212942
3845
3846 2017-02-26  Chris Dumez  <cdumez@apple.com>
3847
3848         HitTestResult's linkSuggestedFilename should sanitize download attribute
3849         https://bugs.webkit.org/show_bug.cgi?id=168856
3850         <rdar://problem/30683109>
3851
3852         Reviewed by Antti Koivisto.
3853
3854         HitTestResult's linkSuggestedFilename should sanitize download attribute.
3855         This is used by the context menu's "Download Linked File" & "Download Linked
3856         File As..." actions.
3857
3858         * rendering/HitTestResult.cpp:
3859         (WebCore::HitTestResult::linkSuggestedFilename):
3860         * rendering/HitTestResult.h:
3861
3862 2017-02-25  Zalan Bujtas  <zalan@apple.com>
3863
3864         Simple line layout: Move coverage functions out of SimpleLineLayout.cpp
3865         https://bugs.webkit.org/show_bug.cgi?id=168872
3866         
3867         Reviewed by Simon Fraser.
3868
3869         SimpleLineLayout.cpp is for core functions only.
3870
3871         No change in functionality.
3872
3873         * CMakeLists.txt:
3874         * WebCore.xcodeproj/project.pbxproj:
3875         * rendering/RenderingAllInOne.cpp:
3876         * rendering/SimpleLineLayout.cpp:
3877         (WebCore::SimpleLineLayout::canUseForWithReason):
3878         (WebCore::SimpleLineLayout::printReason): Deleted.
3879         (WebCore::SimpleLineLayout::printReasons): Deleted.
3880         (WebCore::SimpleLineLayout::printTextForSubtree): Deleted.
3881         (WebCore::SimpleLineLayout::textLengthForSubtree): Deleted.
3882         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows): Deleted.
3883         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage): Deleted.
3884         (WebCore::SimpleLineLayout::toggleSimpleLineLayout): Deleted.
3885         (WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList): Deleted.
3886         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage): Deleted.
3887         * rendering/SimpleLineLayout.h:
3888         * rendering/SimpleLineLayoutCoverage.cpp: Added.
3889         (WebCore::SimpleLineLayout::printReason):
3890         (WebCore::SimpleLineLayout::printReasons):
3891         (WebCore::SimpleLineLayout::printTextForSubtree):
3892         (WebCore::SimpleLineLayout::textLengthForSubtree):
3893         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlows):
3894         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):
3895         (WebCore::SimpleLineLayout::toggleSimpleLineLayout):
3896         (WebCore::SimpleLineLayout::printSimpleLineLayoutBlockList):
3897         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
3898         * rendering/SimpleLineLayoutCoverage.h: Added.
3899
3900 2017-02-25  Zalan Bujtas  <zalan@apple.com>
3901
3902         Text might wrap when its preferred logical width is used for sizing the containing block.
3903         https://bugs.webkit.org/show_bug.cgi?id=168864
3904         <rdar://problem/30690734>
3905
3906         Reviewed by Antti Koivisto.
3907
3908         In certain cases we end up measuring a text run in 2 different ways.
3909         1. preferred width computation -> slow path FontCascade::width() 
3910         2. line breaking logic -> fast path FontCascade::widthForSimpleText()
3911  
3912         FontCascade::width() and ::widthForSimpleText() might return different results for the same run even when
3913         the individual glyph widths are measured to be the same. It's because they run diffrent set of
3914         arithmetics on the float values and for certain values these arithmetics produce different results due to the floating point
3915         precision.
3916         Since RenderText::computePreferredLogicalWidths() currently forces us to use the slow path
3917         (to retrieve fontfallback and glyph overflow information) the only alternative solution is to turn off the fast path
3918         for all runs that have been already measured using the slow path (which would be just wasteful).
3919
3920         Test: fast/text/fast-run-width-vs-slow-run-width.html
3921
3922         * platform/graphics/FontCascade.cpp:
3923         (WebCore::FontCascade::widthForSimpleText): Mimics WidthIterator::applyFontTransforms. Use the same set of arithmetics here.  
3924
3925 2017-02-24  Simon Fraser  <simon.fraser@apple.com>
3926
3927         Improve how multiple codegen-properties are handled in CSSProperties.json
3928         https://bugs.webkit.org/show_bug.cgi?id=168867
3929
3930         Reviewed by Zalan Bujtas.
3931
3932         To make upcoming metadata storage easier, it's better if property entries in CSSProperties.json
3933         are always hashes. One property (line-height) used an array, in order to represent settings for
3934         two different build flags (ENABLE_TEXT_AUTOSIZING and !ENABLE_TEXT_AUTOSIZING).
3935
3936         Fix by making "codegen-properties" optionally be an array. The relevant item is selected in
3937         removeInactiveCodegenProperties() and used to replace the array.
3938
3939         Sort @internalProprerties when generating code, otherwise the contents of isInternalCSSProperty()
3940         are unstable (the order in @allNames is not stable because it's the keys in a hash).
3941
3942         * css/CSSProperties.json:
3943         * css/makeprop.pl:
3944         (matchEnableFlags):
3945         (removeInactiveCodegenProperties):
3946         (isPropertyEnabled):
3947
3948 2017-02-24  Joseph Pecoraro  <pecoraro@apple.com>
3949
3950         [Resource Timing] Media elements initiated loads should set the initiatorType to their element name (video/audio)
3951         https://bugs.webkit.org/show_bug.cgi?id=168680
3952
3953         Reviewed by Youenn Fablet.
3954
3955         * html/HTMLMediaElement.cpp:
3956         (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
3957         Pass in the