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