[Color] Make gradients work with ExtendedColors
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-04-25  Dean Jackson  <dino@apple.com>
2
3         [Color] Make gradients work with ExtendedColors
4         https://bugs.webkit.org/show_bug.cgi?id=171315
5         <rdar://problems/31830177>
6
7         Reviewed by Antoine Quint.
8
9         Allow gradients to hold Color objects, and thus
10         handle ExtendedColor. Implement the backend for
11         CoreGraphics.
12
13         Test: css3/color/gradients.html
14
15         * platform/graphics/Gradient.cpp:
16         (WebCore::Gradient::addColorStop): Just copy the Color now.
17         (WebCore::compareStops): Handle rename of stop to offset.
18         (WebCore::Gradient::hasAlpha): Use Color's helper.
19         * platform/graphics/Gradient.h:
20         (WebCore::Gradient::ColorStop::ColorStop): Rename stop
21         to offset, and store a Color rather than four floating
22         point values.
23         * platform/graphics/cairo/GradientCairo.cpp:
24         (WebCore::Gradient::platformGradient):
25         * platform/graphics/cg/GradientCG.cpp:
26         (WebCore::Gradient::platformGradient): Use the CG method
27         that can handle CGColorRefs with ColorSpace values, and
28         pass the Extended sRGB space which should be no change for
29         all existing gradients but also handle ColorSpaces like
30         Display P3.
31         * platform/graphics/win/GradientDirect2D.cpp:
32         (WebCore::Gradient::generateGradient):
33         * svg/SVGGradientElement.cpp:
34         (WebCore::SVGGradientElement::buildStops):
35
36 2017-04-25  Alex Christensen  <achristensen@webkit.org>
37
38         Encoded filename should be decoded for WKContentExtension.identifier
39         https://bugs.webkit.org/show_bug.cgi?id=171316
40
41         Reviewed by Andy Estes.
42
43         * platform/FileSystem.h:
44
45 2017-04-26  Frederic Wang  <fwang@igalia.com>
46
47         Fix typo in RenderFrameBase
48         https://bugs.webkit.org/show_bug.cgi?id=171324
49
50         Reviewed by Zalan Bujtas.
51
52         No new tests, behavior unchanged.
53
54         * rendering/RenderFrameBase.cpp:
55         (WebCore::RenderFrameBase::layoutWithFlattening):
56         (WebCore::RenderFrameBase::performLayoutWithFlattening):
57         (WebCore::RenderFrameBase::peformLayoutWithFlattening): Deleted.
58         * rendering/RenderFrameBase.h:
59
60 2017-04-26  Zalan Bujtas  <zalan@apple.com>
61
62         Forced page break on :after triggers infinite loop in column balancing
63         https://bugs.webkit.org/show_bug.cgi?id=171309
64         rdar://problem/26285884
65
66         Reviewed by David Hyatt.
67
68         Stop trying to balance the columns when the forced page breaks >= the number of
69         columns even when this number is 1. Content will always overflow to the next page.
70         see https://chromium.googlesource.com/chromium/src/+/fbbebf38cefb2712c912581eccb046ef363ec84e%5E%21/#F2 
71
72         Test: fast/multicol/infinite-loop-when-forced-break.html
73
74         * rendering/RenderMultiColumnSet.cpp:
75         (WebCore::RenderMultiColumnSet::calculateBalancedHeight):
76
77 2017-04-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
78
79         Attempt to fix a PLT regression.
80
81         Unreviewed.
82
83         Disable async decoding for large images till the flickering bug wk170640
84         is fixed.
85
86         * platform/graphics/BitmapImage.cpp:
87         (WebCore::BitmapImage::shouldUseAsyncDecodingForLargeImages):
88
89 2017-04-26  Ryan Haddad  <ryanhaddad@apple.com>
90
91         Unreviewed, rolling out r215767.
92
93         The LayoutTest for this change is a flaky failure.
94
95         Reverted changeset:
96
97         "Restrict WebKit image formats to a known whitelist"
98         https://bugs.webkit.org/show_bug.cgi?id=170700
99         http://trac.webkit.org/changeset/215767
100
101 2017-04-26  Dave Hyatt  <hyatt@apple.com>
102
103         Improve wavy underline rendering
104         https://bugs.webkit.org/show_bug.cgi?id=171281
105
106         Reviewed by Sam Weinig.
107
108         Change wavy underline rendering to use font size instead of stroke
109         thickness as a way to tune it. Cut the extra offset from 2 to 1.
110         Change the parameters to make the line flatter and to make the proportion
111         of the wave that renders underneath a glyph the same.
112
113         * rendering/TextDecorationPainter.cpp:
114         (WebCore::strokeWavyTextDecoration):
115         (WebCore::TextDecorationPainter::paintTextDecoration):
116         * style/InlineTextBoxStyle.cpp:
117         (WebCore::getWavyStrokeParameters):
118         (WebCore::visualOverflowForDecorations):
119         * style/InlineTextBoxStyle.h:
120         (WebCore::wavyOffsetFromDecoration):
121
122 2017-04-24  Sergio Villar Senin  <svillar@igalia.com>
123
124         [css-grid] Remove most of the usage of SizingOperation
125         https://bugs.webkit.org/show_bug.cgi?id=171225
126
127         Reviewed by Darin Adler.
128
129         SizingOperation was added as a way to modify the behaviour of the track sizing algorithm
130         with the specifics for intrinsic size computations. The problem is that although intrinsic
131         size computation does imply indefinite sizes, the opposite is not always true. For example,
132         a grid container with height:auto would compute the row sizes with an indefinite size but is
133         not part of the intrinsic size (preferred widths) computation.
134
135         That's why it was wrongly used in some parts of the current code, in most of the cases is
136         more than enough to check whether the available space is indefinite or not. In order to do
137         that we have to keep both available sizes (height & width) around all the time to properly
138         support orthogonal flows.
139
140         This change does not imply any change in behaviour.
141
142         * rendering/GridTrackSizingAlgorithm.cpp:
143         (WebCore::GridTrackSizingAlgorithm::setAvailableSpace):
144         (WebCore::GridTrackSizingAlgorithm::computeTrackBasedSize):
145         (WebCore::GridTrackSizingAlgorithm::initialBaseSize):
146         (WebCore::GridTrackSizingAlgorithm::initialGrowthLimit):
147         (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem):
148         (WebCore::GridTrackSizingAlgorithm::increaseSizesToAccommodateSpanningItems):
149         (WebCore::GridTrackSizingAlgorithm::assumedRowsSizeForOrthogonalChild):
150         (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild):
151         (WebCore::GridTrackSizingAlgorithm::gridTrackSize):
152         (WebCore::IndefiniteSizeStrategy::findUsedFlexFraction):
153         (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded):
154         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
155         (WebCore::GridTrackSizingAlgorithm::setup):
156         (WebCore::GridTrackSizingAlgorithm::reset):
157         * rendering/GridTrackSizingAlgorithm.h:
158         (WebCore::GridTrackSizingAlgorithmStrategy::availableSpace):
159         * rendering/RenderGrid.cpp:
160         (WebCore::RenderGrid::availableSpaceForGutters):
161         (WebCore::RenderGrid::computeTrackBasedLogicalHeight):
162         (WebCore::RenderGrid::computeTrackSizesForDefiniteSize):
163         (WebCore::RenderGrid::layoutBlock):
164         (WebCore::RenderGrid::gridGap):
165         (WebCore::RenderGrid::guttersSize):
166         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
167         (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize):
168         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
169         (WebCore::RenderGrid::placeItemsOnGrid):
170         (WebCore::RenderGrid::trackSizesForComputedStyle):
171         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded):
172         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
173         (WebCore::RenderGrid::populateGridPositionsForDirection):
174         (WebCore::RenderGrid::columnAxisOffsetForChild):
175         (WebCore::RenderGrid::rowAxisOffsetForChild):
176         (WebCore::RenderGrid::gridGapForDirection): Deleted.
177         * rendering/RenderGrid.h:
178
179 2017-04-26  Frederic Wang  <fwang@igalia.com>
180
181         Remove Document::*FrameElementsShouldIgnoreScrolling
182         https://bugs.webkit.org/show_bug.cgi?id=171271
183
184         Reviewed by Chris Dumez.
185
186         setFrameElementsShouldIgnoreScrolling and frameElementsShouldIgnoreScrolling were
187         introduced bug 23072 in order to work around a bug in the Dictionary application.
188         However, this was removed in bug 132095 and hence the functions are no longer necessary.
189
190         No new tests.
191
192         * dom/Document.h:
193         (WebCore::Document::setFrameElementsShouldIgnoreScrolling): Deleted.
194         (WebCore::Document::frameElementsShouldIgnoreScrolling): Deleted.
195         * html/HTMLFrameElementBase.cpp:
196         (WebCore::HTMLFrameElementBase::parseAttribute):
197
198 2017-04-26  Zan Dobersek  <zdobersek@igalia.com>
199
200         [GCrypt] CryptoKeyRSA: implement create(), keySizeInBits(), buildAlgorithm(), exportData()
201         https://bugs.webkit.org/show_bug.cgi?id=171213
202
203         Reviewed by Michael Catanzaro.
204
205         CryptoKeyRSA::create() validates the specified key type along with the
206         provided data. If everything is OK, it then proceeds to build the key
207         of the appropriate type through an s-expression that is constructed with
208         the necessary data. We don't currently support creating private keys
209         with any additional prime information (apart from p and q).
210
211         CryptoKeyRSA::keySizeInBits() calls the helper getRSAModulusLength()
212         function that find the modulus MPI in the key s-expression and returns
213         the modulus data length in bits.
214
215         CryptoKeyRSA::buildAlgorithm() returns KeyAlgorithm that's constructed
216         from the appropriate name, this key's modulus length, and this key's
217         public exponent data. It also specifies the hash if there is such a
218         restriction for this key.
219
220         CryptoKeyRSA::exportData() returns a properly-constructed
221         CryptoKeyDataRSAComponents object. The public modulus and exponent are
222         used in case the key is public. If the key is private, the secret
223         exponent and the p and q prime numbers are retrieved in MPI format.
224         They're then used to calculate the dp, dq and qi parameters that are
225         exported in the JWK format. Note that libgcrypt internally switches
226         the p and q prime numbers such that p < q, but the Web Crypto
227         specification and the dependant RFCs expect that q < p. We address
228         this by simply switching the roles of the two primes and follow the
229         usual q < p assumption when exporting the primes and computing the
230         dependant exponents and coefficients.
231
232         No new tests -- existing ones cover this but don't work yet due to missing
233         RSA-related CryptoAlgorithm implementations.
234
235         * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp:
236         (WebCore::getRSAModulusLength):
237         (WebCore::getParameterMPIData):
238         (WebCore::getRSAKeyParameter):
239         (WebCore::CryptoKeyRSA::create):
240         (WebCore::CryptoKeyRSA::keySizeInBits):
241         (WebCore::CryptoKeyRSA::buildAlgorithm):
242         (WebCore::CryptoKeyRSA::exportData):
243
244 2017-04-25  Jiewen Tan  <jiewen_tan@apple.com>
245
246         [WebCrypto] Enhance ways to convert an ECDSA signature binary into DER format
247         https://bugs.webkit.org/show_bug.cgi?id=171287
248         <rdar://problem/31735332>
249
250         Reviewed by Brent Fulgham.
251
252         Covered by existing tests.
253
254         * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
255         (WebCore::verifyECDSA):
256
257 2017-04-25  Brent Fulgham  <bfulgham@apple.com>
258
259         Relax the event firing ASSERT for Attr changes
260         https://bugs.webkit.org/show_bug.cgi?id=171236
261         <rdar://problem/30516349>
262
263         Reviewed by Dean Jackson.
264
265         The assertions added in Bug 167318 were overly strict, and trigger for valid behavior.
266         Relax the assertion preventing event dispatch for the case of Attr elements at the
267         end of childrenChanged.
268
269         Test: fast/dom/HTMLLinkElement/event-while-removing-attribute.html
270
271         * dom/Attr.cpp:
272         (WebCore::Attr::childrenChanged):
273
274 2017-04-25  John Wilander  <wilander@apple.com>
275
276         Resource Load Statistics: Introduce shorter time-to-live for cookie partition whitelisting
277         https://bugs.webkit.org/show_bug.cgi?id=171295
278         <rdar://problem/31823818>
279
280         Reviewed by Brent Fulgham.
281
282         Test: http/tests/loading/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html
283
284         * loader/ResourceLoadObserver.cpp:
285         (WebCore::reduceTimeResolutionToOneDay): Deleted.
286         (WebCore::reduceTimeResolution):
287             Changed name to no longer lock this to a specific resolution.
288         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
289             Now calls WebCore::reduceTimeResolution().
290         (WebCore::ResourceLoadObserver::setTimeToLiveCookiePartitionFree):
291             Added for testing purposes.
292         (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler):
293             Added for testing purposes.
294         * loader/ResourceLoadObserver.h:
295         * loader/ResourceLoadStatisticsStore.cpp:
296         (WebCore::shouldPartitionCookies):
297             Static inline convenience function.
298         (WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
299             Now decides whether a domain should get partitioned cookies
300             based on timeToLiveCookiePartitionFree.
301             Removed clearFirst parameter since it's not needed here
302             and it introduced complexity in keeping the store and the
303             network process cache in sync.
304         (WebCore::ResourceLoadStatisticsStore::setTimeToLiveCookiePartitionFree):
305             Added for testing purposes.
306         * loader/ResourceLoadStatisticsStore.h:
307
308 2017-04-25  Saam Barati  <sbarati@apple.com>
309
310         JSArray::isArrayPrototypeIteratorProtocolFastAndNonObservable is wrong because it does not do the necessary checks on the base object
311         https://bugs.webkit.org/show_bug.cgi?id=171150
312         <rdar://problem/31771880>
313
314         Reviewed by Sam Weinig.
315
316         This patch moves the sequence converters to use the now fixed
317         JSArray::isArrayPrototypeIteratorProtocolFastAndNonObservable test
318         inside JSC.
319         
320         This patch also fixes a few bugs:
321         1. Converting to a sequence of numbers must prove that the JSArray
322         is filled only with Int32/Double. If there is a chance the array
323         contains objects, the conversion to a numeric IDLType can be observable
324         (via valueOf()), and can change the iterator protocol.
325         2. There are other conversions that can have side effects a-la valueOf().
326         This patch introduces a new static constant in the various Converter
327         classes that tell the sequence converter if the conversion operation
328         can have JS side effects. If it does have side effects, we fall back to
329         the generic conversion that uses the iterator protocol. If not, we can
330         do a faster version that iterates over each element of the array,
331         reading it directly, and converting it.
332
333         Tests: js/sequence-iterator-protocol-2.html
334                js/sequence-iterator-protocol.html
335
336         * bindings/js/JSDOMConvertAny.h: Does not have side effects.
337         * bindings/js/JSDOMConvertBase.h: We pessimistically assume inside DefaultConverter that converions have side effects.
338         * bindings/js/JSDOMConvertBoolean.h: Does not have side effects.
339         * bindings/js/JSDOMConvertCallbacks.h: Does not have side effects.
340         * bindings/js/JSDOMConvertObject.h: Does not have side effects.
341         * bindings/js/JSDOMConvertSequences.h:
342         (WebCore::Detail::NumericSequenceConverter::convert):
343         (WebCore::Detail::SequenceConverter::convert):
344
345 2017-04-25  Michael Saboff  <msaboff@apple.com>
346
347         Call bmalloc scavenger first when handling a memory pressure event
348         https://bugs.webkit.org/show_bug.cgi?id=171289
349
350         Reviewed by Geoffrey Garen.
351
352         Let bmalloc free any pages to the OS that it can before doing anything else.
353
354         * page/MemoryRelease.cpp:
355         (WebCore::releaseMemory):
356
357 2017-04-25  Dean Jackson  <dino@apple.com>
358
359         Skip WebKitAdditions for Safari Technology Preview media controls
360         https://bugs.webkit.org/show_bug.cgi?id=171302
361         <rdar://problem/31823256>
362
363         Reviewed by Simon Fraser.
364
365         Safari Technology Preview should use the same controls
366         as OpenSource.
367
368         * WebCore.xcodeproj/project.pbxproj:
369
370 2017-04-25  Ryan Haddad  <ryanhaddad@apple.com>
371
372         Unreviewed, rolling out r215730.
373
374         The LayoutTest for this change is a flaky timeout on mac-wk1
375         debug.
376
377         Reverted changeset:
378
379         "Enable expired-only reload policy on Mac and iOS"
380         https://bugs.webkit.org/show_bug.cgi?id=171264
381         http://trac.webkit.org/changeset/215730
382
383 2017-04-24  Matt Rajca  <mrajca@apple.com>
384
385         Indicate presence of audio when handling autoplay events.
386         https://bugs.webkit.org/show_bug.cgi?id=171227
387
388         Reviewed by Alex Christensen.
389
390         Added API tests.
391
392         * html/HTMLMediaElement.cpp:
393         (WebCore::HTMLMediaElement::handleAutoplayEvent):
394         (WebCore::HTMLMediaElement::playInternal):
395         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
396         (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer):
397         (WebCore::HTMLMediaElement::userDidInterfereWithAutoplay):
398         (WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture):
399         * html/HTMLMediaElement.h:
400         * page/AutoplayEvent.h:
401         * page/ChromeClient.h:
402
403 2017-04-25  Aakash Jain  <aakash_jain@apple.com>
404
405         WebCore.framework should restrict allowable_clients
406         https://bugs.webkit.org/show_bug.cgi?id=171260
407
408         Reviewed by Alexey Proskuryakov.
409
410         * Configurations/WebCore.xcconfig: Adding allowable_client to all platform, in order to restrict WebCore
411         from being directly linked on any platform.
412         Moved WebKitLegacy and WebCoreTestSupport to OTHER_LDFLAGS_BASE.
413         Removed WebKit2 as allowable_client from mac.
414         Added iTunesU, Casablanca and Remote to OTHER_LDFLAGS_BASE_ios for iTunes related projects.
415         Added WebKit, TVBooks, DumpRenderTree, WebKitTestRunner and TestWebKitAPI to OTHER_LDFLAGS_BASE_ios.
416
417 2017-04-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
418
419         Restrict WebKit image formats to a known whitelist
420         https://bugs.webkit.org/show_bug.cgi?id=170700
421
422         Reviewed by Tim Horton.
423
424         If the image format is not supported, the load should be canceled and the
425         image is marked a broken image.
426
427         Test: fast/images/image-formats-support.html
428
429         * loader/cache/CachedImage.cpp:
430         (WebCore::CachedImage::addIncrementalDataBuffer):
431         (WebCore::CachedImage::setImageDataBuffer):
432         (WebCore::CachedImage::finishLoading):
433         * loader/cache/CachedImage.h:
434
435 2017-04-25  Youenn Fablet  <youenn@apple.com>
436
437         CoreAudioCaptureSource::suspend is asserting too often
438         https://bugs.webkit.org/show_bug.cgi?id=171285
439
440         Reviewed by Eric Carlson.
441
442         No change of behavior.
443
444         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
445         (WebCore::CoreAudioCaptureSource::suspend): Moving the assertion to where it might be useful.
446
447 2017-04-25  Daniel Bates  <dabates@apple.com>
448
449         Use an OptionSet for compositing reasons bitmask
450         https://bugs.webkit.org/show_bug.cgi?id=171153
451
452         Reviewed by Simon Fraser.
453
454         We should make use of OptionSet to represent the bitmask of the reasons a layer
455         was composited instead of using an integer and bitwise operations.
456
457         * inspector/InspectorLayerTreeAgent.cpp:
458         (WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer):
459         * rendering/RenderLayerCompositor.cpp:
460         (WebCore::RenderLayerCompositor::reasonsForCompositing):
461         (WebCore::RenderLayerCompositor::logReasonsForCompositing): Also fix code style issues;
462         an else-if statement should be written as an if-statement when the prior if-statement
463         concludes with a return statement.
464         * rendering/RenderLayerCompositor.h:
465
466 2017-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
467
468         Supplementary Multilingual Plane Complex Scripts Rendered Incorrectly
469         https://bugs.webkit.org/show_bug.cgi?id=171272
470         <rdar://problem/30966764>
471
472         Reviewed by Zalan Bujtas.
473
474         These scripts need to take the complex text codepath.
475
476         Test: fast/text/kaithi.html
477
478         * platform/graphics/FontCascade.cpp:
479         (WebCore::FontCascade::characterRangeCodePath):
480
481 2017-04-25  Carlos Alberto Lopez Perez  <clopez@igalia.com>
482
483         [GTK] Revert r215745 (especulative build fix) after r215752.
484         https://bugs.webkit.org/show_bug.cgi?id=170842
485
486         Unreviewed.
487
488         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
489         (WebCore::normalizeCharacters):
490
491 2017-04-25  Daniel Bates  <dabates@apple.com>
492
493         [Cocoa][Win] Enable of X-Content-Type-Options: nosniff header
494         https://bugs.webkit.org/show_bug.cgi?id=136452
495         <rdar://problem/23412620>
496
497         Reviewed by Brent Fulgham.
498
499         Enable support for X-Content-Type-Options: nosniff on Mac, iOS and Windows.
500
501         Additionally, honor X-Content-Type-Options: nosniff header for stylesheets as per
502         <https://fetch.spec.whatwg.org/#should-response-to-request-be-blocked-due-to-nosniff%3F> (30 March 2017).
503
504         Test: http/tests/security/contentTypeOptions/nosniff-dynamic-script-blocked.html
505
506         * Configurations/FeatureDefines.xcconfig:
507         * css/StyleSheetContents.cpp:
508         (WebCore::StyleSheetContents::parseAuthorStyleSheet): Log an error if the stylesheet
509         has the nosniff header and does not have a valid MIME type. Also update code for
510         renaming of MIMETypeCheck to MIMETypeCheckHint.
511         (WebCore::StyleSheetContents::notifyLoadedSheet): If the stylesheet is blocked by
512         nosniff then consider it analogous to a load error so that we dispatch a DOM error
513         event at the <style>/<link> element.
514         * dom/LoadableClassicScript.cpp:
515         (WebCore::LoadableClassicScript::notifyFinished): Modified the wording of the error
516         message when a script is disallowed by nosniff so as to more closely match the
517         wording used when a stylesheet is disallowed by nonsniff.
518         * loader/cache/CachedCSSStyleSheet.cpp:
519         (WebCore::CachedCSSStyleSheet::sheetText): Update for renaming of MIMETypeCheck
520         to MIMETypeCheckHint.
521         (WebCore::CachedCSSStyleSheet::responseMIMEType): Added.
522         (WebCore::CachedCSSStyleSheet::mimeTypeAllowedByNosniff): Added.
523         (WebCore::CachedCSSStyleSheet::canUseSheet): Modified to check if the X-Content-Type-Options: nosniff
524         header is in the HTTP response for the stylesheet. If it is then we can only use the stylesheet
525         if its content-type is "text/css". Otherwise, apply the existing criterion for determining whether
526         to to use the stylesheet.
527         * loader/cache/CachedCSSStyleSheet.h: Rename MIMETypeCheck to MIMETypeCheckHint to better
528         describe its purpose as a hint as to whether to enforce MIME type checking for the stylesheet.
529         Processing of the HTTP header X-Content-Type-Options takes precedence over this hint.
530         * loader/cache/CachedScript.h: Make mimeType() private.
531
532 2017-04-25  Daniel Bates  <dabates@apple.com>
533
534         [Cocoa][Win] Enable of X-Content-Type-Options: nosniff header
535         https://bugs.webkit.org/show_bug.cgi?id=136452
536         <rdar://problem/23412620>
537
538         Reviewed by Brent Fulgham.
539
540         Part 1
541
542         Enable X-Content-Type-Options: nosniff on Mac, iOS and Windows platforms.
543
544         * Configurations/FeatureDefines.xcconfig:
545
546 2017-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
547
548         [GTK] Build fix after r215737
549         https://bugs.webkit.org/show_bug.cgi?id=170842
550
551         Unreviewed.
552
553         No new tests because there is no behavior change.
554
555         * platform/graphics/FontCascade.h:
556         (WebCore::FontCascade::treatAsZeroWidthSpace):
557         (WebCore::FontCascade::treatAsZeroWidthSpaceInComplexScript):
558
559 2017-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
560
561         Remove an unnecessary -respondsToSelector: check after r215724
562
563         Rubber-stamped by Tim Horton.
564
565         Addresses review feedback from <https://bugs.webkit.org/show_bug.cgi?id=171156>. -[NSURL _title]
566         will always for builds that need to access it.
567
568         * platform/ios/PlatformPasteboardIOS.mm:
569         (WebCore::PlatformPasteboard::readURL):
570
571 2017-04-25  Antti Koivisto  <antti@apple.com>
572
573         REGRESSION (r215469): [ios-simulator-wk2] LayoutTest compositing/animation/animation-backing.html is a flaky failure
574         https://bugs.webkit.org/show_bug.cgi?id=171060
575         <rdar://problem/31771174>
576
577         Reviewed by Simon Fraser.
578
579         Accelerated transform animations move underlying layers without invalidating GraphicsLayers.
580         To update tile coverage we need to commit such subtrees even if there are not other changes.
581
582         * platform/graphics/ca/GraphicsLayerCA.cpp:
583         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
584         (WebCore::GraphicsLayerCA::needsCommit):
585
586             Commit subtrees with accelerated transform animations.
587             Factor into a function.
588
589         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
590
591             Track if descendants had any accelerated transform animations after commit.
592
593         * platform/graphics/ca/GraphicsLayerCA.h:
594         (WebCore::GraphicsLayerCA::hasDescendantsWithRunningTransformAnimations):
595         (WebCore::GraphicsLayerCA::setHasDescendantsWithRunningTransformAnimations):
596
597 2017-04-25  Eric Carlson  <eric.carlson@apple.com>
598
599         [MediaStream macOS] Unable to apply frameRate constraint
600         https://bugs.webkit.org/show_bug.cgi?id=171279
601
602         Reviewed by Youenn Fablet.
603
604         No new tests, this doesn't affect the mock capture devices.
605
606         * platform/mediastream/mac/AVVideoCaptureSource.mm:
607         (WebCore::AVVideoCaptureSource::supportsSizeAndFrameRate): Cast frame rate
608         ranges to int before comparing.
609
610 2017-04-25  Carlos Alberto Lopez Perez  <clopez@igalia.com>
611
612         [GTK] Build fix after r215737
613         https://bugs.webkit.org/show_bug.cgi?id=170842
614
615         Unreviewed.
616
617         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
618         (WebCore::normalizeCharacters):
619
620 2017-04-25  John Wilander  <wilander@apple.com>
621
622         Resource Load Statistics: Clear network process cache when clearing store
623         https://bugs.webkit.org/show_bug.cgi?id=171256
624         <rdar://problem/31802347>
625
626         Reviewed by Brent Fulgham.
627
628         Test that covers this code:
629         http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store.html
630
631         * loader/ResourceLoadObserver.cpp:
632         (WebCore::ResourceLoadObserver::clearInMemoryStore):
633             Better name.
634         (WebCore::ResourceLoadObserver::logUserInteraction):
635             Now passes on the boolean parameter clearFirst to
636             ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
637         (WebCore::ResourceLoadObserver::fireShouldPartitionCookiesHandler):
638             Now takes and passes on the boolean parameter clearFirst to
639             ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
640         (WebCore::ResourceLoadObserver::statisticsStore): Deleted.
641             This getter violated abstraction. The way it was used
642             is now solved through dedicated functions.
643         * loader/ResourceLoadObserver.h:
644         * loader/ResourceLoadStatisticsStore.cpp:
645         (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
646             Now passes on the boolean parameter clearFirst to
647             ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler().
648         (WebCore::ResourceLoadStatisticsStore::clearInMemory):
649             Better name.
650             Now triggers clearing of the associated network process cache.
651         (WebCore::ResourceLoadStatisticsStore::clearInMemoryAndPersistent):
652             Now calls clearInMemory().
653         (WebCore::ResourceLoadStatisticsStore::setShouldPartitionCookiesCallback):
654             Now expects a handler with the boolean parameter clearFirst.
655         (WebCore::ResourceLoadStatisticsStore::fireShouldPartitionCookiesHandler):
656             Now takes and passes on the boolean parameter clearFirst to
657             m_shouldPartitionCookiesForDomainsHandler().
658         * loader/ResourceLoadStatisticsStore.h:
659         (WebCore::ResourceLoadStatisticsStore::clear): Deleted.
660         * platform/network/NetworkStorageSession.h:
661             NetworkStorageSession::setShouldPartitionCookiesForHosts() now
662             takes the boolean parameter clearFirst.
663         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
664         (WebCore::NetworkStorageSession::setShouldPartitionCookiesForHosts):
665             Now clears m_topPrivatelyControlledDomainsForCookiePartitioning
666             if the boolean parameter clearFirst is true.
667
668 2017-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
669
670         Add performance test for FontCache::systemFallbackForCharacters()
671         https://bugs.webkit.org/show_bug.cgi?id=170842
672
673         Reviewed by Tim Horton.
674
675         No new tests because there is no behavior change.
676
677         * platform/graphics/FontCascade.h:
678         (WebCore::FontCascade::treatAsZeroWidthSpace):
679         (WebCore::FontCascade::treatAsZeroWidthSpaceInComplexScript): Deleted.
680         * platform/graphics/WidthCache.h:
681         (WebCore::WidthCache::add):
682         (WebCore::WidthCache::addSlowCase):
683
684 2017-04-25  Chris Dumez  <cdumez@apple.com>
685
686         Content-Disposition header filename is ignored when 'download' attribute is specified in HTML
687         https://bugs.webkit.org/show_bug.cgi?id=171239
688         <rdar://problem/31789855>
689
690         Reviewed by Alex Christensen.
691
692         Add isAttachmentWithFilename() utility method to ResourceResponse to implement:
693         - https://html.spec.whatwg.org/#as-a-download (Step 2)
694
695         Test: http/tests/download/anchor-download-attribute-content-disposition.html
696
697         * platform/network/ResourceResponseBase.cpp:
698         (WebCore::ResourceResponseBase::isAttachmentWithFilename):
699         * platform/network/ResourceResponseBase.h:
700
701 2017-04-25  Antti Koivisto  <antti@apple.com>
702
703         Enable expired-only reload policy on Mac and iOS
704         https://bugs.webkit.org/show_bug.cgi?id=171264
705         <rdar://problem/31807637>
706
707         Reviewed by Andreas Kling.
708
709         * loader/NavigationAction.cpp:
710         (WebCore::navigationType):
711
712         Test for reload navigation type correctly.
713
714 2017-04-25  Miguel Gomez  <magomez@igalia.com>
715
716         Image decoders must have private constructors to avoid refcount misuse: ASSERTION FAILED: m_deletionHasBegun when destroying ImageDecoder
717         https://bugs.webkit.org/show_bug.cgi?id=171211
718
719         Reviewed by Carlos Garcia Campos.
720
721         Add a create method to each of the decoders and set their constructors as private. Change
722         ICOImageDecoder to store its internal PNG decoders as RefPtr and use the new create method, and
723         change ImageDecoder to use the create methods as well.
724
725         Covered by existent tests.
726
727         * platform/image-decoders/ImageDecoder.cpp:
728         (WebCore::ImageDecoder::create):
729         * platform/image-decoders/bmp/BMPImageDecoder.h:
730         * platform/image-decoders/gif/GIFImageDecoder.h:
731         * platform/image-decoders/ico/ICOImageDecoder.cpp:
732         (WebCore::ICOImageDecoder::decodeAtIndex):
733         * platform/image-decoders/ico/ICOImageDecoder.h:
734         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
735         * platform/image-decoders/png/PNGImageDecoder.h:
736         * platform/image-decoders/webp/WEBPImageDecoder.h:
737
738 2017-04-25  Myles C. Maxfield  <mmaxfield@apple.com>
739
740         Build fix
741
742         Unreviewed.
743
744         No new tests because there is no behavior change.
745
746         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
747         (WebCore::wrapSerializedCryptoKey):
748         (WebCore::unwrapSerializedCryptoKey):
749
750 2017-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
751
752         Support reading NSURL titles from the pasteboard when performing data interaction
753         https://bugs.webkit.org/show_bug.cgi?id=171156
754         <rdar://problem/31356937>
755
756         Reviewed by Tim Horton.
757
758         Support reading link titles from the pasteboard when performing data interaction. To do this, we refactor
759         Pasteboard::readURL to take in an additional String& title which is ultimately plumbed to the PlatformPasteboard
760         where it is set to the value of -[NSURL _title].
761
762         Test: DataInteractionTests.ExternalSourceTitledNSURL.
763
764         * editing/FrameSelection.h:
765         * editing/ios/EditorIOS.mm:
766         (WebCore::Editor::WebContentReader::readURL):
767         * page/DragController.cpp:
768         (WebCore::DragController::performDragOperation):
769         (WebCore::DragController::concludeEditDrag):
770
771         Move calls to clearDragCaret() out of concludeEditDrag and into the call site, in performDragOperation after
772         attempting to concludeEditDrag. This is done so that if the WebEditorClient queries whether the drag caret is
773         in richly editable content for the purposes of generating a document fragment to insert, the answer will not
774         always be false as a drop is occurring.
775
776         * platform/PasteboardStrategy.h:
777         * platform/PlatformPasteboard.h:
778         * platform/ios/PasteboardIOS.mm:
779         (WebCore::Pasteboard::respectsUTIFidelities):
780         (WebCore::Pasteboard::readString):
781         * platform/ios/PlatformPasteboardIOS.mm:
782         (WebCore::PlatformPasteboard::readURL):
783
784 2017-04-24  Andy VanWagoner  <thetalecrafter@gmail.com>
785
786         Clean up ICU headers
787         https://bugs.webkit.org/show_bug.cgi?id=170997
788
789         Reviewed by JF Bastien.
790
791         Update all icu headers to 55.1
792
793         * icu/LICENSE: Update copyright
794         * icu/README: Explain ICU headers for OS X better
795         * icu/unicode/localpointer.h:
796         (LocalPointer::LocalPointer):
797         (LocalPointer::adoptInsteadAndCheckErrorCode):
798         * icu/unicode/platform.h:
799         * icu/unicode/putil.h:
800         * icu/unicode/std_string.h:
801         * icu/unicode/ubrk.h:
802         * icu/unicode/uchar.h:
803         * icu/unicode/ucnv.h:
804         * icu/unicode/ucol.h:
805         * icu/unicode/ucoleitr.h:
806         * icu/unicode/uconfig.h:
807         * icu/unicode/ucurr.h:
808         * icu/unicode/uidna.h:
809         * icu/unicode/uloc.h:
810         * icu/unicode/umachine.h:
811         * icu/unicode/unistr.h:
812         (UnicodeString::getArrayStart):
813         (UnicodeString::UnicodeString):
814         (UnicodeString::hasShortLength):
815         (UnicodeString::getShortLength):
816         (UnicodeString::length):
817         (UnicodeString::getCapacity):
818         (UnicodeString::isBogus):
819         (UnicodeString::isWritable):
820         (UnicodeString::isBufferWritable):
821         (UnicodeString::getBuffer):
822         (UnicodeString::isEmpty):
823         (UnicodeString::setZeroLength):
824         (UnicodeString::setShortLength):
825         (UnicodeString::setLength):
826         (UnicodeString::setToEmpty):
827         (UnicodeString::remove):
828         * icu/unicode/urename.h:
829         * icu/unicode/uscript.h:
830         * icu/unicode/usearch.h:
831         * icu/unicode/uset.h:
832         * icu/unicode/ustring.h:
833         * icu/unicode/utf8.h:
834         * icu/unicode/utypes.h:
835         * icu/unicode/uvernum.h:
836
837 2017-04-24  Jiewen Tan  <jiewen_tan@apple.com>
838
839         LayoutTests crypto/subtle/ecdsa-generate-key-sign-verify-p384.html and crypto/subtle/ecdsa-generate-key-sign-verify-p256.html are flaky failures
840         https://bugs.webkit.org/show_bug.cgi?id=171059
841         <rdar://problem/31734958>
842
843         Reviewed by Brent Fulgham.
844
845         Covered by existing tests.
846
847         * crypto/mac/CryptoAlgorithmECDSAMac.cpp:
848         (WebCore::signECDSA):
849         Enhance ways to convert the DER signatures produced from CommonCrypto to r||s.
850
851 2017-04-24  Manuel Rego Casasnovas  <rego@igalia.com>
852
853         [selectors4] :focus-within should use the flat tree
854         https://bugs.webkit.org/show_bug.cgi?id=170899
855
856         Reviewed by Antti Koivisto.
857
858         This has been discussed in the following CSS WG issue:
859         https://github.com/w3c/csswg-drafts/issues/1135
860
861         And the spec has been updated (https://drafts.csswg.org/selectors-4/#the-focus-within-pseudo):
862         "An element also matches :focus-within if one of its descendants in the flat tree
863          (including non-element nodes, such as text nodes) matches the conditions for matching :focus."
864
865         Test: imported/w3c/web-platform-tests/css/selectors4/focus-within-shadow-006.html
866
867         * dom/Element.cpp:
868         (WebCore::Element::setFocus): Use "flat tree" ("composed tree" in WebKit)
869         to set focus-within flag.
870
871 2017-04-24  Wenson Hsieh  <wenson_hsieh@apple.com>
872
873         Respect fidelity order when reading web content from item providers
874         https://bugs.webkit.org/show_bug.cgi?id=171155
875         <rdar://problem/31356937>
876
877         Reviewed by Tim Horton.
878
879         Currently, when reading web content from pasteboards, we assume the old UIPasteboard/NSPasteboard model wherein
880         the destination must determine which of the items is considered to have the highest fidelity for the purposes of
881         inserting into an editable area. This destination-side fidelity ranking is determined solely by the NSArray
882         returned from Pasteboard::supportedPasteboardTypes, which lists compatible types in order from highest fidelity
883         to lowest fidelity. Pasteboard::read effectively iterates over this list of types in order, attempting to read
884         highest fidelity types and bailing when it first successfully reads data.
885
886         However, when our pasteboard is backed by UIItemProviders, we should instead read pasteboard types in order of
887         fidelity as specified by the source rather than the destination. To accomplish this, we introduce an alternate
888         codepath, Pasteboard::readRespectingUTIFidelities, which we take if Pasteboard::respectsUTIFidelities is true
889         (currently, this only applies for the purposes of data interaction). This version follows a different flow:
890         for each item in the pasteboard, we ask for just the UTIs for that item, in order of fidelity. For each item,
891         we then call readPasteboardWebContentDataForType to try and read data for that type, continuing until either
892         all UTIs have been attempted, or reading was successful.
893
894         This patch makes two additional adjustments. First, we introduce Pasteboard::getTypesByFidelityForItemAtIndex,
895         which is used by Pasteboard::readRespectingUTIFidelities when querying the list of supported UTIs for each
896         pasteboard item, sorted by highest to lowest fidelity.
897
898         Secondly, we refactor logic to write to the item provider pasteboard in PlatformPasteboardIOS. Since we are
899         now respecting fidelity rankings on the destination, the source must also register UTI types in the right
900         fidelity order. While this was mostly achieved using our existing method of writing a list of object
901         representations to the pasteboard and then all of the contents of a NSString => NSData dictionary containing
902         private UTI data, this approach has two flaws:
903         1.  We are unable to register high-priority custom types, followed by representing objects, followed by more
904             lower-priority custom types, since we assume that all custom types follow all representing objects.
905         2.  Since we're just iterating over a dictionary of NSString => NSData when registering custom UTI
906             representations to the item provider, there cannot inherently be any fidelity ordering for custom types.
907
908         To address both of these issues, we introduce two new objects that encapsulate how we register data to the item
909         provider pasteboard. WebItemProviderRegistrationInfo represents some data that can be registered to an item
910         provider (either an object conforming to UIItemProviderWriting, or an NSString and NSData).
911         WebItemProviderRegistrationInfoList represents a list of WebItemProviderRegistrationInfos in order of highest to
912         lowest fidelity. In PlatformPasteboardIOS, we transform PasteboardWebContent, PasteboardImage, and PasteboardURL
913         into a WebItemProviderRegistrationInfoList, which we then pass along to the WebItemProviderPasteboard. In
914         WebItemProviderPasteboard, we traverse the list of WebItemProviderRegistrationInfos in the list and register
915         each WebItemProviderRegistrationInfo's representing object or data to the item provider.
916
917         Test: DataInteractionTests.RespectsExternalSourceFidelityRankings.
918
919         * WebCore.xcodeproj/project.pbxproj:
920         * platform/Pasteboard.h:
921         * platform/PasteboardStrategy.h:
922         * platform/PlatformPasteboard.h:
923         * platform/ios/AbstractPasteboard.h:
924         * platform/ios/AbstractPasteboard.mm: Removed.
925
926         Moves WebItemProviderData, formerly implemented in AbstractPasteboard.mm, into WebItemProviderPasteboard.mm.
927         We can delete AbstractPasteboard.mm as a result.
928
929         * platform/ios/PasteboardIOS.mm:
930         (WebCore::readPasteboardWebContentDataForType):
931
932         Pull out common logic for reading data given a UTI type from the pasteboard into the PasteboardWebContentReader.
933         This is invoked from both the existing Pasteboard::read codepath, as well as the readRespectingUTIFidelities
934         codepath.
935
936         (WebCore::Pasteboard::read):
937
938         Refactored to call the new readPasteboardWebContentDataForType helper. Behavior should not have changed, unless
939         the pasteboard supports UTI fidelities.
940
941         (WebCore::Pasteboard::respectsUTIFidelities):
942         (WebCore::Pasteboard::readRespectingUTIFidelities):
943
944         An alternative to Pasteboard::read that considers source-side fidelity rankings of UTIs.
945
946         * platform/ios/PlatformPasteboardIOS.mm:
947         (WebCore::PlatformPasteboard::getTypesByFidelityForItemAtIndex):
948         (WebCore::PlatformPasteboard::writeObjectRepresentations):
949
950         Refactored to build a WebItemProviderRegistrationInfoList and pass it to the WebItemProviderPasteboard to
951         register items and data.
952
953         (WebCore::PlatformPasteboard::write):
954         * platform/ios/WebItemProviderPasteboard.h:
955         * platform/ios/WebItemProviderPasteboard.mm:
956         (-[WebItemProviderRegistrationInfo initWithRepresentingObject:typeIdentifier:data:]):
957         (-[WebItemProviderRegistrationInfo representingObject]):
958         (-[WebItemProviderRegistrationInfo typeIdentifier]):
959         (-[WebItemProviderRegistrationInfo data]):
960
961         Represents a single calls to register data onto the item provider pasteboard. See
962         WebItemProviderPasteboard.h header comments for more info.
963
964         (-[WebItemProviderRegistrationInfoList init]):
965         (-[WebItemProviderRegistrationInfoList addData:forType:]):
966         (-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
967         (-[WebItemProviderRegistrationInfoList numberOfItems]):
968         (-[WebItemProviderRegistrationInfoList itemAtIndex:]):
969         (-[WebItemProviderRegistrationInfoList enumerateItems:]):
970
971         Represents a series of calls to register representations onto the item provider pasteboard. See
972         WebItemProviderPasteboard.h header comments for more info.
973
974         (-[WebItemProviderPasteboard pasteboardTypesByFidelityForItemAtIndex:]):
975         (-[WebItemProviderPasteboard setItemsUsingRegistrationInfoLists:]):
976         (-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]): Deleted.
977
978 2017-04-24  Chris Dumez  <cdumez@apple.com>
979
980         Regression(r204605): support for "cp874" charset alias was inadvertently dropped which may cause issues on certain Thai sites
981         https://bugs.webkit.org/show_bug.cgi?id=171128
982         <rdar://problem/31526844>
983
984         Reviewed by Alexey Proskuryakov.
985
986         When using Thai as default language on MacOS, defaultTextEncodingNameForSystemLanguage()
987         was returning "cp874" encoding with was dropped in r204605 for not being part of the
988         encoding specification (https://encoding.spec.whatwg.org/#names-and-labels).
989
990         To address the issue, we map "cp874" encoding to the "dos-874" encoding which is
991         properly recognized. Without this, this could lead to issue on WebSites that do not
992         specify a charset.
993
994         * platform/text/TextEncodingRegistry.cpp:
995         (WebCore::defaultTextEncodingNameForSystemLanguage):
996
997 2017-04-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
998
999         [CG] Provide a type identifier hint to the CGImageSource so getting the type identifier is more accurate
1000         https://bugs.webkit.org/show_bug.cgi?id=171042
1001
1002         Reviewed by Tim Horton.
1003
1004         The image URL can be used to get the type identifier hint. Without providing
1005         this hint, the image type identifier is not accurate for image formats.
1006
1007         Also add a function to the ImageDecoder class to get the typeIdentifier. Add
1008         all the pluming from the ImageDecoder till the Image class.
1009
1010         * WebCore.xcodeproj/project.pbxproj:
1011         * platform/graphics/BitmapImage.cpp:
1012         (WebCore::BitmapImage::destroyDecodedData):
1013         (WebCore::BitmapImage::frameImageAtIndexCacheIfNeeded):
1014         (WebCore::BitmapImage::draw):
1015         (WebCore::BitmapImage::internalStartAnimation):
1016         (WebCore::BitmapImage::advanceAnimation):
1017         (WebCore::BitmapImage::internalAdvanceAnimation):
1018         (WebCore::BitmapImage::newFrameNativeImageAvailableAtIndex):
1019         * platform/graphics/BitmapImage.h:
1020         * platform/graphics/Image.cpp:
1021         (WebCore::Image::sourceURL):
1022         * platform/graphics/Image.h: Change the sourceURL() to return a URL so CG can create CFURLRef from it.
1023         (WebCore::Image::uti):
1024         * platform/graphics/ImageFrameCache.cpp:
1025         (WebCore::ImageFrameCache::cacheAsyncFrameNativeImageAtIndex):
1026         (WebCore::ImageFrameCache::startAsyncDecodingQueue):
1027         (WebCore::ImageFrameCache::requestFrameAsyncDecodingAtIndex):
1028         (WebCore::ImageFrameCache::stopAsyncDecodingQueue):
1029         (WebCore::ImageFrameCache::clearMetadata):
1030         (WebCore::ImageFrameCache::sourceURL):
1031         (WebCore::ImageFrameCache::encodedDataStatus):
1032         (WebCore::ImageFrameCache::uti):
1033         (WebCore::ImageFrameCache::filenameExtension):
1034         * platform/graphics/ImageFrameCache.h:
1035         * platform/graphics/ImageSource.cpp:
1036         (WebCore::ImageSource::ensureDecoderAvailable):
1037         * platform/graphics/ImageSource.h:
1038         (WebCore::ImageSource::uti):
1039         * platform/graphics/cg/ImageDecoderCG.cpp:
1040         (WebCore::ImageDecoder::ImageDecoder): Pass the type identifier hint to CGImageSourceCreateIncremental().
1041         (WebCore::ImageDecoder::uti):
1042         (WebCore::ImageDecoder::filenameExtension):
1043         (WebCore::ImageDecoder::frameHasAlphaAtIndex):
1044         (WebCore::ImageDecoder::createFrameImageAtIndex):
1045         * platform/graphics/cg/ImageDecoderCG.h:
1046         (WebCore::ImageDecoder::create):
1047         * platform/graphics/win/ImageDecoderDirect2D.cpp:
1048         (WebCore::ImageDecoder::encodedDataStatus):
1049         * platform/graphics/win/ImageDecoderDirect2D.h:
1050         (WebCore::ImageDecoder::create): Add an argument of type URL.
1051         * platform/image-decoders/ImageDecoder.cpp:
1052         (WebCore::ImageDecoder::create): Add an argument of type URL.
1053         * platform/image-decoders/ImageDecoder.h:
1054         (WebCore::ImageDecoder::encodedDataStatus): Make it const.
1055         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
1056         (WebCore::BMPImageDecoder::encodedDataStatus):
1057         * platform/image-decoders/bmp/BMPImageDecoder.h:
1058         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1059         (WebCore::GIFImageDecoder::encodedDataStatus):
1060         * platform/image-decoders/gif/GIFImageDecoder.h:
1061         * platform/image-decoders/ico/ICOImageDecoder.cpp:
1062         (WebCore::ICOImageDecoder::encodedDataStatus):
1063         * platform/image-decoders/ico/ICOImageDecoder.h:
1064         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
1065         (WebCore::JPEGImageDecoder::encodedDataStatus):
1066         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
1067         * platform/image-decoders/png/PNGImageDecoder.cpp:
1068         (WebCore::PNGImageDecoder::encodedDataStatus):
1069         * platform/image-decoders/png/PNGImageDecoder.h:
1070         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
1071         (WebCore::WEBPImageDecoder::encodedDataStatus):
1072         * platform/image-decoders/webp/WEBPImageDecoder.h:
1073         * platform/spi/cg/ImageIOSPI.h: Added.
1074
1075 2017-04-24  Ryan Haddad  <ryanhaddad@apple.com>
1076
1077         Unreviewed build fix.
1078
1079         * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
1080         (WebCore::encryptAES_GCM):
1081         (WebCore::decyptAES_GCM):
1082
1083 2017-04-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
1084
1085         Whitelist supported image MIME types
1086         https://bugs.webkit.org/show_bug.cgi?id=171077
1087
1088         Reviewed by Tim Horton.
1089
1090         Restrict the CG port image formats to a known whitelist. Build this list from image
1091         UTI's instead of MIME types, since the image UTI's is a superset of the MIME types.
1092         Use this list to build the list of supported image MIME types.
1093
1094         * PlatformAppleWin.cmake:
1095         * WebCore.xcodeproj/project.pbxproj:
1096         * platform/MIMETypeRegistry.cpp:
1097         (WebCore::initializeSupportedImageMIMETypes):
1098         * platform/graphics/cg/UTIRegistry.cpp: Added.
1099         (WebCore::allowedImageUTIs):
1100         (WebCore::isAllowedImageUTI):
1101         * platform/graphics/cg/UTIRegistry.h: Added.
1102
1103 2017-04-24  Nan Wang  <n_wang@apple.com>
1104
1105         AX: Crash at WebCore::AXObjectCache::characterOffsetForIndex(int, WebCore::AccessibilityObject const*) + 703
1106         https://bugs.webkit.org/show_bug.cgi?id=171247
1107
1108         Reviewed by Chris Fleizach.
1109
1110         Crashed because we were passing a nil node into rootAXEditableElement(). Fixed it by
1111         adding a null check.
1112
1113         Test: accessibility/mac/input-string-for-range-crash.html
1114
1115         * accessibility/AXObjectCache.cpp:
1116         (WebCore::AXObjectCache::characterOffsetForIndex):
1117
1118 2017-04-24  Youenn Fablet  <youenn@apple.com>
1119
1120         Set defaults video getUserMedia constraints
1121         https://bugs.webkit.org/show_bug.cgi?id=171127
1122
1123         Reviewed by Eric Carlson.
1124
1125         Test: fast/mediastream/getUserMedia-default.html
1126
1127         Adding default optional constraints for video size and frame rate if none is defined.
1128         Default is 640x480 30fps.
1129
1130         Doing some refactoring in MeddiaConstraintsImpl and MeddiaConstraintsData to use more move constructors.
1131
1132         * Modules/mediastream/MediaConstraintsImpl.cpp:
1133         (WebCore::defaultVideoConstraints):
1134         (WebCore::MediaConstraintsData::setDefaultVideoConstraints):
1135         (WebCore::MediaConstraintsImpl::create): Deleted.
1136         * Modules/mediastream/MediaConstraintsImpl.h:
1137         * Modules/mediastream/MediaDevices.cpp:
1138         (WebCore::MediaDevices::getUserMedia):
1139         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
1140         (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): Fixing crash when setting frameRate.
1141
1142 2017-04-24  Chris Dumez  <cdumez@apple.com>
1143
1144         createElementNS() should now throw only InvalidCharacterError, not NamespaceError
1145         https://bugs.webkit.org/show_bug.cgi?id=171052
1146
1147         Reviewed by Sam Weinig.
1148
1149         Validating a qualified name should only throw InvalidCharacterError, not NamespaceError,
1150         after:
1151         - https://github.com/whatwg/dom/issues/319
1152         - https://github.com/w3c/web-platform-tests/issues/5161
1153         - https://github.com/whatwg/dom/issues/423
1154
1155         Latest spec:
1156         - https://dom.spec.whatwg.org/#validate
1157
1158         No new tests, updated web-platform-tests.
1159
1160         * dom/Document.cpp:
1161         (WebCore::Document::parseQualifiedName):
1162
1163 2017-04-24  Chris Dumez  <cdumez@apple.com>
1164
1165         REGRESSION (214503): Webkit crash under RenderElement::repaintForPausedImageAnimationsIfNeeded() when scrolling giphy pages
1166         https://bugs.webkit.org/show_bug.cgi?id=171243
1167         <rdar://problem/31715572>
1168
1169         Reviewed by Antti Koivisto.
1170
1171         After r214503, we would frequently crash when scrolling giphy pages because we were failing to call
1172         RenderView::removeRendererWithPausedImageAnimations(renderer, cachedImage) in some cases. This would
1173         cause a RenderElement to still be associated to a CachedImage in RenderView but not in practice.
1174         If the CachedImage then gets destroyed and the user scrolls, we end up calling
1175         RenderElement::repaintForPausedImageAnimationsIfNeeded() with a bad CachedImage.
1176
1177         StyleCachedImage was properly calling RenderView::removeRendererWithPausedImageAnimations() before
1178         unregistering the renderer as a client to the CachedImage. However, RenderImageResource was failing
1179         to do the same. To make this less error-prone, I added a didRemoveCachedImageClient(CachedImage&)
1180         function to the CachedImageClient interface. It is overriden in RenderElement only to call
1181         RenderView::removeRendererWithPausedImageAnimations().
1182
1183         Test: fast/images/animated-gif-scrolling-crash.html
1184
1185         * loader/cache/CachedImage.cpp:
1186         (WebCore::CachedImage::didRemoveClient):
1187         * loader/cache/CachedImageClient.h:
1188         (WebCore::CachedImageClient::didRemoveCachedImageClient):
1189         * rendering/RenderElement.cpp:
1190         (WebCore::RenderElement::didRemoveCachedImageClient):
1191         * rendering/RenderElement.h:
1192         * rendering/style/StyleCachedImage.cpp:
1193         (WebCore::StyleCachedImage::removeClient):
1194
1195 2017-04-24  Andy Estes  <aestes@apple.com>
1196
1197         [macOS] Fix two minor issues with MediaSelectionOption::Type
1198         https://bugs.webkit.org/show_bug.cgi?id=171235
1199
1200         Reviewed by Sam Weinig.
1201
1202         * platform/MediaSelectionOption.h: Gave type a default value, and added explicit
1203         constructors to make gcc and msvc happy.
1204         * platform/mac/WebPlaybackControlsManager.mm:
1205         (toAVTouchBarMediaSelectionOptionType): Added an ASSERT_NOT_REACHED if none of the switch
1206         cases match.
1207
1208 2017-04-24  Andy Estes  <aestes@apple.com>
1209
1210         [macOS] Enable media selection button on AVTouchBarScrubber
1211         https://bugs.webkit.org/show_bug.cgi?id=171149
1212         <rdar://problem/29875010>
1213
1214         Reviewed by Beth Dakin.
1215
1216         * platform/spi/cocoa/AVKitSPI.h:
1217
1218 2017-04-24  Alex Christensen  <achristensen@webkit.org>
1219
1220         Reduce copies and allocations in SharedBuffer::append
1221         https://bugs.webkit.org/show_bug.cgi?id=170956
1222
1223         Reviewed by Andreas Kling.
1224
1225         SharedBuffer was a mess of different data structures added over the years.
1226         SharedBuffer::append would allocate large Vector<char>s and call memcpy, and that
1227         is inefficient and causes crashes when large allocations fail, and the allocations
1228         and copies aren't even necessary.  There were also const correctness problems in
1229         ResourceLoader::addDataOrBuffer, and iterating a SharedBuffer was strange because
1230         sometimes we don't want to add unnecessary copies.
1231
1232         These problems are solved by making SharedBuffer a Vector of read-only data segments,
1233         which can be contained in various ways but we don't care because all we want to do is
1234         read them.  Appending SharedBuffers is now const correct because we just add to a
1235         Vector<Ref<DataSegment>> and neither SharedBuffer can write to the data.  Sometimes,
1236         though, we want all the data to be in continuous memory, and if there are multiple
1237         segments then the data needs to be copied once to a new segment.  We should audit the
1238         call sites of SharedBuffer::data and see if this is really necessary.
1239
1240         No change in functional behavior.  Fewer copies of the data are made when buffering
1241         data in the NetworkProcess.  No extra memory is allocated for bytes we think we might
1242         need to append in the future.  Data is now only copied into one buffer lazily as needed,
1243         which could slightly change when small delays from memcpy happen, but it's an overall
1244         improvement.  We could have a performance hit if we were to call append() then data()
1245         then append() then data() etc. but that doesn't happen in WebKit because we call append
1246         repeatedly when buffering the data then call data() once when reading the data.
1247
1248         * editing/cocoa/EditorCocoa.mm:
1249         (WebCore::archivedDataForAttributedString):
1250         (WebCore::Editor::selectionInWebArchiveFormat):
1251         (WebCore::Editor::dataInRTFDFormat):
1252         (WebCore::Editor::dataInRTFFormat):
1253         * editing/ios/EditorIOS.mm:
1254         (WebCore::Editor::WebContentReader::readURL):
1255         * editing/mac/EditorMac.mm:
1256         (WebCore::Editor::imageInWebArchiveFormat):
1257         * loader/TextTrackLoader.cpp:
1258         (WebCore::TextTrackLoader::processNewCueData):
1259         * loader/archive/cf/LegacyWebArchive.cpp:
1260         (WebCore::LegacyWebArchive::createResource):
1261         * loader/cache/CachedResource.cpp:
1262         (WebCore::CachedResource::tryReplaceEncodedData):
1263         * loader/cocoa/DiskCacheMonitorCocoa.mm:
1264         (WebCore::DiskCacheMonitor::tryGetFileBackedSharedBufferFromCFURLCachedResponse):
1265         * platform/SharedBuffer.cpp:
1266         (WebCore::SharedBuffer::SharedBuffer):
1267         (WebCore::SharedBuffer::create):
1268         (WebCore::SharedBuffer::combineToOneSegment):
1269         (WebCore::SharedBuffer::data):
1270         (WebCore::SharedBuffer::createArrayBuffer):
1271         (WebCore::SharedBuffer::append):
1272         (WebCore::SharedBuffer::clear):
1273         (WebCore::SharedBuffer::copy):
1274         (WebCore::SharedBuffer::DataSegment::data):
1275         (WebCore::SharedBuffer::DataSegment::size):
1276         (WebCore::segmentIndex): Deleted.
1277         (WebCore::offsetInSegment): Deleted.
1278         (WebCore::allocateSegment): Deleted.
1279         (WebCore::freeSegment): Deleted.
1280         (WebCore::SharedBuffer::~SharedBuffer): Deleted.
1281         (WebCore::SharedBuffer::size): Deleted.
1282         (WebCore::SharedBuffer::duplicateDataBufferIfNecessary): Deleted.
1283         (WebCore::SharedBuffer::appendToDataBuffer): Deleted.
1284         (WebCore::SharedBuffer::clearDataBuffer): Deleted.
1285         (WebCore::SharedBuffer::copyBufferAndClear): Deleted.
1286         (WebCore::SharedBuffer::buffer): Deleted.
1287         (WebCore::SharedBuffer::getSomeData): Deleted.
1288         (WebCore::SharedBuffer::maybeTransferMappedFileData): Deleted.
1289         (WebCore::SharedBuffer::clearPlatformData): Deleted.
1290         (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
1291         (WebCore::SharedBuffer::hasPlatformData): Deleted.
1292         (WebCore::SharedBuffer::platformData): Deleted.
1293         (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
1294         * platform/SharedBuffer.h:
1295         (WebCore::SharedBuffer::create): Deleted.
1296         (WebCore::SharedBuffer::isEmpty): Deleted.
1297         * platform/SharedBufferChunkReader.cpp:
1298         (WebCore::SharedBufferChunkReader::nextChunk):
1299         (WebCore::SharedBufferChunkReader::peek):
1300         * platform/SharedBufferChunkReader.h:
1301         * platform/URLParser.cpp:
1302         (WebCore::URLParser::URLParser):
1303         * platform/cf/KeyedEncoderCF.cpp:
1304         (WebCore::KeyedEncoderCF::finishEncoding):
1305         * platform/cf/SharedBufferCF.cpp:
1306         (WebCore::SharedBuffer::SharedBuffer):
1307         (WebCore::SharedBuffer::createCFData):
1308         (WebCore::SharedBuffer::create):
1309         (WebCore::SharedBuffer::hintMemoryNotNeededSoon):
1310         (WebCore::SharedBuffer::append):
1311         (WebCore::SharedBuffer::wrapCFData): Deleted.
1312         (WebCore::SharedBuffer::hasPlatformData): Deleted.
1313         (WebCore::SharedBuffer::platformData): Deleted.
1314         (WebCore::SharedBuffer::platformDataSize): Deleted.
1315         (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
1316         (WebCore::SharedBuffer::clearPlatformData): Deleted.
1317         (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Deleted.
1318         (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
1319         (WebCore::SharedBuffer::copyBufferAndClear): Deleted.
1320         (WebCore::SharedBuffer::copySomeDataFromDataArray): Deleted.
1321         (WebCore::SharedBuffer::singleDataArrayBuffer): Deleted.
1322         (WebCore::SharedBuffer::maybeAppendDataArray): Deleted.
1323         * platform/cocoa/NetworkExtensionContentFilter.mm:
1324         (WebCore::NetworkExtensionContentFilter::replacementData):
1325         * platform/cocoa/ParentalControlsContentFilter.mm:
1326         (WebCore::ParentalControlsContentFilter::replacementData):
1327         * platform/cocoa/SharedBufferCocoa.mm:
1328         (-[WebCoreSharedBufferData initWithSharedBufferDataSegment:]):
1329         (-[WebCoreSharedBufferData length]):
1330         (-[WebCoreSharedBufferData bytes]):
1331         (WebCore::SharedBuffer::create):
1332         (WebCore::SharedBuffer::createCFData):
1333         (WebCore::SharedBuffer::createFromReadingFile):
1334         (WebCore::SharedBuffer::createNSDataArray):
1335         (-[WebCoreSharedBufferData initWithSharedBufferDataBuffer:]): Deleted.
1336         (WebCore::SharedBuffer::wrapNSData): Deleted.
1337         (WebCore::SharedBuffer::existingCFData): Deleted.
1338         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
1339         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
1340         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1341         (WebCore::FontPlatformData::openTypeTable):
1342         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1343         (ResourceHandleStreamingClient::didReceiveBuffer):
1344         * platform/graphics/mac/ImageMac.mm:
1345         (WebCore::Image::loadPlatformResource):
1346         * platform/image-decoders/ImageDecoder.cpp:
1347         (WebCore::ImageDecoder::create):
1348         * platform/image-decoders/png/PNGImageDecoder.cpp:
1349         (WebCore::PNGImageReader::decode):
1350         * platform/ios/PlatformPasteboardIOS.mm:
1351         (WebCore::PlatformPasteboard::readBuffer):
1352         * platform/mac/PasteboardMac.mm:
1353         (WebCore::writeFileWrapperAsRTFDAttachment):
1354         (WebCore::Pasteboard::write):
1355         * platform/mac/PlatformPasteboardMac.mm:
1356         (WebCore::PlatformPasteboard::bufferForType):
1357         * platform/network/BlobResourceHandle.cpp:
1358         (WebCore::BlobResourceHandle::notifyReceiveData):
1359         * platform/network/MIMEHeader.cpp:
1360         * platform/network/MIMEHeader.h:
1361         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1362         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
1363         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
1364         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData):
1365         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
1366         (-[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:]):
1367         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1368         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
1369         * platform/soup/SharedBufferSoup.cpp:
1370         (WebCore::SharedBuffer::SharedBuffer):
1371         (WebCore::SharedBuffer::createSoupBuffer):
1372         (WebCore::SharedBuffer::clearPlatformData): Deleted.
1373         (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
1374         (WebCore::SharedBuffer::hasPlatformData): Deleted.
1375         (WebCore::SharedBuffer::platformData): Deleted.
1376         (WebCore::SharedBuffer::platformDataSize): Deleted.
1377         (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
1378         (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Deleted.
1379
1380 2017-04-24  Dan Bernstein  <mitz@apple.com>
1381
1382         [Cocoa] Some ivars are needlessly @protected
1383         https://bugs.webkit.org/show_bug.cgi?id=171208
1384
1385         Reviewed by Anders Carlsson.
1386
1387         Made ivars @private where possible.
1388
1389         * platform/mac/WebCoreFullScreenPlaceholderView.h:
1390         * platform/mac/WebCoreFullScreenWarningView.h:
1391         * platform/mac/WebPlaybackControlsManager.h:
1392         * platform/network/cocoa/WebCoreNSURLSession.h:
1393
1394 2017-04-24  Carlos Garcia Campos  <cgarcia@igalia.com>
1395
1396         [GTK] Switch to use ENABLE_REMOTE_INSPECTOR instead of ENABLE_INSPECTOR_SERVER for the remote inspector
1397         https://bugs.webkit.org/show_bug.cgi?id=166680
1398
1399         Reviewed by Michael Catanzaro.
1400
1401         Add PageDebuggable.cpp to the compilation.
1402
1403         * CMakeLists.txt:
1404
1405 2017-04-23  Commit Queue  <commit-queue@webkit.org>
1406
1407         Unreviewed, rolling out r215657 and r215676.
1408         https://bugs.webkit.org/show_bug.cgi?id=171201
1409
1410         Broke the build (Requested by ap on #webkit).
1411
1412         Reverted changesets:
1413
1414         "[macOS] Enable media selection button on AVTouchBarScrubber"
1415         https://bugs.webkit.org/show_bug.cgi?id=171149
1416         http://trac.webkit.org/changeset/215657
1417
1418         "Build fix after r215657."
1419         http://trac.webkit.org/changeset/215676
1420
1421 2017-04-23  Andy Estes  <aestes@apple.com>
1422
1423         [macOS] AVTouchBarMediaSelectionOptions should be created with the correct type
1424         https://bugs.webkit.org/show_bug.cgi?id=171192
1425         <rdar://problem/29875010>
1426
1427         Reviewed by Wenson Hsieh.
1428
1429         AVTouchBarMediaSelectionOption was always being created with type
1430         AVTouchBarMediaSelectionOptionTypeRegular, but we know if a TextTrack is really the legible
1431         off or legible auto track. This change plumbs that information into
1432         WebPlaybackControlsManager so that AVTouchBarMediaSelectionOptions can be created with the
1433         right AVTouchBarMediaSelectionOptionType. 
1434
1435         * WebCore.xcodeproj/project.pbxproj:
1436         * page/CaptionUserPreferences.cpp:
1437         (WebCore::CaptionUserPreferences::mediaSelectionOptionForTrack):
1438         * page/CaptionUserPreferences.h:
1439         * platform/MediaSelectionOption.h: Added.
1440         * platform/cocoa/WebPlaybackSessionModel.h:
1441         (WebCore::WebPlaybackSessionModelClient::audioMediaSelectionOptionsChanged):
1442         (WebCore::WebPlaybackSessionModelClient::legibleMediaSelectionOptionsChanged):
1443         * platform/cocoa/WebPlaybackSessionModelMediaElement.h:
1444         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
1445         (WebCore::WebPlaybackSessionModelMediaElement::audioMediaSelectionOptions):
1446         (WebCore::WebPlaybackSessionModelMediaElement::legibleMediaSelectionOptions):
1447         * platform/ios/WebPlaybackSessionInterfaceAVKit.h:
1448         * platform/ios/WebPlaybackSessionInterfaceAVKit.mm:
1449         (WebCore::mediaSelectionOptions):
1450         (WebCore::WebPlaybackSessionInterfaceAVKit::audioMediaSelectionOptionsChanged):
1451         (WebCore::WebPlaybackSessionInterfaceAVKit::legibleMediaSelectionOptionsChanged):
1452         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1453         (WebVideoFullscreenControllerContext::audioMediaSelectionOptionsChanged):
1454         (WebVideoFullscreenControllerContext::legibleMediaSelectionOptionsChanged):
1455         (WebVideoFullscreenControllerContext::audioMediaSelectionOptions):
1456         (WebVideoFullscreenControllerContext::legibleMediaSelectionOptions):
1457         * platform/mac/WebPlaybackControlsManager.h:
1458         * platform/mac/WebPlaybackControlsManager.mm:
1459         (toAVTouchBarMediaSelectionOptionType):
1460         (mediaSelectionOptions):
1461         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]):
1462         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]):
1463         (-[WebPlaybackControlsManager webPlaybackSessionInterfaceMac]):
1464         (-[WebPlaybackControlsManager setWebPlaybackSessionInterfaceMac:]):
1465         * platform/mac/WebPlaybackSessionInterfaceMac.h:
1466         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
1467         (WebCore::WebPlaybackSessionInterfaceMac::audioMediaSelectionOptionsChanged):
1468         (WebCore::WebPlaybackSessionInterfaceMac::legibleMediaSelectionOptionsChanged):
1469
1470 2017-04-22  Wenson Hsieh  <wenson_hsieh@apple.com>
1471
1472         File inputs only accept UTI types that can be inserted into contenteditable areas when dropping
1473         https://bugs.webkit.org/show_bug.cgi?id=171177
1474         <rdar://problem/31765379>
1475
1476         Reviewed by Andy Estes.
1477
1478         Currently, DragController::canProcessDrag bails immediately with `false` if the drag data does not contain
1479         compatible content. However, if we are dragging over a file input, we want the presence of files in the drag
1480         data to take priority. To fix this, we teach DragData::containsCompatibleContent to take the purpose of the drag
1481         into account (by default, this is Editing, but when dragging over a file input, this becomes FileUpload). We
1482         then consider DragData to have compatible content for the purpose of file uploading if it contains any files.
1483
1484         Test: DataInteractionTests.ExternalSourceJSONToFileInput.
1485
1486         * page/DragController.cpp:
1487         (WebCore::DragController::canProcessDrag):
1488         * platform/DragData.h:
1489         * platform/gtk/DragDataGtk.cpp:
1490         (WebCore::DragData::containsCompatibleContent):
1491         * platform/mac/DragDataMac.mm:
1492         (WebCore::DragData::containsCompatibleContent):
1493         * platform/win/DragDataWin.cpp:
1494         (WebCore::DragData::containsCompatibleContent):
1495
1496 2017-04-22  Eric Carlson  <eric.carlson@apple.com>
1497
1498         [MediaStream] Fix regression caused by r215626
1499         https://bugs.webkit.org/show_bug.cgi?id=171168
1500         <rdar://problem/31774787>
1501
1502         Reviewed by Antoine Quint.
1503
1504         No new tests, fixes fast/mediastream/MediaStream-page-muted.html
1505
1506         * Modules/mediastream/MediaStream.cpp:
1507         (WebCore::MediaStream::mediaState): Test muted before m_isProducingData because if both are 
1508         true we want to report that the stream is muted.
1509
1510 2017-04-21  Zalan Bujtas  <zalan@apple.com>
1511
1512         Do not measure large chunk of text repeatedly during mid-word breaking.
1513         https://bugs.webkit.org/show_bug.cgi?id=171065
1514         <rdar://problem/31630245>
1515
1516         Reviewed by Antti Koivisto.
1517
1518         This patch reduces redundant text measuring for mid-word breaking by
1519         1. Adjusting the range for the binary search when the text fragment is longer than the available width
1520         2. Preserving the width value for the left side of the split fragment (computed during the binary search) so
1521         that when the fragment is being split we don't need to re-measure it
1522         3. Checking if the right side fits the next line and only adjust the width (by re-measuring the text) for
1523         kerning/ligature if it does (if it does not fit, we'll end up re-measuring some part of it
1524         during the next split)
1525
1526         Performance test has already been added.
1527
1528         * rendering/SimpleLineLayout.cpp:
1529         (WebCore::SimpleLineLayout::hyphenPositionForFragment):
1530         (WebCore::SimpleLineLayout::split): binary search with adjusting the range and preserving the width for the left side.
1531         (WebCore::SimpleLineLayout::splitFragmentToFitLine):
1532         (WebCore::SimpleLineLayout::FragmentForwardIterator::FragmentForwardIterator): Deleted.
1533         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator++): Deleted.
1534         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator!=): Deleted.
1535         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator==): Deleted.
1536         (WebCore::SimpleLineLayout::FragmentForwardIterator::operator*): Deleted.
1537         (WebCore::SimpleLineLayout::begin): Deleted.
1538         (WebCore::SimpleLineLayout::end): Deleted.
1539         * rendering/SimpleLineLayoutTextFragmentIterator.h:
1540         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::split):
1541         (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::splitWithHyphen):
1542
1543 2017-04-21  Wenson Hsieh  <wenson_hsieh@apple.com>
1544
1545         Support writing link titles to the pasteboard when beginning data interaction on a link
1546         https://bugs.webkit.org/show_bug.cgi?id=171154
1547         <rdar://problem/31356937>
1548
1549         Reviewed by Andy Estes.
1550
1551         Currently, when writing NSURLs to the pasteboard, we only write a String to the pasteboard corresponding to
1552         kUTTypeURL. This means richer data associated with the link (in this case, the title) are not captured when
1553         writing to the pasteboard. To address this, we introduce a new codepath for writing links to the pasteboard that
1554         mirrors the way PasteboardImage and PasteboardWebContent are written to the pasteboard.
1555
1556         Test: Augmented DataInteractionTests.LinkToInput.
1557
1558         * platform/PasteboardStrategy.h:
1559         * platform/PlatformPasteboard.h:
1560
1561         Add plumbing support for writing PasteboardURLs.
1562
1563         * platform/ios/PasteboardIOS.mm:
1564         (WebCore::Pasteboard::write):
1565         * platform/ios/PlatformPasteboardIOS.mm:
1566         (WebCore::PlatformPasteboard::writeObjectRepresentations):
1567
1568         Teach PlatformPasteboard to also set the _title attribute of the NSURL when creating an NSURL representation
1569         for registering with the shared WebItemProviderPasteboard.
1570
1571         (WebCore::PlatformPasteboard::write):
1572         * platform/ios/WebItemProviderPasteboard.mm:
1573
1574         Remove deprecation guards and replace deprecated method calls with the latest undeprecated versions.
1575
1576         (-[WebItemProviderPasteboard setItemsFromObjectRepresentations:]):
1577
1578 2017-04-21  Michael Catanzaro  <mcatanzaro@igalia.com>
1579
1580         Unreviewed, rolling out r215608.
1581
1582         Hundreds of test failures on GTK bot
1583
1584         Reverted changeset:
1585
1586         "Reduce copies and allocations in SharedBuffer::append"
1587         https://bugs.webkit.org/show_bug.cgi?id=170956
1588         http://trac.webkit.org/changeset/215608
1589
1590 2017-04-21  Zalan Bujtas  <zalan@apple.com>
1591
1592         REGRESSION(r205374): <li> content inside <ul> should mid-word wrap when word-break: break-word is present.
1593         https://bugs.webkit.org/show_bug.cgi?id=171108
1594         <rdar://problem/30271747>
1595
1596         Reviewed by Dan Bernstein.
1597
1598         This patch ensures that we search for mid-word breaks when a zero sized element has been committed on the line
1599         unless it's an image or some other replaced element with special properties (e.g. list-style: inside).  
1600
1601         Tests: fast/replaced/ul-li-word-break-break-word.html
1602                fast/replaced/zero-width-image-force-linebreak.html
1603
1604         * rendering/line/BreakingContext.h:
1605         (WebCore::BreakingContext::handleReplaced):
1606         (WebCore::BreakingContext::handleText): This matches pre-r205374 behaviour, but it's explicit about whether a 
1607         replaced width has already been committed on the current line.
1608         * rendering/line/LineWidth.cpp:
1609         (WebCore::LineWidth::commit):
1610         * rendering/line/LineWidth.h:
1611         (WebCore::LineWidth::hasCommittedReplaced):
1612         (WebCore::LineWidth::addUncommittedReplacedWidth): These 2 last functions were removed with r205374 (and now I am adding them back). 
1613
1614 2017-04-21  Jer Noble  <jer.noble@apple.com>
1615
1616         [MediaCapture] Improvements to CoreAudioCaptureSource
1617         https://bugs.webkit.org/show_bug.cgi?id=171146
1618
1619         Reviewed by Eric Carlson.
1620
1621         Various interlocking improvements to CoreAudioCaptureSource:
1622
1623         - Allow the volume, sampleRate, and echoCancellation settings to be applied to the source.
1624         - Update the values returned via settings() when these values change.
1625         - Obey the sampleRate and echoCancellation settings when creating the VPIO unit.
1626         - Because AudioUnitRender() mutates the passed in AudioBufferList, reset it immediately before calling.
1627
1628         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1629         (WebCore::CoreAudioCaptureSource::create):
1630         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
1631         (WebCore::CoreAudioCaptureSource::preferredSampleRate):
1632         (WebCore::CoreAudioCaptureSource::preferredIOBufferSize):
1633         (WebCore::CoreAudioCaptureSource::configureMicrophoneProc):
1634         (WebCore::CoreAudioCaptureSource::configureSpeakerProc):
1635         (WebCore::CoreAudioCaptureSource::processMicrophoneSamples):
1636         (WebCore::CoreAudioCaptureSource::setupAudioUnits):
1637         (WebCore::CoreAudioCaptureSource::stopProducingData):
1638         (WebCore::CoreAudioCaptureSource::settings):
1639         (WebCore::CoreAudioCaptureSource::settingsDidChange):
1640         (WebCore::CoreAudioCaptureSource::preferredIOBufferDuration): Deleted.
1641         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1642
1643 2017-04-21  Youenn Fablet  <youenn@apple.com>
1644
1645         com.apple.WebCore: non-virtual thunk to WebCore::LibWebRTCDataChannelHandler::OnBufferedAmountChange + 39
1646         https://bugs.webkit.org/show_bug.cgi?id=171087
1647         <rdar://problem/31739051>
1648
1649         Reviewed by Eric Carlson.
1650
1651         Covered by existing tests.
1652         No test added as this behavior is really libwebrtc specific and cannot be triggered easily.
1653
1654         * Modules/mediastream/RTCDataChannel.cpp:
1655         (WebCore::RTCDataChannel::close): Stopping observing libwebrtc data channel before closing it.
1656         This ensures we will stop getting notified as soon as there is no more interest.
1657         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
1658         (WebCore::LibWebRTCDataChannelHandler::OnStateChange): libwebrtc can still notify us even though we said we were
1659         not interested. Ensuring we do not call the client if we are no longer interested.
1660         (WebCore::LibWebRTCDataChannelHandler::OnMessage): Ditto.
1661         (WebCore::LibWebRTCDataChannelHandler::OnBufferedAmountChange): Ditto.
1662
1663 2017-04-21  Andy Estes  <aestes@apple.com>
1664
1665         [macOS] Enable media selection button on AVTouchBarScrubber
1666         https://bugs.webkit.org/show_bug.cgi?id=171149
1667         <rdar://problem/29875010>
1668
1669         Reviewed by Beth Dakin.
1670
1671         * platform/spi/cocoa/AVKitSPI.h:
1672
1673 2017-04-21  Andy Estes  <aestes@apple.com>
1674
1675         [macOS] Name WebPlaybackControlsManager delegate methods correctly depending on OS version
1676         https://bugs.webkit.org/show_bug.cgi?id=171147
1677         <rdar://problem/29875010>
1678
1679         Reviewed by Beth Dakin.
1680
1681         On macOS 10.12, WebPlaybackControlsManager conforms to
1682         AVFunctionBarPlaybackControlsControlling, but on 10.13 it conforms to
1683         AVTouchBarPlaybackControlsControlling. These protocols are near-identical, except for
1684         instances of "FunctionBar" in method names are renamed to "TouchBar". This patch updates to
1685         the new method names, and generally renames things with "FunctionBar" to "TouchBar".
1686
1687         * platform/mac/WebPlaybackControlsManager.h:
1688         * platform/mac/WebPlaybackControlsManager.mm:
1689         (-[WebPlaybackControlsManager generateTouchBarThumbnailsForTimes:tolerance:size:thumbnailHandler:]):
1690         (-[WebPlaybackControlsManager generateTouchBarAudioAmplitudeSamples:completionHandler:]):
1691         (-[WebPlaybackControlsManager canBeginTouchBarScrubbing]):
1692         (-[WebPlaybackControlsManager beginTouchBarScrubbing]):
1693         (-[WebPlaybackControlsManager endTouchBarScrubbing]):
1694         (-[WebPlaybackControlsManager generateFunctionBarThumbnailsForTimes:size:completionHandler:]):
1695         (-[WebPlaybackControlsManager generateFunctionBarAudioAmplitudeSamples:completionHandler:]):
1696         (-[WebPlaybackControlsManager canBeginFunctionBarScrubbing]):
1697         (-[WebPlaybackControlsManager beginFunctionBarScrubbing]):
1698         (-[WebPlaybackControlsManager endFunctionBarScrubbing]):
1699         (-[WebPlaybackControlsManager audioTouchBarMediaSelectionOptions]):
1700         (-[WebPlaybackControlsManager setAudioTouchBarMediaSelectionOptions:]):
1701         (-[WebPlaybackControlsManager currentAudioTouchBarMediaSelectionOption]):
1702         (-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]):
1703         (-[WebPlaybackControlsManager legibleTouchBarMediaSelectionOptions]):
1704         (-[WebPlaybackControlsManager setLegibleTouchBarMediaSelectionOptions:]):
1705         (-[WebPlaybackControlsManager currentLegibleTouchBarMediaSelectionOption]):
1706         (-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]):
1707         (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:withSelectedIndex:]):
1708         (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:withSelectedIndex:]):
1709         (-[WebPlaybackControlsManager audioFunctionBarMediaSelectionOptions]): Deleted.
1710         (-[WebPlaybackControlsManager setAudioFunctionBarMediaSelectionOptions:]): Deleted.
1711         (-[WebPlaybackControlsManager currentAudioFunctionBarMediaSelectionOption]): Deleted.
1712         (-[WebPlaybackControlsManager setCurrentAudioFunctionBarMediaSelectionOption:]): Deleted.
1713         (-[WebPlaybackControlsManager legibleFunctionBarMediaSelectionOptions]): Deleted.
1714         (-[WebPlaybackControlsManager setLegibleFunctionBarMediaSelectionOptions:]): Deleted.
1715         (-[WebPlaybackControlsManager currentLegibleFunctionBarMediaSelectionOption]): Deleted.
1716         (-[WebPlaybackControlsManager setCurrentLegibleFunctionBarMediaSelectionOption:]): Deleted.
1717
1718 2017-04-21  Jer Noble  <jer.noble@apple.com>
1719
1720         Make CoreAudioCaptureDevice stackable.
1721         https://bugs.webkit.org/show_bug.cgi?id=171097
1722
1723         Reviewed by Eric Carlson.
1724
1725         There's no real reason to keep CoreAudioCaptureDevice from being created on the stack. 
1726         Make it un-RefCounted, and have it's static factory method return an std::optional rather
1727         than a RefPtr.
1728
1729         Drive-by fix: clean up the factory method of CoreAudioCaptureSource a bit.
1730
1731         * platform/mediastream/mac/CoreAudioCaptureDevice.cpp:
1732         (WebCore::CoreAudioCaptureDevice::create):
1733         (WebCore::CoreAudioCaptureDevice::deviceID): Deleted.
1734         * platform/mediastream/mac/CoreAudioCaptureDevice.h:
1735         (WebCore::CoreAudioCaptureDevice::deviceID):
1736         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
1737         (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices):
1738         (WebCore::CoreAudioCaptureDeviceManager::coreAudioDeviceWithUID):
1739         (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices):
1740         * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:
1741         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
1742         (WebCore::CoreAudioCaptureSource::create):
1743         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
1744         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1745
1746 2017-04-21  Eric Carlson  <eric.carlson@apple.com>
1747
1748         [MediaStream iOS] Release capture session when not producing data
1749         https://bugs.webkit.org/show_bug.cgi?id=171148
1750         <rdar://problem/29265868>
1751
1752         Reviewed by Jer Noble.
1753
1754         On iOS, only one AVCaptureSession can be active at a time, so release a session whenever
1755         it is told to stop producing data. The session will recreated if the capture source if/when
1756         told to produce data again.
1757
1758         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1759         (WebCore::AVMediaCaptureSource::stopProducingData): Clear m_session to release the session.
1760         It will be re-allocated if startProducingData is called later.
1761
1762 2017-04-21  Aaron Chu  <aaron_chu@apple.com>
1763
1764         AX: FKA: Buttons need a visible focus indicator
1765         https://bugs.webkit.org/show_bug.cgi?id=171040
1766         <rdar://problem/30922548>
1767
1768         Reviewed by Antoine Quint.
1769
1770         Added a background color for the focus state of the icon buttons in modern media controls.
1771
1772         Test: media/modern-media-controls/icon-button/icon-button-focus-state.html
1773
1774         * Modules/modern-media-controls/controls/icon-button.css:
1775         (button.icon:focus):
1776
1777 2017-03-22  Matt Rajca  <mrajca@apple.com>
1778
1779         Consider muting audio hardware a form of autoplay interference.
1780         https://bugs.webkit.org/show_bug.cgi?id=169971
1781
1782         Reviewed by Eric Carlson.
1783
1784         If the user mutes audio hardware and a media element is auto-playing, consider that
1785         as a form of auto-play interference that we tell clients about.
1786
1787         * html/HTMLMediaElement.cpp:
1788         (WebCore::HTMLMediaElement::HTMLMediaElement):
1789         (WebCore::HTMLMediaElement::~HTMLMediaElement):
1790         (WebCore::HTMLMediaElement::hardwareMutedStateDidChange):
1791         * html/HTMLMediaElement.h:
1792         * platform/audio/AudioSession.h:
1793         (WebCore::AudioSession::MutedStateObserver::~MutedStateObserver):
1794         * platform/audio/mac/AudioSessionMac.cpp:
1795         (WebCore::AudioSession::isMuted):
1796         (WebCore::muteProcess):
1797         (WebCore::AudioSession::handleMutedStateChange):
1798         (WebCore::AudioSession::addMutedStateObserver):
1799         (WebCore::AudioSession::removeMutedStateObserver):
1800
1801 2017-04-21  Chris Dumez  <cdumez@apple.com>
1802
1803         Regression(r206240): XMLSerializer.serializeToString() does not properly escape '<' / '>' in attribute values
1804         https://bugs.webkit.org/show_bug.cgi?id=171132
1805         <rdar://problem/31426752>
1806
1807         Reviewed by Ryosuke Niwa.
1808
1809         Use XMLSerialization [1] in MarkupAccumulator::appendAttribute() when inXMLFragmentSerialization()
1810         returns true, even if the node's associated document is an HTML document. When XMLSerializer.serializeToString()
1811         is called on a Node, we want XML serialization, even if the node comes from an HTML document.
1812
1813         [1] https://w3c.github.io/DOM-Parsing/#dfn-xml-serialization
1814
1815         Test: fast/dom/XMLSerializer-serializeToString-entities.html
1816
1817         * editing/MarkupAccumulator.cpp:
1818         (WebCore::MarkupAccumulator::appendAttributeValue):
1819         (WebCore::MarkupAccumulator::appendAttribute):
1820         * editing/MarkupAccumulator.h:
1821
1822 2017-04-20  Sam Weinig  <sam@webkit.org>
1823
1824         Split cryptographic digest computation and parsing out of CSP code so it can be reused
1825         https://bugs.webkit.org/show_bug.cgi?id=171076
1826
1827         Reviewed by Chris Dumez.
1828
1829         Factor out cryptographic digest parsing from Content Security Policy code
1830         so that it can be reused for the Subresource Integrity implementation.
1831
1832         * CMakeLists.txt:
1833         * WebCore.xcodeproj/project.pbxproj:
1834         Add new files.
1835
1836         * html/parser/ParsingUtilities.h:
1837         (WebCore::skipExactlyIgnoringASCIICase):
1838         Add parsing helper to match / skip over a constant string, using IgnoringASCIICase semantics.
1839
1840         * loader/ResourceCryptographicDigest.cpp: Added.
1841         (WebCore::parseHashAlgorithmAdvancingPosition):
1842         (WebCore::parseCryptographicDigestImpl):
1843         (WebCore::parseCryptographicDigest):
1844         Move parsing of cryptographic-digest strings from ContentSecurityPolicySourceList.cpp
1845         and optimize it a little by avoiding String allocations and generalizing it so that it
1846         can parse either UChars or LChars.
1847
1848         * loader/ResourceCryptographicDigest.h: Added.
1849         (WebCore::ResourceCryptographicDigest::operator==):
1850         (WebCore::ResourceCryptographicDigest::operator!=):
1851         (WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::Hash::hash):
1852         (WTF::DefaultHash<WebCore::ResourceCryptographicDigest>::Hash::equal):
1853         (WTF::HashTraits<WebCore::ResourceCryptographicDigest>::emptyValue):
1854         (WTF::HashTraits<WebCore::ResourceCryptographicDigest>::constructDeletedValue):
1855         (WTF::HashTraits<WebCore::ResourceCryptographicDigest>::isDeletedValue):
1856         Add a struct (rather than using a std::pair) to represent the digest + algorithm. And add
1857         HashTraits so it can be used as HashMap.
1858         
1859         * page/csp/ContentSecurityPolicy.cpp:
1860         (WebCore::ContentSecurityPolicy::findHashOfContentInPolicies):
1861         (WebCore::toCryptoDigestAlgorithm): Deleted.
1862         Move algorithm conversion to ResourceCryptographicDigest.cpp. Make use of new 
1863         cryptographicDigestForBytes function to do hashing.
1864
1865         * page/csp/ContentSecurityPolicy.h:
1866         * page/csp/ContentSecurityPolicyHash.h:
1867         (WTF::DefaultHash<WebCore::ContentSecurityPolicyDigest>::Hash::hash): Deleted.
1868         (WTF::DefaultHash<WebCore::ContentSecurityPolicyDigest>::Hash::equal): Deleted.
1869         Remove HashTraits for the digest, this is now handled by ResourceCryptographicDigest. 
1870         To keep things relatively straight-forward, redefine ContentSecurityPolicyHashAlgorithm
1871         and ContentSecurityPolicyHash in terms of ResourceCryptographicDigest, so that less code
1872         has to be changed all at once. In a later pass, if wanted, we can remove these using 
1873         declarations.
1874
1875         * page/csp/ContentSecurityPolicySourceList.cpp:
1876         (WebCore::isNonceCharacter):
1877         Use renamed isBase64OrBase64URLCharacter predicate.
1878
1879         (WebCore::ContentSecurityPolicySourceList::parseHashSource):
1880         Rework using ResourceCryptographicDigest parsing. Quotation and maximum digest
1881         length have been kept here, as they are not applicable to other uses of 
1882         the digest, specifically Subresource Integrity.
1883
1884 2017-04-21  Jer Noble  <jer.noble@apple.com>
1885
1886         Unreviewed fix after r215624; null-deref crash.
1887
1888         Make sure to call reset() inside each constructor.
1889
1890         * platform/audio/WebAudioBufferList.cpp:
1891         (WebCore::WebAudioBufferList::WebAudioBufferList):
1892
1893 2017-04-21  Anders Carlsson  <andersca@apple.com>
1894
1895         Stop using deprecated APIs, part 5
1896         https://bugs.webkit.org/show_bug.cgi?id=171134
1897         rdar://problem/31589635
1898
1899         Reviewed by Tim Horton.
1900
1901         * Modules/applepay/ApplePaySession.cpp:
1902         (WebCore::convertAndValidate):
1903         Stop using the toPaymentAuthorizationStatus. Convert the passed in status results to the remaining
1904         PaymentAuthorizationStatus values, and add errors if needed.
1905
1906         (WebCore::toPaymentAuthorizationStatus):
1907         This function is no longer used.
1908
1909         * Modules/applepay/PaymentAuthorizationStatus.h:
1910         Remove deprecated status values. We can achieve the same results with errors now.
1911
1912         * Modules/applepay/PaymentRequest.cpp:
1913         (WebCore::isFinalStateResult):
1914         Remove deprecated status values.
1915
1916         * Modules/applepay/PaymentRequest.h:
1917         Remove deprecated status values.
1918
1919 2017-04-21  Per Arne Vollan  <pvollan@apple.com>
1920
1921         Validate vImage arguments
1922         https://bugs.webkit.org/show_bug.cgi?id=171109
1923         rdar://problem/30236606
1924
1925         Reviewed by Brent Fulgham.
1926
1927         When writing data to a canvas context, clip the source rectangle to the data rectangle
1928         to make sure we will not attempt to read data outside of the buffer.
1929
1930         Test: fast/canvas/canvas-crash.html
1931
1932         * html/canvas/CanvasRenderingContext2D.cpp:
1933         (WebCore::CanvasRenderingContext2D::putImageData):
1934
1935 2017-04-21  David Kilzer  <ddkilzer@apple.com>
1936
1937         Switch from -std=gnu++11 to -std=gnu++14 for consistency in DerivedSources.make
1938         <https://webkit.org/b/171122>
1939
1940         Reviewed by Brent Fulgham.
1941
1942         * DerivedSources.make: Switch to -std=gnu++14 for preprocessing
1943         headers to check for build settings.
1944
1945 2017-04-21  Jer Noble  <jer.noble@apple.com>
1946
1947         [MediaCapture][iOS] AVAudioSession must be active and the correct category before IO AudioUnits start producing data.
1948         https://bugs.webkit.org/show_bug.cgi?id=171095
1949
1950         Reviewed by Youenn Fablet.
1951
1952         If an input audio unit is asked to start before the AVAudioSession is in a recording category and active,
1953         CoreAudio will return an error stating that no input device is available.
1954
1955         The PlatformMediaSessionManager will automatically set the category of and activate the AVAudioSession when one
1956         of its associated MediaStreams has a capturing RealtimeMediaSource and is currently producing data.  To solve
1957         the chicken-or-egg problem of activating the AVAudioSession before the source produces data, move the state bit
1958         of "producing data" directly into MediaStreams, and notify the PlatformMediaSessionManager that capturing is
1959         occurring after flipping that bit, but before asking the constituent tracks to begin producing data.
1960
1961         In places (i.e. UserMediaRequest) where we previously told a stream's tracks to begin producing data, instead
1962         allow the stream to handle that by telling it to produce data directly.
1963
1964         * Modules/mediastream/MediaStream.cpp:
1965         (WebCore::MediaStream::startProducingData):
1966         (WebCore::MediaStream::stopProducingData):
1967         (WebCore::MediaStream::mediaState):
1968         (WebCore::MediaStream::mediaType):
1969         (WebCore::MediaStream::characteristics):
1970         (WebCore::MediaStream::canProduceAudio):
1971         * Modules/mediastream/MediaStream.h:
1972         * Modules/mediastream/UserMediaRequest.cpp:
1973         (WebCore::UserMediaRequest::allow):
1974         * platform/mediastream/mac/CoreAudioCaptureSource.h:
1975
1976 2017-04-21  Jer Noble  <jer.noble@apple.com>
1977
1978         Add a method to retrieve the current I/O buffer size from AudioSession
1979         https://bugs.webkit.org/show_bug.cgi?id=171126
1980
1981         Reviewed by Eric Carlson.
1982
1983         There is an existing method to get and set the preferred I/O buffer size; add a matching method to return
1984         the acutal I/O buffer size.
1985
1986         * platform/audio/AudioSession.cpp:
1987         (WebCore::AudioSession::bufferSize):
1988         * platform/audio/AudioSession.h:
1989         * platform/audio/ios/AudioSessionIOS.mm:
1990         (WebCore::AudioSession::bufferSize):
1991         * platform/audio/mac/AudioSessionMac.cpp:
1992         (WebCore::AudioSession::bufferSize):
1993
1994 2017-04-21  Jer Noble  <jer.noble@apple.com>
1995
1996         Make AudioSampleBufferList::reset() less expensive.
1997         https://bugs.webkit.org/show_bug.cgi?id=171124
1998
1999         Reviewed by Eric Carlson.
2000
2001         Previously, AudioSampleBufferList would reallocate its constituent WebAudioBufferList every time reset() was
2002         called. Instead, add a reset() method to WebAudioBufferList which re-initializes its AudioBufferList (which is a
2003         simple memcpy of a 24-byte struct), reusing the existing memory buffers.
2004
2005         While making these changes, we'll also take the opportunity to clean up the AudioSampleBufferList class by
2006         making some of its members into UniqueRefs instead of unique_ptrs, thus removing the possibility of null-
2007         dereferences.
2008
2009         * platform/audio/WebAudioBufferList.cpp:
2010         (WebCore::WebAudioBufferList::WebAudioBufferList):
2011         (WebCore::WebAudioBufferList::reset):
2012         * platform/audio/WebAudioBufferList.h:
2013         * platform/audio/mac/AudioSampleBufferList.cpp:
2014         (WebCore::AudioSampleBufferList::AudioSampleBufferList):
2015         (WebCore::AudioSampleBufferList::applyGain):
2016         (WebCore::AudioSampleBufferList::mixFrom):
2017         (WebCore::AudioSampleBufferList::reset):
2018         (WebCore::AudioSampleBufferList::zero):
2019         (WebCore::AudioSampleBufferList::~AudioSampleBufferList): Deleted.
2020         * platform/audio/mac/AudioSampleBufferList.h:
2021         (WebCore::AudioSampleBufferList::bufferList):
2022
2023 2017-04-21  Jer Noble  <jer.noble@apple.com>
2024
2025         Fix some spurious ASSERTs when working with capturing media elements
2026         https://bugs.webkit.org/show_bug.cgi?id=171096
2027
2028         Reviewed by Youenn Fablet.
2029
2030         Two related ASSERTS:
2031
2032         1) When we added a new PlatformMediaSession MediaType (MediaStreamCapturingAudio), we did not update all the
2033         places that validated the enum. This would lead to spurious ASSERTs when an element capturing audio would
2034         fail various checks to enusre it's type's validity.
2035
2036         2) Audio elements will ASSERT when they change page visibility, as they do not have a renderer which implements
2037         visibleInViewportStateChanged(). So opt out of visibility-state checking for non-video media elements.
2038
2039         * html/MediaElementSession.cpp:
2040         (WebCore::MediaElementSession::wantsToObserveViewportVisibilityForAutoplay):
2041         * platform/audio/PlatformMediaSessionManager.cpp:
2042         (WebCore::PlatformMediaSessionManager::resetRestrictions):
2043         (WebCore::PlatformMediaSessionManager::addRestriction):
2044         (WebCore::PlatformMediaSessionManager::removeRestriction):
2045         (WebCore::PlatformMediaSessionManager::restrictions):
2046         * platform/audio/PlatformMediaSessionManager.h:
2047
2048 2017-04-21  Konstantin Tokarev  <annulen@yandex.ru>
2049
2050         [cmake] WTF target should not have wtf and subdirectries in public interface
2051         https://bugs.webkit.org/show_bug.cgi?id=171115
2052
2053         Reviewed by Michael Catanzaro.
2054
2055         In r209665 WEBCORE_FRAMEWORK macro started to export INCLUDE_DIRECTORIES of
2056         targets as their public interface, so that linked targets can use them
2057         implicitly without copying directory lists around. This matches existing
2058         practice for all targets except WTF, headers from which are always included
2059         with full path starting from "<wtf/...".
2060
2061         Since r209665 it became possible to include headers from wtf or its
2062         subdirectories in CMake builds without using "<wtf/..." path. It should
2063         not be allowed.
2064
2065         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp: Fix
2066         incorrect include of WTF header.
2067
2068 2017-04-21  Gwang Yoon Hwang  <yoon@igalia.com>
2069
2070         Do not paint the border of the box if the dirty region does not intersect with border area
2071         https://bugs.webkit.org/show_bug.cgi?id=170988
2072
2073         Reviewed by Simon Fraser.
2074
2075         No new tests, since there is no change in behavior.
2076
2077         * platform/graphics/GeometryUtilities.cpp:
2078         (WebCore::ellipseContainsPoint):
2079         Checks if a point is within an ellipse.
2080
2081         * platform/graphics/GeometryUtilities.h:
2082         Replace header-guards with #pragma once.
2083
2084         * platform/graphics/RoundedRect.cpp:
2085         (WebCore::RoundedRect::contains):
2086         Implemented to know the dirty rectangle intersects with rounded rectangle or not.
2087         * platform/graphics/RoundedRect.h:
2088         * rendering/RenderBoxModelObject.cpp:
2089         (WebCore::RenderBoxModelObject::paintBorder):
2090         When typing in decorated text box, the dirty rect generated only for the
2091         inside of the text box, not for the decorations.  So we can avoid the
2092         calculations to draw borders if the inner border totally covers the
2093         target surface. It will optimize the rendering process since we don't
2094         have to render border decorations whenever we type somethings in side of
2095         the text input element.
2096
2097 2017-04-21  Anders Carlsson  <andersca@apple.com>
2098
2099         Remove another use of toPaymentAuthorizationStatus
2100         https://bugs.webkit.org/show_bug.cgi?id=171114
2101
2102         Reviewed by Dan Bernstein.
2103
2104         * Modules/applepay/ApplePaySession.cpp:
2105         (WebCore::ApplePaySession::completeShippingContactSelection):
2106
2107 2017-04-21  Alex Christensen  <achristensen@webkit.org>
2108
2109         Reduce copies and allocations in SharedBuffer::append
2110         https://bugs.webkit.org/show_bug.cgi?id=170956
2111
2112         Reviewed by Andreas Kling.
2113
2114         SharedBuffer was a mess of different data structures added over the years.
2115         SharedBuffer::append would allocate large Vector<char>s and call memcpy, and that
2116         is inefficient and causes crashes when large allocations fail, and the allocations
2117         and copies aren't even necessary.  There were also const correctness problems in
2118         ResourceLoader::addDataOrBuffer, and iterating a SharedBuffer was strange because
2119         sometimes we don't want to add unnecessary copies.
2120
2121         These problems are solved by making SharedBuffer a Vector of read-only data segments,
2122         which can be contained in various ways but we don't care because all we want to do is
2123         read them.  Appending SharedBuffers is now const correct because we just add to a
2124         Vector<Ref<DataSegment>> and neither SharedBuffer can write to the data.  Sometimes,
2125         though, we want all the data to be in continuous memory, and if there are multiple
2126         segments then the data needs to be copied once to a new segment.  We should audit the
2127         call sites of SharedBuffer::data and see if this is really necessary.
2128
2129         No change in functional behavior.  Fewer copies of the data are made when buffering
2130         data in the NetworkProcess.  No extra memory is allocated for bytes we think we might
2131         need to append in the future.  Data is now only copied into one buffer lazily as needed,
2132         which could slightly change when small delays from memcpy happen, but it's an overall
2133         improvement.  We could have a performance hit if we were to call append() then data()
2134         then append() then data() etc. but that doesn't happen in WebKit because we call append
2135         repeatedly when buffering the data then call data() once when reading the data.
2136
2137         * editing/cocoa/EditorCocoa.mm:
2138         (WebCore::archivedDataForAttributedString):
2139         (WebCore::Editor::selectionInWebArchiveFormat):
2140         (WebCore::Editor::dataInRTFDFormat):
2141         (WebCore::Editor::dataInRTFFormat):
2142         * editing/ios/EditorIOS.mm:
2143         (WebCore::Editor::WebContentReader::readURL):
2144         * editing/mac/EditorMac.mm:
2145         (WebCore::Editor::imageInWebArchiveFormat):
2146         * loader/TextTrackLoader.cpp:
2147         (WebCore::TextTrackLoader::processNewCueData):
2148         * loader/archive/cf/LegacyWebArchive.cpp:
2149         (WebCore::LegacyWebArchive::createResource):
2150         * loader/cache/CachedResource.cpp:
2151         (WebCore::CachedResource::tryReplaceEncodedData):
2152         * loader/cocoa/DiskCacheMonitorCocoa.mm:
2153         (WebCore::DiskCacheMonitor::tryGetFileBackedSharedBufferFromCFURLCachedResponse):
2154         * platform/SharedBuffer.cpp:
2155         (WebCore::SharedBuffer::SharedBuffer):
2156         (WebCore::SharedBuffer::create):
2157         (WebCore::SharedBuffer::combineToOneSegment):
2158         (WebCore::SharedBuffer::data):
2159         (WebCore::SharedBuffer::createArrayBuffer):
2160         (WebCore::SharedBuffer::append):
2161         (WebCore::SharedBuffer::clear):
2162         (WebCore::SharedBuffer::copy):
2163         (WebCore::SharedBuffer::DataSegment::data):
2164         (WebCore::SharedBuffer::DataSegment::size):
2165         (WebCore::segmentIndex): Deleted.
2166         (WebCore::offsetInSegment): Deleted.
2167         (WebCore::allocateSegment): Deleted.
2168         (WebCore::freeSegment): Deleted.
2169         (WebCore::SharedBuffer::~SharedBuffer): Deleted.
2170         (WebCore::SharedBuffer::size): Deleted.
2171         (WebCore::SharedBuffer::duplicateDataBufferIfNecessary): Deleted.
2172         (WebCore::SharedBuffer::appendToDataBuffer): Deleted.
2173         (WebCore::SharedBuffer::clearDataBuffer): Deleted.
2174         (WebCore::SharedBuffer::copyBufferAndClear): Deleted.
2175         (WebCore::SharedBuffer::buffer): Deleted.
2176         (WebCore::SharedBuffer::getSomeData): Deleted.
2177         (WebCore::SharedBuffer::maybeTransferMappedFileData): Deleted.
2178         (WebCore::SharedBuffer::clearPlatformData): Deleted.
2179         (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
2180         (WebCore::SharedBuffer::hasPlatformData): Deleted.
2181         (WebCore::SharedBuffer::platformData): Deleted.
2182         (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
2183         * platform/SharedBuffer.h:
2184         (WebCore::SharedBuffer::create): Deleted.
2185         (WebCore::SharedBuffer::isEmpty): Deleted.
2186         * platform/SharedBufferChunkReader.cpp:
2187         (WebCore::SharedBufferChunkReader::nextChunk):
2188         (WebCore::SharedBufferChunkReader::peek):
2189         * platform/SharedBufferChunkReader.h:
2190         * platform/URLParser.cpp:
2191         (WebCore::URLParser::URLParser):
2192         * platform/cf/KeyedEncoderCF.cpp:
2193         (WebCore::KeyedEncoderCF::finishEncoding):
2194         * platform/cf/SharedBufferCF.cpp:
2195         (WebCore::SharedBuffer::SharedBuffer):
2196         (WebCore::SharedBuffer::createCFData):
2197         (WebCore::SharedBuffer::create):
2198         (WebCore::SharedBuffer::hintMemoryNotNeededSoon):
2199         (WebCore::SharedBuffer::append):
2200         (WebCore::SharedBuffer::wrapCFData): Deleted.
2201         (WebCore::SharedBuffer::hasPlatformData): Deleted.
2202         (WebCore::SharedBuffer::platformData): Deleted.
2203         (WebCore::SharedBuffer::platformDataSize): Deleted.
2204         (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
2205         (WebCore::SharedBuffer::clearPlatformData): Deleted.
2206         (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Deleted.
2207         (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
2208         (WebCore::SharedBuffer::copyBufferAndClear): Deleted.
2209         (WebCore::SharedBuffer::copySomeDataFromDataArray): Deleted.
2210         (WebCore::SharedBuffer::singleDataArrayBuffer): Deleted.
2211         (WebCore::SharedBuffer::maybeAppendDataArray): Deleted.
2212         * platform/cocoa/NetworkExtensionContentFilter.mm:
2213         (WebCore::NetworkExtensionContentFilter::replacementData):
2214         * platform/cocoa/ParentalControlsContentFilter.mm:
2215         (WebCore::ParentalControlsContentFilter::replacementData):
2216         * platform/cocoa/SharedBufferCocoa.mm:
2217         (-[WebCoreSharedBufferData initWithSharedBufferDataSegment:]):
2218         (-[WebCoreSharedBufferData length]):
2219         (-[WebCoreSharedBufferData bytes]):
2220         (WebCore::SharedBuffer::create):
2221         (WebCore::SharedBuffer::createCFData):
2222         (WebCore::SharedBuffer::createFromReadingFile):
2223         (WebCore::SharedBuffer::createNSDataArray):
2224         (-[WebCoreSharedBufferData initWithSharedBufferDataBuffer:]): Deleted.
2225         (WebCore::SharedBuffer::wrapNSData): Deleted.
2226         (WebCore::SharedBuffer::existingCFData): Deleted.
2227         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2228         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
2229         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2230         (WebCore::FontPlatformData::openTypeTable):
2231         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2232         (ResourceHandleStreamingClient::didReceiveBuffer):
2233         * platform/graphics/mac/ImageMac.mm:
2234         (WebCore::Image::loadPlatformResource):
2235         * platform/image-decoders/ImageDecoder.cpp:
2236         (WebCore::ImageDecoder::create):
2237         * platform/image-decoders/png/PNGImageDecoder.cpp:
2238         (WebCore::PNGImageReader::decode):
2239         * platform/ios/PlatformPasteboardIOS.mm:
2240         (WebCore::PlatformPasteboard::readBuffer):
2241         * platform/mac/PasteboardMac.mm:
2242         (WebCore::writeFileWrapperAsRTFDAttachment):
2243         (WebCore::Pasteboard::write):
2244         * platform/mac/PlatformPasteboardMac.mm:
2245         (WebCore::PlatformPasteboard::bufferForType):
2246         * platform/network/BlobResourceHandle.cpp:
2247         (WebCore::BlobResourceHandle::notifyReceiveData):
2248         * platform/network/MIMEHeader.cpp:
2249         * platform/network/MIMEHeader.h:
2250         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2251         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveData):
2252         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
2253         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData):
2254         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
2255         (-[WebCoreResourceHandleAsDelegate connection:didReceiveData:lengthReceived:]):
2256         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2257         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveData:lengthReceived:]):
2258         * platform/soup/SharedBufferSoup.cpp:
2259         (WebCore::SharedBuffer::SharedBuffer):
2260         (WebCore::SharedBuffer::createSoupBuffer):
2261         (WebCore::SharedBuffer::clearPlatformData): Deleted.
2262         (WebCore::SharedBuffer::maybeTransferPlatformData): Deleted.
2263         (WebCore::SharedBuffer::hasPlatformData): Deleted.
2264         (WebCore::SharedBuffer::platformData): Deleted.
2265         (WebCore::SharedBuffer::platformDataSize): Deleted.
2266         (WebCore::SharedBuffer::maybeAppendPlatformData): Deleted.
2267         (WebCore::SharedBuffer::tryReplaceContentsWithPlatformBuffer): Deleted.
2268
2269 2017-04-21  Timothy Horton  <timothy_horton@apple.com>
2270
2271         Expose obscured insets to web content (as "safe area insets")
2272         https://bugs.webkit.org/show_bug.cgi?id=171013
2273         <rdar://problem/31564652>
2274
2275         Reviewed by Wenson Hsieh and Dave Hyatt.
2276
2277         Tests: fast/css/variables/constants/invalid-constant-name-fallback.html
2278                fast/css/variables/constants/ios/safe-area-inset-set.html
2279                fast/css/variables/constants/safe-area-inset-cannot-override.html
2280                fast/css/variables/constants/safe-area-inset-zero.html
2281
2282         * CMakeLists.txt:
2283         * WebCore.xcodeproj/project.pbxproj:
2284         * css/CSSValueKeywords.in:
2285         * css/CSSVariableData.cpp:
2286         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange):
2287         (WebCore::CSSVariableData::resolveTokenRange):
2288         * css/parser/CSSVariableParser.cpp:
2289         (WebCore::isValidConstantName):
2290         (WebCore::classifyBlock):
2291         (WebCore::isValidConstantReference):
2292         Add a constant() function, which takes both custom properties and
2293         arbitrary idents which are looked up in ConstantPropertyMap, allowing
2294         fallback from the arbitrary, UA-defined idents to custom properties.
2295
2296         * dom/ConstantPropertyMap.cpp: Added.
2297         (WebCore::ConstantPropertyMap::ConstantPropertyMap):
2298         (WebCore::ConstantPropertyMap::values):
2299         (WebCore::ConstantPropertyMap::nameForProperty):
2300         (WebCore::ConstantPropertyMap::setValueForProperty):
2301         (WebCore::ConstantPropertyMap::buildValues):
2302         (WebCore::variableDataForSafeAreaInset):
2303         (WebCore::ConstantPropertyMap::didChangeObscuredInsets):
2304         * dom/ConstantPropertyMap.h: Added.
2305         Keep a mapping of UA-defined "constants", which can be looked up
2306         from CSS via the aforementioned function. For now, this mapping
2307         includes only safe-area-inset-{top, right, bottom, left}, which
2308         expose the obscured insets (now that they can be painted into via
2309         the viewport parameter clip-to-safe-area-inset=no).
2310
2311         * dom/Document.cpp:
2312         (WebCore::Document::Document):
2313         (WebCore::Document::didChangeObscuredInsets):
2314         * dom/Document.h:
2315         (WebCore::Document::constantProperties):
2316         * page/Page.cpp:
2317         (WebCore::Page::setObscuredInsets):
2318         * page/Page.h:
2319         (WebCore::Page::setObscuredInsets): Deleted.
2320         Make setObscuredInsets and related storage not iOS-specific, though
2321         nothing from the other platforms yet calls this code.
2322
2323         * style/StyleResolveForDocument.cpp:
2324         (WebCore::Style::resolveForDocument):
2325         Grab the constant properties from ConstantPropertyMap and plop them into
2326         the CustomPropertyValueMap. Constant properties aren't allowed to start
2327         with --, and variable properties must, so there is no opportunity here
2328         for exposing things to var() (or allowing custom properties to override
2329         UA-defined constant properties).
2330
2331 2017-04-20  Konstantin Tokarev  <annulen@yandex.ru>
2332
2333         [cmake] Define FORWARDING_HEADERS_DIR in WebKitFS and use it everywhere
2334         https://bugs.webkit.org/show_bug.cgi?id=171071
2335
2336         Reviewed by Michael Catanzaro.
2337
2338         "${DERIVED_SOURCES_DIR}/ForwardingHeaders" path occurs very often in the
2339         build system files. GTK-specifc FORWARDING_HEADERS_DIR variable should
2340         be available for all ports.
2341
2342         * CMakeLists.txt:
2343         * PlatformMac.cmake:
2344         * PlatformWin.cmake:
2345         * PlatformWinCairo.cmake:
2346
2347 2017-04-20  Commit Queue  <commit-queue@webkit.org>
2348
2349         Unreviewed, rolling out r215597.
2350         https://bugs.webkit.org/show_bug.cgi?id=171102
2351
2352         Made all tests crash under GuardMalloc (Requested by ap on
2353         #webkit).
2354
2355         Reverted changeset:
2356
2357         "Expose obscured insets to web content (as "safe area
2358         insets")"
2359         https://bugs.webkit.org/show_bug.cgi?id=171013
2360         http://trac.webkit.org/changeset/215597
2361
2362 2017-04-20  Dean Jackson  <dino@apple.com>
2363
2364         Add Web Sharing to the features under consideration.
2365
2366         * features.json:
2367
2368 2017-04-20  Dean Jackson  <dino@apple.com>
2369
2370         Add Scroll Anchoring to features under consideration.
2371
2372         * features.json:
2373
2374 2017-04-20  Konstantin Tokarev  <annulen@yandex.ru>
2375
2376         Remove unused lamda captures
2377         https://bugs.webkit.org/show_bug.cgi?id=171098
2378
2379         Reviewed by Yusuke Suzuki.
2380
2381         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2382         (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
2383         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2384         (WebCore::IDBServer::UniqueIDBDatabase::activateTransactionInBackingStore):
2385         * loader/ResourceLoadStatisticsStore.cpp:
2386         (WebCore::ResourceLoadStatisticsStore::createEncoderFromData):
2387         (WebCore::ResourceLoadStatisticsStore::readDataFromDecoder):
2388
2389 2017-04-20  Timothy Horton  <timothy_horton@apple.com>
2390
2391         Expose obscured insets to web content (as "safe area insets")
2392         https://bugs.webkit.org/show_bug.cgi?id=171013
2393         <rdar://problem/31564652>
2394
2395         Reviewed by Wenson Hsieh and Dave Hyatt.
2396
2397         Tests: fast/css/variables/constants/invalid-constant-name-fallback.html
2398                fast/css/variables/constants/ios/safe-area-inset-set.html
2399                fast/css/variables/constants/safe-area-inset-cannot-override.html
2400                fast/css/variables/constants/safe-area-inset-zero.html
2401
2402         * CMakeLists.txt:
2403         * WebCore.xcodeproj/project.pbxproj:
2404         * css/CSSValueKeywords.in:
2405         * css/CSSVariableData.cpp:
2406         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange):
2407         (WebCore::CSSVariableData::resolveTokenRange):
2408         * css/parser/CSSVariableParser.cpp:
2409         (WebCore::isValidConstantName):
2410         (WebCore::classifyBlock):
2411         (WebCore::isValidConstantReference):
2412         Add a constant() function, which takes both custom properties and
2413         arbitrary idents which are looked up in ConstantPropertyMap, allowing
2414         fallback from the arbitrary, UA-defined idents to custom properties.
2415
2416         * dom/ConstantPropertyMap.cpp: Added.
2417         (WebCore::ConstantPropertyMap::ConstantPropertyMap):
2418         (WebCore::ConstantPropertyMap::values):
2419         (WebCore::ConstantPropertyMap::nameForProperty):
2420         (WebCore::ConstantPropertyMap::setValueForProperty):
2421         (WebCore::ConstantPropertyMap::buildValues):
2422         (WebCore::variableDataForSafeAreaInset):
2423         (WebCore::ConstantPropertyMap::didChangeObscuredInsets):
2424         * dom/ConstantPropertyMap.h: Added.
2425         Keep a mapping of UA-defined "constants", which can be looked up
2426         from CSS via the aforementioned function. For now, this mapping
2427         includes only safe-area-inset-{top, right, bottom, left}, which
2428         expose the obscured insets (now that they can be painted into via
2429         the viewport parameter clip-to-safe-area-inset=no).
2430
2431         * dom/Document.cpp:
2432         (WebCore::Document::Document):
2433         (WebCore::Document::didChangeObscuredInsets):
2434         * dom/Document.h:
2435         (WebCore::Document::constantProperties):
2436         * page/Page.cpp:
2437         (WebCore::Page::setObscuredInsets):
2438         * page/Page.h:
2439         (WebCore::Page::setObscuredInsets): Deleted.
2440         Make setObscuredInsets and related storage not iOS-specific, though
2441         nothing from the other platforms yet calls this code.
2442
2443         * style/StyleResolveForDocument.cpp:
2444         (WebCore::Style::resolveForDocument):
2445         Grab the constant properties from ConstantPropertyMap and plop them into
2446         the CustomPropertyValueMap. Constant properties aren't allowed to start
2447         with --, and variable properties must, so there is no opportunity here
2448         for exposing things to var() (or allowing custom properties to override
2449         UA-defined constant properties).
2450
2451 2017-04-20  Anders Carlsson  <andersca@apple.com>
2452
2453         Remove one use of toPaymentAuthorizationStatus
2454         https://bugs.webkit.org/show_bug.cgi?id=171086
2455
2456         Reviewed by Tim Horton.
2457
2458         Just switch on the individual ApplePaySession::STATUS_ values.
2459
2460         * Modules/applepay/ApplePaySession.cpp:
2461         (WebCore::ApplePaySession::completeShippingMethodSelection):
2462
2463 2017-04-20  Fujii Hironori  <Hironori.Fujii@sony.com>
2464
2465         [WinCairo] Fix build break after updating ANGLE
2466         https://bugs.webkit.org/show_bug.cgi?id=170980
2467
2468         Reviewed by Brent Fulgham.
2469
2470         By stopping using SoftLinking for ANGLE, some changes are needed
2471         for WebCore and WebKit.
2472           - Define a macro 'GL_GLEXT_PROTOTYPES' before #include <GLES2/gl2.h> or <GLES2/gl2ext.h>.
2473           - Link libEGL import library explicitly.
2474
2475         * PlatformWin.cmake: Link libEGL to WebCore.
2476         * platform/graphics/PlatformDisplay.cpp:
2477         (WebCore::PlatformDisplay::initializeEGLDisplay): Removed the code for SoftLinking.
2478         * platform/graphics/GLContext.cpp: Define GL_GLEXT_PROTOTYPES.
2479         * platform/graphics/egl/GLContextEGL.cpp: Ditto.
2480         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp: Ditto.
2481         * platform/graphics/opengl/Extensions3DOpenGLES.h: Ditto.
2482         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp: Ditto.
2483         * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp: Ditto.
2484
2485 2017-04-20  Matt Baker  <mattbaker@apple.com>
2486
2487         Web Inspector: Add regular expression support to XHR breakpoints
2488         https://bugs.webkit.org/show_bug.cgi?id=170099
2489         <rdar://problem/31558082>
2490
2491         Reviewed by Joseph Pecoraro.
2492
2493         * inspector/InspectorDOMDebuggerAgent.cpp:
2494         (WebCore::InspectorDOMDebuggerAgent::setXHRBreakpoint):
2495         (WebCore::InspectorDOMDebuggerAgent::willSendXMLHttpRequest):
2496         Use ContentSearchUtilities for both Text and RegularExpression breakpoints.
2497
2498         * inspector/InspectorDOMDebuggerAgent.h:
2499         Associate XHR breakpoint with a type.
2500
2501 2017-04-20  Eric Carlson  <eric.carlson@apple.com>
2502
2503         [MediaStream] Cleanup and simplify CoreAudioCaptureSource
2504         https://bugs.webkit.org/show_bug.cgi?id=171064
2505
2506         There is no need for a mutex to guard against internal state changes because we
2507         don't currently change configuration after the audio unit is allocated. Once
2508         we do support reconfiguration on the fly, we can just stop the output unit before
2509         changing configuration because the I/O proc isn't called if the output unit
2510         is stopped, and AudioOutputUnitStop blocks until the audio device has stopped.
2511         
2512         Reviewed by Jer Noble.
2513
2514         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2515         (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource): Call cleanupAudioUnits
2516         instead of duplicating logic. 
2517         (WebCore::CoreAudioCaptureSource::preferredIOBufferDuration): Change preferred
2518         duration from 20ms to 40ms.
2519         (WebCore::CoreAudioCaptureSource::configureMicrophoneProc): Set mSampleRate to the
2520         preferred sample rate if it is 0.
2521         (WebCore::CoreAudioCaptureSource::configureSpeakerProc): Ditto.
2522         (WebCore::CoreAudioCaptureSource::provideSpeakerData): Only increment counter and
2523         check timestamps in debug builds.
2524         (WebCore::CoreAudioCaptureSource::processMicrophoneSamples): Ditto.
2525         (WebCore::CoreAudioCaptureSource::cleanupAudioUnits): We only need the audio unit
2526         name in debug builds.
2527         (WebCore::CoreAudioCaptureSource::setupAudioUnits): Ditto. No more internal state
2528         lock. Don't try to get the default input device on iOS.
2529         (WebCore::CoreAudioCaptureSource::startProducingData): No more internal state lock.
2530         Assert if not called on the main thread.
2531         (WebCore::CoreAudioCaptureSource::stopProducingData): Ditto.
2532         (WebCore::CoreAudioCaptureSource::suspend): Ditto.
2533         (WebCore::CoreAudioCaptureSource::resume): Ditto.
2534         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2535
2536 2017-04-20  Eric Carlson  <eric.carlson@apple.com>
2537
2538         [MediaStream iOS] Hold process assertion while media capture is active
2539         https://bugs.webkit.org/show_bug.cgi?id=171017
2540         <rdar://problem/31719177>
2541
2542         Reviewed by Dean Jackson.
2543
2544         * page/ActivityState.h: Add IsCapturingMedia flag.
2545
2546         * page/Page.cpp:
2547         (WebCore::Page::updateTimerThrottlingState): Enable timer throttling when capture is active
2548         like we do when playing audio.
2549         (WebCore::Page::setActivityState): Ditto.
2550
2551         * page/PerformanceMonitor.cpp:
2552         (WebCore::PerformanceMonitor::updateProcessStateForMemoryPressure): A process is active when
2553         capturing media, as it is when playing audio.
2554
2555 2017-04-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2556
2557         Inline anchor elements cannot be dragged when starting the drag from a block descendant
2558         https://bugs.webkit.org/show_bug.cgi?id=171062
2559         <rdar://problem/31697835>
2560
2561         Reviewed by Tim Horton.
2562
2563         Tweaks DragController::draggableElement to traverse the DOM instead of the render tree when finding a draggable
2564         element. This prevents us from skipping elements that are in the DOM ancestor chain, but appear as siblings to
2565         the hit-tested node's renderer in the render tree.
2566
2567         There was also previously a check to ensure that we skip anonymous RenderObjects while traversing up the chain,
2568         but this is no longer necessary fter this change, since all the elements we traverse in the DOM should have
2569         renderers that are not anonymous.
2570
2571         Test: fast/events/drag-and-drop-link-containing-block.html
2572
2573         * page/DragController.cpp:
2574         (WebCore::DragController::draggableElement):
2575
2576 2017-04-20  Michael Catanzaro  <mcatanzaro@igalia.com>
2577
2578         -Wformat warning on HistoryController.cpp:295:5
2579         https://bugs.webkit.org/show_bug.cgi?id=171028
2580
2581         Reviewed by Daniel Bates.
2582
2583         Need to cast WebCore::FrameLoadType to int before using it in printf.
2584
2585         * loader/HistoryController.cpp:
2586         (WebCore::HistoryController::goToItem):
2587
2588 2017-04-20  Per Arne Vollan  <pvollan@apple.com>
2589
2590         The toleranceBefore parameter in the AVPlayerItem method seekToTime should not be negative.
2591         https://bugs.webkit.org/show_bug.cgi?id=171063
2592
2593         Reviewed by Eric Carlson.
2594
2595         The AVPlayerItem method seekToTime will throw an exception if toleranceBefore is negative.
2596
2597         No new tests since the change is a sanity check.
2598
2599         * html/HTMLMediaElement.cpp:
2600         (WebCore::HTMLMediaElement::seekTask):
2601         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2602         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
2603
2604 2017-04-20  Anders Carlsson  <andersca@apple.com>
2605
2606         Replace isFinalStateStatus with isFinalStateResult
2607         https://bugs.webkit.org/show_bug.cgi?id=171072
2608         rdar://problem/31589635
2609
2610         Reviewed by Tim Horton.
2611
2612         This will let us get rid of some of the status enum declarations.
2613
2614         * Modules/applepay/ApplePaySession.cpp:
2615         (WebCore::ApplePaySession::completePayment):
2616         * Modules/applepay/PaymentAuthorizationStatus.h:
2617         (WebCore::isFinalStateStatus): Deleted.
2618         * Modules/applepay/PaymentCoordinator.cpp:
2619         (WebCore::PaymentCoordinator::completePaymentSession):
2620         * Modules/applepay/PaymentRequest.cpp:
2621         (WebCore::isFinalStateResult):
2622         * Modules/applepay/PaymentRequest.h:
2623
2624 2017-04-20  Brent Fulgham  <bfulgham@apple.com>
2625
2626         [Win] REGRESSION(r215486): Windows Release build is broken
2627         https://bugs.webkit.org/show_bug.cgi?id=171024
2628         <rdar://problem/31722618>
2629
2630         Reviewed by Mark Lam.
2631
2632         Add missing include needed for clean Release build on Windows (proper
2633         fix found by Fujii Hironori).
2634
2635         * bindings/js/JSDOMGlobalObject.h:
2636
2637 2017-04-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
2638
2639         CachedImage should cancel loading images for unsupported/unknown types
2640         https://bugs.webkit.org/show_bug.cgi?id=170697
2641
2642         Reviewed by Youenn Fablet.
2643
2644         Currently when the image decoder detects an error with the incoming encoded
2645         data of an image, we mark the image to be a broken image. But the network
2646         process keeps feeding the web process with the rest of the data. We should
2647         cancel loading the rest of the data to save network bandwidth and CPU time
2648         loading and processing useless data.
2649
2650         * loader/cache/CachedImage.cpp:
2651         (WebCore::CachedImage::addIncrementalDataBuffer):
2652         (WebCore::CachedImage::finishLoading):
2653
2654 2017-04-20  Aaron Chu  <aaron_chu@apple.com>
2655
2656         AX: Modern Media Controls Timeline slider should be operable
2657         https://bugs.webkit.org/show_bug.cgi?id=170250
2658
2659         Reviewed by Antoine Quint.
2660
2661         Added a "change" event listener and aria-valuetext to the slider so that when a
2662         VoiceOver user operates the timeline control, VO speaks the updated timestamp
2663
2664         Test: media/modern-media-controls/scrubber/scrubber-has-correct-ax-label.html
2665
2666         * English.lproj/modern-media-controls-localized-strings.js:
2667         * Modules/modern-media-controls/controls/scrubber.js:
2668         (Scrubber.prototype.set inputAccessibleLabel):
2669         (Scrubber.prototype._formatTime):
2670         * Modules/modern-media-controls/controls/slider.js:
2671         (Slider.prototype.handleEvent):
2672         (Slider.prototype._handleInputEvent): Deleted.
2673         * Modules/modern-media-controls/controls/time-control.js:
2674         (TimeControl.prototype.updateScrubberLabel):
2675         * Modules/modern-media-controls/controls/time-label.js:
2676         (TimeLabel.prototype.commitProperty):
2677         (TimeLabel.prototype._formattedTime):
2678         * Modules/modern-media-controls/main.js:
2679         (formatTimeByUnit):
2680         (unitizeTime):
2681
2682 2017-04-20  Andy Estes  <aestes@apple.com>
2683
2684         Fix indentation in AVKitSPI.h
2685         https://bugs.webkit.org/show_bug.cgi?id=171066
2686
2687         Reviewed by Jer Noble.
2688
2689         * platform/spi/cocoa/AVKitSPI.h:
2690
2691 2017-04-20  Jer Noble  <jer.noble@apple.com>
2692
2693         [MediaCapture] gUM() with CoreAudio fails if capturing audio in the UIProcess.
2694         https://bugs.webkit.org/show_bug.cgi?id=171021
2695
2696         Reviewed by Eric Carlson.
2697
2698         Refactor the creation of RealtimeMediaSources to take a persistent device ID rather
2699         than a CaptureDevice directly. This allows WebKit2 to iterate devices in the UIProcess
2700         rather than the WebProcess.
2701
2702         * platform/mediastream/RealtimeMediaSource.h:
2703         * platform/mediastream/mac/AVAudioCaptureSource.mm:
2704         * platform/mediastream/mac/AVVideoCaptureSource.mm:
2705         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2706         (WebCore::CoreAudioCaptureSource::create):
2707         (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource):
2708         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2709         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2710         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
2711         (WebCore::RealtimeMediaSourceCenterMac::bestSourcesForTypeAndConstraints):
2712         * platform/mock/MockRealtimeAudioSource.cpp:
2713         * platform/mock/MockRealtimeVideoSource.cpp:
2714
2715 2017-04-20  Tim Horton  <timothy_horton@apple.com>
2716
2717         Make it possible to request the non-expanded scrollbar width from ScrollbarTheme
2718         https://bugs.webkit.org/show_bug.cgi?id=171047
2719
2720         Reviewed by Sam Weinig.
2721
2722         No new tests, new behavior is not exposed in any way.
2723
2724         * platform/ScrollTypes.h:
2725         * platform/ScrollbarTheme.h:
2726         (WebCore::ScrollbarTheme::scrollbarThickness):
2727         * platform/gtk/ScrollbarThemeGtk.cpp:
2728         (WebCore::ScrollbarThemeGtk::scrollbarThickness):
2729         * platform/gtk/ScrollbarThemeGtk.h:
2730         * platform/ios/ScrollbarThemeIOS.h:
2731         * platform/ios/ScrollbarThemeIOS.mm:
2732         (WebCore::ScrollbarThemeIOS::scrollbarThickness):
2733         * platform/mac/ScrollbarThemeMac.h:
2734         * platform/mac/ScrollbarThemeMac.mm:
2735         (WebCore::ScrollbarThemeMac::scrollbarThickness):
2736         * platform/mock/ScrollbarThemeMock.cpp:
2737         (WebCore::ScrollbarThemeMock::scrollbarThickness):
2738         * platform/mock/ScrollbarThemeMock.h:
2739         * platform/win/ScrollbarThemeWin.cpp:
2740         (WebCore::ScrollbarThemeWin::scrollbarThickness):
2741         * platform/win/ScrollbarThemeWin.h:
2742         * rendering/RenderScrollbarTheme.h:
2743         On Mac, when the scrollbar is hovered, it gets bigger.
2744         Currently, scrollbarThickness always returns the big size.
2745         It should be possible to request the smaller, "regular" scrollbar size as well.
2746
2747 2017-04-20  Jon Lee  <jonlee@apple.com>
2748
2749         Update pip placard to "picture in picture"
2750         https://bugs.webkit.org/show_bug.cgi?id=171036
2751         rdar://problem/30201536
2752
2753         Reviewed by Antoine Quint.
2754
2755         Updated media/modern-media-controls/pip-placard/pip-placard.html
2756
2757         Update the text shown with the picture in picture placard.
2758
2759         * English.lproj/mediaControlsLocalizedStrings.js:
2760         * English.lproj/modern-media-controls-localized-strings.js:
2761         * Modules/mediacontrols/mediaControlsApple.js:
2762         (Controller.prototype.updatePictureInPicturePlaceholder):
2763         * Modules/modern-media-controls/controls/pip-placard.js:
2764         (PiPPlacard):
2765
2766 2017-04-20  Youenn Fablet  <youenn@apple.com>
2767
2768         RTCPeerConnection is stopping its backend twice sometimes
2769         https://bugs.webkit.org/show_bug.cgi?id=171043
2770
2771         Reviewed by Eric Carlson.
2772
2773         Test: webrtc/closing-peerconnection.html
2774
2775         Making sure we stop the backend only once.
2776         Adding an internals API to close the peer connection so as to replicate frame disconnection.
2777
2778         * Modules/mediastream/RTCPeerConnection.cpp:
2779         (WebCore::RTCPeerConnection::doClose):
2780         (WebCore::RTCPeerConnection::doStop):
2781         * Modules/mediastream/RTCPeerConnection.h:
2782         * testing/Internals.cpp:
2783         (WebCore::Internals::stopPeerConnection):
2784         * testing/Internals.h:
2785         * testing/Internals.idl:
2786
2787 2017-04-20  Antti Koivisto  <antti@apple.com>
2788
2789         Increase large animation cutoff
2790         https://bugs.webkit.org/show_bug.cgi?id=171051
2791         <rdar://problem/31731532>
2792
2793         Reviewed by Andreas Kling.
2794
2795         We currently switch to per-frame decoding if the animation is larger than 5MB. This is very
2796         power-inefficient and such animations are now common. The cutoff originates from 2007 (r20069),
2797         it is time update it.
2798
2799         Note that the normal low memory handling will still kill animation frames as needed.
2800
2801         * platform/graphics/BitmapImage.h:
2802
2803             Increase cutoff to 30MB. This is enough (with some room to spare) for animations on current
2804             tumblr.com/search/aww.
2805
2806             Also remove the separate cutoff value for iOS.
2807
2808 2017-04-20  Zan Dobersek  <zdobersek@igalia.com>
2809
2810         Register missing AES_CTR, ECDSA and HKDF algorithms in
2811         GCrypt's CryptoAlgorithmRegistry implementation.
2812
2813         Rubber-stamped by Carlos Alberto Lopez Perez.
2814
2815         * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp:
2816         (WebCore::CryptoAlgorithmRegistry::platformRegisterAlgorithms):
2817
2818 2017-04-20  Joanmarie Diggs  <jdiggs@igalia.com>
2819
2820         [ATK] Implement support for DPub ARIA roles
2821         https://bugs.webkit.org/show_bug.cgi?id=170679
2822
2823         Reviewed by Chris Fleizach.
2824
2825         Create two new WebCore AccessibilityRole values: TextGroup and ApplicationTextGroup.
2826         These roles make it possible for platforms to distinguish groups which are primarily
2827         intended to display textual content from groups which are primarily intended to hold
2828         user-interface objects. Use these roles to fix the ATK mapping of DPub's groups, which
2829         should be exposed as ATK_ROLE_SECTION; not ATK_ROLE_PANEL.
2830
2831         Modify the following WebCore AccessibilityRole mappings:
2832         - doc-abstract changed to ApplicationTextGroupRole because this DPub ARIA role does
2833           not subclass the ARIA landmark role
2834         - doc-biblioentry and doc-endnote changed to ListItemRole, because these DPub ARIA
2835           roles subclass the ARIA listitem role
2836         - doc-notice and doc-tip changed to DocumentNoteRole because these DPub ARIA roles
2837           subclass the ARIA note role
2838         - doc-pagebreak changed to SplitterRole because this DPub ARIA role subclasses the
2839           ARIA separator role
2840
2841         No new tests required: New test cases were added to xml-roles-exposed.html, and
2842         the platform expectations for roles-exposed.html were updated to reflect the
2843         correct mappings.
2844
2845         * accessibility/AccessibilityList.cpp:
2846         (WebCore::AccessibilityList::determineAccessibilityRole):
2847         * accessibility/AccessibilityNodeObject.cpp:
2848         (WebCore::AccessibilityNodeObject::isGroup):
2849         (WebCore::AccessibilityNodeObject::helpText):
2850         * accessibility/AccessibilityObject.cpp:
2851         (WebCore::AccessibilityObject::ariaTreeItemContent):
2852         (WebCore::initializeRoleMap):
2853         (WebCore::AccessibilityObject::computedRoleString):
2854         * accessibility/AccessibilityObject.h:
2855         * accessibility/AccessibilityRenderObject.cpp:
2856         (WebCore::AccessibilityRenderObject::helpText):
2857         (WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant):
2858         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
2859         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2860         (webkitAccessibleGetAttributes):
2861         (atkRole):
2862         (roleIsTextType):
2863         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2864         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
2865         (-[WebAccessibilityObjectWrapper containsUnnaturallySegmentedChildren]):
2866         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2867         (createAccessibilityRoleMap):
2868         (-[WebAccessibilityObjectWrapper subrole]):
2869
2870 2017-04-19  Youenn Fablet  <youenn@apple.com>
2871
2872         [Mac] Allow customizing H264 encoder
2873         https://bugs.webkit.org/show_bug.cgi?id=170829
2874
2875         Reviewed by Alex Christensen.
2876
2877         Using WebKitAdditions CreateCompressionSession if available.
2878
2879         * Configurations/FeatureDefines.xcconfig:
2880         * WebCore.xcodeproj/project.pbxproj:
2881         * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.h: Added.
2882         * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm: Added.
2883         (WebCore::H264VideoToolboxEncoder::CreateCompressionSession):
2884         * platform/mediastream/libwebrtc/VideoToolBoxEncoderFactory.cpp:
2885         (WebCore::VideoToolboxVideoEncoderFactory::CreateSupportedVideoEncoder):
2886
2887 2017-04-19  Eric Carlson  <eric.carlson@apple.com>
2888
2889         Another deadlock in CoreAudioCaptureSource
2890         https://bugs.webkit.org/show_bug.cgi?id=171001
2891
2892         Fix another regression introduced by r215201, plus make changes suggested
2893         in the review of 170771.
2894
2895         Reviewed by Youenn Fablet.
2896
2897         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
2898         (WebCore::CoreAudioCaptureSource::configureSpeakerProc): Assert if the lock is no held.
2899         (WebCore::CoreAudioCaptureSource::provideSpeakerData): Don't reset the buffer.
2900         (WebCore::CoreAudioCaptureSource::processMicrophoneSamples): Take the state lock. Don't
2901         reset the buffer. No more microphone callbacks.
2902         (WebCore::CoreAudioCaptureSource::stopProducingData): Return early if the io unit isn't
2903         running. Drop the lock before calling setMuted to avoid another deadlock.
2904         (WebCore::CoreAudioCaptureSource::addMicrophoneDataConsumer): Deleted.
2905         (WebCore::CoreAudioCaptureSource::removeMicrophoneDataConsumer): Deleted.
2906         * platform/mediastream/mac/CoreAudioCaptureSource.h:
2907
2908 2017-04-19  Anders Carlsson  <andersca@apple.com>
2909
2910         Stop using deprecated APIs, part 3
2911         https://bugs.webkit.org/show_bug.cgi?id=171003
2912         rdar://problem/31589635
2913         rdar://problem/31589635
2914
2915         Reviewed by Tim Horton.
2916
2917         * Modules/applepay/ApplePaySession.cpp:
2918         (WebCore::convertAndValidate):
2919         The status member variable has been removed from ApplePayShippingMethodUpdate.
2920
2921         (WebCore::ApplePaySession::completeShippingMethodSelection):
2922         If status is not STATUS_SUCCESS, cancel the payment session.
2923
2924         (WebCore::ApplePaySession::canSuspendForDocumentSuspension):
2925         (WebCore::ApplePaySession::canBegin):
2926         (WebCore::ApplePaySession::canAbort):
2927         (WebCore::ApplePaySession::canCancel):
2928         (WebCore::ApplePaySession::canCompleteShippingMethodSelection):
2929         (WebCore::ApplePaySession::canCompleteShippingContactSelection):
2930         (WebCore::ApplePaySession::canCompletePaymentMethodSelection):
2931         (WebCore::ApplePaySession::canCompletePayment):
2932         (WebCore::ApplePaySession::isFinalState):
2933         Add State::CancelRequested.
2934
2935         * Modules/applepay/ApplePayShippingMethodUpdate.h:
2936         * Modules/applepay/ApplePayShippingMethodUpdate.idl:
2937         Remove status.
2938
2939         * Modules/applepay/PaymentCoordinator.cpp:
2940         (WebCore::PaymentCoordinator::cancelPaymentSession):
2941         Call through to the client.
2942
2943         * Modules/applepay/PaymentCoordinator.h:
2944         * Modules/applepay/PaymentCoordinatorClient.h:
2945         Add cancelPaymentSession().
2946
2947         * Modules/applepay/PaymentRequest.h:
2948         Remove status.
2949
2950         * loader/EmptyClients.cpp:
2951         Add new client member function.
2952
2953 2017-04-19  Eric Carlson  <eric.carlson@apple.com>
2954
2955         [MediaStream] Limit capture to one tab at a time
2956         https://bugs.webkit.org/show_bug.cgi?id=171009
2957
2958         Reviewed by Jon Lee.
2959
2960         No new tests yet, filed bug 171011.
2961
2962         * Modules/mediastream/MediaStreamTrack.cpp:
2963         (WebCore::MediaStreamTrack::stopTrack): Drive-by fix: renamed from stopProducingData
2964         because stopProducingData is a method in RealtimeMediaSource that does something different.
2965         (WebCore::MediaStreamTrack::stop): Call stopTrack.
2966         (WebCore::MediaStreamTrack::stopProducingData): Deleted.
2967         * Modules/mediastream/MediaStreamTrack.h:
2968         * Modules/mediastream/MediaStreamTrack.idl:
2969
2970         * Modules/mediastream/RTCRtpSender.cpp:
2971         (WebCore::RTCRtpSender::replaceTrack): Update for rename.
2972
2973         * platform/mediastream/MediaStreamPrivate.cpp:
2974         (WebCore::MediaStreamPrivate::muted): Drive-by fix: a track that has ended but 
2975         which is not muted will never produce data.
2976
2977 2017-04-19  Alex Christensen  <achristensen@webkit.org>
2978
2979         Parsing large XML strings fails
2980         https://bugs.webkit.org/show_bug.cgi?id=170999
2981         <rdar://problem/17336267>
2982
2983         Reviewed by Brady Eidson.
2984
2985         Test: fast/dom/xml-large.html
2986
2987         * xml/parser/XMLDocumentParserLibxml2.cpp:
2988         (WebCore::XMLParserContext::createStringParser):
2989         (WebCore::XMLParserContext::createMemoryParser):
2990         Allow huge XML strings. They work fine in Chrome and Firefox.
2991
2992 2017-04-19  Chris Fleizach  <cfleizach@apple.com>
2993
2994         AX: <hr> should use a different role description than interactive separators
2995         https://bugs.webkit.org/show_bug.cgi?id=170317
2996         <rdar://problem/31363024>
2997
2998         Reviewed by Joanmarie Diggs.
2999
3000         Users are confused with WebKit's accessibility description of separators. 
3001         We should call these what they are, horizontal rules.
3002
3003         Updated test: accessibility/mac/hr-element-expected.txt
3004
3005         * English.lproj/Localizable.strings:
3006         * accessibility/AccessibilityRenderObject.cpp:
3007         (WebCore::AccessibilityRenderObject::orientation):
3008         * platform/cocoa/LocalizedStringsCocoa.mm:
3009         (WebCore::AXHorizontalRuleDescriptionText):
3010
3011 2017-04-19  Anders Carlsson  <andersca@apple.com>
3012
3013         Rename cancelPayment to cancelPaymentSession
3014         https://bugs.webkit.org/show_bug.cgi?id=171007
3015
3016         Reviewed by Tim Horton.
3017
3018         * Modules/applepay/ApplePaySession.cpp:
3019         (WebCore::ApplePaySession::didCancelPaymentSession):
3020         (WebCore::ApplePaySession::didCancelPayment): Deleted.
3021         * Modules/applepay/ApplePaySession.h:
3022         * Modules/applepay/PaymentCoordinator.cpp:
3023         (WebCore::PaymentCoordinator::didCancelPaymentSession):
3024         (WebCore::PaymentCoordinator::didCancelPayment): Deleted.
3025         * Modules/applepay/PaymentCoordinator.h:
3026
3027 2017-04-19  Joseph Pecoraro  <pecoraro@apple.com>
3028
3029         ASAN Crash running LayoutTests/inspector/worker tests
3030         https://bugs.webkit.org/show_bug.cgi?id=170967
3031         <rdar://problem/31256437>
3032
3033         Reviewed by Alex Christensen.
3034
3035         * workers/WorkerMessagingProxy.h:
3036         * workers/WorkerMessagingProxy.cpp:
3037         (WebCore::WorkerMessagingProxy::WorkerMessagingProxy):
3038         (WebCore::WorkerMessagingProxy::workerGlobalScopeDestroyedInternal):
3039         Make the MessagingProxy thread safe ref counted. Since it used to
3040         delete itself, turn this into a ref (implicit on construction)
3041         and deref (replacing delete this).
3042
3043         (WebCore::WorkerMessagingProxy::postMessageToPageInspector):
3044         When dispatching have the lambda implicitly ref/deref with the
3045         lambda to keep the proxy alive while a lambda is queued.
3046
3047 2017-04-19  Brent Fulgham  <bfulgham@apple.com>
3048
3049         [iOS, macOS] Guard against passing nullptr to vImagePremultiplyData
3050         https://bugs.webkit.org/show_bug.cgi?id=170912
3051         <rdar://problem/30565800>
3052
3053         Reviewed by Brady Eidson.
3054
3055         * platform/graphics/cg/ImageBufferDataCG.cpp:
3056         (WebCore::affineWarpBufferData): Assert if we passed nullptr buffers.
3057         (WebCore::transferData): Ditto.
3058         (WebCore::ImageBufferData::getData): Check for nullptr data member and avoid passing to vImage routines.
3059         (WebCore::ImageBufferData::putData): Ditto.
3060
3061 2017-04-19  Dave Hyatt  <hyatt@apple.com>
3062
3063         Remove bogus assert for :not.
3064         https://bugs.webkit.org/show_bug.cgi?id=170995
3065         <rdar://problem/29693115>
3066
3067         Reviewed by Zalan Bujtas.
3068
3069         * css/parser/CSSSelectorParser.cpp:
3070
3071 2017-04-19  Antoine Quint  <graouts@apple.com>
3072
3073         [Modern Media Controls] Allow non-PNG resources
3074         https://bugs.webkit.org/show_bug.cgi?id=170992
3075         <rdar://problem/31706590>
3076
3077         Reviewed by Dean Jackson.
3078
3079         Instead of passing in a name and a platform to MediaControlsHost::base64StringForIconAndPlatform(),
3080         we now pass in a name and a type to MediaControlsHost::base64StringForIconNameAndType(). We've removed
3081         the need to provide a platform by copying the resources directly under "Resources/modern-media-controls"
3082         insted of "Resources/modern-media-controls/platform-name-here", and now we provide a type so that it
3083         may be passed down to -[NSBundle pathForResource:ofType:inDirectory:].
3084
3085         * Modules/mediacontrols/MediaControlsHost.cpp:
3086         (WebCore::MediaControlsHost::base64StringForIconNameAndType):
3087         (WebCore::MediaControlsHost::base64StringForIconAndPlatform): Deleted.
3088         * Modules/mediacontrols/MediaControlsHost.h:
3089         * Modules/mediacontrols/MediaControlsHost.idl:
3090         * Modules/modern-media-controls/controls/icon-service.js:
3091         (const.iconService.new.IconService.prototype.imageForIconNameAndLayoutTraits):
3092         * WebCore.xcodeproj/project.pbxproj:
3093         * rendering/RenderTheme.h:
3094         (WebCore::RenderTheme::mediaControlsBase64StringForIconNameAndType):
3095         (WebCore::RenderTheme::mediaControlsBase64StringForIconAndPlatform): Deleted.
3096         * rendering/RenderThemeIOS.h:
3097         * rendering/RenderThemeIOS.mm:
3098         (WebCore::RenderThemeIOS::mediaControlsBase64StringForIconNameAndType):
3099         (WebCore::RenderThemeIOS::mediaControlsBase64StringForIconAndPlatform): Deleted.
3100         * rendering/RenderThemeMac.h:
3101         * rendering/RenderThemeMac.mm:
3102         (WebCore::RenderThemeMac::mediaControlsBase64StringForIconNameAndType):
3103         (WebCore::RenderThemeMac::mediaControlsBase64StringForIconAndPlatform): Deleted.
3104
3105 2017-04-19  Antti Koivisto  <antti@apple.com>
3106
3107         Avoid repaints for invisible animations on tumblr.com/search/aww
3108         https://bugs.webkit.org/show_bug.cgi?id=170986
3109         <rdar://problem/28644580>
3110
3111         Reviewed by Andreas Kling.
3112
3113         Test: fast/repaint/mutate-non-visible.html
3114
3115         * rendering/style/RenderStyle.cpp:
3116         (WebCore::requiresPainting):
3117         (WebCore::RenderStyle::changeRequiresRepaint):
3118
3119             If an element is invisible it does not require repaint even if something else changes.
3120
3121 2017-04-19  Dean Jackson  <dino@apple.com>
3122
3123         Non-muxable GPUs shouldn't allow offline rendering
3124         https://bugs.webkit.org/show_bug.cgi?id=170984
3125         <rdar://problem/31614406>
3126
3127         Reviewed by Myles Maxfield.
3128
3129         Setting the kCGLPFAAllowOfflineRenderers flag doesn't do any
3130         harm on devices that only have one GPU. It's also what we
3131         want on devices that can mux between GPUs. However, we were
3132         also setting it unconditionally on devices with multiple
3133         GPUs that have issues muxing.
3134
3135         * platform/graphics/mac/GraphicsContext3DMac.mm:
3136         (WebCore::setPixelFormat): Add a test for hasMuxableGPU.
3137
3138 2017-04-18  Youenn Fablet  <youenn@apple.com>
3139
3140         RTCOfferOptions iceRestart should be supported
3141         https://bugs.webkit.org/show_bug.cgi?id=170966
3142
3143         Reviewed by Alex Christensen.
3144
3145         No ability to test iceRestart as of now.
3146         Passing iceRestart value to libwebrtc.
3147         Passing also voiceActivityDetection value to libwebrtc.
3148         Updating mock to use the new overloaded CreateOffer method.
3149
3150         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3151         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
3152         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
3153         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3154         (WebCore::LibWebRTCPeerConnectionBackend::doCreateOffer):
3155         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3156         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
3157         * testing/MockLibWebRTCPeerConnection.cpp:
3158         (WebCore::MockLibWebRTCPeerConnection::CreateOffer):
3159         * testing/MockLibWebRTCPeerConnection.h:
3160
3161 2017-04-18  Wenson Hsieh  <wenson_hsieh@apple.com>
3162
3163         [WK2] Support DataTransfer::files() when performing a DHTML data interaction
3164         https://bugs.webkit.org/show_bug.cgi?id=170880
3165         <rdar://problem/31314689>
3166
3167         Reviewed by Tim Horton.
3168
3169         Adds support for fetching files from the DataTransfer when performing a data interaction operation handled by
3170         JavaScript. There are two changes we make here to achieve this:
3171
3172         First, we teach the Pasteboard on iOS to know what file paths hold the item provider contents used in the
3173         current data interaction operation. On iOS, Pasteboard::readFilenames is currently hard-coded to return an empty
3174         vector. To fix this, we add logic to the iOS Pasteboard to remember what the paths of all files that were
3175         successfully loaded from item providers as the data interaction is taking place. This ensures that at the
3176         WebCore layer, the implementation of Pasteboard::readFilenames on Mac and iOS is similar -- they both call out
3177         to the client layer in order to read file paths off of their respective pasteboards. Once in the client layer
3178         (WebKit1 or WebKit2) we then call into PlatformPasteboard::filenamesForDataInteraction, which then calls into
3179         WebItemProviderPasteboard if applicable.
3180
3181         The second tweak is to propagate information about whether the document is preventing default data interaction
3182         behavior to the client layer. This prevents us from having to save pasteboard content when performing data
3183         interaction in cases where file information is not needed (i.e. the default behavior is being performed, and
3184         the target is not a file input). This also avoids compatibility issues with insertion animations when performing
3185         data interaction in editable areas, due to the extra time spent loading item provider data into a temporary
3186         file.
3187
3188         Unit tests in <https://bugs.webkit.org/show_bug.cgi?id=170903>.
3189
3190         * page/DragController.cpp:
3191         (WebCore::DragController::DragController):
3192         (WebCore::DragController::performDragOperation):
3193         (WebCore::DragController::dragEnteredOrUpdated):
3194         (WebCore::DragController::tryDocumentDrag):
3195
3196         Refactor DragController::tryDocumentDrag to return a DragHandlingMethod. This method currently returns either
3197         true or false; this patch changes it to return a DragHandlingMethod, which is either None (the equivalent of
3198         returning false before the patch), Default (indicating that the drop destination is allowing default handling),
3199         or NonDefault, which indicates that the drop destination has explicitly prevented default.
3200
3201         * page/DragController.h:
3202         (WebCore::DragController::documentIsHandlingNonDefaultDrag):
3203
3204         Used by WebPage when sending an IPC response after handling dragentered or dragupdated.
3205
3206         * platform/PasteboardStrategy.h:
3207         * platform/PlatformPasteboard.h:
3208         * platform/ios/AbstractPasteboard.h:
3209         * platform/ios/PasteboardIOS.mm:
3210         (WebCore::Pasteboard::readFilenames):
3211         * platform/ios/PlatformPasteboardIOS.mm:
3212         (WebCore::PlatformPasteboard::filenamesForDataInteraction):
3213         * platform/ios/WebItemProviderPasteboard.h:
3214         * platform/ios/WebItemProviderPasteboard.mm:
3215
3216         WebItemProviderPasteboard now remembers the file URLs of successfully loaded item provider content when a data
3217         interaction is being performed. The new filenamesForDataInteraction property returns the array of data
3218         interaction file URLs which have been propagated to the web process along with sandbox extensions. This state
3219         is cleaned up when list of item providers change (i.e. when the data interaction operation is finished, or if
3220         the web content process crashes, etc.)
3221
3222         (-[WebItemProviderPasteboard init]):
3223         (-[WebItemProviderPasteboard setItemProviders:]):
3224         (-[WebItemProviderPasteboard filenamesForDataInteraction]):
3225         (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:]):
3226
3227 2017-04-18  Dean Jackson  <dino@apple.com>
3228
3229         Cairo build fix.
3230         https://bugs.webkit.org/show_bug.cgi?id=170941
3231
3232         * platform/graphics/cairo/GraphicsContext3DCairo.cpp:
3233         (WebCore::GraphicsContext3D::GraphicsContext3D):
3234
3235 2017-04-18  Ryan Haddad  <ryanhaddad@apple.com>
3236
3237         Rebaseline bindings tests after r215486.
3238
3239         Unreviewed test gardening.
3240
3241         * bindings/scripts/test/JS/JSTestObj.cpp:
3242         (WebCore::jsTestObjOnfooGetter):
3243         (WebCore::jsTestObjOnwebkitfooGetter):
3244
3245 2017-04-18  Dean Jackson  <dino@apple.com>
3246
3247         Attempted build fix. Add/remove some files from ANGLE.
3248
3249         * CMakeLists.txt:
3250
3251 2017-04-18  Dean Jackson  <dino@apple.com>
3252
3253         Update ANGLE
3254         https://bugs.webkit.org/show_bug.cgi?id=170941
3255         <rdar://problem/31633999>
3256
3257         Reviewed by Alex Christensen.
3258
3259         * platform/graphics/ANGLEWebKitBridge.cpp:
3260         (WebCore::getSymbolInfo):
3261         (WebCore::ANGLEWebKitBridge::ANGLEWebKitBridge):
3262         (WebCore::ANGLEWebKitBridge::cleanupCompilers):
3263         (WebCore::ANGLEWebKitBridge::compileShaderSource):
3264         * platform/graphics/mac/GraphicsContext3DMac.mm:
3265         (WebCore::GraphicsContext3D::GraphicsContext3D):
3266         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
3267         (WebCore::GraphicsContext3D::checkVaryingsPacking):
3268
3269 2017-04-18  John Wilander  <wilander@apple.com>
3270
3271         Make WebCore::topPrivatelyControlledDomain() return "localhost" for localhost
3272         https://bugs.webkit.org/show_bug.cgi?id=170798
3273         <rdar://problem/31595108>
3274
3275         Reviewed by Alex Christensen.
3276
3277         API test augmented.
3278
3279         * platform/mac/PublicSuffixMac.mm:
3280         (WebCore::topPrivatelyControlledDomain):
3281             Now returns the lowercase top privately controlled
3282             domain including "localhost" for the host localhost.
3283
3284 2017-04-18  Brent Fulgham  <bfulgham@apple.com>
3285
3286         JSEventListener::m_isolatedWorld should be a Ref
3287         https://bugs.webkit.org/show_bug.cgi?id=170910
3288         <rdar://problem/30470332>
3289
3290         Reviewed by Alex Christensen.
3291
3292         Since m_isolatedWorld should never be nullptr, change the implementation of m_isolatedWorld
3293         from a RefPtr to a Ref, and adjust the various call sites to support this change.
3294
3295         This should help us catch any changes that permit the isolatedWorld to be set to nullptr.
3296
3297         No new tests since there should be no change in behavior.
3298
3299         * bindings/js/JSEventListener.cpp:
3300         (WebCore::JSEventListener::JSEventListener):
3301         (WebCore::JSEventListener::initializeJSFunction):
3302         (WebCore::JSEventListener::handleEvent):
3303         * bindings/js/JSEventListener.h:
3304         (WebCore::JSEventListener::cast):
3305         (WebCore::JSEventListener::isolatedWorld):
3306         (WebCore::JSEventListener::jsFunction):
3307
3308 2017-04-18  Brent Fulgham  <bfulgham@apple.com>
3309
3310         Correct handling of isolatedWorld in event handling
3311         https://bugs.webkit.org/show_bug.cgi?id=65589
3312         <rdar://problem/24097804>
3313
3314         Reviewed by Geoffrey Garen.
3315
3316         This patch was inspired by Adam's original patch as well as the
3317         following Blink change:
3318         https://src.chromium.org/viewvc/blink?revision=152377&view=revision
3319
3320         Thread isolatedWorld state through event handling logic.
3321
3322         Tests: fast/dom/event-attrs-isolated-world.html
3323                http/tests/security/isolatedWorld/onclick-attribute.html
3324
3325         * bindings/js/JSEventListener.cpp:
3326         (WebCore::JSEventListener::initializeJSFunction):
3327         (WebCore::JSEventListener::world):
3328         (WebCore::eventHandlerAttribute):
3329         (WebCore::setEventHandlerAttribute):
3330         (WebCore::windowEventHandlerAttribute):
3331         (WebCore::setWindowEventHandlerAttribute):
3332         (WebCore::documentEventHandlerAttribute):
3333         (WebCore::setDocumentEventHandlerAttribute):
3334         * bindings/js/JSEventListener.h:
3335         * bindings/scripts/CodeGeneratorJS.pm:
3336         (GenerateImplementation):
3337         * dom/Document.cpp:
3338         (WebCore::Document::setWindowAttributeEventListener):
3339         (WebCore::Document::getWindowAttributeEventListener):
3340         * dom/Document.h:
3341         * dom/Element.cpp:
3342         (WebCore::Element::setAttributeEventListener):
3343         * dom/EventTarget.cpp:
3344         (WebCore::EventTarget::setAttributeEventListener):
3345         (WebCore::EventTarget::attributeEventListener):
3346         * dom/EventTarget.h:
3347         * editing/ReplaceSelectionCommand.cpp:
3348         (WebCore::ReplacementFragment::ReplacementFragment):
3349         * html/HTMLBodyElement.cpp:
3350         (WebCore::HTMLBodyElement::parseAttribute):
3351         * html/HTMLFrameSetElement.cpp:
3352         (WebCore::HTMLFrameSetElement::parseAttribute):
3353         * svg/SVGSVGElement.cpp:
3354         (WebCore::SVGSVGElement::parseAttribute):
3355
3356 2017-04-18  Jeremy Jones  <jeremyj@apple.com>
3357
3358         Deadlock in CoreAudioCaptureSource
3359         https://bugs.webkit.org/show_bug.cgi?id=170771
3360         rdar://problem/31578919
3361
3362         Reviewed by Eric Carlson.
3363
3364         Fixes a regression introduced by r215201.
3365
3366         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
3367         (WebCore::CoreAudioCaptureSource::startProducingData):
3368         (WebCore::CoreAudioCaptureSource::stopProducingData):
3369
3370 2017-04-18  Anders Carlsson  <andersca@apple.com>
3371
3372         Stop using deprecated APIs, part 2
3373         https://bugs.webkit.org/show_bug.cgi?id=170965
3374         rdar://problem/31589635
3375
3376         Reviewed by Tim Horton.
3377
3378         * Modules/applepay/ApplePaySession.cpp:
3379         (WebCore::convertAndValidate):
3380         No need to convert the status anymore.
3381
3382         (WebCore::ApplePaySession::completeShippingContactSelection):
3383         Create an ApplePayError given the status.
3384
3385         * Modules/applepay/ApplePayShippingContactUpdate.h:
3386         Remove the status member variable.
3387
3388         * Modules/applepay/PaymentRequest.h:
3389         Remove the status member variable.
3390
3391 2017-04-18  Tim Horton  <timothy_horton@apple.com>
3392
3393         Safari crash when clicking phone number data detector popover button
3394         https://bugs.webkit.org/show_bug.cgi?id=170936
3395         <rdar://problem/31416570>
3396
3397         Reviewed by Wenson Hsieh.
3398
3399         * platform/spi/mac/DataDetectorsSPI.h:
3400         Soft-link the phone number key from the correct framework.
3401
3402 2017-04-17  Sam Weinig  <sam@webkit.org>
3403
3404         [WebIDL] Make annotated types first class allowing them to be used in sequences and unions
3405         https://bugs.webkit.org/show_bug.cgi?id=170926
3406
3407         Reviewed by Chris Dumez.
3408
3409         - Adds IDL types for WebIDL annotated types:
3410             [Clamp] T -> IDLClampAdaptor<T>
3411             [EnforceRange] T -> IDLEnforceRangeAdaptor<T>
3412             [TreatNullAs=EmptyString] T -> IDLTreatNullAsEmptyAdaptor<T>
3413         - Adds additional adaptors for existing specializations
3414             [AtomicString] T -> IDLAtomicStringAdaptor<T>
3415             [RequiresExistingAtomicString] T -> IDLRequiresExistingAtomicStringAdaptor<T>
3416         - Removes the need for IntegerConversionConfiguration and StringConversionConfiguration
3417           overloads of convert().
3418         - Allows the use of annotated types as subtypes, such as in sequences and unions.
3419
3420         * bindings/IDLTypes.h:
3421         Add new types:
3422             - IDLClampAdaptor
3423             - IDLEnforceRangeAdaptor
3424             - IDLTreatNullAsEmptyAdaptor
3425             - IDLAtomicStringAdaptor
3426             - IDLRequiresExistingAtomicStringAdaptor