W3C importer should be able to update the import expectations file
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-03-07  Chris Dumez  <cdumez@apple.com>
2
3         Align initEvent / initCustomEvent / initMessageEvent with the latest specification
4         https://bugs.webkit.org/show_bug.cgi?id=169176
5
6         Reviewed by Alex Christensen.
7
8         Align initEvent / initCustomEvent / initMessageEvent with the latest specification
9         after:
10         - https://github.com/whatwg/dom/pull/417
11         - https://github.com/whatwg/html/pull/2410
12
13         In particular, the following changes were made:
14         - initEvent: The length property now properly returns 1 instead of 3 as only the
15           first parameter is mandatory. We were already behaving correcting the the length
16           property value was wrong because we forgot to drop a hack from the bindings
17           generator.
18         - initCustomEvent: Make all parameters except the first optional. Previously, all
19           parameters were mandatory so this is safe.
20         - initMessageEvent: Drop the custom code and mark the first parameter as mandatory.
21           A side effect of dropping the custom code is that null is no longer considered as
22           valid input for the last parameter. The parameter is of type sequence<> and the
23           new behavior is consistent with the specification and Firefox. If it turns out to
24           break existing content, I'll make the parameter nullable in a follow-up.
25
26         No new tests, updated existing tests.
27
28         * bindings/js/JSMessageEventCustom.cpp:
29         * bindings/scripts/CodeGeneratorJS.pm:
30         (GeneratePropertiesHashTable):
31         * dom/CustomEvent.idl:
32         * dom/MessageEvent.idl:
33
34 2017-03-07  Antti Koivisto  <antti@apple.com>
35
36         Differentiate between pending head and body stylesheets in Style::Scope
37         https://bugs.webkit.org/show_bug.cgi?id=169277
38
39         Reviewed by Andreas Kling.
40
41         Split pending stylesheet node set into separate sets for head and body elements and processing instructions.
42
43         This tightens typing and will also be useful later.
44
45         * style/StyleScope.cpp:
46         (WebCore::Style::Scope::~Scope):
47         (WebCore::Style::Scope::addPendingSheet):
48         (WebCore::Style::Scope::removePendingSheet):
49         (WebCore::Style::Scope::didRemovePendingStylesheet):
50         (WebCore::Style::Scope::hasPendingSheet):
51         (WebCore::Style::Scope::hasPendingSheetInBody):
52         (WebCore::Style::Scope::hasProcessingInstructionWithPendingSheet): Deleted.
53         * style/StyleScope.h:
54         (WebCore::Style::Scope::hasPendingSheet): Deleted.
55         (WebCore::Style::Scope::hasPendingSheets): Deleted.
56         * style/StyleTreeResolver.cpp:
57         (WebCore::Style::hasLoadingStylesheet):
58
59             Just test for body stylesheets.
60
61         (WebCore::Style::TreeResolver::resolve):
62
63             Treat all before-body stylesheets uniformly.
64
65 2017-03-07  Antoine Quint  <graouts@apple.com>
66
67         [Modern Media Controls] Setting a valid source after an invalid one retains the invalid placard
68         https://bugs.webkit.org/show_bug.cgi?id=169280
69         <rdar://problem/30876078>
70
71         Reviewed by Jon Lee.
72
73         We need to track when a new load start to see if we might have recovered from an error
74         and hide the "invalid" placard.
75
76         Test: media/modern-media-controls/placard-support/placard-support-error-recover.html
77
78         * Modules/modern-media-controls/media/placard-support.js:
79         (PlacardSupport.prototype.get mediaEvents):
80
81 2017-03-07  Andy Estes  <aestes@apple.com>
82
83         REGRESSION (r213412): JPEG premultiplication tests fail under GuardMalloc
84         https://bugs.webkit.org/show_bug.cgi?id=169266
85
86         Reviewed by Tim Horton.
87
88         r213412 added functions to create a CGImageRef from a canvas image buffer, which were used
89         to create data: URLs and blobs. If JPEG premultiplication is applied, though,
90         WebCore::cgImage() would return an image with a data provider pointing to stack memory.
91
92         I fixed a similar issue in ImageBuffer::toCGImage() by leaking the reference to a
93         Uint8ClampedArray then creating a CGDataProviderRef with a releaseData function that adopts
94         the leaked reference.
95
96         We could take that approach in cgImage() too by allocating the premultiplied data buffer on
97         the heap then freeing it with a releaseData function, but it's simpler to refactor
98         toCGImage()/cgImage() to return an encoded image as a CFDataRef instead of a CFImageRef.
99         This ensures that a CGDataProviderRef never outlives the data it points to.
100
101         Covered by existing tests.
102
103         * platform/graphics/ImageBuffer.h: Renamed toCGImage() to toCFData().
104         * platform/graphics/cg/ImageBufferCG.cpp:
105         (WebCore::dataURL): Changed to take a CFDataRef.
106         (WebCore::dataVector): Renamed from data(). Changed to take a CFDataRef.
107         (WebCore::ImageBuffer::toDataURL): Changed to call toCFData().
108         (WebCore::ImageBuffer::toData): Ditto.
109         (WebCore::ImageBuffer::toCFData): Changed to return a CFDataRef after encoding the
110         CGImageRef that was previously returned.
111         (WebCore::cfData): Ditto.
112         (WebCore::dataURL): Changed to call cfData().
113         (WebCore::data): Ditto.
114         (WebCore::ImageBuffer::toCGImage): Renamed to ImageBuffer::toCFData().
115         (WebCore::cgImage): Renamed to WebCore::cfData().
116
117 2017-03-07  Myles C. Maxfield  <mmaxfield@apple.com>
118
119         Test fix after r213505
120         https://bugs.webkit.org/show_bug.cgi?id=169267
121
122         Unreviewed.
123
124         * platform/graphics/cocoa/FontCacheCoreText.cpp:
125         (WebCore::preparePlatformFont):
126
127 2017-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
128
129         Apply well-known-axis variation values at the right time in preparePlatformFont()
130         https://bugs.webkit.org/show_bug.cgi?id=168896
131
132         Reviewed by Jon Lee.
133
134         Simply plumb the FontSelectionRequest to the place where font variations are implemented.
135
136         Test: fast/text/variations/font-selection-properties.html
137
138         * platform/graphics/FontCache.h:
139         * platform/graphics/cocoa/FontCacheCoreText.cpp:
140         (WebCore::preparePlatformFont):
141         (WebCore::fontWithFamily):
142         (WebCore::FontCache::createFontPlatformData):
143         (WebCore::FontCache::systemFallbackForCharacters):
144         * platform/graphics/mac/FontCustomPlatformData.cpp:
145         (WebCore::FontCustomPlatformData::fontPlatformData):
146
147 2017-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
148
149         Unreviewed post-review fixup after r213464
150         https://bugs.webkit.org/show_bug.cgi?id=169255
151
152         * platform/graphics/FontCache.h:
153         (WebCore::FontDescriptionKey::FontDescriptionKey):
154         (WebCore::FontDescriptionKey::operator==):
155         (WebCore::FontDescriptionKey::computeHash):
156         (WebCore::FontDescriptionKey::makeFlagsKey):
157         * platform/graphics/cocoa/FontCacheCoreText.cpp:
158         (WebCore::computeNecessarySynthesis):
159
160 2017-03-06  Brent Fulgham  <bfulgham@apple.com>
161
162         Validate DOM after potentially destructive actions during parser insert operations
163         https://bugs.webkit.org/show_bug.cgi?id=169222
164         <rdar://problem/30689729>
165
166         Reviewed by Ryosuke Niwa.
167
168         Do not perform an insert operation if the next child's parent is no longer
169         part of the tree. This can happen if JavaScript runs during node removal
170         events and modifies the contents of the document.
171
172         This patch was inspired by a similar Blink change by Marius Mlynski:
173         <https://src.chromium.org/viewvc/blink?view=revision&revision=200690>        
174
175         Tests: fast/parser/scriptexec-during-parserInsertBefore.html
176
177         * html/parser/HTMLConstructionSite.cpp:
178         (WebCore::executeReparentTask):
179         (WebCore::executeInsertAlreadyParsedChildTask):
180
181 2017-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
182
183         Update isEmojiGroupCandidate() to the latest version of Unicode
184         https://bugs.webkit.org/show_bug.cgi?id=168198
185
186         Reviewed by Jon Lee.
187
188         In the latest version of Unicode, many more code points are candidates for emoji groups.
189         Therefore, isEmojiGroupCandidate() should be made more permissive. This way, the function
190         is more future-proof.
191
192         Test: editing/deleting/delete-emoji.html
193
194         * platform/text/CharacterProperties.h:
195         (WebCore::icuLibraryUnderstandsSupplementalSymbolsAndPictographs):
196         (WebCore::isEmojiGroupCandidate):
197
198 2017-03-06  Youenn Fablet  <youenn@apple.com>
199
200         Use default configuration for libwebrtc peerconnection
201         https://bugs.webkit.org/show_bug.cgi?id=169239
202
203         Reviewed by Alex Christensen.
204
205         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
206         (WebCore::configurationFromMediaEndpointConfiguration): Using the default configuration instead of the aggressive one.
207
208 2017-03-06  Fujii Hironori  <Hironori.Fujii@sony.com>
209
210         [CMake] SN-DBS fails to build: Cannot open include file: 'WebCoreTestSupportPrefix.h'
211         https://bugs.webkit.org/show_bug.cgi?id=169244
212
213         Reviewed by Alex Christensen.
214
215         A distributed build system SN-DBS can not find
216         WebCoreTestSupportPrefix.h without an include path to it.
217
218         * CMakeLists.txt: Add 'WebCore/testing/js' to include paths.
219
220 2017-03-06  Fujii Hironori  <Hironori.Fujii@sony.com>
221
222         [cairo] error C2065: 'quality': undeclared identifier since r213412
223         https://bugs.webkit.org/show_bug.cgi?id=169240
224
225         Reviewed by Ryosuke Niwa.
226
227         * platform/graphics/cairo/ImageBufferCairo.cpp:
228         (WebCore::ImageBuffer::toDataURL): Name the unnamed second argument 'quality'.
229
230 2017-03-06  Jiewen Tan  <jiewen_tan@apple.com>
231
232         [WebCrypto] Implement ECDH GenerateKey operation
233         https://bugs.webkit.org/show_bug.cgi?id=169093
234         <rdar://problem/23789585>
235
236         Reviewed by Brent Fulgham.
237
238         This patch implements GenerateKey operation of ECDH according to:
239         https://www.w3.org/TR/WebCryptoAPI/#ecdh-operations.
240         Note: Sad that we are not able to support P-521 at this moment due
241         to lack of necessary support in the underlying crypto library.
242
243         Tests: crypto/subtle/ec-generate-key-malformed-parameters.html
244                crypto/subtle/ecdh-generate-key-extractable.html
245                crypto/subtle/ecdh-generate-key-p256.html
246                crypto/subtle/ecdh-generate-key-p384.html
247                crypto/subtle/ecdh-generate-key-single-usage.html
248                crypto/workers/subtle/ec-generate-key.html
249
250         * CMakeLists.txt:
251         * DerivedSources.make:
252         * PlatformGTK.cmake:
253         * PlatformMac.cmake:
254         * WebCore.xcodeproj/project.pbxproj:
255         * bindings/js/JSCryptoKeyCustom.cpp:
256         (WebCore::JSCryptoKey::algorithm):
257         * bindings/js/JSSubtleCryptoCustom.cpp:
258         (WebCore::normalizeCryptoAlgorithmParameters):
259         (WebCore::jsSubtleCryptoFunctionGenerateKeyPromise):
260         Add support for ECDH.
261         * bindings/js/SerializedScriptValue.cpp:
262         (WebCore::CloneSerializer::write):
263         Structured clonable will be added later on.
264         * crypto/CommonCryptoUtilities.h:
265         Add SPI for EC.
266         * crypto/CryptoAlgorithmParameters.h:
267         * crypto/CryptoKey.h:
268         * crypto/algorithms/CryptoAlgorithmECDH.cpp: Added.
269         (WebCore::CryptoAlgorithmECDH::create):
270         (WebCore::CryptoAlgorithmECDH::identifier):
271         (WebCore::CryptoAlgorithmECDH::generateKey):
272         * crypto/algorithms/CryptoAlgorithmECDH.h: Added.
273         * crypto/gnutls/CryptoKeyECGnuTLS.cpp: Added.
274         (WebCore::CryptoKeyEC::~CryptoKeyEC):
275         (WebCore::CryptoKeyEC::platformGeneratePair):
276         * crypto/keys/CryptoKeyEC.cpp: Added.
277         (WebCore::CryptoKeyEC::CryptoKeyEC):
278         (WebCore::CryptoKeyEC::generatePair):
279         (WebCore::CryptoKeyEC::buildAlgorithm):
280         (WebCore::CryptoKeyEC::exportData):
281         * crypto/keys/CryptoKeyEC.h: Added.
282         (WebCore::EcKeyAlgorithm::EcKeyAlgorithm):
283         (WebCore::EcKeyAlgorithm::namedCurve):
284         * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
285         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
286         Add support for ECDH.
287         * crypto/mac/CryptoKeyECMac.cpp: Added.
288         (WebCore::CryptoKeyEC::~CryptoKeyEC):
289         (WebCore::CryptoKeyEC::platformGeneratePair):
290         * crypto/parameters/CryptoAlgorithmEcKeyParams.h: Added.
291         * crypto/parameters/EcKeyParams.idl: Added.
292
293 2017-03-06  Michael Catanzaro  <mcatanzaro@igalia.com>
294
295         Unreviewed, fix unused parameter warning after r213464
296
297         * platform/graphics/freetype/FontCacheFreeType.cpp:
298         (WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
299
300 2017-03-06  Michael Saboff  <msaboff@apple.com>
301
302         Take advantage of fast permissions switching of JIT memory for devices that support it
303         https://bugs.webkit.org/show_bug.cgi?id=169155
304
305         Reviewed by Saam Barati.
306
307         Updated the Xcode config files to match what is in the JavaScriptCore ones.
308
309         * Configurations/Base.xcconfig:
310         * Configurations/FeatureDefines.xcconfig:
311         * Configurations/WebCore.xcconfig:
312
313 2017-03-06  Aakash Jain  <aakash_jain@apple.com>
314
315         Make WKMenuItemIdentifiersPrivate.h private header
316         https://bugs.webkit.org/show_bug.cgi?id=168981
317
318         Reviewed by Tim Horton.
319
320         * platform/spi/mac/NSMenuSPI.h: NSUserInterfaceItemIdentification is in the public header in recent SDKs.
321
322 2017-03-06  Dave Hyatt  <hyatt@apple.com>
323
324         REGRESSION: Block no longer shrinks to preferred width in this flex box layout
325         https://bugs.webkit.org/show_bug.cgi?id=169203
326         <rdar://problem/30873895>
327
328         Reviewed by Simon Fraser.
329
330         Added new test in css3/flexbox.
331
332         * css/StyleResolver.cpp:
333         (WebCore::StyleResolver::adjustRenderStyle):
334         (WebCore::StyleResolver::adjustStyleForAlignment):
335         * html/shadow/TextControlInnerElements.cpp:
336         (WebCore::TextControlInnerElement::resolveCustomStyle):
337         Resolve auto alignment values by adjusting the render style as needed. Make a helper
338         function for adjusting only alignment that can be called from the inner text control
339         custom style creation.
340
341         * rendering/GridTrackSizingAlgorithm.cpp:
342         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild):
343         Replaced items in grids should not stretch by default.
344
345         * rendering/RenderBox.cpp:
346         (WebCore::RenderBox::hasStretchedLogicalWidth):
347         Patched to properly check the default alignment for the child, making sure
348         that if it's a replacd item inside a grid, that the default is start and not
349         stretch.
350
351         * rendering/RenderBox.h:
352         (WebCore::RenderBox::selfAlignmentNormalBehavior):
353         Self-alignment function now takes an optional child argument, since the behavior
354         varies in grids depending on the child being replaced or not.
355
356         * rendering/RenderFlexibleBox.cpp:
357         (WebCore::RenderFlexibleBox::alignmentForChild):
358         Fixed to do the right thing when the child is anonymous.
359
360         (WebCore::RenderFlexibleBox::styleDidChange): Deleted.
361         * rendering/RenderFlexibleBox.h:
362         Deleted, since alignment changes are handled at the style diff level now.
363
364         * rendering/RenderFullScreen.h:
365         Patched the selfAlignmentNormalBehavior method to take an optional child argument.
366
367         * rendering/RenderGrid.cpp:
368         (WebCore::RenderGrid::styleDidChange):
369         (WebCore::RenderGrid::alignSelfForChild):
370         (WebCore::RenderGrid::justifySelfForChild):
371         (WebCore::RenderGrid::columnAxisPositionForChild):
372         (WebCore::RenderGrid::rowAxisPositionForChild):
373         (WebCore::RenderGrid::columnAxisOffsetForChild):
374         (WebCore::RenderGrid::rowAxisOffsetForChild):
375         (WebCore::defaultAlignmentIsStretch): Deleted.
376         (WebCore::defaultAlignmentChangedToStretchInRowAxis): Deleted.
377         (WebCore::defaultAlignmentChangedFromStretchInRowAxis): Deleted.
378         (WebCore::defaultAlignmentChangedFromStretchInColumnAxis): Deleted.
379         (WebCore::selfAlignmentChangedToStretchInRowAxis): Deleted.
380         (WebCore::selfAlignmentChangedFromStretchInRowAxis): Deleted.
381         (WebCore::selfAlignmentChangedFromStretchInColumnAxis): Deleted.
382         * rendering/RenderGrid.h:
383         Removed the alignment change logic in styleDidChange for grids, since style diffing handles
384         it now. Updated all selfAlignmentForNormalBehavior queries to pass in the child so that
385         replaced elements are handled properly.
386
387         * rendering/style/RenderStyle.h:
388         (WebCore::RenderStyle::overflowInlineDirection):
389         (WebCore::RenderStyle::overflowBlockDirection):
390         (WebCore::RenderStyle::setJustifySelfPosition):
391         New helpers used by grid and by adjustRenderStyle.
392
393         * style/StyleChange.cpp:
394         (WebCore::Style::determineChange):
395         If alignment or justification changes occur on a parent that could affect the child (e.g., align-items)
396         return Inherit so the child render styles get adjusted properly.
397
398 2017-03-06  Youenn Fablet  <youenn@apple.com>
399
400         ASSERTION FAILED: numberOfChannels == 2 in WebCore::RealtimeIncomingAudioSource::OnData
401         https://bugs.webkit.org/show_bug.cgi?id=169224
402         <rdar://problem/30856811>
403
404         Reviewed by Alex Christensen.
405
406         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
407         (WebCore::RealtimeIncomingAudioSource::OnData): Updated assertion to allow 1 channel since we can handle it as well.
408
409 2017-03-06  Chris Dumez  <cdumez@apple.com>
410
411         [iOS] Throttle CSS animations to 30fps in low power mode
412         https://bugs.webkit.org/show_bug.cgi?id=169138
413         <rdar://problem/30837805>
414
415         Reviewed by Said Abou-Hallawa.
416
417         Throttle software CSS animations to 30fps in low power mode on iOS
418         to save battery.
419
420         Test: fast/animation/css-animation-throttling-lowPowerMode.html
421
422         * page/Page.cpp:
423         (WebCore::Page::handleLowModePowerChange):
424         * page/animation/CSSAnimationController.cpp:
425         (WebCore::CSSAnimationControllerPrivate::CSSAnimationControllerPrivate):
426         (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer):
427         (WebCore::CSSAnimationControllerPrivate::updateThrottlingState):
428         (WebCore::CSSAnimationControllerPrivate::animationInterval):
429         (WebCore::CSSAnimationControllerPrivate::beginAnimationUpdateTime):
430         (WebCore::CSSAnimationControllerPrivate::beginAnimationUpdate):
431         (WebCore::CSSAnimationController::updateThrottlingState):
432         (WebCore::CSSAnimationController::animationInterval):
433         * page/animation/CSSAnimationController.h:
434         * page/animation/CSSAnimationControllerPrivate.h:
435         * testing/Internals.cpp:
436         (WebCore::Internals::animationsInterval):
437         * testing/Internals.h:
438         * testing/Internals.idl:
439
440 2017-03-03  Matt Rajca  <mrajca@apple.com>
441
442         Media: notify clients when the user never plays a media element that was prevented from auto-playing
443         https://bugs.webkit.org/show_bug.cgi?id=169150
444
445         Reviewed by Alex Christensen.
446
447         Added API tests.
448
449         * html/HTMLMediaElement.cpp:
450         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
451         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
452         * page/AutoplayEvent.h:
453
454 2017-03-06  Alex Christensen  <achristensen@webkit.org>
455
456         Refactor ContentExtensionParser
457         https://bugs.webkit.org/show_bug.cgi?id=169214
458
459         Reviewed by Brady Eidson.
460
461         No change in behavior, as verified by existing API tests.
462         This will make it easier to use getStringList for other things in coming patches.
463
464         * contentextensions/ContentExtensionParser.cpp:
465         (WebCore::ContentExtensions::getStringList):
466         (WebCore::ContentExtensions::getDomainList):
467
468 2017-03-06  Alex Christensen  <achristensen@webkit.org>
469
470         Fix URLs relative to file URLs with paths beginning with Windows drive letters
471         https://bugs.webkit.org/show_bug.cgi?id=169178
472
473         Reviewed by Tim Horton.
474
475         Windows drives in file URLs can begin with windows drive letters, such as file:///C:/
476         which should not be removed when making other URLs relative to them.
477         See https://url.spec.whatwg.org/#file-slash-state
478
479         Covered by new API tests and newly passing web-platform-tests.
480
481         * platform/URLParser.cpp:
482         (WebCore::URLParser::copyBaseWindowsDriveLetter):
483         (WebCore::URLParser::copyASCIIStringUntil):
484         (WebCore::URLParser::parse):
485         * platform/URLParser.h:
486
487 2017-03-06  Simon Fraser  <simon.fraser@apple.com>
488
489         Only use layer backing store which supports subpixel antialiased text if we know subpixel antialiased will be painted into it
490         https://bugs.webkit.org/show_bug.cgi?id=169191
491
492         Reviewed by Zalan Bujtas.
493
494         Instead of unconditionally calling setSupportsSubpixelAntialiasedText() on GraphicsLayers created
495         by RenderLayerBacking, only do so when we know (or suspect) that a layer contains smoothed text.
496         
497         This is done by enhancing RenderLayer::isVisuallyNonEmpty() and RenderLayer::hasNonEmptyChildRenderers()
498         to take a PaintedContentRequest parameter, which allows the caller to specify what qualities of
499         the layer contents it is interested in. Most of the time, this is just any painted content, but on
500         platforms where GraphicsLayer::supportsSubpixelAntialiasedLayerText() returns true, the query also
501         asks about whether the layer will contain subpixel-antialiased text. In this case, it can't early
502         return as soon as painted content is found; it must keep iterating renderers while all the query 
503         requests are unsatisfied, or until it hits depth or sibling limits. If a limit is hit, we take the
504         same path of assuming there is subpixel-antialiased text (via the "Undetermined" state).
505
506         RenderLayerBacking also makes use of PaintedContentRequest during its non-composited child layer walk.
507
508         To offset the additional cost of this tree walking, RenderLayerBacking now caches information about its
509         painted content for the duration of a single update via PaintedContentsInfo, so we no longer call
510         isDirectlyCompositedImage() and isSimpleContainerCompositingLayer() multiple times per backing per update.
511         The traversal code here too now has to continue until all necessary states in the request have been computed.
512         
513         Add some functions to RenderImage so that we know if it's showing the alt text or has a non-bitmap image
514         (which may contain text).
515         
516         Subpixel-antialiased ("smoothed") text is disabled by DRT and WTR by default, so we need Internals API to enable it.
517         
518         Platforms now express their support for subpixel-antialiased text via GraphicsLayer::supportsSubpixelAntialiasedLayerText()
519         which only returns true on Mac.
520
521         Tests: compositing/contents-format/subpixel-antialiased-text-configs-antialiasing-style.html
522                compositing/contents-format/subpixel-antialiased-text-configs.html
523                compositing/contents-format/subpixel-antialiased-text-images.html
524                compositing/contents-format/subpixel-antialiased-text-visibility.html
525
526         * platform/graphics/GraphicsLayer.cpp:
527         (WebCore::GraphicsLayer::supportsSubpixelAntialiasedLayerText):
528         * platform/graphics/GraphicsLayer.h:
529         * platform/graphics/ca/GraphicsLayerCA.cpp:
530         (WebCore::GraphicsLayer::supportsSubpixelAntialiasedLayerText):
531         (WebCore::GraphicsLayerCA::changeLayerTypeTo):
532         * rendering/RenderImage.cpp:
533         (WebCore::RenderImage::isShowingMissingOrImageError):
534         (WebCore::RenderImage::isShowingAltText):
535         (WebCore::RenderImage::hasNonBitmapImage):
536         * rendering/RenderImage.h:
537         * rendering/RenderLayer.cpp:
538         (WebCore::RenderLayer::calculateClipRects):
539         * rendering/RenderLayer.h:
540         * rendering/RenderLayerBacking.cpp:
541         (WebCore::PaintedContentsInfo::PaintedContentsInfo):
542         (WebCore::PaintedContentsInfo::setWantsSubpixelAntialiasedTextState):
543         (WebCore::PaintedContentsInfo::paintsBoxDecorations):
544         (WebCore::PaintedContentsInfo::paintsContent):
545         (WebCore::PaintedContentsInfo::paintsSubpixelAntialiasedText):
546         (WebCore::PaintedContentsInfo::isSimpleContainer):
547         (WebCore::PaintedContentsInfo::isDirectlyCompositedImage):
548         (WebCore::PaintedContentsInfo::paintsBoxDecorationsDetermination):
549         (WebCore::PaintedContentsInfo::paintsContentDetermination):
550         (WebCore::PaintedContentsInfo::paintsSubpixelAntialiasedTextDetermination):
551         (WebCore::PaintedContentsInfo::contentsTypeDetermination):
552         (WebCore::RenderLayerBacking::createGraphicsLayer):
553         (WebCore::RenderLayerBacking::updateConfiguration):
554         (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect):
555         (WebCore::RenderLayerBacking::updateAfterDescendants):
556         (WebCore::RenderLayerBacking::updateDirectlyCompositedBoxDecorations):
557         (WebCore::RenderLayerBacking::updateDrawsContent):
558         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
559         (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundImage):
560         (WebCore::RenderLayerBacking::paintsContent):
561         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
562         (WebCore::RenderLayerBacking::isPaintDestinationForDescendantLayers):
563         (WebCore::RenderLayerBacking::hasVisibleNonCompositedDescendants):
564         (WebCore::RenderLayerBacking::containsPaintedContent):
565         (WebCore::RenderLayerBacking::contentChanged):
566         (WebCore::RenderLayerBacking::updateImageContents):
567         (WebCore::RenderLayerBacking::paintsChildRenderers): Deleted.
568         * rendering/RenderLayerBacking.h:
569         * rendering/RenderLayerCompositor.cpp:
570         (WebCore::RenderLayerCompositor::logLayerInfo):
571         * testing/Internals.cpp:
572         (WebCore::Internals::setFontSmoothingEnabled):
573         * testing/Internals.h:
574         * testing/Internals.idl:
575
576 2017-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
577
578         Expand font-weight and font-stretch to take any number
579         https://bugs.webkit.org/show_bug.cgi?id=168889
580
581         Reviewed by Simon Fraser.
582
583         This patch expands parsing support for font-weight and font-stretch so that they can accept
584         numbers in addition to the keyword values they accepted previously. Eventually, these numbers
585         will be used as inputs to select variation fonts; however, in this patch, the values are just
586         parsed and held in our internal data model. This means that this patch doesn't actually change
587         the general behavior of WebKit; instead, it parses new values, outputs them (via
588         getComputedStyle() and similar functions), and provides them as input to our preexisting font
589         selection algorithm. 
590
591         This patch doesn't actually modify anything algorithmically, and therefore, it doesn't include
592         any additional tests for the font selection algorithm. Instead, it tests the parsing of the
593         newly accepted values (both input and output).
594
595         Because our internal data model needs to hold numbers now, this patch also completely eliminates
596         the FontWidth, FontItalic, and FontTraitsMask enum values in favor of FontSelectionValues (which
597         can hold numbers instead of individual enum values). Therefore, every place which we were using
598         these enum values is migrated in this patch to using FontSelectionValues instead.
599
600         Tests: fast/text/font-selection-font-face-parse.html
601                fast/text/font-selection-font-loading-api-parse.html
602                fast/text/font-style-parse.html
603                fast/text/font-weight-parse.html
604
605         * accessibility/AccessibilityRenderObject.cpp: Migrate off of old enum types.
606         (WebCore::AccessibilityRenderObject::hasBoldFont):
607         (WebCore::AccessibilityRenderObject::hasItalicFont):
608         (WebCore::AccessibilityRenderObject::hasPlainText):
609         * accessibility/atk/WebKitAccessibleInterfaceText.cpp: Ditto.
610         (getAttributeSetForAccessibilityObject):
611         * css/CSSComputedStyleDeclaration.cpp: Output newly parsed values.
612         (WebCore::fontWeightFromStyle):
613         (WebCore::fontStretchFromStyle):
614         (WebCore::fontStyleFromStyle):
615         (WebCore::fontShorthandValueForSelectionProperties):
616         (WebCore::ComputedStyleExtractor::propertyValue):
617         * css/CSSFontFace.cpp: Migrate off old enum types.
618         (WebCore::calculateWeightRange):
619         (WebCore::CSSFontFace::setWeight):
620         (WebCore::calculateStretchRange):
621         (WebCore::CSSFontFace::setStretch):
622         (WebCore::calculateStyleRange):
623         (WebCore::CSSFontFace::setStyle):
624         (WebCore::CSSFontFace::calculateStyleMask): Deleted.
625         (WebCore::CSSFontFace::calculateWeightMask): Deleted.
626         (WebCore::CSSFontFace::calculateStretch): Deleted.
627         * css/CSSFontFace.h:
628         * css/CSSFontFaceSet.cpp: Migrate off old enum types.
629         (WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered):
630         (WebCore::calculateWeightValue):
631         (WebCore::calculateStretchValue):
632         (WebCore::calculateStyleValue):
633         (WebCore::computeFontSelectionRequest):
634         (WebCore::CSSFontFaceSet::matchingFaces):
635         (WebCore::CSSFontFaceSet::fontFace):
636         (WebCore::computeFontTraitsMask): Deleted.
637         (WebCore::computeFontStretch): Deleted.
638         * css/CSSFontFaceSet.h:
639         * css/CSSFontSelector.cpp: Migrate off old enum types.
640         (WebCore::CSSFontSelector::fontRangesForFamily):
641         * css/CSSPrimitiveValueMappings.h: font-weight and font-style are no longer
642         keyword properties.
643         (WebCore::CSSPrimitiveValue::operator FontWeight): Deleted.
644         (WebCore::CSSPrimitiveValue::operator FontItalic): Deleted.
645         * css/CSSProperties.json: Use the same infrastructure for all three of the
646         font selection properties.
647         * css/CSSSegmentedFontFace.cpp: Migrate off old enum types.
648         (WebCore::CSSSegmentedFontFace::fontRanges):
649         * css/CSSValueKeywords.in: The 100-based font-weight values are now represented
650         as real numbers.
651         * css/FontFace.cpp: Update the string output functions for the new values.
652         (WebCore::rangeIsSingleValue):
653         (WebCore::FontFace::style):
654         (WebCore::FontFace::weight):
655         (WebCore::FontFace::stretch):
656         * css/StyleBuilderConverter.h: Use CSSValue conversion functions to convert
657         to our new data model.
658         (WebCore::StyleBuilderConverter::convertFontWeight):
659         (WebCore::StyleBuilderConverter::convertFontStretch):
660         (WebCore::StyleBuilderConverter::convertFontStyle):
661         * css/StyleBuilderCustom.h: font-weight is no longer a completely custom
662         property.
663         (WebCore::StyleBuilderCustom::applyInitialFontWeight): Deleted.
664         (WebCore::StyleBuilderCustom::applyInheritFontWeight): Deleted.
665         (WebCore::StyleBuilderCustom::applyValueFontWeight): Deleted.
666         * css/parser/CSSParserFastPaths.cpp: font-style is no longer a keyword property.
667         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
668         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
669         * css/parser/CSSPropertyParser.cpp: Parse the new values in the font selection
670         properties.
671         (WebCore::consumeFontWeightKeywordValue):
672         (WebCore::consumeFontWeightCSS21):
673         (WebCore::consumeFontWeight):
674         (WebCore::consumeFontStyleKeywordValue):
675         (WebCore::consumeFontStyle):
676         (WebCore::CSSPropertyParser::parseSingleValue):
677         (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
678         (WebCore::CSSPropertyParser::consumeSystemFont):
679         (WebCore::CSSPropertyParser::consumeFont):
680         * editing/EditingStyle.cpp: Migrate off old enum types.
681         (WebCore::fontWeightIsBold):
682         * editing/mac/EditorMac.mm: Ditto.
683         (WebCore::Editor::applyFontStyles):
684         * platform/graphics/FontCache.h: Unify our font selection values into
685         their enclosing struct, FontSelectionCapabilities. Also, clean up utility
686         functions.
687         * platform/graphics/FontCascade.cpp: Migrate off old enum types.
688         (WebCore::FontCascade::FontCascade):
689         * platform/graphics/FontCascade.h: Ditto.
690         (WebCore::FontCascade::italic):
691         (WebCore::FontCascade::weight):
692         * platform/graphics/FontDescription.cpp: Ditto.
693         (WebCore::FontDescription::FontDescription):
694         (WebCore::FontCascadeDescription::lighterWeight):
695         (WebCore::FontCascadeDescription::bolderWeight):
696         (WebCore::FontDescription::traitsMask): Deleted.
697         * platform/graphics/FontDescription.h: Migrate off old enum types.
698         (WebCore::FontDescription::italic):
699         (WebCore::FontDescription::stretch):
700         (WebCore::FontDescription::weight):
701         (WebCore::FontDescription::fontSelectionRequest):
702         (WebCore::FontDescription::computedPixelSize):
703         (WebCore::FontDescription::setItalic):
704         (WebCore::FontDescription::setStretch):
705         (WebCore::FontDescription::setIsItalic):
706         (WebCore::FontDescription::setWeight):
707         (WebCore::FontDescription::operator==):
708         (WebCore::FontCascadeDescription::lighterWeight):
709         (WebCore::FontCascadeDescription::bolderWeight):
710         (WebCore::FontCascadeDescription::initialItalic):
711         (WebCore::FontCascadeDescription::initialWeight):
712         (WebCore::FontCascadeDescription::initialStretch):
713         * platform/graphics/FontSelectionAlgorithm.cpp: Delete code which was only
714         present to convert from the old enum types to the new FontSelectionRequest
715         type.
716         (WebCore::fontSelectionRequestForTraitsMask): Deleted.
717         (WebCore::initialFontSelectionCapabilitiesForTraitsMask): Deleted.
718         (WebCore::fontSelectionCapabilitiesForTraitsMask): Deleted.
719         * platform/graphics/FontSelectionAlgorithm.h: Migrate to new named functions
720         for special values.
721         (WebCore::isItalic):
722         (WebCore::boldWeightValue):
723         (WebCore::normalWeightValue):
724         (WebCore::isFontWeightBold):
725         (WebCore::normalStretchValue):
726         (WebCore::FontSelectionRequest::FontSelectionRequest):
727         * platform/graphics/cocoa/FontCacheCoreText.cpp: Migrate all platforms which
728         compile this file to know about FontDatabase. This simplifies the interaction
729         between @font-face fonts and installed fonts. Also, migrate off old enum types.
730         (WebCore::stretchFromCoreTextTraits):
731         (WebCore::fontWeightFromCoreText):
732         (WebCore::capabilitiesForFontDescriptor):
733         (WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
734         (WebCore::platformFontLookupWithFamily):
735         (WebCore::invalidateFontCache):
736         (WebCore::fontWithFamily):
737         (WebCore::FontCache::createFontPlatformData):
738         (WebCore::lookupFallbackFont):
739         (WebCore::toTraitsMask): Deleted.
740         (WebCore::isFontWeightBold): Deleted.
741         (WebCore::toCoreTextFontWeight): Deleted.
742         (): Deleted.
743         (WebCore::FontDatabase::capabilitiesForFontDescriptor): Deleted.
744         (WebCore::calculateFontSelectionRequest): Deleted.
745         * platform/graphics/freetype/FontCacheFreeType.cpp: Migrate off old enum types.
746         (WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
747         (WebCore::fontWeightToFontconfigWeight):
748         (): Deleted.
749         * platform/graphics/freetype/FontPlatformDataFreeType.cpp: Ditto.
750         (WebCore::FontPlatformData::FontPlatformData):
751         * platform/graphics/ios/FontCacheIOS.mm: Ditto.
752         (WebCore::baseSystemFontDescriptor):
753         (WebCore::systemFontModificationAttributes):
754         (WebCore::systemFontDescriptor):
755         (WebCore::platformFontWithFamilySpecialCase):
756         (WebCore::FontCache::weightOfCTFont): Deleted.
757         * platform/graphics/mac/FontCacheMac.mm: Ditto.
758         (WebCore::toNSFontWeight):
759         (WebCore::platformFontWithFamilySpecialCase):
760         * platform/graphics/win/FontCacheWin.cpp: Ditto.
761         (WebCore::toGDIFontWeight):
762         (WebCore::traitsInFamilyEnumProc):
763         (WebCore::FontCache::getFontSelectionCapabilitiesInFamily):
764         (): Deleted.
765         * platform/mock/MockRealtimeVideoSource.cpp: Ditto.
766         (WebCore::MockRealtimeVideoSource::applySize):
767         * platform/text/TextFlags.h: Delete old enum types.
768         * platform/win/DragImageWin.cpp: Migrate off old enum types.
769         (WebCore::dragLabelFont):
770         * rendering/RenderEmbeddedObject.cpp: Ditto.
771         (WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
772         * rendering/RenderThemeGtk.cpp: Ditto.
773         (WebCore::RenderThemeGtk::updateCachedSystemFontDescription):
774         * rendering/RenderThemeIOS.mm: Ditto.
775         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
776         * rendering/RenderThemeMac.mm: Ditto.
777         (WebCore::toFontWeight):
778         * rendering/RenderThemeWin.cpp: Ditto.
779         (WebCore::fillFontDescription):
780
781 2017-03-06  Chris Dumez  <cdumez@apple.com>
782
783         [iOS] Disable autoplay of silent videos in low power mode
784         https://bugs.webkit.org/show_bug.cgi?id=168985
785         <rdar://problem/30739051>
786
787         Reviewed by Jer Noble.
788
789         Disable autoplay of silent videos in low power mode on iOS to save battery.
790         We force the display of the start button when denying autoplay in low power
791         mode to allow the user to start playback.
792
793         Test: media/modern-media-controls/start-support/start-support-lowPowerMode.html
794
795         * Modules/mediacontrols/MediaControlsHost.cpp:
796         (WebCore::MediaControlsHost::shouldForceControlsDisplay):
797         * Modules/mediacontrols/MediaControlsHost.h:
798         * Modules/mediacontrols/MediaControlsHost.idl:
799         Add shouldForceControlsDisplay property on MediaControlsHost. This property
800         is set to true when we want to force the display for media controls. Currently,
801         this only returns true for autoplay videos, while in low power mode.
802
803         * Modules/modern-media-controls/media/controls-visibility-support.js:
804         (ControlsVisibilitySupport.prototype._updateControls):
805         Take into consideration MediaControlsHost.shouldForceControlsDisplay when
806         initializing shouldShowControls variable.
807
808         * Modules/modern-media-controls/media/start-support.js:
809         (StartSupport.prototype._shouldShowStartButton):
810         Show the start button when MediaControlsHost.shouldForceControlsDisplay
811         returns true.
812
813         * html/HTMLMediaElement.cpp:
814         (WebCore::HTMLMediaElement::HTMLMediaElement):
815         Add MediaElementSession::RequireUserGestureForVideoDueToLowPowerMode restriction
816         to the session when low power mode is enabled so we know we need to force a
817         gesture to start playback of autoplay videos.
818
819         (WebCore::HTMLMediaElement::shouldForceControlsDisplay):
820         Add convenience function to decide if we should force display of media controls.
821         This returns true if the media element is a video with autoplay attribute and
822         its session has the MediaElementSession::RequireUserGestureForVideoDueToLowPowerMode
823         restriction (i.e. we are in low power mode).
824
825         (WebCore::HTMLMediaElement::configureMediaControls):
826         Force requireControls variable to true if shouldForceControlsDisplay() returns
827         true. We do this here instead of inside HTMLMediaElement::controls() because
828         we do not want to change the value of media.controls exposed to JavaScript.
829
830         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
831         Add MediaElementSession::RequireUserGestureForVideoDueToLowPowerMode to the list
832         of restrictions that get removed on user gesture.
833
834         * html/MediaElementSession.cpp:
835         (WebCore::MediaElementSession::playbackPermitted):
836         Deny playback for videos that have the RequireUserGestureForVideoDueToLowPowerMode
837         restriction unless there is a user gesture.
838
839         * html/MediaElementSession.h:
840         Add new MediaElementSession::RequireUserGestureForVideoDueToLowPowerMode
841         restriction.
842
843 2017-03-06  Chris Dumez  <cdumez@apple.com>
844
845         LayoutTest fast/dom/timer-throttling-hidden-page.html is a flaky failure
846         https://bugs.webkit.org/show_bug.cgi?id=168927
847
848         Reviewed by Simon Fraser.
849
850         Update internals.isTimerThrottled() to return true for any kind of throttling.
851         It used to only account only for specific timers that do not cause changes
852         inside the viewport. It now accounts for all kind of throttling, such as
853         timer alignment due to the page being hidden.
854
855         * page/DOMTimer.h:
856         * testing/Internals.cpp:
857         (WebCore::Internals::isTimerThrottled):
858
859 2017-03-06  Dave Hyatt  <hyatt@apple.com>
860
861         Enable fieldsets to be flexboxes, grids and multicolumn.
862         https://bugs.webkit.org/show_bug.cgi?id=169082
863
864         Reviewed by Simon Fraser .
865
866         Added new tests in fast/forms/fieldset.
867
868         This patch eliminates RenderFieldset and moves the functionality into RenderBlock so that
869         derived classes can also be fieldsets.
870
871         * CMakeLists.txt:
872         * WebCore.xcodeproj/project.pbxproj:
873         Remove RenderFieldset from the project.
874
875         * accessibility/AccessibilityRenderObject.cpp:
876         (WebCore::AccessibilityRenderObject::titleUIElement):
877         Call in to RenderBlock now instead of RenderFieldset.
878
879         * html/HTMLFieldSetElement.cpp:
880         (WebCore::HTMLFieldSetElement::createElementRenderer):
881         * html/HTMLFieldSetElement.h:
882         The fieldset DOM element now uses RenderElement::createFor to make renderers so that multiple display types
883         can be supported. A special flag has been added that indicates only to make flexbox and block-related
884         renderers (not table display types).
885
886         * rendering/OrderIterator.cpp:
887         (WebCore::OrderIterator::shouldSkipChild):
888         (WebCore::OrderIteratorPopulator::collectChild):
889         * rendering/OrderIterator.h:
890         Streamline child collection for flexboxes and grids to indicate whether the child should be skipped as a return
891         value from collectChild. Add a shouldSkipChild method that skips both out of flow positioned objects and
892         excluded children like the legends of fieldsets.
893
894         * rendering/RenderBlock.cpp:
895         (WebCore::RenderBlockRareData::RenderBlockRareData):
896         When the legend is taller than the fieldset's borderBefore(), intrinsic border is added to the CSS border width.
897         This intrinsic border being factored in ensures that the padding and content boxes of fieldsets are correct
898         across any layout system, since the legend is now just treated as part of the border.
899
900         (WebCore::RenderBlock::computePreferredLogicalWidths):
901         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
902         Call the new computePreferredWidthsForExcludedChildren to ensure that excluded children contribute to
903         preferred width in their own way and not as part of a specific layout system.
904
905         (WebCore::RenderBlock::renderName):
906         Hacked to still return RenderFieldSet for RenderBlockFlow-backed fieldsets for layout test compatibility.
907
908         (WebCore::RenderBlock::layoutExcludedChildren):
909         Renamed from layoutSpecialExcludedChild to more accurately reflect the fact that multiple excluded children
910         can be included here (e.g., both a multicolumn flow thread and a legend). The RenderBlock base class handles
911         the layout of legends by both placing them and setting the correct intrinsic border before amount on the
912         block.
913
914         (WebCore::RenderBlock::findFieldsetLegend):
915         Moved from RenderFieldset.
916
917         (WebCore::RenderBlock::adjustBorderBoxRectForPainting):
918         (WebCore::RenderBlock::paintRectToClipOutFromBorder):
919         These methods are used when painting to shrink the border box as needed to account for the legend and to
920         provide the portion of the border that needs to be clipped out. These methods have been enhanced to
921         properly support all writing modes.
922
923         (WebCore::RenderBlock::intrinsicBorderForFieldset):
924         (WebCore::RenderBlock::setIntrinsicBorderForFieldset):
925         (WebCore::RenderBlock::borderTop):
926         (WebCore::RenderBlock::borderLeft):
927         (WebCore::RenderBlock::borderBottom):
928         (WebCore::RenderBlock::borderRight):
929         (WebCore::RenderBlock::borderBefore):
930         These methods are overridden for border to ensure that the intrinsic border added by a tall legend is
931         properly factored in.
932
933         (WebCore::RenderBlock::computePreferredWidthsForExcludedChildren):
934         * rendering/RenderBlock.h:
935         This method computes the preferred widths for legend children in order to ensure that the legend properly
936         grows the width of the fieldset when it is the widest item.
937
938         (WebCore::RenderBlock::adjustBorderBoxLogicalHeightForBoxSizing):
939         (WebCore::RenderBlock::adjustContentBoxLogicalHeightForBoxSizing):
940         Preserve the behavior of fieldsets in that the available content size includes the space lost accounting
941         for the legend. I don't think this makes much sense, but it matches the behavior of other browsers
942         (and our old behavior).
943
944         (WebCore::RenderBlock::paintExcludedChildrenInBorder):
945         Method for painting the excluded children that might be present in our border. We only do this if the
946         paint phase is a box decoration painting phase and if the legend isn't self-painting.
947
948         * rendering/RenderBlockFlow.cpp:
949         (WebCore::RenderBlockFlow::willCreateColumns):
950         Allow fieldsets to create columns now.
951
952         (WebCore::RenderBlockFlow::layoutBlockChildren):
953         (WebCore::RenderBlockFlow::layoutExcludedChildren):
954         Renamed this method and change it to call the base class to ensure that legends in multicolumn fieldsets
955         get handled properly.
956
957         (WebCore::RenderBlockFlow::addChild):
958         Patched to make sure legends don't get put into the multicolumn flow thread, as they need to
959         remain outside of it.
960
961         (WebCore::RenderBlockFlow::layoutSpecialExcludedChild): Deleted.
962         Renamed to layoutExcludedChildren.
963
964         * rendering/RenderBlockFlow.h:
965         * rendering/RenderBox.cpp:
966         (WebCore::RenderBox::paintBoxDecorations):
967         (WebCore::RenderBox::paintMask):
968         Patched to call the new adjustBorderBoxRectForPainting and paintRectToClipOutFromBorder methods in
969         order to properly shrink the border box rect for painting and to clip out the portion of the border
970         covered by the legend.
971
972         (WebCore::RenderBox::avoidsFloats):
973         Add fieldsets as avoiding floats. RenderFieldset used to subclass this method to return true, but with
974         its removal, we need to put this in the base class along with legends.
975
976         * rendering/RenderBox.h:
977         (WebCore::RenderBox::isGridItem):
978         (WebCore::RenderBox::isFlexItem):
979         Patched to exclude legends so that they don't try to size like they are really in the grid or flexbox.
980
981         (WebCore::RenderBox::adjustBorderBoxRectForPainting):
982         This method is overridden by RenderBLock to handle adjusting fieldset border rects for painting.
983
984         * rendering/RenderBoxModelObject.cpp:
985         (WebCore::RenderBoxModelObject::paintBorder):
986         * rendering/RenderBoxModelObject.h:
987         (WebCore::RenderBoxModelObject::paintRectToClipOutFromBorder):
988         Patched to properly paint fieldsets using the new helpers.
989
990         * rendering/RenderDeprecatedFlexibleBox.cpp:
991         (WebCore::FlexBoxIterator::next):
992         (WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
993         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
994         Make sure deprecated flexible boxes lay out their legends properly by calling layoutExcludedChildren.
995
996         * rendering/RenderElement.cpp:
997         (WebCore::RenderElement::createFor):
998         * rendering/RenderElement.h:
999         Patched to take a flag that limits what renderers can be created so that fieldsets don't make table
1000         display types.
1001
1002         * rendering/RenderFieldset.cpp: Removed.
1003         * rendering/RenderFieldset.h: Removed.
1004         Remove RenderFieldset files from the tree.
1005
1006         * rendering/RenderFlexibleBox.cpp:
1007         (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
1008         (WebCore::RenderFlexibleBox::firstLineBaseline):
1009         (WebCore::RenderFlexibleBox::layoutBlock):
1010         (WebCore::RenderFlexibleBox::layoutFlexItems):
1011         (WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins):
1012         Make sure flexible boxes lay out their legends properly by calling layoutExcludedChildren.
1013         Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't
1014         part of the flexible box layout.
1015
1016         * rendering/RenderGrid.cpp:
1017         (WebCore::RenderGrid::layoutBlock):
1018         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
1019         (WebCore::RenderGrid::placeItemsOnGrid):
1020         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
1021         (WebCore::RenderGrid::layoutGridItems):
1022         Make sure grids lay out their legends properly by calling layoutExcludedChildren.
1023         Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't
1024         part of the grid's layout.
1025
1026         * rendering/RenderMultiColumnFlowThread.cpp:
1027         (WebCore::RenderMultiColumnFlowThread::populate):
1028         Pull legends back up into the block and don't let them be part of the flow thread.
1029
1030         * rendering/RenderMultiColumnSet.cpp:
1031         (WebCore::RenderMultiColumnSet::requiresBalancing):
1032         Fix an assert to allow legends to exist as siblings of multicolumn sets.
1033
1034         * rendering/RenderObject.cpp:
1035         (WebCore::RenderObject::isFieldset):
1036         Changed to examine the HTML element rather than RenderFieldset.
1037
1038         * rendering/RenderObject.h:
1039         (WebCore::RenderObject::isExcludedFromNormalLayout):
1040         (WebCore::RenderObject::setIsExcludedFromNormalLayout):
1041         (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
1042         RenderObjects now have a new bit that is set for excluded objects like legends, flow threads,
1043         placeholders, and ruby text. This bit lets code easily detect that an object is excluded from
1044         the layout system and can be skipped.
1045
1046         (WebCore::RenderObject::isExcludedAndPlacedInBorder):
1047         Helper method for asking if an object is painting inside the border. Used to know we
1048         need to factor it into preferred width calculations outside of any one layout system
1049         and also to know that we need to paint it when we paint the fieldset's border instead of
1050         later (after we might have scrolled or clipped the child painting area).
1051
1052         * rendering/RenderRubyRun.cpp:
1053         (WebCore::RenderRubyRun::layoutExcludedChildren):
1054         (WebCore::RenderRubyRun::layoutSpecialExcludedChild): Deleted.
1055         * rendering/RenderRubyRun.h:
1056         Rename layoutSpecialExcludedChild to layoutExcludedChildren.
1057
1058         * rendering/RenderTable.cpp:
1059         (WebCore::RenderTable::adjustBorderBoxRectForPainting):
1060         (WebCore::RenderTable::paintBoxDecorations):
1061         (WebCore::RenderTable::paintMask):
1062         (WebCore::RenderTable::subtractCaptionRect): Deleted.
1063         * rendering/RenderTable.h:
1064         Patched tables to share the same border box rect adjustment used by fieldsets when subtracting
1065         out captions. This is prep work to allow tables to be fieldsets, but for now I didn't go all the
1066         way.
1067
1068         * rendering/RenderTableCell.cpp:
1069         (WebCore::RenderTableCell::paintBoxDecorations):
1070         (WebCore::RenderTableCell::paintMask):
1071         Make sure table cells adjust their border box rects for painting. Again this is prep work for
1072         cells potentially being fieldsets, but not supported yet.
1073
1074         * rendering/RenderTextControl.cpp:
1075         (WebCore::RenderTextControl::layoutExcludedChildren):
1076         (WebCore::RenderTextControl::layoutSpecialExcludedChild): Deleted.
1077         * rendering/RenderTextControl.h:
1078         * rendering/RenderTextControlMultiLine.cpp:
1079         (WebCore::RenderTextControlMultiLine::layoutExcludedChildren):
1080         (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild): Deleted.
1081         * rendering/RenderTextControlMultiLine.h:
1082         Renamed the methods for doing the excluded child layout.
1083
1084         * rendering/RenderTreeAsText.cpp:
1085         (WebCore::RenderTreeAsText::writeRenderObject):
1086         Make sure to dump the original fieldset border and not the border with the extra legend stuff in it.
1087
1088 2017-03-06  Antoine Quint  <graouts@apple.com>
1089
1090         [Modern Media Controls] Tracks panel should clip and scroll content when numerous tracks are available
1091         https://bugs.webkit.org/show_bug.cgi?id=169201
1092         <rdar://problem/30867979>
1093
1094         Reviewed by Eric Carlson.
1095
1096         We now position and size the tracks panel dynamically and ensure a max-height is applied
1097         to the panel so that it allows a margin of 10px above it within the media controls. We also
1098         apply that same max-height to a new intermediary scrollable container for the track lists,
1099         so that it scrolls independently of the container and the background tint.
1100
1101         Test: media/modern-media-controls/tracks-panel/tracks-panel-position-and-size.html
1102
1103         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
1104         (MacOSFullscreenMediaControls.prototype.showTracksPanel): Deleted.
1105         * Modules/modern-media-controls/controls/macos-inline-media-controls.css:
1106         (.media-controls.mac.inline .volume.slider):
1107         (.media-controls.mac.inline .tracks-panel): Deleted.
1108         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
1109         (MacOSInlineMediaControls.prototype.showTracksPanel): Deleted.
1110         * Modules/modern-media-controls/controls/macos-media-controls.js:
1111         (MacOSMediaControls.prototype.showTracksPanel):
1112         * Modules/modern-media-controls/controls/tracks-panel.css:
1113         (.tracks-panel > .background-tint > div,):
1114         (.tracks-panel > .scrollable-container):
1115         (.tracks-panel section):
1116         (.tracks-panel section:first-of-type):
1117         (.tracks-panel section > h3):
1118         (.tracks-panel section > ul):
1119         (.tracks-panel section > ul > li):
1120         (.tracks-panel section > ul > li:focus):
1121         (.tracks-panel section > ul > li.selected:before):
1122         (.tracks-panel section > ul > li.animated):
1123         (.tracks-panel > .background-tint > div): Deleted.
1124         (.tracks-panel > section): Deleted.
1125         (.tracks-panel > section:first-of-type): Deleted.
1126         (.tracks-panel > section > h3): Deleted.
1127         (.tracks-panel > section > ul): Deleted.
1128         (.tracks-panel > section > ul > li): Deleted.
1129         (.tracks-panel > section > ul > li:focus): Deleted.
1130         (.tracks-panel > section > ul > li.selected:before): Deleted.
1131         (.tracks-panel > section > ul > li.animated): Deleted.
1132         * Modules/modern-media-controls/controls/tracks-panel.js:
1133         (TracksPanel.prototype.presentInParent):
1134         (TracksPanel.prototype.get maxHeight):
1135         (TracksPanel.prototype.set maxHeight):
1136         (TracksPanel.prototype.commitProperty):
1137         (TracksPanel.prototype._childrenFromDataSource):
1138
1139 2017-03-06  Manuel Rego Casasnovas  <rego@igalia.com>
1140
1141         [css-grid] Stretch should grow and shrink items to fit its grid area
1142         https://bugs.webkit.org/show_bug.cgi?id=163200
1143
1144         Reviewed by Darin Adler.
1145
1146         After some discussions the CSS WG agreed that stretch should not only
1147         grow items, but also shrink them to fit its grid area.
1148         That way the "min-width|height: auto" is somehow ignored for grid items.
1149         More info at: https://github.com/w3c/csswg-drafts/issues/283
1150
1151         The good part is that this allows us to remove some ugly code we've
1152         in RenderBox that was only used by Grid Layout.
1153
1154         For images, we'll be stretching on both axis right now, so the aspect
1155         ratio won't be preserved. The default behavior might change in those
1156         cases, but that should be implemented in a different patch.
1157
1158         * rendering/RenderBox.cpp:
1159         (WebCore::RenderBox::computeLogicalWidthInRegion):
1160         (WebCore::RenderBox::computeLogicalHeight):
1161
1162 2017-03-06  Miguel Gomez  <magomez@igalia.com>
1163
1164         [GTK] WebProcess from WebKitGtk+ 2.15.x SIGSEVs in GIFLZWContext::doLZW(unsigned char const*, unsigned long) at Source/WebCore/platform/image-decoders/gif/GIFImageReader.cpp:303
1165         https://bugs.webkit.org/show_bug.cgi?id=167304
1166
1167         Reviewed by Carlos Garcia Campos.
1168
1169         Add a lock to ensure that the GIFImageReader that we are using for decoding is not deleted while
1170         the decoding thread is using it.
1171
1172         No new tests.
1173
1174         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1175         (WebCore::GIFImageDecoder::clearFrameBufferCache):
1176
1177 2017-03-06  Antti Koivisto  <antti@apple.com>
1178
1179         Allow render tree building before loading stylesheet elements
1180         https://bugs.webkit.org/show_bug.cgi?id=169079
1181         <rdar://problem/30865709>
1182
1183         Reviewed by Andreas Kling.
1184
1185         Currently we don't resolve style or construct renderers if there are any pending
1186         stylesheet loads. This patch enables style and renderer constuction up to the
1187         first encountered loading style element.
1188
1189         This is a step toward allowing incremental rendering for in-body stylesheets.
1190
1191         * dom/Document.cpp:
1192         (WebCore::Document::needsStyleRecalc):
1193
1194             Ensure scrolling to anchor eventually happens.
1195
1196         * dom/Document.h:
1197         (WebCore::Document::isIgnoringPendingStylesheets):
1198         * dom/InlineStyleSheetOwner.cpp:
1199         (WebCore::InlineStyleSheetOwner::createSheet):
1200         (WebCore::InlineStyleSheetOwner::sheetLoaded):
1201         (WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
1202         * dom/ProcessingInstruction.cpp:
1203         (WebCore::ProcessingInstruction::checkStyleSheet):
1204         (WebCore::ProcessingInstruction::sheetLoaded):
1205         (WebCore::ProcessingInstruction::removedFrom):
1206         * html/HTMLLinkElement.cpp:
1207         (WebCore::HTMLLinkElement::addPendingSheet):
1208         (WebCore::HTMLLinkElement::removePendingSheet):
1209         * style/StyleScope.cpp:
1210         (WebCore::Style::Scope::addPendingSheet):
1211         (WebCore::Style::Scope::removePendingSheet):
1212
1213             Track pending sheet nodes in a map so we can test if a given node has a pending sheet.
1214             This is also more robust in general.
1215
1216         (WebCore::Style::Scope::hasProcessingInstructionWithPendingSheet):
1217         (WebCore::Style::Scope::updateActiveStyleSheets):
1218         * style/StyleScope.h:
1219         (WebCore::Style::Scope::hasPendingSheet):
1220         (WebCore::Style::Scope::hasPendingSheets):
1221         (WebCore::Style::Scope::addPendingSheet): Deleted.
1222         * style/StyleTreeResolver.cpp:
1223         (WebCore::Style::TreeResolver::styleForElement):
1224
1225             Instead of global test for placeholder construction check the status of the pending sheet flag.
1226
1227         (WebCore::Style::hasLoadingStylesheet):
1228         (WebCore::Style::TreeResolver::resolveComposedTree):
1229
1230             Set a flag when encountering a pending top level sheet during DOM traversal.
1231
1232         (WebCore::Style::TreeResolver::resolve):
1233         * style/StyleTreeResolver.h:
1234         * svg/graphics/SVGImage.cpp:
1235         (WebCore::SVGImage::dataChanged):
1236
1237             Ensure SVG images have layout before getting the size.
1238
1239 2017-03-06  Vanessa Chipirrás Navalón  <vchipirras@igalia.com>
1240
1241         [GStreamer] Adopt nullptr
1242         https://bugs.webkit.org/show_bug.cgi?id=123438
1243
1244         Reviewed by Xabier Rodriguez-Calvar.
1245
1246         To adapt the code to the C++11 standard, all NULL or 0 pointers have been changed to nullptr.
1247
1248         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
1249         (WebCore::AudioDestinationGStreamer::AudioDestinationGStreamer):
1250         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
1251         (WebCore::AudioFileReader::handleNewDeinterleavePad):
1252         (WebCore::AudioFileReader::plugDeinterleave):
1253         (WebCore::AudioFileReader::decodeAudioForBusCreation):
1254         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
1255         (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
1256         (WebCore::AudioSourceProviderGStreamer::configureAudioBin):
1257         (WebCore::AudioSourceProviderGStreamer::setClient):
1258         (WebCore::AudioSourceProviderGStreamer::handleNewDeinterleavePad):
1259         * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
1260         (webkit_web_audio_src_init):
1261         (webKitWebAudioSrcLoop):
1262         (webKitWebAudioSrcChangeState):
1263         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
1264         (WebCore::AudioTrackPrivateGStreamer::setEnabled):
1265         * platform/graphics/gstreamer/GStreamerUtilities.cpp:
1266         (WebCore::initializeGStreamer):
1267         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1268         (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties):
1269         (WebCore::MediaPlayerPrivateGStreamer::registerMediaEngine):
1270         (WebCore::initializeGStreamerAndRegisterWebKitElements):
1271         (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
1272         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
1273         (WebCore::MediaPlayerPrivateGStreamer::newTextSample):
1274         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
1275         (WebCore::MediaPlayerPrivateGStreamer::processTableOfContents):
1276         Removed the unused second argument on processTableOfContentsEntry function.
1277         (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry):
1278         Removed the unused second argument on this function.
1279         (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
1280         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
1281         (WebCore::MediaPlayerPrivateGStreamer::createAudioSink):
1282         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1283         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1284         Removed the unused second argument on processTableOfContentsEntry function.
1285         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1286         (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
1287         (WebCore::MediaPlayerPrivateGStreamerBase::setMuted):
1288         (WebCore::MediaPlayerPrivateGStreamerBase::muted):
1289         (WebCore::MediaPlayerPrivateGStreamerBase::notifyPlayerOfMute):
1290         (WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement):
1291         (WebCore::MediaPlayerPrivateGStreamerBase::decodedFrameCount):
1292         (WebCore::MediaPlayerPrivateGStreamerBase::droppedFrameCount):
1293         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
1294         (WebCore::MediaPlayerPrivateGStreamerOwr::registerMediaEngine):
1295         * platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
1296         (webkit_text_combiner_init):
1297         (webkitTextCombinerPadEvent):
1298         (webkitTextCombinerRequestNewPad):
1299         (webkitTextCombinerNew):
1300         * platform/graphics/gstreamer/TextSinkGStreamer.cpp:
1301         (webkitTextSinkNew):
1302         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
1303         (WebCore::TrackPrivateBaseGStreamer::tagsChanged):
1304         (WebCore::TrackPrivateBaseGStreamer::notifyTrackOfActiveChanged):
1305         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1306         (webkit_video_sink_init):
1307         (webkitVideoSinkProposeAllocation):
1308         (webkitVideoSinkNew):
1309         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
1310         (WebCore::VideoTrackPrivateGStreamer::setSelected):
1311         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1312         (webkit_web_src_init):
1313         (webKitWebSrcDispose):
1314         (webKitWebSrcSetProperty):
1315         (webKitWebSrcStop):
1316         (webKitWebSrcChangeState):
1317         (webKitWebSrcQueryWithParent):
1318         (webKitWebSrcGetProtocols):
1319         (StreamingClient::handleResponseReceived):
1320         (StreamingClient::handleDataReceived):
1321         (ResourceHandleStreamingClient::didFail):
1322         (ResourceHandleStreamingClient::wasBlocked):
1323         (ResourceHandleStreamingClient::cannotShowURL):
1324         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
1325         (webKitMediaSrcGetProtocols):
1326
1327 2017-03-06  Andreas Kling  <akling@apple.com>
1328
1329         [iOS] Report domains crashing under memory pressure via enhanced privacy logging.
1330         <https://webkit.org/b/169133>
1331         <rdar://problem/29964017>
1332
1333         Reviewed by Antti Koivisto.
1334
1335         * page/DiagnosticLoggingKeys.h:
1336
1337 2017-03-05  Simon Fraser  <simon.fraser@apple.com>
1338
1339         Avoid backing store for layers with empty text nodes in a few more cases
1340         https://bugs.webkit.org/show_bug.cgi?id=169185
1341
1342         Reviewed by Dan Bernstein.
1343
1344         In hasPaintingNonLayerDescendants() we can check whether the RenderText's linesBoundingBox()
1345         is empty to avoid backing store in a few more cases. Also use containsOnlyWhitespace() rather
1346         than isAllCollapsibleWhitespace(), because there's no need for backing store for non-selectable
1347         whitespace text.
1348
1349         Covered by existing tests.
1350
1351         * rendering/RenderLayer.cpp:
1352         (WebCore::RenderLayer::calculateClipRects):
1353
1354 2017-03-05  Chris Dumez  <cdumez@apple.com>
1355
1356         Drop unnecessary backslash in ResourceResponse::sanitizeSuggestedFilename()
1357         https://bugs.webkit.org/show_bug.cgi?id=169066
1358
1359         Reviewed by Sam Weinig.
1360
1361         Drop unnecessary backslash in ResourceResponse::sanitizeSuggestedFilename().
1362
1363         * platform/network/ResourceResponseBase.cpp:
1364         (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
1365
1366 2017-03-05  Chris Dumez  <cdumez@apple.com>
1367
1368         Using <form> in <template> causes following <form> to get swallowed
1369         https://bugs.webkit.org/show_bug.cgi?id=163552
1370
1371         Reviewed by Sam Weinig.
1372
1373         As per the HTML specification [1], when finding a "form" tag in the "in body"
1374         insertion mode, we should insert an HTML element for the token, and, if there
1375         is no template element on the stack of open elements, set the form element
1376         pointer to point to the element created.
1377
1378         We were missing the "if there is no template element on the stack of open
1379         elements" check and setting the form element pointer unconditionally.
1380         This patch fixes the issue.
1381
1382         [1] https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody:form-element-pointer-2
1383
1384         Test: fast/parser/form-after-template.html
1385
1386         * html/parser/HTMLConstructionSite.cpp:
1387         (WebCore::HTMLConstructionSite::insertHTMLFormElement):
1388
1389 2017-03-04  Myles C. Maxfield  <mmaxfield@apple.com>
1390
1391         Update CSSFontSelector's matching algorithm to understand ranges
1392         https://bugs.webkit.org/show_bug.cgi?id=168892
1393
1394         Reviewed by Jon Lee.
1395
1396         This patch migrates the font selection algorithm out of FontCacheCoreText and into its own file which can be shared
1397         among all ports. It then migrates our web font selection algorithm to use it.
1398
1399         This patch doesn't actually change the parsing rules; it just changes the internal machinery for how fonts get
1400         selected. Therefore, this patch simply makes zero-length ranges from the discrete values the parser emits, and passes
1401         those zero-length ranges to the range-based font selection routine. This means that this patch doesn't actually
1402         change the results of the font selection algorithm.
1403
1404         One of the inputs to the new font selection algorithm is font-stretch, which previously was not parsed inside
1405         @font-face blocks or the CSS Font Loading API. This patch therefore adds parsing support and modifies the existing
1406         tests for these pieces to expect parsing to work. Because the font selection algorithm itself is shared between
1407         installed fonts and webfonts, this patch doesn't add any additional tests for it (because it is already covered under
1408         existing tests).
1409
1410         No new tests because there is no behavior change.
1411
1412         * CMakeLists.txt:
1413         * WebCore.xcodeproj/project.pbxproj: Add new file for the font selection algorithm.
1414         * css/CSSFontFace.cpp:
1415         (WebCore::CSSFontFace::calculateStretch): Used on @font-face blocks and the CSS Font Loading API.
1416         (WebCore::CSSFontFace::setStretch): Fill out the previously stubbed function.
1417         * css/CSSFontFace.h: Add the range member variable to CSSFontFaces.
1418         * css/CSSFontFaceSet.cpp:
1419         (WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered): Now that we care about font-stretch, we need to
1420         look it up for local fonts too. This current approach of an extra FontSelectionValue hanging around with a
1421         FontTraitsMask is very ugly and will be removed soon (https://bugs.webkit.org/show_bug.cgi?id=168889 and
1422         https://bugs.webkit.org/show_bug.cgi?id=168890).
1423         (WebCore::computeFontStretch): Used on @font-face blocks and the CSS Font Loading API.
1424         (WebCore::CSSFontFaceSet::matchingFaces): Educate about font-stretch.
1425         (WebCore::CSSFontFaceSet::fontFace): Migrate to the new font-selection algorithm.
1426         (WebCore::fontFaceComparator): Deleted.
1427         * css/CSSFontFaceSet.h:
1428         * css/CSSFontSelector.cpp:
1429         (WebCore::CSSFontSelector::addFontFaceRule): Educate about font-stretch.
1430         (WebCore::CSSFontSelector::fontRangesForFamily): Ditto.
1431         * css/FontFace.cpp:
1432         (WebCore::FontFace::setStretch): Ditto.
1433         (WebCore::FontFace::stretch): Ditto.
1434         * css/parser/CSSPropertyParser.cpp:
1435         (WebCore::CSSPropertyParser::parseFontFaceDescriptor): Ditto.
1436         * platform/graphics/FontCache.h: Ditto.
1437         * platform/graphics/FontDescription.h:
1438         * platform/graphics/FontSelectionAlgorithm.cpp: Added.
1439         (WebCore::FontSelectionAlgorithm::filterCapability):
1440         (WebCore::FontSelectionAlgorithm::indexOfBestCapabilities):
1441         (WebCore::fontSelectionRequestForTraitsMask):
1442         (WebCore::initialFontSelectionCapabilitiesForTraitsMask):
1443         (WebCore::fontSelectionCapabilitiesForTraitsMask):
1444         * platform/graphics/FontSelectionAlgorithm.h: Added. Taken from FontCacheCoreText.cpp.
1445         (WebCore::FontSelectionValue::FontSelectionValue):
1446         (WebCore::FontSelectionValue::operator float):
1447         (WebCore::FontSelectionValue::rawValue):
1448         (WebCore::FontSelectionValue::maximumValue):
1449         (WebCore::FontSelectionValue::minimumValue):
1450         (WebCore::FontSelectionValue::operator+):
1451         (WebCore::FontSelectionValue::operator-):
1452         (WebCore::FontSelectionValue::operator*):
1453         (WebCore::FontSelectionValue::operator/):
1454         (WebCore::FontSelectionValue::operator==):
1455         (WebCore::FontSelectionValue::operator!=):
1456         (WebCore::FontSelectionValue::operator<):
1457         (WebCore::FontSelectionValue::operator<=):
1458         (WebCore::FontSelectionValue::operator>):
1459         (WebCore::FontSelectionValue::operator>=):
1460         (WebCore::FontSelectionRange::isValid):
1461         (WebCore::FontSelectionRange::expand):
1462         (WebCore::FontSelectionRange::includes):
1463         (WebCore::FontSelectionRequest::operator==):
1464         (WebCore::FontSelectionRequest::operator!=):
1465         (WebCore::FontSelectionRequestKey::FontSelectionRequestKey):
1466         (WebCore::FontSelectionRequestKey::isHashTableDeletedValue):
1467         (WebCore::FontSelectionRequestKey::operator==):
1468         (WebCore::FontSelectionRequestKeyHash::hash):
1469         (WebCore::FontSelectionRequestKeyHash::equal):
1470         (WebCore::FontSelectionCapabilities::expand):
1471         (WebCore::FontSelectionAlgorithm::FontSelectionAlgorithm):
1472         (WebCore::FontSelectionAlgorithm::iterateActiveCapabilitiesWithReturn):
1473         (WebCore::FontSelectionAlgorithm::iterateActiveCapabilities):
1474         * platform/graphics/cocoa/FontCacheCoreText.cpp: Moved to FontSelectionAlgorithm.
1475         (WebCore::stretchFromCoreTextTraits):
1476         (WebCore::FontDatabase::capabilitiesForFontDescriptor):
1477         (WebCore::findClosestFont):
1478         (WebCore::calculateFontSelectionRequest):
1479         (WebCore::platformFontLookupWithFamily):
1480         (WebCore::FontCache::getTraitsInFamily): Deleted.
1481         (WebCore::iterateActiveFontsWithReturn): Deleted.
1482         (WebCore::iterateActiveFonts): Deleted.
1483         (WebCore::findClosestStretch): Deleted.
1484         (WebCore::filterStretch): Deleted.
1485         (WebCore::findClosestStyle): Deleted.
1486         (WebCore::filterStyle): Deleted.
1487         (WebCore::findClosestWeight): Deleted.
1488         (WebCore::filterWeight): Deleted.
1489         (WebCore::computeTargetWeight): Deleted.
1490         * platform/text/TextFlags.h: Moved to FontSelectionAlgorithm.
1491         (WebCore::FontSelectionValue::FontSelectionValue): Deleted.
1492         (WebCore::FontSelectionValue::operator float): Deleted.
1493         (WebCore::FontSelectionValue::operator+): Deleted.
1494         (WebCore::FontSelectionValue::operator-): Deleted.
1495         (WebCore::FontSelectionValue::operator*): Deleted.
1496         (WebCore::FontSelectionValue::operator/): Deleted.
1497         (WebCore::FontSelectionValue::operator==): Deleted.
1498         (WebCore::FontSelectionValue::operator!=): Deleted.
1499         (WebCore::FontSelectionValue::operator<): Deleted.
1500         (WebCore::FontSelectionValue::operator<=): Deleted.
1501         (WebCore::FontSelectionValue::operator>): Deleted.
1502         (WebCore::FontSelectionValue::operator>=): Deleted.
1503         (WebCore::FontSelectionValue::rawValue): Deleted.
1504         (WebCore::FontSelectionValue::maximumValue): Deleted.
1505         (WebCore::FontSelectionValue::minimumValue): Deleted.
1506         (WebCore::FontSelectionRange::isValid): Deleted.
1507         (WebCore::FontSelectionRange::expand): Deleted.
1508         (WebCore::FontSelectionRange::includes): Deleted.
1509         (WebCore::FontSelectionCapabilities::expand): Deleted.
1510
1511 2017-03-05  Simon Fraser  <simon.fraser@apple.com>
1512
1513         Make some RenderLayer tree traversal in RenderLayerBacking more generic
1514         https://bugs.webkit.org/show_bug.cgi?id=169177
1515
1516         Reviewed by Zalan Bujtas.
1517
1518         The real goal of this patch is reduce the number of callers of
1519         RenderLayerBacking::isPaintDestinationForDescendantLayers() to one. To achieve that,
1520         have the setContentsVisible() logic (which is really just about the CSS 'visibility' property)
1521         do its own tree traversal which just consults layer.hasVisibleContent(). So
1522         make descendantLayerPaintsIntoAncestor() a generic traversal function which walks
1523         descendant layers which may paint into the target layer. The "Visible" in the name
1524         reflects the fact that it can bypass a subtree for a layer with !hasVisibleDescendant().
1525
1526         * rendering/RenderLayerBacking.cpp:
1527         (WebCore::RenderLayerBacking::updateAfterDescendants):
1528         (WebCore::traverseVisibleNonCompositedDescendantLayers):
1529         (WebCore::RenderLayerBacking::isPaintDestinationForDescendantLayers):
1530         (WebCore::RenderLayerBacking::hasVisibleNonCompositedDescendants):
1531         (WebCore::descendantLayerPaintsIntoAncestor): Deleted.
1532         * rendering/RenderLayerBacking.h:
1533
1534 2017-03-04  Simon Fraser  <simon.fraser@apple.com>
1535
1536         Clarify some terminology in RenderLayerBacking
1537         https://bugs.webkit.org/show_bug.cgi?id=169174
1538
1539         Reviewed by Zalan Bujtas.
1540
1541         Rename some functions related to directly-composited background images and
1542         box decorations for clarify.
1543
1544         Only behavior change is for canDirectlyCompositeBackgroundBackgroundImage() to check
1545         GraphicsLayer::supportsContentsTiling(), which means that RenderLayerBacking::contentChanged()
1546         will no longer trigger a updateGeometry() when it gets BackgroundImageChanged on non-
1547         CoordinateGraphics platforms.
1548
1549         * rendering/RenderLayerBacking.cpp:
1550         (WebCore::RenderLayerBacking::updateConfiguration):
1551         (WebCore::RenderLayerBacking::updateAfterDescendants):
1552         (WebCore::RenderLayerBacking::updateDirectlyCompositedBoxDecorations):
1553         (WebCore::canDirectlyCompositeBackgroundBackgroundImage):
1554         (WebCore::hasPaintedBoxDecorationsOrBackgroundImage):
1555         (WebCore::supportsDirectlyCompositedBoxDecorations):
1556         (WebCore::RenderLayerBacking::paintsBoxDecorations):
1557         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
1558         (WebCore::RenderLayerBacking::contentChanged):
1559         (WebCore::RenderLayerBacking::updateDirectlyCompositedContents): Deleted.
1560         (WebCore::canCreateTiledImage): Deleted.
1561         (WebCore::hasVisibleBoxDecorationsOrBackgroundImage): Deleted.
1562         (WebCore::supportsDirectBoxDecorationsComposition): Deleted.
1563         * rendering/RenderLayerBacking.h:
1564
1565 2017-03-04  Alex Christensen  <achristensen@webkit.org>
1566
1567         Cleanup after r213418
1568         https://bugs.webkit.org/show_bug.cgi?id=169165
1569
1570         Reviewed by Youenn Fablet.
1571
1572         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
1573         (WebCore::RealtimeIncomingAudioSource::OnData):
1574         Restore the assertion I removed.
1575
1576 2017-03-04  Commit Queue  <commit-queue@webkit.org>
1577
1578         Unreviewed, rolling out r213379.
1579         https://bugs.webkit.org/show_bug.cgi?id=169169
1580
1581         broke GTK+ and Windows builds (Requested by mcatanzaro on
1582         #webkit).
1583
1584         Reverted changeset:
1585
1586         "Enable fieldsets to be flexboxes, grids and multicolumn."
1587         https://bugs.webkit.org/show_bug.cgi?id=169082
1588         http://trac.webkit.org/changeset/213379
1589
1590 2017-03-03  Youenn Fablet  <youenn@apple.com>
1591
1592         [WebRTC] Update libwebrtc source code
1593         https://bugs.webkit.org/show_bug.cgi?id=168599
1594
1595         Reviewed by Alex Christensen.
1596
1597         * Modules/mediastream/RTCStatsReport.h:
1598         * Modules/mediastream/RTCStatsReport.idl:
1599         Update to match the latest spec, which matches the new structures in libwebrtc.
1600         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1601         (WebCore::fillRTCRTPStreamStats):
1602         (WebCore::fillOutboundRTPStreamStats):
1603         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1604         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
1605         * platform/mediastream/mac/RealtimeIncomingAudioSource.cpp:
1606         (WebCore::RealtimeIncomingAudioSource::OnData):
1607         Comment out an assertion that was failing.  We should revisit this.
1608         * testing/MockLibWebRTCPeerConnection.h:
1609
1610 2017-03-03  Commit Queue  <commit-queue@webkit.org>
1611
1612         Unreviewed, rolling out r213400.
1613         https://bugs.webkit.org/show_bug.cgi?id=169163
1614
1615         Caused frequent assertion failures (Requested by ap on
1616         #webkit).
1617
1618         Reverted changeset:
1619
1620         "[Modern Media Controls] Improve media documents across macOS,
1621         iPhone and iPad"
1622         https://bugs.webkit.org/show_bug.cgi?id=169145
1623         http://trac.webkit.org/changeset/213400
1624
1625 2017-03-03  Andy Estes  <aestes@apple.com>
1626
1627         Add support for canvas.toBlob
1628         https://bugs.webkit.org/show_bug.cgi?id=148878
1629
1630         Reviewed by Tim Horton.
1631
1632         Address additional review feedback received after r213412 landed.
1633
1634         * html/HTMLCanvasElement.cpp:
1635         (WebCore::HTMLCanvasElement::toBlob): Passed null to the blob callback if blob conversion
1636         fails for any reason.
1637         * platform/graphics/cg/ImageBufferCG.cpp:
1638         (WebCore::cgImage): Removed an unnecessary local variable.
1639
1640 2017-03-03  Andy Estes  <aestes@apple.com>
1641
1642         Add support for canvas.toBlob
1643         https://bugs.webkit.org/show_bug.cgi?id=148878
1644         <rdar://problem/22590406>
1645
1646         Reviewed by Tim Horton.
1647
1648         These tests now pass:
1649         imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.jpeg.html
1650         imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.png.html
1651
1652         * CMakeLists.txt:
1653         * DerivedSources.make:
1654         * WebCore.xcodeproj/project.pbxproj:
1655         * fileapi/BlobCallback.cpp: Added.
1656         (WebCore::BlobCallback::scheduleCallback):
1657         * fileapi/BlobCallback.h: Added.
1658         (WebCore::BlobCallback::~BlobCallback):
1659         * fileapi/BlobCallback.idl: Added.
1660         * html/HTMLCanvasElement.cpp:
1661         (WebCore::HTMLCanvasElement::toBlob):
1662         * html/HTMLCanvasElement.h:
1663         * html/HTMLCanvasElement.idl:
1664         * platform/graphics/ImageBuffer.h:
1665         * platform/graphics/cairo/ImageBufferCairo.cpp:
1666         (WebCore::writeFunction):
1667         (WebCore::encodeImage):
1668         (WebCore::ImageBuffer::toDataURL):
1669         (WebCore::ImageBuffer::toData):
1670         * platform/graphics/cg/ImageBufferCG.cpp:
1671         (WebCore::data):
1672         (WebCore::ImageBuffer::toDataURL):
1673         (WebCore::ImageBuffer::toData):
1674         (WebCore::ImageBuffer::toCGImage):
1675         (WebCore::cgImage):
1676         (WebCore::dataURL):
1677         * platform/graphics/gtk/ImageBufferGtk.cpp:
1678         (WebCore::ImageBuffer::toDataURL):
1679         (WebCore::ImageBuffer::toData):
1680         * platform/graphics/win/ImageBufferDirect2D.cpp:
1681         (WebCore::ImageBuffer::toData):
1682
1683 2017-03-03  Dean Jackson  <dino@apple.com>
1684
1685         Add WebGPU compile flag and experimental feature flag
1686         https://bugs.webkit.org/show_bug.cgi?id=169161
1687         <rdar://problem/30846689>
1688
1689         Reviewed by Tim Horton.
1690
1691         Add ENABLE_WEBGPU, an experimental feature flag, a RuntimeEnabledFeature,
1692         and an InternalSetting.
1693
1694         * Configurations/FeatureDefines.xcconfig:
1695         * page/RuntimeEnabledFeatures.h:
1696         (WebCore::RuntimeEnabledFeatures::setWebGPUEnabled):
1697         (WebCore::RuntimeEnabledFeatures::webGPUEnabled):
1698         * testing/InternalSettings.cpp:
1699         (WebCore::InternalSettings::Backup::Backup):
1700         (WebCore::InternalSettings::Backup::restoreTo):
1701         (WebCore::InternalSettings::setWebGPUEnabled):
1702         * testing/InternalSettings.h:
1703         * testing/InternalSettings.idl:
1704
1705 2017-03-03  Simon Fraser  <simon.fraser@apple.com>
1706
1707         Clean up some RenderLayerBacking code
1708         https://bugs.webkit.org/show_bug.cgi?id=169160
1709
1710         Reviewed by Dean Jackson.
1711
1712         Modern loops in descendantLayerPaintsIntoAncestor().
1713
1714         Rename RenderLayerBacking::paintsChildren() to RenderLayerBacking::paintsChildRenderers() to clarify that
1715         it refers to renderers, not RenderLayers.
1716
1717         Rename RenderLayerBacking::paintsNonDirectCompositedBoxDecoration() to RenderLayerBacking::paintsBoxDecorations().
1718         "Paints" already implies non-composited.
1719
1720         No behavior change.
1721
1722         * rendering/RenderLayerBacking.cpp:
1723         (WebCore::RenderLayerBacking::updateDrawsContent):
1724         (WebCore::RenderLayerBacking::paintsBoxDecorations):
1725         (WebCore::RenderLayerBacking::paintsChildRenderers):
1726         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
1727         (WebCore::descendantLayerPaintsIntoAncestor):
1728         (WebCore::RenderLayerBacking::paintsNonDirectCompositedBoxDecoration): Deleted.
1729         (WebCore::RenderLayerBacking::paintsChildren): Deleted.
1730         * rendering/RenderLayerBacking.h:
1731
1732 2017-03-03  Simon Fraser  <simon.fraser@apple.com>
1733
1734         Clean up RenderImage and a RenderImageResource function
1735         https://bugs.webkit.org/show_bug.cgi?id=169153
1736
1737         Reviewed by Zalan Bujtas.
1738         
1739         Change all calls to imageResource().cachedImage() in RenderImage to use the inline
1740         cachedImage() function.
1741
1742         In RenderImage::paintReplaced(), early return after the broken image block (and no need
1743         to test imageResource().hasImage() again in the second condition). Convert height/width to size,
1744         which also forces us to be explicit about using flooredIntSize() when fetching the image
1745         (perhaps this should be a roundedIntSize, but I didn't want to change behavior).
1746
1747         Change RenderImageResource::image() to take an IntSize, rather than int height and width.
1748
1749         No behavior change.
1750
1751         * rendering/RenderImage.cpp:
1752         (WebCore::RenderImage::styleDidChange):
1753         (WebCore::RenderImage::imageChanged):
1754         (WebCore::RenderImage::notifyFinished):
1755         (WebCore::RenderImage::paintReplaced):
1756         (WebCore::RenderImage::paintIntoRect):
1757         (WebCore::RenderImage::foregroundIsKnownToBeOpaqueInRect):
1758         (WebCore::RenderImage::embeddedContentBox):
1759         * rendering/RenderImageResource.cpp:
1760         (WebCore::RenderImageResource::image):
1761         * rendering/RenderImageResource.h:
1762         (WebCore::RenderImageResource::image):
1763         * rendering/RenderImageResourceStyleImage.cpp:
1764         (WebCore::RenderImageResourceStyleImage::image):
1765         * rendering/RenderImageResourceStyleImage.h:
1766
1767 2017-03-03  Antoine Quint  <graouts@apple.com>
1768
1769         [Modern Media Controls] Improve media documents across macOS, iPhone and iPad
1770         https://bugs.webkit.org/show_bug.cgi?id=169145
1771         <rdar://problem/17048858>
1772
1773         Reviewed by Dean Jackson.
1774
1775         There were a variety of issues with media documents, some longstanding, and some specifically
1776         about modern media controls.
1777
1778         One issue was that fullscreen and picture-in-picture buttons would show for audio media documents,
1779         due to using a <video> element to load the audio file. We now have additional logic in MediaController
1780         to identify if the loaded media is really an audio file, and using this information to hide the
1781         fullscreen and picture-in-picture buttons.
1782
1783         Another issue was that we would inject style in MediaDocument.cpp that was specific to modern media
1784         controls when we could have the modern-media-controls module injected CSS handle this styling. We now
1785         use the injected style in the shadow root to size media documents based on the device characteristics
1786         and ensuring that page styles are overridden.
1787
1788         We also simplify how MediaDocument.cpp sets the source of the media element to simply use the "src"
1789         attribute and not a <source> element.
1790
1791         Finally, we introduce a MediaDocumentController class that is instantiated when we're dealing with
1792         a media document to hide the controls while we determine the type of media we're loading (audio vs.
1793         video) in order to apply the appropriate styling without flashes.
1794
1795         As a result of the new styles applied by the modern-media-controls module, media documents have a
1796         similar behavior on macOS and iPad, where we only enforce a min-width for video allowing them
1797         to play at their natural size otherwise, and enforcing a fixed width for audio. On iPhone however,
1798         we want to always play the media at full width, with some padding in the case of audio.
1799
1800         Tests: media/modern-media-controls/fullscreen-support/fullscreen-support-disabled-video-with-audio-tracks-only.html
1801                media/modern-media-controls/media-documents/ipad/media-document-audio-ios-sizing.html
1802                media/modern-media-controls/media-documents/ipad/media-document-video-ios-sizing.html
1803                media/modern-media-controls/media-documents/media-document-audio-ios-sizing.html
1804                media/modern-media-controls/media-documents/media-document-audio-mac-sizing.html
1805                media/modern-media-controls/media-documents/media-document-video-ios-sizing.html
1806                media/modern-media-controls/media-documents/media-document-video-mac-sizing.html
1807                media/modern-media-controls/pip-support/pip-support-disabled-video-with-audio-tracks-only.html
1808
1809         * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
1810         (:host(audio) .media-controls.ios.inline > .controls-bar:before,):
1811         (:host(audio) .media-controls.ios.inline > .controls-bar:before): Deleted.
1812         * Modules/modern-media-controls/controls/macos-media-controls.css:
1813         (:host(audio) .media-controls.mac.inline > .controls-bar,):
1814         (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint,):
1815         (:host(audio) .media-controls.mac.inline > .controls-bar): Deleted.
1816         (:host(audio) .media-controls.mac.inline > .controls-bar > .background-tint): Deleted.
1817         * Modules/modern-media-controls/controls/media-document.css: Added.
1818         (:host(.media-document)):
1819         (:host(.media-document.ready)):
1820         (:host(.media-document.audio.mac)):
1821         (:host(.media-document.audio.ipad)):
1822         (:host(.media-document.audio.iphone)):
1823         (:host(.media-document.video.mac)):
1824         (:host(.media-document.video.ipad)):
1825         (:host(.media-document.video.iphone)):
1826         * Modules/modern-media-controls/js-files:
1827         * Modules/modern-media-controls/media/fullscreen-support.js:
1828         (FullscreenSupport.prototype.syncControl):
1829         (FullscreenSupport):
1830         * Modules/modern-media-controls/media/media-controller.js:
1831         (MediaController):
1832         (MediaController.prototype.get isAudio):
1833         * Modules/modern-media-controls/media/media-document-controller.js: Added.
1834         (MediaDocumentController):
1835         (MediaDocumentController.prototype.handleEvent):
1836         (MediaDocumentController.prototype._mediaDocumentHasMetadata):
1837         (MediaDocumentController.prototype._mediaDocumentHasSize):
1838         * Modules/modern-media-controls/media/pip-support.js:
1839         (PiPSupport.prototype.syncControl):
1840         (PiPSupport):
1841         * html/MediaDocument.cpp:
1842         (WebCore::MediaDocumentParser::createDocumentStructure):
1843
1844 2017-03-03  Chris Dumez  <cdumez@apple.com>
1845
1846         [iOS] Throttle SVG SMIL animations to 30fps in low power mode
1847         https://bugs.webkit.org/show_bug.cgi?id=169137
1848         <rdar://problem/30833754>
1849
1850         Reviewed by Simon Fraser.
1851
1852         Throttle SVG SMIL animations to 30fps in low power mode on iOS to save
1853         battery.
1854
1855         Test: svg/animations/animations-lowPowerMode-throttling.html
1856
1857         * svg/SVGSVGElement.cpp:
1858         (WebCore::SVGSVGElement::SVGSVGElement):
1859         * svg/SVGSVGElement.idl:
1860         * svg/animation/SMILTime.h:
1861         (WebCore::SMILTime::SMILTime):
1862         * svg/animation/SMILTimeContainer.cpp:
1863         (WebCore::SMILTimeContainer::SMILTimeContainer):
1864         (WebCore::SMILTimeContainer::animationFrameDelay):
1865         (WebCore::SMILTimeContainer::updateDocumentOrderIndexes):
1866         (WebCore::SMILTimeContainer::updateAnimations):
1867         * svg/animation/SMILTimeContainer.h:
1868         * svg/animation/SVGSMILElement.cpp:
1869         (WebCore::SVGSMILElement::calculateNextProgressTime):
1870         * testing/Internals.cpp:
1871         (WebCore::Internals::svgAnimationsInterval):
1872         * testing/Internals.h:
1873         * testing/Internals.idl:
1874
1875 2017-03-03  Joseph Pecoraro  <pecoraro@apple.com>
1876
1877         [Mac] WebCore.framework is missing a symlink from Frameworks to Versions/Current/Frameworks when the latter exists
1878         https://bugs.webkit.org/show_bug.cgi?id=169067
1879
1880         Reviewed by Dan Bernstein.
1881
1882         * WebCore.xcodeproj/project.pbxproj:
1883
1884 2017-03-03  Sam Weinig  <sam@webkit.org>
1885
1886         REGRESSION (r209760): Apple Pay doesn't work on casper.com, shopspring.com, maybe other sites
1887         <rdar://problem/30313445>
1888         https://bugs.webkit.org/show_bug.cgi?id=169149
1889
1890         Reviewed by Simon Fraser.
1891
1892         Relax restriction that the ApplePayShippingMethod sequence must not be empty. This
1893         was incorrect.
1894
1895         * Modules/applepay/ApplePaySession.cpp:
1896         (WebCore::convertAndValidate):
1897
1898 2017-03-03  Alex Christensen  <achristensen@webkit.org>
1899
1900         [URLParser] Fix file: as a relative file URL
1901         https://bugs.webkit.org/show_bug.cgi?id=169122
1902
1903         Reviewed by Tim Horton.
1904
1905         This is clearly defined in https://url.spec.whatwg.org/#file-state with the EOF code point.
1906         I got it wrong and didn't test it.  It's been added to the web platform tests since we last updated.
1907
1908         * platform/URLParser.cpp:
1909         (WebCore::URLParser::parse):
1910
1911 2017-03-03  Dave Hyatt  <hyatt@apple.com>
1912
1913         Enable fieldsets to be flexboxes, grids and multicolumn.
1914         https://bugs.webkit.org/show_bug.cgi?id=169082
1915
1916         Reviewed by Simon Fraser.
1917
1918         Added new tests in fast/forms/fieldset.
1919
1920         This patch eliminates RenderFieldset and moves the functionality into RenderBlock so that
1921         derived classes can also be fieldsets.
1922
1923         * CMakeLists.txt:
1924         * WebCore.xcodeproj/project.pbxproj:
1925         Remove RenderFieldset from the project.
1926
1927         * accessibility/AccessibilityRenderObject.cpp:
1928         (WebCore::AccessibilityRenderObject::titleUIElement):
1929         Call in to RenderBlock now instead of RenderFieldset.
1930
1931         * html/HTMLFieldSetElement.cpp:
1932         (WebCore::HTMLFieldSetElement::createElementRenderer):
1933         * html/HTMLFieldSetElement.h:
1934         The fieldset DOM element now uses RenderElement::createFor to make renderers so that multiple display types
1935         can be supported. A special flag has been added that indicates only to make flexbox and block-related
1936         renderers (not table display types).
1937
1938         * rendering/OrderIterator.cpp:
1939         (WebCore::OrderIterator::shouldSkipChild):
1940         (WebCore::OrderIteratorPopulator::collectChild):
1941         * rendering/OrderIterator.h:
1942         Streamline child collection for flexboxes and grids to indicate whether the child should be skipped as a return
1943         value from collectChild. Add a shouldSkipChild method that skips both out of flow positioned objects and
1944         excluded children like the legends of fieldsets.
1945
1946         * rendering/RenderBlock.cpp:
1947         (WebCore::RenderBlockRareData::RenderBlockRareData):
1948         When the legend is taller than the fieldset's borderBefore(), intrinsic border is added to the CSS border width.
1949         This intrinsic border being factored in ensures that the padding and content boxes of fieldsets are correct
1950         across any layout system, since the legend is now just treated as part of the border.
1951
1952         (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
1953         Call the new computePreferredWidthsForExcludedChildren to ensure that excluded children contribute to
1954         preferred width in their own way and not as part of a specific layout system.
1955
1956         (WebCore::RenderBlock::renderName):
1957         Hacked to still return RenderFieldSet for RenderBlockFlow-backed fieldsets for layout test compatibility.
1958
1959         (WebCore::RenderBlock::layoutExcludedChildren):
1960         Renamed from layoutSpecialExcludedChild to more accurately reflect the fact that multiple excluded children
1961         can be included here (e.g., both a multicolumn flow thread and a legend). The RenderBlock base class handles
1962         the layout of legends by both placing them and setting the correct intrinsic border before amount on the
1963         block.
1964
1965         (WebCore::RenderBlock::findFieldsetLegend):
1966         Moved from RenderFieldset.
1967
1968         (WebCore::RenderBlock::adjustBorderBoxRectForPainting):
1969         (WebCore::RenderBlock::paintRectToClipOutFromBorder):
1970         These methods are used when painting to shrink the border box as needed to account for the legend and to
1971         provide the portion of the border that needs to be clipped out. These methods have been enhanced to
1972         properly support all writing modes.
1973
1974         (WebCore::RenderBlock::intrinsicBorderForFieldset):
1975         (WebCore::RenderBlock::setIntrinsicBorderForFieldset):
1976         (WebCore::RenderBlock::borderTop):
1977         (WebCore::RenderBlock::borderLeft):
1978         (WebCore::RenderBlock::borderBottom):
1979         (WebCore::RenderBlock::borderRight):
1980         (WebCore::RenderBlock::borderBefore):
1981         These methods are overridden for border to ensure that the intrinsic border added by a tall legend is
1982         properly factored in.
1983
1984         (WebCore::RenderBlock::computePreferredWidthsForExcludedChildren):
1985         * rendering/RenderBlock.h:
1986         This method computes the preferred widths for legend children in order to ensure that the legend properly
1987         grows the width of the fieldset when it is the widest item.
1988
1989         (WebCore::RenderBlock::adjustBorderBoxLogicalHeightForBoxSizing):
1990         (WebCore::RenderBlock::adjustContentBoxLogicalHeightForBoxSizing):
1991         Preserve the behavior of fieldsets in that the available content size includes the space lost accounting
1992         for the legend. I don't think this makes much sense, but it matches the behavior of other browsers
1993         (and our old behavior).
1994
1995         (WebCore::RenderBlock::paintExcludedChildrenInBorder):
1996         Method for painting the excluded children that might be present in our border. We only do this if the
1997         paint phase is a box decoration painting phase and if the legend isn't self-painting.
1998
1999         * rendering/RenderBlockFlow.cpp:
2000         (WebCore::RenderBlockFlow::willCreateColumns):
2001         Allow fieldsets to create columns now.
2002
2003         (WebCore::RenderBlockFlow::layoutBlockChildren):
2004         (WebCore::RenderBlockFlow::layoutExcludedChildren):
2005         Renamed this method and change it to call the base class to ensure that legends in multicolumn fieldsets
2006         get handled properly.
2007
2008         (WebCore::RenderBlockFlow::addChild):
2009         Patched to make sure legends don't get put into the multicolumn flow thread, as they need to
2010         remain outside of it.
2011
2012         (WebCore::RenderBlockFlow::layoutSpecialExcludedChild): Deleted.
2013         Renamed to layoutExcludedChildren.
2014
2015         * rendering/RenderBlockFlow.h:
2016         * rendering/RenderBox.cpp:
2017         (WebCore::RenderBox::paintBoxDecorations):
2018         (WebCore::RenderBox::paintMask):
2019         Patched to call the new adjustBorderBoxRectForPainting and paintRectToClipOutFromBorder methods in
2020         order to properly shrink the border box rect for painting and to clip out the portion of the border
2021         covered by the legend.
2022
2023         (WebCore::RenderBox::avoidsFloats):
2024         Add fieldsets as avoiding floats. RenderFieldset used to subclass this method to return true, but with
2025         its removal, we need to put this in the base class along with legends.
2026
2027         * rendering/RenderBox.h:
2028         (WebCore::RenderBox::isGridItem):
2029         (WebCore::RenderBox::isFlexItem):
2030         Patched to exclude legends so that they don't try to size like they are really in the grid or flexbox.
2031
2032         (WebCore::RenderBox::adjustBorderBoxRectForPainting):
2033         This method is overridden by RenderBLock to handle adjusting fieldset border rects for painting.
2034
2035         * rendering/RenderBoxModelObject.cpp:
2036         (WebCore::RenderBoxModelObject::paintBorder):
2037         * rendering/RenderBoxModelObject.h:
2038         (WebCore::RenderBoxModelObject::paintRectToClipOutFromBorder):
2039         Patched to properly paint fieldsets using the new helpers.
2040
2041         * rendering/RenderDeprecatedFlexibleBox.cpp:
2042         (WebCore::FlexBoxIterator::next):
2043         (WebCore::RenderDeprecatedFlexibleBox::layoutBlock):
2044         (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox):
2045         Make sure deprecated flexible boxes lay out their legends properly by calling layoutExcludedChildren.
2046
2047         * rendering/RenderElement.cpp:
2048         (WebCore::RenderElement::createFor):
2049         * rendering/RenderElement.h:
2050         Patched to take a flag that limits what renderers can be created so that fieldsets don't make table
2051         display types.
2052
2053         * rendering/RenderFieldset.cpp: Removed.
2054         * rendering/RenderFieldset.h: Removed.
2055         Remove RenderFieldset files from the tree.
2056
2057         * rendering/RenderFlexibleBox.cpp:
2058         (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
2059         (WebCore::RenderFlexibleBox::firstLineBaseline):
2060         (WebCore::RenderFlexibleBox::layoutBlock):
2061         (WebCore::RenderFlexibleBox::layoutFlexItems):
2062         (WebCore::RenderFlexibleBox::prepareOrderIteratorAndMargins):
2063         Make sure flexible boxes lay out their legends properly by calling layoutExcludedChildren.
2064         Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't
2065         part of the flexible box layout.
2066
2067         * rendering/RenderGrid.cpp:
2068         (WebCore::RenderGrid::layoutBlock):
2069         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
2070         (WebCore::RenderGrid::placeItemsOnGrid):
2071         (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
2072         (WebCore::RenderGrid::layoutGridItems):
2073         Make sure grids lay out their legends properly by calling layoutExcludedChildren.
2074         Patch methods to use the OrderIterator's new shouldSkipChild method to ensure legends aren't
2075         part of the grid's layout.
2076
2077         * rendering/RenderMultiColumnFlowThread.cpp:
2078         (WebCore::RenderMultiColumnFlowThread::populate):
2079         Pull legends back up into the block and don't let them be part of the flow thread.
2080
2081         * rendering/RenderMultiColumnSet.cpp:
2082         (WebCore::RenderMultiColumnSet::requiresBalancing):
2083         Fix an assert to allow legends to exist as siblings of multicolumn sets.
2084
2085         * rendering/RenderObject.cpp:
2086         (WebCore::RenderObject::isFieldset):
2087         Changed to examine the HTML element rather than RenderFieldset.
2088
2089         * rendering/RenderObject.h:
2090         (WebCore::RenderObject::isExcludedFromNormalLayout):
2091         (WebCore::RenderObject::setIsExcludedFromNormalLayout):
2092         (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
2093         RenderObjects now have a new bit that is set for excluded objects like legends, flow threads,
2094         placeholders, and ruby text. This bit lets code easily detect that an object is excluded from
2095         the layout system and can be skipped.
2096
2097         (WebCore::RenderObject::isExcludedAndPlacedInBorder):
2098         Helper method for asking if an object is painting inside the border. Used to know we
2099         need to factor it into preferred width calculations outside of any one layout system
2100         and also to know that we need to paint it when we paint the fieldset's border instead of
2101         later (after we might have scrolled or clipped the child painting area).
2102
2103         * rendering/RenderRubyRun.cpp:
2104         (WebCore::RenderRubyRun::layoutExcludedChildren):
2105         (WebCore::RenderRubyRun::layoutSpecialExcludedChild): Deleted.
2106         * rendering/RenderRubyRun.h:
2107         Rename layoutSpecialExcludedChild to layoutExcludedChildren.
2108
2109         * rendering/RenderTable.cpp:
2110         (WebCore::RenderTable::adjustBorderBoxRectForPainting):
2111         (WebCore::RenderTable::paintBoxDecorations):
2112         (WebCore::RenderTable::paintMask):
2113         (WebCore::RenderTable::subtractCaptionRect): Deleted.
2114         * rendering/RenderTable.h:
2115         Patched tables to share the same border box rect adjustment used by fieldsets when subtracting
2116         out captions. This is prep work to allow tables to be fieldsets, but for now I didn't go all the
2117         way.
2118
2119         * rendering/RenderTableCell.cpp:
2120         (WebCore::RenderTableCell::paintBoxDecorations):
2121         (WebCore::RenderTableCell::paintMask):
2122         Make sure table cells adjust their border box rects for painting. Again this is prep work for
2123         cells potentially being fieldsets, but not supported yet.
2124
2125         * rendering/RenderTextControl.cpp:
2126         (WebCore::RenderTextControl::layoutExcludedChildren):
2127         (WebCore::RenderTextControl::layoutSpecialExcludedChild): Deleted.
2128         * rendering/RenderTextControl.h:
2129         * rendering/RenderTextControlMultiLine.cpp:
2130         (WebCore::RenderTextControlMultiLine::layoutExcludedChildren):
2131         (WebCore::RenderTextControlMultiLine::layoutSpecialExcludedChild): Deleted.
2132         * rendering/RenderTextControlMultiLine.h:
2133         Renamed the methods for doing the excluded child layout.
2134
2135         * rendering/RenderTreeAsText.cpp:
2136         (WebCore::RenderTreeAsText::writeRenderObject):
2137         Make sure to dump the original fieldset border and not the border with the extra legend stuff in it.
2138
2139 2017-03-03  Ryan Haddad  <ryanhaddad@apple.com>
2140
2141         Unreviewed, rolling out r213344.
2142
2143         This changed caused LayoutTest crashes under GuardMalloc.
2144
2145         Reverted changeset:
2146
2147         "Add support for canvas.toBlob"
2148         https://bugs.webkit.org/show_bug.cgi?id=148878
2149         http://trac.webkit.org/changeset/213344
2150
2151 2017-03-03  Konstantin Tokarev  <annulen@yandex.ru>
2152
2153         Unreviewed typo fix
2154
2155         * features.json:
2156
2157 2017-03-03  Eric Carlson  <eric.carlson@apple.com>
2158
2159         [MediaStream] Remove #if USE(VIDEOTOOLBOX) from AVVideoCaptureSource
2160         https://bugs.webkit.org/show_bug.cgi?id=169131
2161
2162         Reviewed by Youenn Fablet.
2163
2164         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2165         (WebCore::AVVideoCaptureSource::currentFrameCGImage):
2166
2167 2017-03-03  Chris Dumez  <cdumez@apple.com>
2168
2169         Add assertion in Frame::setView() to make sure associated document has no living render tree
2170         https://bugs.webkit.org/show_bug.cgi?id=169134
2171
2172         Reviewed by Brent Fulgham.
2173
2174         Add assertion in Frame::setView() to make sure associated document has no living render tree.
2175         This is not supposed to happen and r213311 fixed one case where this could happen. We need
2176         to find out if it can still happen.
2177
2178         * page/Frame.cpp:
2179         (WebCore::Frame::setView):
2180
2181 2017-03-02  Sam Weinig  <sam@webkit.org>
2182
2183         Rename htmlediting.h/cpp to Editing.h/cpp
2184         https://bugs.webkit.org/show_bug.cgi?id=169103
2185
2186         Reviewed by Alex Christensen.
2187
2188         * CMakeLists.txt:
2189         * WebCore.xcodeproj/project.pbxproj:
2190         * accessibility/AXObjectCache.cpp:
2191         * accessibility/AccessibilityNodeObject.cpp:
2192         * accessibility/AccessibilityObject.cpp:
2193         * accessibility/AccessibilityRenderObject.cpp:
2194         * accessibility/atk/WebKitAccessibleHyperlink.cpp:
2195         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2196         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2197         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2198         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2199         * dom/Document.cpp:
2200         * dom/Element.cpp:
2201         * dom/Node.h:
2202         * dom/Position.cpp:
2203         * dom/PositionIterator.cpp:
2204         * dom/Range.cpp:
2205         * editing/AlternativeTextController.cpp:
2206         * editing/AppendNodeCommand.cpp:
2207         * editing/ApplyBlockElementCommand.cpp:
2208         * editing/ApplyStyleCommand.cpp:
2209         * editing/BreakBlockquoteCommand.cpp:
2210         * editing/CompositeEditCommand.cpp:
2211         * editing/CreateLinkCommand.cpp:
2212         (WebCore::CreateLinkCommand::CreateLinkCommand):
2213         * editing/DeleteFromTextNodeCommand.cpp:
2214         * editing/DeleteSelectionCommand.cpp:
2215         * editing/EditCommand.cpp:
2216         * editing/Editing.cpp: Copied from Source/WebCore/editing/htmlediting.cpp.
2217         * editing/Editing.h: Copied from Source/WebCore/editing/htmlediting.h.
2218         * editing/EditingAllInOne.cpp:
2219         * editing/EditingStyle.cpp:
2220         * editing/Editor.cpp:
2221         * editing/EditorCommand.cpp:
2222         * editing/FormatBlockCommand.cpp:
2223         * editing/FrameSelection.cpp:
2224         * editing/HTMLInterchange.cpp:
2225         * editing/IndentOutdentCommand.cpp:
2226         * editing/InsertLineBreakCommand.cpp:
2227         * editing/InsertListCommand.cpp:
2228         * editing/InsertNodeBeforeCommand.cpp:
2229         * editing/InsertParagraphSeparatorCommand.cpp:
2230         * editing/InsertTextCommand.cpp:
2231         * editing/ModifySelectionListLevel.cpp:
2232         * editing/RemoveNodeCommand.cpp:
2233         * editing/ReplaceNodeWithSpanCommand.cpp:
2234         * editing/ReplaceSelectionCommand.cpp:
2235         * editing/SpellChecker.cpp:
2236         * editing/TextIterator.cpp:
2237         * editing/TypingCommand.cpp:
2238         * editing/VisiblePosition.cpp:
2239         * editing/VisibleSelection.cpp:
2240         * editing/VisibleUnits.cpp:
2241         * editing/cocoa/DataDetection.mm:
2242         * editing/cocoa/EditorCocoa.mm:
2243         * editing/htmlediting.cpp: Removed.
2244         * editing/htmlediting.h: Removed.
2245         * editing/ios/EditorIOS.mm:
2246         * editing/mac/DictionaryLookup.mm:
2247         * editing/mac/EditorMac.mm:
2248         * editing/markup.cpp:
2249         * html/HTMLTextFormControlElement.cpp:
2250         * inspector/InspectorDOMAgent.cpp:
2251         * page/DOMSelection.cpp:
2252         * page/DragController.cpp:
2253         * page/EventHandler.cpp:
2254         * page/FocusController.cpp:
2255         * page/Frame.cpp:
2256         * platform/ios/PasteboardIOS.mm:
2257         * platform/mac/PasteboardMac.mm:
2258         * rendering/RenderBox.cpp:
2259         * rendering/RenderObject.cpp:
2260
2261 2017-03-02  Matt Baker  <mattbaker@apple.com>
2262
2263         Web Inspector: Should be able to push nodes in an iframe subtree to the frontend
2264         https://bugs.webkit.org/show_bug.cgi?id=169086
2265
2266         Reviewed by Joseph Pecoraro.
2267
2268         Test: inspector/dom/push-node-by-path-to-frontend.html
2269
2270         * inspector/InspectorDOMAgent.cpp:
2271         (WebCore::InspectorDOMAgent::nodeForPath):
2272         During top-down document traversal, descend into content document nodes
2273         when visiting an HTMLFrameOwnerElement.
2274
2275 2017-03-02  Ryan Haddad  <ryanhaddad@apple.com>
2276
2277         Unreviewed, rolling out r213274.
2278
2279         This change caused flakiness with LayoutTest memory/memory-
2280         pressure-simulation.html
2281
2282         Reverted changeset:
2283
2284         "Don't keep dead resources in MemoryCache while under memory
2285         pressure."
2286         https://bugs.webkit.org/show_bug.cgi?id=169070
2287         http://trac.webkit.org/changeset/213274
2288
2289 2017-03-02  Jiewen Tan  <jiewen_tan@apple.com>
2290
2291         WebCrypto API support for AES-GCM
2292         https://bugs.webkit.org/show_bug.cgi?id=157175
2293         <rdar://problem/27311691>
2294
2295         Reviewed by Brent Fulgham.
2296
2297         This patch adds support for AES-GCM. Operations of AES-GCM include: encrypt, decrypt, generateKey,
2298         importKey, exportKey, wrapKey, and unwrapKey. https://www.w3.org/TR/WebCryptoAPI/#aes-gcm
2299
2300         Tests: crypto/subtle/aes-gcm-decrypt-malformed-parameters.html
2301                crypto/subtle/aes-gcm-encrypt-malformed-parameters.html
2302                crypto/subtle/aes-gcm-generate-export-key-jwk-length-128.html
2303                crypto/subtle/aes-gcm-generate-export-key-jwk-length-192.html
2304                crypto/subtle/aes-gcm-generate-export-key-jwk-length-256.html
2305                crypto/subtle/aes-gcm-generate-export-raw-key.html
2306                crypto/subtle/aes-gcm-generate-key-encrypt-decrypt.html
2307                crypto/subtle/aes-gcm-generate-key.html
2308                crypto/subtle/aes-gcm-import-jwk-key-length-128.html
2309                crypto/subtle/aes-gcm-import-jwk-key-length-192.html
2310                crypto/subtle/aes-gcm-import-jwk-key-length-256.html
2311                crypto/subtle/aes-gcm-import-key-decrypt-additional-data-tag-length-32.html
2312                crypto/subtle/aes-gcm-import-key-decrypt-additional-data.html
2313                crypto/subtle/aes-gcm-import-key-decrypt-tagLengths.html
2314                crypto/subtle/aes-gcm-import-key-decrypt.html
2315                crypto/subtle/aes-gcm-import-key-encrypt-additional-data-tag-length-32.html
2316                crypto/subtle/aes-gcm-import-key-encrypt-additional-data.html
2317                crypto/subtle/aes-gcm-import-key-encrypt-tagLengths.html
2318                crypto/subtle/aes-gcm-import-key-encrypt.html
2319                crypto/subtle/aes-gcm-import-key-unwrap-jwk-key.html
2320                crypto/subtle/aes-gcm-import-key-unwrap-raw-key.html
2321                crypto/subtle/aes-gcm-import-key-wrap-jwk-key.html
2322                crypto/subtle/aes-gcm-import-key-wrap-raw-key.html
2323                crypto/subtle/aes-gcm-import-raw-key.html
2324                crypto/workers/subtle/aes-gcm-import-key-decrypt.html
2325                crypto/workers/subtle/aes-gcm-import-key-encrypt.html
2326                crypto/workers/subtle/aes-gcm-import-key-unwrap-key.html
2327                crypto/workers/subtle/aes-gcm-import-key-wrap-key.html
2328
2329         * CMakeLists.txt:
2330         * DerivedSources.make:
2331         * PlatformGTK.cmake:
2332         * PlatformMac.cmake:
2333         Add CryptoAlgorithmAES_CFBMac.cpp as well.
2334         * WebCore.xcodeproj/project.pbxproj:
2335         * bindings/js/JSSubtleCryptoCustom.cpp:
2336         (WebCore::normalizeCryptoAlgorithmParameters):
2337         Add support for AES-GCM.
2338         * crypto/CommonCryptoUtilities.h:
2339         Include SPI header for AES-GCM support. We have a mismatch SPI between different OS version.
2340         Therefore, a guardian is placed.
2341         * crypto/CryptoAlgorithmParameters.h:
2342         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp: Added.
2343         (WebCore::usagesAreInvalidForCryptoAlgorithmAES_GCM):
2344         (WebCore::tagLengthIsValid):
2345         (WebCore::CryptoAlgorithmAES_GCM::create):
2346         (WebCore::CryptoAlgorithmAES_GCM::identifier):
2347         (WebCore::CryptoAlgorithmAES_GCM::encrypt):
2348         (WebCore::CryptoAlgorithmAES_GCM::decrypt):
2349         (WebCore::CryptoAlgorithmAES_GCM::generateKey):
2350         (WebCore::CryptoAlgorithmAES_GCM::importKey):
2351         (WebCore::CryptoAlgorithmAES_GCM::exportKey):
2352         * crypto/algorithms/CryptoAlgorithmAES_GCM.h: Added.
2353         * crypto/gnutls/CryptoAlgorithmAES_GCMGnuTLS.cpp: Added.
2354         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2355         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2356         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp: Added.
2357         (WebCore::encryptAES_GCM):
2358         (WebCore::decyptAES_GCM):
2359         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2360         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2361         * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
2362         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
2363         * crypto/parameters/AesGcmParams.idl: Added.
2364         * crypto/parameters/CryptoAlgorithmAesGcmParams.h: Added.
2365
2366 2017-03-02  Andy Estes  <aestes@apple.com>
2367
2368         Add support for canvas.toBlob
2369         https://bugs.webkit.org/show_bug.cgi?id=148878
2370         <rdar://problem/22590406>
2371
2372         Reviewed by Tim Horton.
2373
2374         These tests now pass:
2375         imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.jpeg.html
2376         imported/w3c/web-platform-tests/html/semantics/embedded-content/the-canvas-element/toBlob.png.html
2377
2378         * CMakeLists.txt:
2379         * DerivedSources.make:
2380         * WebCore.xcodeproj/project.pbxproj:
2381         * fileapi/BlobCallback.cpp: Added.
2382         (WebCore::BlobCallback::scheduleCallback):
2383         * fileapi/BlobCallback.h: Added.
2384         (WebCore::BlobCallback::~BlobCallback):
2385         * fileapi/BlobCallback.idl: Added.
2386         * html/HTMLCanvasElement.cpp:
2387         (WebCore::HTMLCanvasElement::toBlob):
2388         * html/HTMLCanvasElement.h:
2389         * html/HTMLCanvasElement.idl:
2390         * platform/graphics/ImageBuffer.h:
2391         * platform/graphics/cairo/ImageBufferCairo.cpp:
2392         (WebCore::writeFunction):
2393         (WebCore::encodeImage):
2394         (WebCore::ImageBuffer::toDataURL):
2395         (WebCore::ImageBuffer::toData):
2396         * platform/graphics/cg/ImageBufferCG.cpp:
2397         (WebCore::data):
2398         (WebCore::ImageBuffer::toDataURL):
2399         (WebCore::ImageBuffer::toData):
2400         (WebCore::ImageBuffer::toCGImage):
2401         (WebCore::cgImage):
2402         (WebCore::dataURL):
2403         * platform/graphics/gtk/ImageBufferGtk.cpp:
2404         (WebCore::ImageBuffer::toDataURL):
2405         (WebCore::ImageBuffer::toData):
2406         * platform/graphics/win/ImageBufferDirect2D.cpp:
2407         (WebCore::ImageBuffer::toData):
2408
2409 2017-03-02  Myles C. Maxfield  <mmaxfield@apple.com>
2410
2411         Migrate font-stretch to use fixed-point values
2412         https://bugs.webkit.org/show_bug.cgi?id=169107
2413
2414         Reviewed by Dean Jackson.
2415
2416         There are a few benefits of using fixed-point values:
2417         - Not all of the entropy of a float is necessary for font selection. In particular, values are
2418         expected to stay between around -1000 to 1000, and only need to have a few fractional bits.
2419         Therefore, the values can be represented by 16-bit fixed point numbers, which includes one sign
2420         bit and two fractional bits. This is smaller than the 32-bit floating point numbers we were
2421         using, which means FontDescription can be slimmed down. This becomes even more important when
2422         the rest of the variation font properties are implemented, since those will use these fixed-
2423         point values too.
2424         - Fixed point values have a larger distance between adjacent representable values, which means
2425         there are more collisions, which means our cache hit rates are higher.
2426
2427         No new tests because there is no behavior change.
2428
2429         * css/CSSComputedStyleDeclaration.cpp:
2430         (WebCore::fontStretchFromStyle):
2431         * css/StyleBuilderConverter.h:
2432         (WebCore::StyleBuilderConverter::convertFontStretch):
2433         * platform/graphics/FontCache.h:
2434         (WebCore::FontDescriptionKey::FontDescriptionKey):
2435         * platform/graphics/FontDescription.h:
2436         (WebCore::FontDescription::stretch):
2437         (WebCore::FontDescription::setStretch):
2438         (WebCore::FontCascadeDescription::initialStretch):
2439         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2440         (WebCore::defaultFontSelectionValues):
2441         (WebCore::preparePlatformFont):
2442         (WebCore::FontDatabase::InstalledFont::InstalledFont):
2443         (WebCore::FontDatabase::InstalledFontFamily::expand):
2444         (WebCore::FontDatabase::capabilitiesForFontDescriptor):
2445         (WebCore::FontDatabase::stretchThreshold):
2446         (WebCore::FontDatabase::italicThreshold):
2447         (WebCore::FontDatabase::weightThreshold):
2448         (WebCore::findClosestStretch):
2449         (WebCore::filterStretch):
2450         (WebCore::findClosestStyle):
2451         (WebCore::filterStyle):
2452         (WebCore::findClosestWeight):
2453         (WebCore::filterWeight):
2454         (WebCore::computeTargetWeight):
2455         (WebCore::findClosestFont):
2456         (WebCore::platformFontLookupWithFamily):
2457         (WebCore::fontWithFamily):
2458         (WebCore::defaultVariationValues): Deleted.
2459         (WebCore::FontDatabase::Range::Range): Deleted.
2460         (WebCore::FontDatabase::Range::isValid): Deleted.
2461         (WebCore::FontDatabase::Range::expand): Deleted.
2462         (WebCore::FontDatabase::Range::includes): Deleted.
2463         (): Deleted.
2464         * platform/text/TextFlags.h:
2465         (WebCore::FontSelectionValue::FontSelectionValue):
2466         (WebCore::FontSelectionValue::operator float):
2467         (WebCore::FontSelectionValue::operator+):
2468         (WebCore::FontSelectionValue::operator-):
2469         (WebCore::FontSelectionValue::operator*):
2470         (WebCore::FontSelectionValue::operator/):
2471         (WebCore::FontSelectionValue::operator==):
2472         (WebCore::FontSelectionValue::operator!=):
2473         (WebCore::FontSelectionValue::operator<):
2474         (WebCore::FontSelectionValue::operator<=):
2475         (WebCore::FontSelectionValue::operator>):
2476         (WebCore::FontSelectionValue::operator>=):
2477         (WebCore::FontSelectionValue::rawValue):
2478         (WebCore::FontSelectionRange::isValid):
2479         (WebCore::FontSelectionRange::expand):
2480         (WebCore::FontSelectionRange::includes):
2481         (WebCore::FontSelectionCapabilities::expand):
2482
2483 2017-03-02  Alex Christensen  <achristensen@webkit.org>
2484
2485         Modernize ContentExtensionParser
2486         https://bugs.webkit.org/show_bug.cgi?id=169106
2487
2488         Reviewed by Andy Estes.
2489
2490         We were returning std::error_code and passing the return value as a parameter reference.
2491         because we wrote this code before we had WTF::Expected.
2492
2493         No change in behavior, verified by many API tests.
2494
2495         * contentextensions/ContentExtensionCompiler.cpp:
2496         (WebCore::ContentExtensions::compileRuleList):
2497         * contentextensions/ContentExtensionParser.cpp:
2498         (WebCore::ContentExtensions::getDomainList):
2499         (WebCore::ContentExtensions::loadTrigger):
2500         (WebCore::ContentExtensions::loadAction):
2501         (WebCore::ContentExtensions::loadRule):
2502         (WebCore::ContentExtensions::loadEncodedRules):
2503         (WebCore::ContentExtensions::parseRuleList):
2504         * contentextensions/ContentExtensionParser.h:
2505         * contentextensions/ContentExtensionRule.cpp:
2506         (WebCore::ContentExtensions::ContentExtensionRule::ContentExtensionRule):
2507         * contentextensions/ContentExtensionRule.h:
2508
2509 2017-03-02  Ryan Haddad  <ryanhaddad@apple.com>
2510
2511         Unreviewed, rolling out r213301.
2512
2513         This change broke internal builds.
2514
2515         Reverted changeset:
2516
2517         "WebCrypto API support for AES-GCM"
2518         https://bugs.webkit.org/show_bug.cgi?id=157175
2519         http://trac.webkit.org/changeset/213301
2520
2521 2017-03-02  Aakash Jain  <aakash_jain@apple.com>
2522
2523         Move stringMatchesWildcardString from WebKit2 to WebCore
2524         https://bugs.webkit.org/show_bug.cgi?id=169065
2525
2526         Reviewed by Alexey Proskuryakov.
2527
2528         * WebCore.xcodeproj/project.pbxproj: Added StringUtilities.h and StringUtilities.mm
2529         * PlatformMac.cmake: Added StringUtilities.mm
2530         * platform/mac/StringUtilities.h: Added.
2531         * platform/mac/StringUtilities.mm: Added.
2532         (WebCore::wildcardRegexPatternString): Added.
2533         (WebCore::stringMatchesWildcardString): Added.
2534
2535 2017-02-28  Matt Rajca  <mrajca@apple.com>
2536
2537         Media: send "did interfere with playback" events when the user pauses an autoplaying element
2538         https://bugs.webkit.org/show_bug.cgi?id=169006
2539
2540         Reviewed by Alex Christensen.
2541
2542         Added API tests.
2543
2544         * html/HTMLMediaElement.cpp:
2545         (WebCore::HTMLMediaElement::pauseInternal):
2546
2547 2017-03-02  Chris Dumez  <cdumez@apple.com>
2548
2549         We should prevent load of subframes inserted during FrameTree deconstruction
2550         https://bugs.webkit.org/show_bug.cgi?id=169095
2551
2552         Reviewed by Brent Fulgham.
2553
2554         When deconstructing the FrameTree, we fire the unload event in each subframe.
2555         Such unload event handler may insert a new frame, we would previously load
2556         such new frame which was unsafe as we would end up with an attached subframe
2557         on a detached tree. To address the issue, we prevent new subframes from loading
2558         while deconstructing the FrameTree and firing the unload events. This new
2559         behavior is consistent with Chrome and should therefore be safe from a
2560         compatibility standpoint.
2561
2562         Test: fast/frames/insert-frame-unload-handler.html
2563
2564         * dom/ContainerNodeAlgorithms.cpp:
2565         (WebCore::disconnectSubframes):
2566         Update SubframeLoadingDisabler call site now that the constructor takes in
2567         a pointer instead of a reference.
2568
2569         * html/HTMLFrameOwnerElement.h:
2570         (WebCore::SubframeLoadingDisabler::SubframeLoadingDisabler):
2571         (WebCore::SubframeLoadingDisabler::~SubframeLoadingDisabler):
2572         Update SubframeLoadingDisabler constructor to take in a pointer instead
2573         of a reference, for convenience.
2574
2575         * loader/FrameLoader.cpp:
2576         (WebCore::FrameLoader::detachChildren):
2577         Prevent loads in subframes while detaching the subframes. It would be unsafe
2578         as we copy the list of frames before iterating to fire the unload events.
2579         Therefore, newly inserted frames would not get unloaded.
2580
2581 2017-03-02  Dave Hyatt  <hyatt@apple.com>
2582
2583         flex-basis should be 0% (not 0px) when omitted
2584         https://bugs.webkit.org/show_bug.cgi?id=169100
2585         rdar://problem/30429154
2586
2587         Reviewed by Dean Jackson.
2588
2589         Covered by existing tests.
2590
2591         * css/parser/CSSPropertyParser.cpp:
2592         (WebCore::CSSPropertyParser::consumeFlex):
2593
2594 2017-02-22  Jiewen Tan  <jiewen_tan@apple.com>
2595
2596         WebCrypto API support for AES-GCM
2597         https://bugs.webkit.org/show_bug.cgi?id=157175
2598         <rdar://problem/27311691>
2599
2600         Reviewed by Brent Fulgham.
2601
2602         This patch adds support for AES-GCM. Operations of AES-GCM include: encrypt, decrypt, generateKey,
2603         importKey, exportKey, wrapKey, and unwrapKey. https://www.w3.org/TR/WebCryptoAPI/#aes-gcm
2604
2605         Tests: crypto/subtle/aes-gcm-decrypt-malformed-parameters.html
2606                crypto/subtle/aes-gcm-encrypt-malformed-parameters.html
2607                crypto/subtle/aes-gcm-generate-export-key-jwk-length-128.html
2608                crypto/subtle/aes-gcm-generate-export-key-jwk-length-192.html
2609                crypto/subtle/aes-gcm-generate-export-key-jwk-length-256.html
2610                crypto/subtle/aes-gcm-generate-export-raw-key.html
2611                crypto/subtle/aes-gcm-generate-key-encrypt-decrypt.html
2612                crypto/subtle/aes-gcm-generate-key.html
2613                crypto/subtle/aes-gcm-import-jwk-key-length-128.html
2614                crypto/subtle/aes-gcm-import-jwk-key-length-192.html
2615                crypto/subtle/aes-gcm-import-jwk-key-length-256.html
2616                crypto/subtle/aes-gcm-import-key-decrypt-additional-data-tag-length-32.html
2617                crypto/subtle/aes-gcm-import-key-decrypt-additional-data.html
2618                crypto/subtle/aes-gcm-import-key-decrypt-tagLengths.html
2619                crypto/subtle/aes-gcm-import-key-decrypt.html
2620                crypto/subtle/aes-gcm-import-key-encrypt-additional-data-tag-length-32.html
2621                crypto/subtle/aes-gcm-import-key-encrypt-additional-data.html
2622                crypto/subtle/aes-gcm-import-key-encrypt-tagLengths.html
2623                crypto/subtle/aes-gcm-import-key-encrypt.html
2624                crypto/subtle/aes-gcm-import-key-unwrap-jwk-key.html
2625                crypto/subtle/aes-gcm-import-key-unwrap-raw-key.html
2626                crypto/subtle/aes-gcm-import-key-wrap-jwk-key.html
2627                crypto/subtle/aes-gcm-import-key-wrap-raw-key.html
2628                crypto/subtle/aes-gcm-import-raw-key.html
2629                crypto/workers/subtle/aes-gcm-import-key-decrypt.html
2630                crypto/workers/subtle/aes-gcm-import-key-encrypt.html
2631                crypto/workers/subtle/aes-gcm-import-key-unwrap-key.html
2632                crypto/workers/subtle/aes-gcm-import-key-wrap-key.html
2633
2634         * CMakeLists.txt:
2635         * DerivedSources.make:
2636         * PlatformGTK.cmake:
2637         * PlatformMac.cmake:
2638         Add CryptoAlgorithmAES_CFBMac.cpp as well.
2639         * WebCore.xcodeproj/project.pbxproj:
2640         * bindings/js/JSSubtleCryptoCustom.cpp:
2641         (WebCore::normalizeCryptoAlgorithmParameters):
2642         Add support for AES-GCM.
2643         * crypto/CommonCryptoUtilities.h:
2644         Include SPI header for AES-GCM support.
2645         * crypto/CryptoAlgorithmParameters.h:
2646         * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp: Added.
2647         (WebCore::usagesAreInvalidForCryptoAlgorithmAES_GCM):
2648         (WebCore::tagLengthIsValid):
2649         (WebCore::CryptoAlgorithmAES_GCM::create):
2650         (WebCore::CryptoAlgorithmAES_GCM::identifier):
2651         (WebCore::CryptoAlgorithmAES_GCM::encrypt):
2652         (WebCore::CryptoAlgorithmAES_GCM::decrypt):
2653         (WebCore::CryptoAlgorithmAES_GCM::generateKey):
2654         (WebCore::CryptoAlgorithmAES_GCM::importKey):
2655         (WebCore::CryptoAlgorithmAES_GCM::exportKey):
2656         * crypto/algorithms/CryptoAlgorithmAES_GCM.h: Added.
2657         * crypto/gnutls/CryptoAlgorithmAES_GCMGnuTLS.cpp: Added.
2658         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2659         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2660         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp: Added.
2661         (WebCore::encryptAES_GCM):
2662         (WebCore::decyptAES_GCM):
2663         (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
2664         (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
2665         * crypto/mac/CryptoAlgorithmRegistryMac.cpp:
2666         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
2667         * crypto/parameters/AesGcmParams.idl: Added.
2668         * crypto/parameters/CryptoAlgorithmAesGcmParams.h: Added.
2669
2670 2017-03-02  Alex Christensen  <achristensen@webkit.org>
2671
2672         Continue enabling WebRTC
2673         https://bugs.webkit.org/show_bug.cgi?id=169056
2674
2675         Reviewed by Jon Lee.
2676
2677         * Configurations/FeatureDefines.xcconfig:
2678
2679 2017-03-02  Ryan Haddad  <ryanhaddad@apple.com>
2680
2681         Unreviewed, rolling out r213281.
2682
2683         This change caused API test WebKit2.UserMediaBasic to time
2684         out.
2685
2686         Reverted changeset:
2687
2688         "[MediaStream] UIClient may not be notified of capture state
2689         change when leaving a page"
2690         https://bugs.webkit.org/show_bug.cgi?id=169014
2691         http://trac.webkit.org/changeset/213281
2692
2693 2017-03-02  Jon Lee  <jonlee@apple.com>
2694
2695         Improve consistency of captions rendering on Mac
2696         https://bugs.webkit.org/show_bug.cgi?id=169071
2697
2698         Reviewed by Eric Carlson.
2699
2700         * page/CaptionUserPreferencesMediaAF.h:
2701         (WebCore::CaptionUserPreferencesMediaAF::captionsEdgeColorForTextColor): Deleted.
2702         (WebCore::CaptionUserPreferencesMediaAF::cssPropertyWithTextEdgeColor): Deleted.
2703
2704         * page/CaptionUserPreferencesMediaAF.cpp:
2705         (WebCore::appendCSS): Helper function to add a CSS rule with a provided StringBuilder.
2706         (WebCore::CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS): Refactor to use
2707         appendCSS.
2708         (WebCore::CaptionUserPreferencesMediaAF::colorPropertyCSS): Ditto.
2709         (WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS): Update text edge styles.
2710         - Add a blur to the shadow
2711         - Drop shadow style includes 1px text border
2712         - Always use black for the text edge color
2713         Also convert the stroke rules to using the CSS property and values instead of straight strings.
2714         (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride): Fly-by fix of a typo.
2715
2716 2017-03-02  Chris Dumez  <cdumez@apple.com>
2717
2718         Download attribute set to "*\" save file with name "example.com"
2719         https://bugs.webkit.org/show_bug.cgi?id=169066
2720         <rdar://problem/30740875>
2721
2722         Reviewed by Alex Christensen.
2723
2724         The issue is that a backslash in recognized as an escaping character in
2725         a quoted string as per RFC2616:
2726         "
2727         The backslash character ("\") MAY be used as a single-character
2728         quoting mechanism only within quoted-string and comment constructs.
2729         "
2730
2731         We therefore need to escape the backslashes in the filename before
2732         using it in the Content-Disposition header, inside the quoted string.
2733
2734         Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash.html
2735
2736         * platform/network/ResourceResponseBase.cpp:
2737         (WebCore::ResourceResponseBase::sanitizeSuggestedFilename):
2738
2739 2017-03-02  Youenn Fablet  <youenn@apple.com>
2740
2741         [WebRTC] Activate ICE candidate privacy policy
2742         https://bugs.webkit.org/show_bug.cgi?id=168975
2743
2744         Reviewed by Alex Christensen.
2745
2746         Test: webrtc/datachannel/filter-ice-candidate.html
2747
2748         * testing/Internals.cpp:
2749         (WebCore::Internals::Internals): Disabling ICE candidate filtering by default for rwt.
2750         (WebCore::Internals::setICECandidateFiltering):
2751         * testing/Internals.h:
2752         * testing/Internals.idl:
2753
2754 2017-03-02  Eric Carlson  <eric.carlson@apple.com>
2755
2756         [MediaStream] UIClient may not be notified of capture state change when leaving a page
2757         https://bugs.webkit.org/show_bug.cgi?id=169014
2758         <rdar://problem/30632267>
2759
2760         Reviewed by Youenn Fablet.
2761
2762         Enable and update the WebKit API test WebKit2.UserMedia.
2763
2764         * dom/Document.cpp:
2765         (WebCore::Document::prepareForDestruction): Always call page.updateIsPlayingMedia() if there
2766         is active media in the document because it won't be possible when the state changes later
2767         because the frame will have been cleared.
2768
2769 2017-03-02  Tomas Popela  <tpopela@redhat.com>
2770
2771         [WK2] Keyboard menu key should show context menu
2772         https://bugs.webkit.org/show_bug.cgi?id=72099
2773
2774         Reviewed by Carlos Garcia Campos.
2775
2776         Show the context menu when the GtkWidget::popup-menu signal is
2777         emitted. This signal is triggered by pressing a key (usually
2778         the Menu key or the Shift + F10 shortcut) or it could be emitted on
2779         WebKitWebView.
2780
2781         Test: fast/events/context-activated-by-key-event.html
2782
2783         Also could be tested by:
2784
2785         ManualTests/keyboard-menukey-event.html
2786         ManualTests/win/contextmenu-key.html
2787         ManualTests/win/contextmenu-key2.html
2788
2789         * page/EventHandler.cpp:
2790         (WebCore::EventHandler::sendContextMenuEventForKey):
2791         Correctly send the mouse event that used for showing the context menu.
2792         Previously the event was immediately dispatched as it is, but this was
2793         only the right way if some element was focused on the page. If there
2794         was no focused element or non-empty text range then the event lacked
2795         the right node, where it was supposed to be shown. The correct node
2796         is determined and added to the event in the sendContextMenuEvent() so
2797         we have to use this function to send the event.
2798
2799         Also use absoluteBoundingBoxRect() instead of
2800         pixelSnappedAbsoluteClippedOverflowRect() when determining
2801         a coordinate where to show the context menu for the currently focus
2802         element. The latter is not returning a right box (it is bigger) which
2803         could lead to the situation that no menu will be displayed at all,
2804         because the HitTest won't contain the right element as the
2805         determined coordinates could be outside of the element.
2806         * page/EventHandler.h:
2807
2808 2017-03-02  Carlos Garcia Campos  <cgarcia@igalia.com>
2809
2810         [GTK] Crash in WebCore::CoordinatedGraphicsLayer::notifyFlushRequired
2811         https://bugs.webkit.org/show_bug.cgi?id=166420
2812
2813         Reviewed by Žan Doberšek.
2814
2815         This is happening when closing a page that is being inspected. When CoordinatedGraphicsLayer::removeFromParent()
2816         is called, the coordinator has already been invalidated, so all its layers were set a nullptr coordinator. I
2817         think it's safe to simply handle m_coordinator being nullptr in notifyFlushRequired().
2818
2819         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2820         (WebCore::CoordinatedGraphicsLayer::notifyFlushRequired): Return early if the coordinator is nullptr.
2821
2822 2017-03-02  Andreas Kling  <akling@apple.com>
2823
2824         Don't keep dead resources in MemoryCache while under memory pressure.
2825         <https://webkit.org/b/169070>
2826
2827         Reviewed by Antti Koivisto.
2828
2829         Have CachedResource::deleteIfPossible() remove the resource from the MemoryCache
2830         if we're under memory pressure and that was the only thing keeping it alive.
2831
2832         This is consistent with the policy where dead resources are evicted from the cache
2833         as we come under pressure.
2834
2835         * loader/cache/CachedResource.cpp:
2836         (WebCore::CachedResource::deleteIfPossible):
2837
2838 2017-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
2839
2840         REGRESSION(r213062): [SOUP] UTF-8 filename in Content-Disposition header incorrectly handled since r213062
2841         https://bugs.webkit.org/show_bug.cgi?id=169024
2842
2843         Reviewed by Youenn Fablet.
2844
2845         This made test http/tests/download/literal-utf-8.html to start failing. The problem is that I removed the
2846         conversion made by String::fromUTF8WithLatin1Fallback that was added in r176930. I removed it because that made
2847         fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html to timeout. This patch brings back
2848         the String::fromUTF8WithLatin1Fallback call but only when the header string is 8 bit one.
2849
2850         Fixes: http/tests/download/literal-utf-8.html
2851
2852         * platform/network/soup/ResourceResponseSoup.cpp:
2853         (WebCore::ResourceResponse::platformSuggestedFilename):
2854
2855 2017-03-01  Alex Christensen  <achristensen@webkit.org>
2856
2857         Actually fix Windows build.
2858
2859         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2860         Win32Handle is now in WTF namespace.
2861
2862 2017-03-01  Alex Christensen  <achristensen@webkit.org>
2863
2864         Fix WinCairo build after r213214
2865         https://bugs.webkit.org/show_bug.cgi?id=168908
2866
2867         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2868
2869 2017-03-01  Myles C. Maxfield  <mmaxfield@apple.com>
2870
2871         Implement font-stretch for installed fonts
2872         https://bugs.webkit.org/show_bug.cgi?id=168888
2873
2874         Reviewed by Darin Adler and Dave Hyatt.
2875
2876         This patch implements the font-stretch property. Both parsing and the implementation is
2877         implemented. Contrary to the name, this property doesn't actually stretch fonts; instead,
2878         it provides one more input to the font selection routine.
2879
2880         The mapping from Core Text's [-1, 1] width values to font-stretch's percentage-based
2881         values is not perfect. For now, I've implemented a piecewise linear curve mapping the
2882         two. However, I expect to be able to improve this transfer function soon.
2883
2884         This patch does not implement the font-stretch descriptor in @font-face, and therefore
2885         does not work with web fonts. I will add this support in
2886         https://bugs.webkit.org/show_bug.cgi?id=168892. The reason it isn't done in this patch is
2887         it requires some architectural changes to our CSSFontFace classes which are large enough
2888         they should be separated into their own patch.
2889
2890         This patch lays the groundwork for implementing the 'wdth' variation axis. It does this
2891         by adding a floating-point value to RenderStyle instead of just an enum. The font-stretch
2892         keywords get converted to these floating-point numbers in accordance with the Fonts spec.
2893         This patch doesn't actually implement the variations piece of font-stretch, because that
2894         piece also requires some architectural changes. This patch just implements the installed
2895         font selection piece.
2896
2897         This patch also fixes the regression introduced in r213163 with Helvetica Neue. Now that
2898         our font selection algorithm has a concept of font stretch, weights 800 and 900 of
2899         Helvetica Neue are rendered as expected. (And this patch updates the tests to make sure.)
2900
2901         Tests: fast/text/font-stretch-parse.html
2902                fast/text/font-stretch-shorthand.html
2903                FontCacheTest.FontLookupFromFamilyName
2904
2905         * css/CSSComputedStyleDeclaration.cpp:
2906         (WebCore::fontStretchFromStyle): Map style values to CSS keywords.
2907         (WebCore::ComputedStyleExtractor::propertyValue): Call the above function.
2908         * css/CSSFontValue.cpp:
2909         (WebCore::CSSFontValue::customCSSText): Used in getComputedStyle() for the "font"
2910         shorthand.
2911         (WebCore::CSSFontValue::equals):
2912         * css/CSSFontValue.h:
2913         * css/CSSProperties.json:
2914         * css/StyleBuilderConverter.h:
2915         (WebCore::StyleBuilderConverter::convertFontStretch): Map CSS keywords to style values.
2916         * css/StyleProperties.cpp:
2917         (WebCore::StyleProperties::appendFontLonghandValueIfExplicit): Used for
2918         Element.style.font.
2919         (WebCore::StyleProperties::fontValue):
2920         * css/parser/CSSParserFastPaths.cpp:
2921         (WebCore::CSSParserFastPaths::isKeywordPropertyID): Now that variation fonts are being
2922         implemented, font-stretch is no longer a keyword property. Instead, it can also take a
2923         number or percentage.
2924         * css/parser/CSSPropertyParser.cpp:
2925         (WebCore::consumeFontStretch): Parse the value.
2926         (WebCore::CSSPropertyParser::parseSingleValue): Call the above function.
2927         (WebCore::CSSPropertyParser::consumeFont): Ditto.
2928         * platform/graphics/FontCache.h:
2929         (WebCore::FontDescriptionKey::FontDescriptionKey): Caches should be sensitive to this
2930         new value.
2931         (WebCore::FontDescriptionKey::operator==):
2932         (WebCore::FontDescriptionKey::computeHash):
2933         * platform/graphics/FontDescription.h:
2934         (WebCore::FontDescription::stretch): The parsed style value.
2935         (WebCore::FontDescription::setStretch):
2936         (WebCore::FontDescription::operator==):
2937         (WebCore::FontCascadeDescription::initialStretch):
2938         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2939         (WebCore::FontDatabase::InstalledFont::InstalledFont): Update the installed font selection
2940         algorithm to understand font-stretch.
2941         (WebCore::findClosestStretch):
2942         (WebCore::filterStretch):
2943         (WebCore::findClosestFont):
2944         (WebCore::platformFontLookupWithFamily):
2945         (WebCore::fontWithFamily):
2946         (WebCore::FontCache::createFontPlatformData):
2947
2948 2017-03-01  Antti Koivisto  <antti@apple.com>
2949
2950         Rename recalcStyle to resolveStyle and clean up the signature
2951         https://bugs.webkit.org/show_bug.cgi?id=169049
2952
2953         Reviewed by Sam Weinig.
2954
2955         Move to modern naming.
2956
2957         * dom/Document.cpp:
2958         (WebCore::Document::resolveStyle):
2959
2960             Only two of the possible values are used so pass in a two-value enum.
2961
2962         (WebCore::Document::updateStyleIfNeeded):
2963         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
2964         (WebCore::Document::createRenderTree):
2965         (WebCore::Document::finishedParsing):
2966         (WebCore::Document::webkitWillEnterFullScreenForElement):
2967         (WebCore::Document::recalcStyle): Deleted.
2968         * dom/Document.h:
2969         * inspector/InspectorOverlay.cpp:
2970         (WebCore::InspectorOverlay::update):
2971         * loader/DocumentWriter.cpp:
2972         (WebCore::DocumentWriter::reportDataReceived):
2973         * page/Frame.cpp:
2974         (WebCore::Frame::setPageAndTextZoomFactors):
2975         * page/Page.cpp:
2976         (WebCore::Page::setPageScaleFactor):
2977         * style/StyleTreeResolver.cpp:
2978         (WebCore::Style::TreeResolver::Parent::Parent):
2979         (WebCore::Style::TreeResolver::resolve):
2980
2981             Remove the argument, Document invalidates the document element if everything needs to be re-resolved.
2982
2983         * style/StyleTreeResolver.h:
2984
2985 2017-03-01  Alex Christensen  <achristensen@webkit.org>
2986
2987         Unreviewed, rolling out r213259.
2988
2989         Broke an internal build
2990
2991         Reverted changeset:
2992
2993         "Continue enabling WebRTC"
2994         https://bugs.webkit.org/show_bug.cgi?id=169056
2995         http://trac.webkit.org/changeset/213259
2996
2997 2017-03-01  Alex Christensen  <achristensen@webkit.org>
2998
2999         Continue enabling WebRTC
3000         https://bugs.webkit.org/show_bug.cgi?id=169056
3001
3002         Reviewed by Jon Lee.
3003
3004         * Configurations/FeatureDefines.xcconfig:
3005
3006 2017-03-01  Chris Dumez  <cdumez@apple.com>
3007
3008         [WK2][!NETWORK_SESSION] Failure to download when using a download attribute with no value on an anchor
3009         https://bugs.webkit.org/show_bug.cgi?id=169060
3010         <rdar://problem/30773140>
3011
3012         Reviewed by Darin Adler.
3013
3014         Make sure we never set the suggested filename to the empty string when
3015         the download attribute is present but has no value.
3016
3017         Test: http/tests/download/anchor-download-no-value.html
3018
3019         * loader/PolicyChecker.cpp:
3020         (WebCore::PolicyChecker::checkNavigationPolicy):
3021
3022 2017-03-01  Antoine Quint  <graouts@apple.com>
3023
3024         [ios-simulator] Unskip media/modern-media-controls/audio/audio-controls-metrics.html
3025         https://bugs.webkit.org/show_bug.cgi?id=167258
3026         <rdar://problem/30282740>
3027
3028         We weren't enforcing the min-width to be 200px as well as the default width, and the
3029         UA stylesheet would override it. Setting a default min-width that trumps the UA
3030         stylesheet makes the test work correctly on iOS and we can safely unskip this test.
3031
3032         Reviewed by Jon Lee.
3033
3034         * Modules/modern-media-controls/controls/media-controls.css:
3035         (:host(audio)):
3036
3037 2017-03-01  Javier Fernandez  <jfernandez@igalia.com>
3038
3039         Missing 'specification' section in the place-content shorthand
3040         https://bugs.webkit.org/show_bug.cgi?id=169052
3041
3042         Reviewed by Darin Adler.
3043
3044         Added 'specification' section in the place-content shorthand.
3045
3046         No new tests, no new functionality.
3047
3048         * css/CSSProperties.json:
3049
3050 2017-02-28  Matt Rajca  <mrajca@apple.com>
3051
3052         Media: notify clients when autoplayed media is muted
3053         https://bugs.webkit.org/show_bug.cgi?id=168987
3054
3055         Reviewed by Alex Christensen.
3056
3057         Added API tests.
3058
3059         * html/HTMLMediaElement.cpp:
3060         (WebCore::HTMLMediaElement::setMuted):
3061         (WebCore::HTMLMediaElement::pageMutedStateDidChange):
3062         * page/AutoplayEvent.h:
3063
3064 2017-03-01  Commit Queue  <commit-queue@webkit.org>
3065
3066         Unreviewed, rolling out r213226.
3067         https://bugs.webkit.org/show_bug.cgi?id=169051
3068
3069         Speculative rollout, might be causing several failures and
3070         crashes in WebKitGTK+ (Requested by lajava on #webkit).
3071
3072         Reverted changeset:
3073
3074         "REGRESSION(r213062): [SOUP] UTF-8 filename in Content-
3075         Disposition header incorrectly handled since r213062"
3076         https://bugs.webkit.org/show_bug.cgi?id=169024
3077         http://trac.webkit.org/changeset/213226
3078
3079 2017-03-01  James Craig  <jcraig@apple.com>
3080
3081         AX: add role aliases for ARIA DPUB module
3082         https://bugs.webkit.org/show_bug.cgi?id=168978
3083         <rdar://problem/30762724>
3084
3085         Reviewed by Chris Fleizach.
3086
3087         Added role aliases for ARIA DPUB module, and updated existing tests.
3088
3089         Test: accessibility/roles-exposed.html
3090         Test: inspector/dom/getAccessibilityPropertiesForNode.html
3091
3092         * accessibility/AccessibilityObject.cpp:
3093         (WebCore::initializeRoleMap): 
3094
3095 2017-03-01  Alex Christensen  <achristensen@webkit.org>
3096
3097         Don't call libwebrtc functions if libwebrtc.dylib doesn't exist while testing
3098         https://bugs.webkit.org/show_bug.cgi?id=169045
3099         <rdar://problem/30735413>
3100
3101         Reviewed by Youenn Fablet.
3102
3103         WebRTC tests fail instead of crashing now if libwebrtc.dylib is missing.
3104         All other tests pass instead of crashing immediately when creating an Internals object.
3105
3106         * Modules/mediastream/RTCController.cpp:
3107         (WebCore::RTCController::disableICECandidateFiltering):
3108         (WebCore::RTCController::enableICECandidateFiltering):
3109         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3110         (WebCore::createLibWebRTCPeerConnectionBackend):
3111         * testing/Internals.cpp:
3112         (WebCore::Internals::enableMockMediaEndpoint):
3113         (WebCore::Internals::emulateRTCPeerConnectionPlatformEvent):
3114         (WebCore::Internals::useMockRTCPeerConnectionFactory):
3115         * testing/Internals.h:
3116
3117 2017-03-01  Javier Fernandez  <jfernandez@igalia.com>
3118
3119         [css-align] Implement the place-content shorthand
3120         https://bugs.webkit.org/show_bug.cgi?id=168771
3121
3122         Reviewed by Manuel Rego Casasnovas.
3123
3124         The CSS Box Alignment specification defines a new shorthand to set the
3125         Content Alignment properties (align-content and justify-content) at the
3126         same time.
3127
3128         This patch provides the implementation of the CSS parsing logic and the
3129         required regression tests.
3130
3131         Test: css3/parse-place-content.html
3132
3133         * css/CSSComputedStyleDeclaration.cpp:
3134         (WebCore::ComputedStyleExtractor::propertyValue):
3135         * css/CSSProperties.json:
3136         * css/StyleProperties.cpp:
3137         (WebCore::StyleProperties::getPropertyValue):
3138         * css/parser/CSSPropertyParser.cpp:
3139         (WebCore::consumeSimplifiedContentPosition):
3140         (WebCore::CSSPropertyParser::consumePlaceContentShorthand):
3141         (WebCore::CSSPropertyParser::parseShorthand):
3142         * css/parser/CSSPropertyParser.h:
3143
3144 2017-03-01  Simon Fraser  <simon.fraser@apple.com>
3145
3146         Try to fix Windows build after r213191.
3147
3148         * platform/spi/win/CoreTextSPIWin.h:
3149
3150 2017-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
3151
3152         REGRESSION(r213062): [SOUP] UTF-8 filename in Content-Disposition header incorrectly handled since r213062
3153         https://bugs.webkit.org/show_bug.cgi?id=169024
3154
3155         Reviewed by Youenn Fablet.
3156
3157         This made test http/tests/download/literal-utf-8.html to start failing. The problem is that I removed the
3158         conversion made by String::fromUTF8WithLatin1Fallback that was added in r176930. I removed it because that made
3159         fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html to timeout. This patch brings back
3160         the String::fromUTF8WithLatin1Fallback call but only when the header string is 8 bit one.
3161
3162         Fixes: http/tests/download/literal-utf-8.html
3163
3164         * platform/network/soup/ResourceResponseSoup.cpp:
3165         (WebCore::ResourceResponse::platformSuggestedFilename):
3166
3167 2017-03-01  Carlos Garcia Campos  <cgarcia@igalia.com>
3168
3169         [GTK] fast/canvas/canvas-createPattern-video-loading.html makes its subsequent test timeout
3170         https://bugs.webkit.org/show_bug.cgi?id=169019
3171
3172         Reviewed by Xabier Rodriguez-Calvar.
3173
3174         The timeout happens normally when the media player is deleted and the pipeline state is set to NULL. The call to
3175         gst_element_set_state() never returns because of different deadlocks with the video sink. Sometimes the deadlock
3176         happens with the sample mutex used by VideoRenderRequestScheduler. VideoRenderRequestScheduler::requestRender()
3177         calls webkitVideoSinkRepaintRequested() with the lock held, that ends up calling
3178         MediaPlayerPrivateGStreamerBase::triggerRepaint(). When rendering can't be accelerated the draw timer is
3179         scheduled and triggerRepaint blocks until the timer is fired. If the media player is destroyed before the timer
3180         is fired, when setting the pipeline state to NULL, other VideoRenderRequestScheduler methods can be called, like
3181         stop() that tries to get the sample mutex that is still held by requestRender(). So, first we need to make
3182         sure that requestRender() releases the lock before calling webkitVideoSinkRepaintRequested(). But that's not
3183         enough, we also need to ensure that the pipeline is set to NULL state after everyting has been properly
3184         stopped. This is currently done in ~MediaPlayerPrivateGStreamer that happens before
3185         ~MediaPlayerPrivateGStreamerBase, so gst_element_set_state() is hanging before allowing the
3186         MediaPlayerPrivateGStreamerBase to be cleaned up. We should move the call to the end of
3187         ~MediaPlayerPrivateGStreamerBase and ensure the draw timer and mutex are properly cleaned up before.
3188
3189         Fixes: fast/canvas/canvas-createPattern-video-loading.html
3190
3191         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3192         (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): Do not reset pipeline here.
3193         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3194         (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase): Stop the draw mutex and notify the
3195         lock to ensure we unblock. Do the pipeline reset at the end.
3196         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
3197         (VideoRenderRequestScheduler::requestRender): Release the mutex lock before calling webkitVideoSinkRepaintRequested().
3198
3199 2017-03-01  Tomas Popela  <tpopela@redhat.com>
3200
3201         Unreviewed compiler warning fix after r213218
3202
3203         * platform/gtk/PlatformKeyboardEventGtk.cpp:
3204         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
3205
3206 2017-03-01  Tomas Popela  <tpopela@redhat.com>
3207
3208         [Cairo] Incorrectly determining height in GraphicsContext::roundToDevicePixels()
3209         https://bugs.webkit.org/show_bug.cgi?id=169031
3210
3211         Reviewed by Carlos Garcia Campos.
3212
3213         We should compare if height is between -1 and 0 and not mixing height
3214         and width together.
3215
3216         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3217         (WebCore::GraphicsContext::roundToDevicePixels):
3218
3219 2017-03-01  Tomas Popela  <tpopela@redhat.com>
3220
3221         [GTK] Fix problems found by Coverity scan in platform's keyboard and mouse events
3222         https://bugs.webkit.org/show_bug.cgi?id=169028
3223
3224         Reviewed by Carlos Garcia Campos.
3225
3226         * platform/gtk/PlatformKeyboardEventGtk.cpp:
3227         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Initialize
3228         the m_handledByInputMethod member.
3229         * platform/gtk/PlatformMouseEventGtk.cpp:
3230         (WebCore::PlatformMouseEvent::PlatformMouseEvent): Initialize the
3231         m_modifierFlags member.
3232
3233 2017-03-01  Andreas Kling  <akling@apple.com>
3234
3235         Move MemoryPressureHandler to WTF
3236         <https://webkit.org/b/168908>
3237
3238         Reviewed by Sam Weinig.
3239
3240         * CMakeLists.txt:
3241         * PlatformMac.cmake:
3242         * PlatformWin.cmake:
3243         * WebCore.xcodeproj/project.pbxproj:
3244         * bindings/js/ScriptController.cpp:
3245         * history/PageCache.cpp:
3246         * html/HTMLMediaElement.cpp:
3247         * inspector/InspectorInstrumentation.h:
3248         * inspector/InspectorMemoryAgent.h:
3249         * page/FrameView.cpp:
3250         * page/MemoryRelease.h:
3251         * page/linux/ResourceUsageThreadLinux.cpp:
3252         * platform/Linux.cmake:
3253         * platform/graphics/FontCache.cpp:
3254         * platform/graphics/WidthCache.h:
3255         * platform/graphics/ca/TileController.cpp:
3256         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
3257         * platform/ios/LegacyTileCache.mm:
3258         * platform/ios/LegacyTileGrid.mm:
3259         * platform/ios/LegacyTileLayerPool.mm:
3260         * platform/ios/TileControllerMemoryHandlerIOS.cpp:
3261         * testing/Internals.cpp:
3262
3263 2017-03-01  Per Arne Vollan  <pvollan@apple.com>
3264
3265         [Win] Popup menus are too small in HiDPI mode.
3266         https://bugs.webkit.org/show_bug.cgi?id=168965
3267
3268         Reviewed by Brent Fulgham.
3269
3270         Scale font with device scale factor.
3271
3272         * platform/win/PopupMenuWin.cpp:
3273         (WebCore::PopupMenuWin::show):
3274         (WebCore::PopupMenuWin::calculatePositionAndSize):
3275         (WebCore::PopupMenuWin::paint):
3276         * platform/win/PopupMenuWin.h:
3277
3278 2017-03-01  Joseph Pecoraro  <pecoraro@apple.com>
3279
3280         [WebRTC] Install libwebrtc.dylib inside of WebCore.framework
3281         https://bugs.webkit.org/show_bug.cgi?id=168859
3282
3283         Reviewed by Dan Bernstein.
3284
3285         * Configurations/WebCore.xcconfig:
3286         Set library search path to find the libwebrtc.dylib inside of WebCore's Frameworks
3287         or in the WK_OVERRIDE_FRAMEWORKS_DIR.
3288
3289 2017-02-28  Myles C. Maxfield  <mmaxfield@apple.com>
3290
3291         Addressing post-review comments on r213163
3292         https://bugs.webkit.org/show_bug.cgi?id=168678
3293
3294         Unreviewed.
3295
3296         No new tests because there is no behavior change.
3297
3298         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3299         (WebCore::platformFontLookupWithFamily):
3300
3301 2017-02-28  Simon Fraser  <simon.fraser@apple.com>
3302
3303         Don't use the LinearGlyphMask format if accelerated drawing is disabled
3304         https://bugs.webkit.org/show_bug.cgi?id=168997
3305
3306         Reviewed by Tim Horton.
3307
3308         Non-accelerated drawing doesn't work into LinearGlyphMask-format backing store,
3309         so don't use that backing store format when accelerated drawing is disabled.
3310
3311         * platform/graphics/ca/PlatformCALayer.cpp:
3312         (WebCore::PlatformCALayer::drawRepaintIndicator):
3313         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3314         (layerContentsFormat):
3315         (PlatformCALayerCocoa::updateContentsFormat):
3316
3317 2017-02-28  Simon Fraser  <simon.fraser@apple.com>
3318
3319         Make the repaint indicators show subpixel antialiased text indication a bit more clearly
3320         https://bugs.webkit.org/show_bug.cgi?id=168988
3321
3322         Reviewed by Tim Horton.
3323
3324         Put a more obvious stroke around the repaint count when subpixel-antialiased layer text is enabled.
3325
3326         * platform/graphics/ca/PlatformCALayer.cpp:
3327         (WebCore::PlatformCALayer::drawRepaintIndicator):
3328         (WebCore::PlatformCALayer::drawTextAtPoint):
3329         * platform/graphics/ca/PlatformCALayer.h:
3330         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
3331         (PlatformCALayerWin::drawTextAtPoint):
3332         * platform/graphics/ca/win/PlatformCALayerWin.h:
3333
3334 2017-02-28  Alex Christensen  <achristensen@webkit.org>
3335
3336         LibWebRTCProvider should check existence of libwebrtc.dylib
3337         https://bugs.webkit.org/show_bug.cgi?id=168986
3338         <rdar://problem/30735413>
3339
3340         Reviewed by Youenn Fablet.
3341
3342         Some configurations of the webrtc tests overwrite the availability of WebRTC in order to test it
3343         with MockLibWebRTCPeerConnection.  If the dylib can not be found, we can't use it, so we want to
3344         fail these tests rather than crashing calling rtc::LogMessage::LogToDebug.
3345
3346         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3347         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
3348         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
3349         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3350         (WebCore::LibWebRTCProvider::factory):
3351         (WebCore::LibWebRTCProvider::webRTCAvailable):
3352         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3353         * testing/MockLibWebRTCPeerConnection.cpp:
3354         (WebCore::useMockRTCPeerConnectionFactory):
3355         (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
3356
3357 2017-02-28  Tim Horton  <timothy_horton@apple.com>
3358
3359         Apply a review comment that was missing in r213182
3360
3361         * loader/ios/QuickLook.mm:
3362         (WebCore::isQuickLookPreviewURL):
3363
3364 2017-02-28  Tim Horton  <timothy_horton@apple.com>
3365
3366         [iOS] Getting QLPreviewProtocol slows down first navigation in Web process
3367         https://bugs.webkit.org/show_bug.cgi?id=168940
3368         <rdar://problem/29468999>
3369
3370         Reviewed by Simon Fraser.
3371
3372         No new tests, just a performance improvement.
3373
3374         * loader/DocumentLoader.cpp:
3375         (WebCore::isRemoteWebArchive):
3376         * loader/PolicyChecker.cpp:
3377         (WebCore::PolicyChecker::checkNavigationPolicy):
3378         * loader/ResourceLoadNotifier.cpp:
3379         (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
3380         Make use of isQuickLookPreviewURL.
3381
3382         * loader/ios/QuickLook.h:
3383         * loader/ios/QuickLook.mm:
3384         (WebCore::isQuickLookPreviewURL):
3385         Add isQuickLookPreviewURL, which first early-returns if the protocol
3386         of the URL is a well-known protocol, and then falls back to loading QuickLook.
3387
3388         In a microbenchmark this is a 30-40% improvement in total time spent
3389         loading an empty HTML document (wall-clock time between loadHTMLString
3390         and didFinishNavigation).
3391
3392 2017-02-28  Simon Fraser  <simon.fraser@apple.com>
3393
3394         Add Geolocation and DeviceOrientation to features.json 
3395
3396         * features.json:
3397
3398 2017-02-28  Wenson Hsieh  <wenson_hsieh@apple.com>
3399
3400         Data interaction should support attachment elements
3401         https://bugs.webkit.org/show_bug.cgi?id=168916
3402         <rdar://problem/30664519>