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