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