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