392613e6cc080f805939231460868d6eb6132a35
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-10-07  Youenn Fablet  <youenn@apple.com>
2
3         Refactor CachedResourceClient::notifyFinished
4         https://bugs.webkit.org/show_bug.cgi?id=162060
5
6         Reviewed by Darin Adler.
7
8         No change of behavior.
9
10         Making CachedResourceClient and CachedRawResourceClient callbacks take CachedResource references and not pointers.
11         In most cases, the CachedResource parameter is only used for assertions.
12         Removing that parameter might be contemplated in the future.
13         The only real case is in RenderImage.
14
15         Removed the CachedResource parameter from ContentFilter methods as code was calling these methods with null values.
16
17         * dom/LoadableClassicScript.cpp:
18         (WebCore::LoadableClassicScript::notifyFinished):
19         * dom/LoadableClassicScript.h:
20         * html/HTMLImageLoader.cpp:
21         (WebCore::HTMLImageLoader::notifyFinished):
22         * html/HTMLImageLoader.h:
23         * loader/ContentFilter.cpp:
24         (WebCore::ContentFilter::continueAfterResponseReceived):
25         (WebCore::ContentFilter::continueAfterDataReceived):
26         (WebCore::ContentFilter::continueAfterNotifyFinished):
27         (WebCore::ContentFilter::deliverResourceData):
28         * loader/ContentFilter.h:
29         * loader/CrossOriginPreflightChecker.cpp:
30         (WebCore::CrossOriginPreflightChecker::notifyFinished):
31         * loader/CrossOriginPreflightChecker.h:
32         * loader/DocumentLoader.cpp:
33         (WebCore::DocumentLoader::notifyFinished):
34         (WebCore::DocumentLoader::handleSubstituteDataLoadNow):
35         (WebCore::DocumentLoader::redirectReceived):
36         (WebCore::DocumentLoader::responseReceived):
37         (WebCore::DocumentLoader::continueAfterContentPolicy):
38         (WebCore::DocumentLoader::dataReceived):
39         * loader/DocumentLoader.h:
40         * loader/DocumentThreadableLoader.cpp:
41         (WebCore::DocumentThreadableLoader::redirectReceived):
42         (WebCore::DocumentThreadableLoader::dataSent):
43         (WebCore::DocumentThreadableLoader::responseReceived):
44         (WebCore::DocumentThreadableLoader::dataReceived):
45         (WebCore::DocumentThreadableLoader::notifyFinished):
46         * loader/DocumentThreadableLoader.h:
47         * loader/ImageLoader.cpp:
48         (WebCore::ImageLoader::notifyFinished):
49         * loader/ImageLoader.h:
50         * loader/LinkLoader.cpp:
51         (WebCore::LinkLoader::triggerEvents):
52         (WebCore::LinkLoader::notifyFinished):
53         * loader/LinkLoader.h:
54         * loader/LinkPreloadResourceClients.cpp:
55         (WebCore::LinkPreloadResourceClient::triggerEvents):
56         * loader/LinkPreloadResourceClients.h:
57         * loader/MediaResourceLoader.cpp:
58         (WebCore::MediaResource::responseReceived):
59         (WebCore::MediaResource::shouldCacheResponse):
60         (WebCore::MediaResource::redirectReceived):
61         (WebCore::MediaResource::dataSent):
62         (WebCore::MediaResource::dataReceived):
63         (WebCore::MediaResource::notifyFinished):
64         (WebCore::MediaResource::getOrCreateReadBuffer):
65         * loader/MediaResourceLoader.h:
66         * loader/TextTrackLoader.cpp:
67         (WebCore::TextTrackLoader::processNewCueData):
68         (WebCore::TextTrackLoader::deprecatedDidReceiveCachedResource):
69         (WebCore::TextTrackLoader::notifyFinished):
70         * loader/TextTrackLoader.h:
71         * loader/cache/CachedRawResource.cpp:
72         (WebCore::CachedRawResource::notifyClientsDataWasReceived):
73         (WebCore::CachedRawResource::didAddClient):
74         (WebCore::CachedRawResource::redirectReceived):
75         (WebCore::CachedRawResource::responseReceived):
76         (WebCore::CachedRawResource::shouldCacheResponse):
77         (WebCore::CachedRawResource::didSendData):
78         * loader/cache/CachedRawResourceClient.h:
79         (WebCore::CachedRawResourceClient::dataSent):
80         (WebCore::CachedRawResourceClient::responseReceived):
81         (WebCore::CachedRawResourceClient::shouldCacheResponse):
82         (WebCore::CachedRawResourceClient::dataReceived):
83         (WebCore::CachedRawResourceClient::redirectReceived):
84         (WebCore::CachedRawResourceClient::getOrCreateReadBuffer):
85         * loader/cache/CachedResource.cpp:
86         (WebCore::CachedResource::checkNotify):
87         (WebCore::CachedResource::didAddClient):
88         * loader/cache/CachedResourceClient.h:
89         (WebCore::CachedResourceClient::notifyFinished):
90         (WebCore::CachedResourceClient::deprecatedDidReceiveCachedResource):
91         * loader/cache/CachedTextTrack.cpp:
92         (WebCore::CachedTextTrack::updateData):
93         * loader/icon/IconLoader.cpp:
94         (WebCore::IconLoader::notifyFinished):
95         * loader/icon/IconLoader.h:
96         * loader/soup/CachedRawResourceSoup.cpp:
97         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
98         (WebCore::WebCoreAVCFResourceLoader::responseReceived):
99         (WebCore::WebCoreAVCFResourceLoader::dataReceived):
100         (WebCore::WebCoreAVCFResourceLoader::notifyFinished):
101         (WebCore::WebCoreAVCFResourceLoader::fulfillRequestWithResource):
102         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.h:
103         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
104         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
105         (WebCore::WebCoreAVFResourceLoader::responseReceived):
106         (WebCore::WebCoreAVFResourceLoader::dataReceived):
107         (WebCore::WebCoreAVFResourceLoader::notifyFinished):
108         (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource):
109         * rendering/RenderImage.cpp:
110         (WebCore::RenderImage::notifyFinished):
111         * rendering/RenderImage.h:
112         * rendering/RenderLayerFilterInfo.cpp:
113         (WebCore::RenderLayer::FilterInfo::setRenderer):
114         (WebCore::RenderLayer::FilterInfo::notifyFinished):
115         * rendering/RenderLayerFilterInfo.h:
116         * svg/SVGFEImageElement.cpp:
117         (WebCore::SVGFEImageElement::notifyFinished):
118         * svg/SVGFEImageElement.h:
119         * svg/SVGUseElement.cpp:
120         (WebCore::SVGUseElement::notifyFinished):
121         * svg/SVGUseElement.h:
122         * xml/parser/XMLDocumentParser.cpp:
123         (WebCore::XMLDocumentParser::notifyFinished):
124         * xml/parser/XMLDocumentParser.h:
125
126 2016-10-06  Youenn Fablet  <youenn@apple.com>
127
128         CachedXSLStylesheet does not need to be updated according Origin/Fetch mode
129         https://bugs.webkit.org/show_bug.cgi?id=162389
130
131         Reviewed by Darin Adler.
132
133         No change of behavior.
134
135         Making clear that there is no reason to update cached XSLT resources according the origin, given that CORS is never checked and loading is always same-origin.
136
137         Renaming CachedResource::isClean to CachedResource::isCORSSameOrigin to better match spec terminology.
138         Updating HTMLLinkElement accordingly.
139
140         * html/HTMLLinkElement.cpp:
141         (WebCore::HTMLLinkElement::initializeStyleSheet):
142         * loader/cache/CachedResource.cpp:
143         (WebCore::CachedResource::isCORSSameOrigin): Ensuring that this method is not called for resource types for which CORS is not to be used.
144         (WebCore::CachedResource::isClean): Deleted.
145         * loader/cache/CachedResource.h:
146         * loader/cache/CachedResourceLoader.cpp:
147         (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
148
149 2016-10-06  Youenn Fablet  <youenn@apple.com>
150
151         Add a place for common HTTP Header values
152         https://bugs.webkit.org/show_bug.cgi?id=163002
153
154         Reviewed by Alex Christensen.
155
156         No change of behavior.
157
158         Introducing HTTPHeaderValues with two Content-Type values.
159
160         * CMakeLists.txt:
161         * Modules/fetch/FetchBody.cpp:
162         (WebCore::FetchBody::extract):
163         * WebCore.xcodeproj/project.pbxproj:
164         * platform/network/HTTPHeaderValues.cpp: Added.
165         (WebCore::HTTPHeaderValues::TextPlainContentType):
166         (WebCore::HTTPHeaderValues::FormURLEncodedContentType):
167         * platform/network/HTTPHeaderValues.h: Added.
168         * xml/XMLHttpRequest.cpp:
169         (WebCore::XMLHttpRequest::send):
170
171 2016-10-06  Youenn Fablet  <youenn@apple.com>
172
173         CachedResourceRequest should not need to store defer and preload options
174         https://bugs.webkit.org/show_bug.cgi?id=163004
175
176         Reviewed by Alex Christensen.
177
178         No change of behavior.
179
180         Removing CachedResourceRequest defer and preload fields.
181         These fields are computed inside CachedResourceLoader instead.
182
183         Updated setting of priority from CachedResourceRequest to CachedResource.
184         Priority is set for any new resource (this covers all cases where no cached resource can be reused from the memory cache).
185         Priority is set for a cached resource if the request is not a preload request.
186
187         * loader/LinkLoader.cpp:
188         (WebCore::LinkLoader::preloadIfNeeded):
189         * loader/cache/CachedResource.cpp:
190         (WebCore::CachedResource::CachedResource):
191         * loader/cache/CachedResourceLoader.cpp:
192         (WebCore::CachedResourceLoader::requestImage):
193         (WebCore::CachedResourceLoader::canRequest):
194         (WebCore::CachedResourceLoader::requestResource):
195         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
196         (WebCore::CachedResourceLoader::requestPreload):
197         * loader/cache/CachedResourceLoader.h:
198         * loader/cache/CachedResourceRequest.cpp:
199         (WebCore::CachedResourceRequest::CachedResourceRequest):
200         * loader/cache/CachedResourceRequest.h:
201         (WebCore::CachedResourceRequest::priority):
202         (WebCore::CachedResourceRequest::forPreload): Deleted.
203         (WebCore::CachedResourceRequest::setForPreload): Deleted.
204         (WebCore::CachedResourceRequest::defer): Deleted.
205         (WebCore::CachedResourceRequest::setDefer): Deleted.
206
207 2016-10-06  Myles C. Maxfield  <mmaxfield@apple.com>
208
209         Variation fonts don't affect glyph advances
210         https://bugs.webkit.org/show_bug.cgi?id=163093
211
212         Reviewed by Darin Adler.
213
214         Work around known bug <rdar://problem/28662086>. For variation fonts,
215         CTFontGetAdvancesForGlyphs() gives correct answers but
216         CTFontGetUnsummedAdvancesForGlyphsAndStyle() doesn't.
217
218         Test: fast/text/variations/advances.html
219
220         * platform/graphics/FontPlatformData.h:
221         (WebCore::FontPlatformData::hasVariations):
222         * platform/graphics/cocoa/FontCocoa.mm:
223         (WebCore::Font::platformWidthForGlyph):
224         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
225         (WebCore::FontPlatformData::FontPlatformData):
226
227 2016-10-06  Commit Queue  <commit-queue@webkit.org>
228
229         Unreviewed, rolling out r206713.
230         https://bugs.webkit.org/show_bug.cgi?id=163097
231
232         triggers apparent codegen bug on ARM 32-bit (Requested by smfr
233         on #webkit).
234
235         Reverted changeset:
236
237         "Support transitions/animations of background-position with
238         right/bottom-relative values"
239         https://bugs.webkit.org/show_bug.cgi?id=162048
240         http://trac.webkit.org/changeset/206713
241
242 2016-10-06  Daniel Bates  <dabates@apple.com>
243
244         Remove unused WebCore::contentDispositionType()
245         https://bugs.webkit.org/show_bug.cgi?id=163095
246
247         Reviewed by Alex Christensen.
248
249         The function WebCore::contentDispositionType() was only used by the Chromium and Qt ports
250         to parse the Content-Disposition HTTP header. Both of these ports have long since been
251         removed from the repository. We should remove WebCore::contentDispositionType().
252
253         * platform/network/HTTPParsers.cpp:
254         (WebCore::contentDispositionType): Deleted.
255         * platform/network/HTTPParsers.h:
256
257 2016-10-06  Ryosuke Niwa  <rniwa@webkit.org>
258
259         Upgrading and constructing element should always report exception instead of rethrowing
260         https://bugs.webkit.org/show_bug.cgi?id=162996
261
262         Reviewed by Darin Adler.
263
264         The latest HTML specification specifies that we must report exceptions thrown during element upgrades:
265         https://html.spec.whatwg.org/#upgrades
266
267         In addition, F2F during 2016 TPAC had a consensus that we should do the same for document.createElement:
268         https://github.com/w3c/webcomponents/issues/569
269
270         Since the HTML parser already reports the exception thrown during custom element construction as it does
271         not have any JS stack, these changes make exceptions thrown during upgrades and constructions.
272
273         In our implementation, this only reduces the code complexity as now we can push the logic to fallback
274         to HTMLUnknownElement into JSCustomElementInterface's constructElement, which has been renamed
275         to constructElementWithFallback, and eliminate ShouldClearException enum class entirely. Moreover,
276         constructElementWithFallback can now return Ref instead of RefPtr.
277
278         No new tests. Existing tests have been updated.
279
280         * bindings/js/JSCustomElementInterface.cpp:
281         (WebCore::JSCustomElementInterface::constructElementWithFallback): Create a HTMLUnknownElement if
282         an attempt to construct a custom element had failed in lieu of returning nullptr.
283         (WebCore::JSCustomElementInterface::tryToConstructCustomElement): Renamed from constructElement.
284         Always report exceptions (the same behavior as ShouldClearException::Clear).
285         (WebCore::JSCustomElementInterface::upgradeElement): Report exceptions instead of rethrowing.
286         * bindings/js/JSCustomElementInterface.h:
287         * dom/Document.cpp:
288         (WebCore::createHTMLElementWithNameValidation):
289         * html/parser/HTMLDocumentParser.cpp:
290         (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
291
292 2016-10-06  Chris Dumez  <cdumez@apple.com>
293
294         Overwriting an attribute event listener can lead to wrong event listener firing order
295         https://bugs.webkit.org/show_bug.cgi?id=163083
296
297         Reviewed by Darin Adler.
298
299         Overwriting an attribute event listener could lead to wrong event listener
300         firing order in WebKit. This is because we were removing the old event
301         listener and then appending the new one instead of actually *replacing*
302         the old one.
303
304         No new tests, rebaselined existing tests.
305
306         * dom/EventListenerMap.cpp:
307         (WebCore::EventListenerMap::replace):
308         * dom/EventListenerMap.h:
309         * dom/EventTarget.cpp:
310         (WebCore::EventTarget::setAttributeEventListener):
311         (WebCore::EventTarget::hasActiveEventListeners): Deleted.
312         (WebCore::EventTarget::dispatchEventForBindings): Deleted.
313         * dom/EventTarget.h:
314
315 2016-10-06  Alex Christensen  <achristensen@webkit.org>
316
317         URLParser: Non-ASCII characters in Non-UTF-8 encoded queries of relative URLs with ws, wss, or nonspecial schemes should be UTF-8 encoded
318         https://bugs.webkit.org/show_bug.cgi?id=163089
319
320         Reviewed by Tim Horton.
321
322         This is a change similar to r206818 but with relative URLs.
323         This matches the spec, URL::parse, and other browsers' behavior.
324         Covered by new API tests for URLParser.
325         This also fixes tests like http/tests/misc/url-in-utf32le.html when URLParser is enabled.
326
327         * platform/URL.cpp:
328         (WebCore::URL::URL):
329         Use the same encoding for the URL constructor whether or not the URLParser is enabled.
330         * platform/URLParser.cpp:
331         (WebCore::URLParser::copyURLPartsUntil):
332         (WebCore::URLParser::parse):
333         (WebCore::isSpecial): Deleted.
334         * platform/URLParser.h:
335         Use UTF-8 for non-special, ws, or wss schemes.
336
337 2016-10-06  Zalan Bujtas  <zalan@apple.com>
338
339         Add back ASSERT(!needsLayout) to RenderTableSection which is now valid
340         https://bugs.webkit.org/show_bug.cgi?id=92954
341         <rdar://problem/12147973>
342
343         Reviewed by Dan Bernstein.
344
345         LayoutTests pass fine now with this assert on.
346
347         Covered by existing tests.
348
349         * rendering/RenderTableSection.cpp:
350         (WebCore::RenderTableSection::paint):
351
352 2016-10-06  Jiewen Tan  <jiewen_tan@apple.com>
353
354         Add a dummy SubtleCrypto interface
355         https://bugs.webkit.org/show_bug.cgi?id=162992
356         <rdar://problem/28643573>
357
358         Reviewed by Brent Fulgham.
359
360         Add a dummy SubtleCrypto interface and rename KeyPair to CryptoKeyPair.
361
362         Tests: crypto/subtle/gc-2.html
363                crypto/subtle/gc-3.html
364                crypto/subtle/gc.html
365                crypto/webkitSubtle/aes-cbc-192-encrypt-decrypt.html
366                crypto/webkitSubtle/aes-cbc-256-encrypt-decrypt.html
367                crypto/webkitSubtle/aes-cbc-encrypt-decrypt-with-padding.html
368                crypto/webkitSubtle/aes-cbc-encrypt-decrypt.html
369                crypto/webkitSubtle/aes-cbc-generate-key.html
370                crypto/webkitSubtle/aes-cbc-import-jwk.html
371                crypto/webkitSubtle/aes-cbc-invalid-length.html
372                crypto/webkitSubtle/aes-cbc-unwrap-failure.html
373                crypto/webkitSubtle/aes-cbc-unwrap-rsa.html
374                crypto/webkitSubtle/aes-cbc-wrap-rsa-non-extractable.html
375                crypto/webkitSubtle/aes-cbc-wrap-rsa.html
376                crypto/webkitSubtle/aes-cbc-wrong-key-class.html
377                crypto/webkitSubtle/aes-export-key.html
378                crypto/webkitSubtle/aes-kw-key-manipulation.html
379                crypto/webkitSubtle/aes-kw-wrap-unwrap-aes.html
380                crypto/webkitSubtle/aes-postMessage.html
381                crypto/webkitSubtle/argument-conversion.html
382                crypto/webkitSubtle/array-buffer-view-offset.html
383                crypto/webkitSubtle/crypto-key-algorithm-gc.html
384                crypto/webkitSubtle/crypto-key-usages-gc.html
385                crypto/webkitSubtle/hmac-check-algorithm.html
386                crypto/webkitSubtle/hmac-export-key.html
387                crypto/webkitSubtle/hmac-generate-key.html
388                crypto/webkitSubtle/hmac-import-jwk.html
389                crypto/webkitSubtle/hmac-postMessage.html
390                crypto/webkitSubtle/hmac-sign-verify-empty-key.html
391                crypto/webkitSubtle/hmac-sign-verify.html
392                crypto/webkitSubtle/import-jwk.html
393                crypto/webkitSubtle/jwk-export-use-values.html
394                crypto/webkitSubtle/jwk-import-use-values.html
395                crypto/webkitSubtle/rsa-export-generated-keys.html
396                crypto/webkitSubtle/rsa-export-key.html
397                crypto/webkitSubtle/rsa-export-private-key.html
398                crypto/webkitSubtle/rsa-indexeddb-non-exportable-private.html
399                crypto/webkitSubtle/rsa-indexeddb-non-exportable.html
400                crypto/webkitSubtle/rsa-indexeddb-private.html
401                crypto/webkitSubtle/rsa-indexeddb.html
402                crypto/webkitSubtle/rsa-oaep-generate-non-extractable-key.html
403                crypto/webkitSubtle/rsa-oaep-key-manipulation.html
404                crypto/webkitSubtle/rsa-oaep-plaintext-length.html
405                crypto/webkitSubtle/rsa-oaep-wrap-unwrap-aes.html
406                crypto/webkitSubtle/rsa-postMessage.html
407                crypto/webkitSubtle/rsaes-pkcs1-v1_5-decrypt.html
408                crypto/webkitSubtle/rsaes-pkcs1-v1_5-wrap-unwrap-aes.html
409                crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key-with-leading-zeroes-in-exponent.html
410                crypto/webkitSubtle/rsassa-pkcs1-v1_5-generate-key.html
411                crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk-small-key.html
412                crypto/webkitSubtle/rsassa-pkcs1-v1_5-import-jwk.html
413                crypto/webkitSubtle/rsassa-pkcs1-v1_5-sign-verify.html
414                crypto/webkitSubtle/sha-1.html
415                crypto/webkitSubtle/sha-224.html
416                crypto/webkitSubtle/sha-256.html
417                crypto/webkitSubtle/sha-384.html
418                crypto/webkitSubtle/sha-512.html
419                crypto/webkitSubtle/unimplemented-unwrap-crash.html
420                crypto/webkitSubtle/unwrapKey-check-usage.html
421                crypto/webkitSubtle/wrapKey-check-usage.html
422                crypto/workers/subtle/aes-postMessage-worker.html
423                crypto/workers/subtle/gc-worker.html
424                crypto/workers/subtle/hmac-postMessage-worker.html
425                crypto/workers/subtle/hrsa-postMessage-worker.html
426                crypto/workers/subtle/multiple-postMessage-worker.html
427                crypto/workers/subtle/rsa-postMessage-worker.html
428
429         * CMakeLists.txt:
430         * DerivedSources.cpp:
431         * DerivedSources.make:
432         * PlatformEfl.cmake:
433         * PlatformGTK.cmake:
434         * PlatformMac.cmake:
435         * WebCore.xcodeproj/project.pbxproj:
436         * crypto/CryptoKeyPair.idl:
437         * crypto/SubtleCrypto.cpp:
438         (WebCore::SubtleCrypto::SubtleCrypto):
439         * crypto/SubtleCrypto.h:
440         (WebCore::SubtleCrypto::create):
441         * crypto/SubtleCrypto.idl: Added.
442         * page/Crypto.cpp:
443         (WebCore::Crypto::Crypto):
444         (WebCore::Crypto::subtle):
445         * page/Crypto.h:
446         * page/Crypto.idl:
447
448 2016-10-06  Anders Carlsson  <andersca@apple.com>
449
450         Crash when ApplePaySession.completeMerchantValidation is not passed a dictionary
451         https://bugs.webkit.org/show_bug.cgi?id=163074
452         rdar://problem/27824842
453
454         Reviewed by Tim Horton.
455
456         Raise a type error on a null initializer object.
457
458         * Modules/applepay/ApplePaySession.cpp:
459         (WebCore::ApplePaySession::completeMerchantValidation):
460
461 2016-10-06  Antti Koivisto  <antti@apple.com>
462
463         Mutating styleSheet in shadow tree doesn't update the style
464         https://bugs.webkit.org/show_bug.cgi?id=162744
465         <rdar://problem/28550588>
466
467         Reviewed by Ryosuke Niwa.
468
469         We weren't always invalidating the right AuthorStyleSheets (to be renamed) instance
470         for the scope after mutations.
471
472         Test: fast/shadow-dom/mutating-stylesheet-in-shadow-tree.html
473
474         * css/CSSStyleSheet.cpp:
475         (WebCore::CSSStyleSheet::didMutateRules):
476         (WebCore::CSSStyleSheet::didMutate):
477         (WebCore::CSSStyleSheet::clearOwnerNode):
478         (WebCore::CSSStyleSheet::rootStyleSheet):
479         (WebCore::CSSStyleSheet::ownerDocument):
480         (WebCore::CSSStyleSheet::styleSheetScope):
481
482             Invalidate the right scope after stylesheet mutations.
483
484         * css/CSSStyleSheet.h:
485         * dom/AuthorStyleSheets.cpp:
486         (WebCore::AuthorStyleSheets::styleResolver):
487         (WebCore::AuthorStyleSheets::styleResolverIfExists):
488
489             Take care to update the right style resolver.
490
491         (WebCore::AuthorStyleSheets::forNode):
492         (WebCore::AuthorStyleSheets::removeStyleSheetCandidateNode):
493
494             Start the update timer so clients don't need to request update separately.
495
496         (WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
497         (WebCore::AuthorStyleSheets::updateActiveStyleSheets):
498         (WebCore::AuthorStyleSheets::updateStyleResolver):
499         * dom/AuthorStyleSheets.h:
500         * dom/InlineStyleSheetOwner.cpp:
501         (WebCore::InlineStyleSheetOwner::insertedIntoDocument):
502
503             Save the scope we were inserted into so removals can be done reliably.
504
505         (WebCore::InlineStyleSheetOwner::removedFromDocument):
506
507             Use and clear the saved scope.
508             Remove didChangeCandidatesForActiveSet() as it is now done by removeStyleSheetCandidateNode() call.
509
510         (WebCore::InlineStyleSheetOwner::clearDocumentData):
511         (WebCore::InlineStyleSheetOwner::createSheet):
512         (WebCore::InlineStyleSheetOwner::sheetLoaded):
513         (WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
514         (WebCore::authorStyleSheetsForElement): Deleted.
515         * dom/InlineStyleSheetOwner.h:
516         (WebCore::InlineStyleSheetOwner::styleSheetScope):
517         * dom/ShadowRoot.cpp:
518         (WebCore::ShadowRoot::styleResolverIfExists):
519         * dom/ShadowRoot.h:
520         * html/HTMLLinkElement.cpp:
521         (WebCore::HTMLLinkElement::removedFrom):
522
523             Remove didChangeCandidatesForActiveSet() as it is now done by removeStyleSheetCandidateNode() call.
524
525         * html/HTMLStyleElement.cpp:
526         (WebCore::HTMLStyleElement::~HTMLStyleElement):
527         (WebCore::HTMLStyleElement::parseAttribute):
528
529             Fix a bug where we wouldn't create stylesheet if a style element was activated by removing a media attribute.
530
531         (WebCore::HTMLStyleElement::insertedInto):
532         (WebCore::HTMLStyleElement::removedFrom):
533         * page/DOMWindow.cpp:
534         (WebCore::DOMWindow::getMatchedCSSRules):
535         * svg/SVGStyleElement.cpp:
536         (WebCore::SVGStyleElement::~SVGStyleElement):
537         (WebCore::SVGStyleElement::insertedInto):
538         (WebCore::SVGStyleElement::removedFrom):
539
540 2016-10-06  Alex Christensen  <achristensen@webkit.org>
541
542         Skip tabs and newlines between end of query and beginning of fragment in non-UTF-8-encoded URLs
543         https://bugs.webkit.org/show_bug.cgi?id=163071
544
545         Reviewed by Tim Horton.
546
547         Covered by a new API test that would have asserted before this change.
548
549         * platform/URLParser.cpp:
550         (WebCore::URLParser::encodeQuery):
551         Skip tabs and newlines before asserting that we are at the end.
552
553 2016-10-06  Alex Christensen  <achristensen@webkit.org>
554
555         URLParser should parse file URLs with ports consistently
556         https://bugs.webkit.org/show_bug.cgi?id=163075
557
558         Reviewed by Brady Eidson.
559
560         Covered by API tests.  We used to assert when parsing the newly tested URLs.
561
562         * platform/URLParser.cpp:
563         (WebCore::URLParser::parse):
564
565 2016-10-06  Chris Dumez  <cdumez@apple.com>
566
567         [WebIDL] Add support for having dictionaries in their own IDL file
568         https://bugs.webkit.org/show_bug.cgi?id=162912
569
570         Reviewed by Darin Adler.
571
572         Add support for having dictionaries in their own IDL file so that they
573         can be shared by multiple interfaces.
574
575         Leverage this new support to merge Element::ScrollToOptions and
576         DOMWindow::ScrollToOptions.
577
578         No new tests, extended bindings tests.
579
580         * CMakeLists.txt:
581         * DerivedSources.cpp:
582         * DerivedSources.make:
583         * WebCore.xcodeproj/project.pbxproj:
584         * bindings/scripts/CodeGenerator.pm:
585         (ProcessDocument):
586         (IDLFileForInterface):
587         (GetDictionaryByName):
588         (IsDictionaryType):
589         (HasEnumImplementationNameOverride): Deleted.
590         (GetEnumImplementationNameOverride): Deleted.
591         * bindings/scripts/CodeGeneratorJS.pm:
592         (GenerateDictionary):
593         (GetEnumerationClassName):
594         (GenerateEnumerationImplementationContent):
595         (GenerateEnumerationHeaderContent):
596         (GetDictionaryClassName):
597         (GenerateDefaultValue):
598         (GenerateDictionaryHeaderContent):
599         (GenerateDictionariesHeaderContent):
600         (GenerateDictionaryImplementationContent):
601         (GenerateDictionariesImplementationContent):
602         (GenerateHeader):
603         (GenerateImplementation):
604         (GenerateParametersCheck):
605         (GenerateDictionaryHeader):
606         (GenerateDictionaryImplementation):
607         (GenerateCallbackHeader):
608         (GenerateCallbackImplementation):
609         (GetNativeType):
610         (JSValueToNative):
611         (GetNestedClassName): Deleted.
612         (GenerateConversionRuleWithLeadingComma): Deleted.
613         (addIterableProperties): Deleted.
614         * bindings/scripts/preprocess-idls.pl:
615         (containsInterfaceOrExceptionFromIDL):
616         * bindings/scripts/test/JS/JSTestObj.cpp:
617         (WebCore::jsTestObjPrototypeFunctionOperationWithExternalDictionaryParameter):
618         (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot): Deleted.
619         * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp: Added.
620         (WebCore::convertDictionary<TestStandaloneDictionary>):
621         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h: Added.
622         * bindings/scripts/test/TestObj.idl:
623         * bindings/scripts/test/TestStandaloneDictionary.idl: Added.
624         * dom/Element.h:
625         * dom/Element.idl:
626         * html/HTMLBodyElement.cpp:
627         (WebCore::HTMLBodyElement::scrollTo):
628         * page/DOMWindow.h:
629         * page/DOMWindow.idl:
630         * page/ScrollToOptions.h: Added.
631         * page/ScrollToOptions.idl: Added.
632
633 2016-10-06  Brent Fulgham  <bfulgham@apple.com>
634
635         Unreviewed build fix.
636
637         * platform/graphics/Image.cpp: Add missing include
638         for 'NotImplemented' when building under Direct2D.
639
640 2016-10-06  Brent Fulgham  <bfulgham@apple.com>
641
642         [Win][Direct2D] Add Direct2D CMake rules
643         https://bugs.webkit.org/show_bug.cgi?id=162925
644
645         Reviewed by Brent Fulgham.
646
647         Modify PlatformAppleWin.cmake to conditionally build the CoreGraphics
648         and CoreAnimation implementation, or the Direct2D files, depending
649         on whether the USE_DIRECT2D macro is set in the CMake build options.
650         By default it builds the normal CA/CG way.
651
652         Add a stub GraphicsLayer implementation for Direct2D.
653
654         No new tests because there is no change in our active ports.
655
656         * PlatformAppleWin.cmake: Conditionalize the build for CA/CG or
657         Direct2D.
658         * config.h: Make sure CA is turned of for Direct2D builds.
659         * page/win/FrameWinDirect2D.cpp: Add missing include file.
660         * platform/graphics/win/GraphicsLayerDirect2D.cpp: Added.
661         * platform/graphics/win/GraphicsLayerDirect2D.h: Added.
662
663 2016-10-06  Yusuke Suzuki  <utatane.tea@gmail.com>
664
665         [WebCore][JSC] Use new @throwTypeError and @throwRangeError intrinsics
666         https://bugs.webkit.org/show_bug.cgi?id=163001
667
668         Reviewed by Keith Miller.
669
670         Replace `throw new @XXXError(...)` to @throwXXXError intrinsic.
671         It reduces the size of bytecode sequence and facilitate inlining.
672
673         No behavior change.
674
675         * Modules/fetch/FetchHeaders.js:
676         (initializeFetchHeaders):
677         * Modules/fetch/FetchInternals.js:
678         (fillFetchHeaders):
679         * Modules/fetch/FetchRequest.js:
680         (initializeFetchRequest):
681         * Modules/fetch/FetchResponse.js:
682         (initializeFetchResponse):
683         (clone):
684         * Modules/mediastream/NavigatorUserMedia.js:
685         (webkitGetUserMedia):
686         * Modules/mediastream/RTCPeerConnection.js:
687         (initializeRTCPeerConnection):
688         (getLocalStreams):
689         (getStreamById):
690         (addStream):
691         * Modules/streams/ReadableStream.js:
692         (initializeReadableStream):
693         (getReader):
694         * Modules/streams/ReadableStreamDefaultController.js:
695         (enqueue):
696         (error):
697         (close):
698         * Modules/streams/ReadableStreamDefaultReader.js:
699         (releaseLock):
700         * Modules/streams/ReadableStreamInternals.js:
701         (privateInitializeReadableStreamDefaultReader):
702         (privateInitializeReadableStreamDefaultController):
703         (doStructuredClone):
704         (readableStreamError):
705         * Modules/streams/StreamInternals.js:
706         (validateAndNormalizeQueuingStrategy):
707         (enqueueValueWithSize):
708         * Modules/streams/WritableStream.js:
709         (initializeWritableStream):
710         (state):
711         * xml/XMLHttpRequest.js:
712         (response):
713
714 2016-10-06  John Wilander  <wilander@apple.com>
715
716         Update Resource Load Statistics
717         https://bugs.webkit.org/show_bug.cgi?id=162811
718
719         Reviewed by Alex Christensen.
720
721         No new tests. The counting is based on top privately owned domains
722         which currently is not supported by layout tests nor API tests.
723
724         * Modules/websockets/WebSocket.cpp:
725         (WebCore::WebSocket::connect):
726             Now captures statistics for web sockets too.
727         * loader/FrameLoader.cpp:
728         (WebCore::FrameLoader::loadResourceSynchronously):
729         * loader/ResourceLoadObserver.cpp:
730             Now captures statistics for synchronous XHR too.
731         (WebCore::is3xxRedirect):
732             Convenience function.
733         (WebCore::ResourceLoadObserver::shouldLog):
734             Convenience function.
735         (WebCore::ResourceLoadObserver::logFrameNavigation):
736             Updated to make use of new convenience functions.
737         (WebCore::ResourceLoadObserver::logSubresourceLoading):
738             Updated to make use of new convenience functions.
739         (WebCore::ResourceLoadObserver::logWebSocketLoading):
740             Added.
741         (WebCore::ResourceLoadObserver::logUserInteraction):
742             Updated to make use of new convenience functions.
743         (WebCore::ResourceLoadObserver::primaryDomain):
744             Now makes use of the Public Suffix list.
745             Removed old custom parsing of primary domain.
746         * loader/ResourceLoadObserver.h:
747         * loader/ResourceLoadStatisticsStore.cpp:
748         (WebCore::ResourceLoadStatisticsStore::prevalentResourceDomainsWithoutUserInteraction):
749             Convenience function.
750         (WebCore::ResourceLoadStatisticsStore::processStatistics): Deleted.
751         * loader/ResourceLoadStatisticsStore.h:
752         * loader/SubresourceLoader.cpp:
753         (WebCore::SubresourceLoader::willSendRequestInternal):
754             Moved logging call higher up and added a check for whether we
755             are loading the main resource. The reason for moving it up is
756             to capture the request before some data may be cleared out in
757             redirect handling. We also want to capture failed CORS requests
758             since they are sent and then cancelled on the way back.
759
760 2016-10-06  Adam Bergkvist  <adam.bergkvist@ericsson.com>
761
762         WebRTC: Add support for the iceconnectionstatechange event in MediaEndpointPeerConnection
763         https://bugs.webkit.org/show_bug.cgi?id=162961
764
765         Reviewed by Eric Carlson.
766
767         Implement MediaEndpointPeerConnection's iceTransportStateChanged callback. When called, it
768         updates the ICE transport state of the corresponding transceiver and determines if the
769         RTCPeerConnection's aggregated iceConnectionState needs to be updated.
770
771         Update MediaEndpointMock's emulatePlatformEvent feature to support a new action:
772         "step-ice-transport-states". When initiated, this action replays a predefined set of ICE
773         transport state changes on a set of transceivers which can be observed via the
774         iceTransportStateChanged (mentioned above).
775
776         Test: fast/mediastream/RTCPeerConnection-iceconnectionstatechange-event.html
777
778         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
779         (WebCore::deriveAggregatedIceConnectionState):
780         (WebCore::MediaEndpointPeerConnection::iceTransportStateChanged):
781         * Modules/mediastream/MediaEndpointPeerConnection.h:
782         * platform/mediastream/MediaEndpoint.h:
783         (WebCore::MediaEndpointClient::~MediaEndpointClient):
784         * platform/mock/MockMediaEndpoint.cpp:
785         (WebCore::MockMediaEndpoint::MockMediaEndpoint):
786         (WebCore::MockMediaEndpoint::emulatePlatformEvent):
787         (WebCore::MockMediaEndpoint::stepIceTransportStates):
788         (WebCore::MockMediaEndpoint::iceTransportTimerFired):
789         * platform/mock/MockMediaEndpoint.h:
790
791 2016-10-06  Youenn Fablet  <youenn@apple.com>
792
793         CachedResource client handling methods should take reference
794         https://bugs.webkit.org/show_bug.cgi?id=163014
795
796         Reviewed by Alex Christensen.
797
798         No change of behavior.
799
800         * bindings/js/CachedScriptSourceProvider.h:
801         (WebCore::CachedScriptSourceProvider::~CachedScriptSourceProvider):
802         (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
803         * css/CSSCrossfadeValue.cpp:
804         (WebCore::CSSCrossfadeValue::~CSSCrossfadeValue):
805         (WebCore::CSSCrossfadeValue::loadSubimages):
806         * css/CSSFilterImageValue.cpp:
807         (WebCore::CSSFilterImageValue::~CSSFilterImageValue):
808         (WebCore::CSSFilterImageValue::loadSubimages):
809         * css/CSSFontFaceSource.cpp:
810         (WebCore::CSSFontFaceSource::CSSFontFaceSource):
811         (WebCore::CSSFontFaceSource::~CSSFontFaceSource):
812         * css/StyleRuleImport.cpp:
813         (WebCore::StyleRuleImport::~StyleRuleImport):
814         (WebCore::StyleRuleImport::requestStyleSheet):
815         * dom/DataTransfer.cpp:
816         (WebCore::DragImageLoader::startLoading):
817         (WebCore::DragImageLoader::stopLoading):
818         * dom/LoadableClassicScript.cpp:
819         (WebCore::LoadableClassicScript::create):
820         (WebCore::LoadableClassicScript::~LoadableClassicScript):
821         * dom/ProcessingInstruction.cpp:
822         (WebCore::ProcessingInstruction::~ProcessingInstruction):
823         (WebCore::ProcessingInstruction::checkStyleSheet):
824         (WebCore::ProcessingInstruction::parseStyleSheet):
825         * html/HTMLLinkElement.cpp:
826         (WebCore::HTMLLinkElement::~HTMLLinkElement):
827         (WebCore::HTMLLinkElement::process):
828         * loader/CrossOriginPreflightChecker.cpp:
829         (WebCore::CrossOriginPreflightChecker::~CrossOriginPreflightChecker):
830         (WebCore::CrossOriginPreflightChecker::startPreflight):
831         * loader/DocumentLoader.cpp:
832         (WebCore::DocumentLoader::detachFromFrame):
833         (WebCore::DocumentLoader::clearMainResource):
834         (WebCore::DocumentLoader::becomeMainResourceClient):
835         * loader/DocumentThreadableLoader.cpp:
836         (WebCore::DocumentThreadableLoader::~DocumentThreadableLoader):
837         (WebCore::DocumentThreadableLoader::clearResource):
838         (WebCore::DocumentThreadableLoader::loadRequest):
839         * loader/ImageLoader.cpp:
840         (WebCore::ImageLoader::~ImageLoader):
841         (WebCore::ImageLoader::clearImageWithoutConsideringPendingLoadEvent):
842         (WebCore::ImageLoader::updateFromElement):
843         (WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
844         * loader/LinkLoader.cpp:
845         (WebCore::LinkLoader::~LinkLoader):
846         (WebCore::LinkLoader::notifyFinished):
847         (WebCore::LinkLoader::loadLink):
848         * loader/LinkPreloadResourceClients.h:
849         (WebCore::LinkPreloadResourceClient::addResource):
850         (WebCore::LinkPreloadResourceClient::clearResource):
851         * loader/MediaResourceLoader.cpp:
852         (WebCore::MediaResource::MediaResource):
853         (WebCore::MediaResource::stop):
854         * loader/TextTrackLoader.cpp:
855         (WebCore::TextTrackLoader::~TextTrackLoader):
856         (WebCore::TextTrackLoader::cancelLoad):
857         (WebCore::TextTrackLoader::load):
858         * loader/cache/CachedCSSStyleSheet.cpp:
859         (WebCore::CachedCSSStyleSheet::didAddClient):
860         * loader/cache/CachedCSSStyleSheet.h:
861         * loader/cache/CachedFont.cpp:
862         (WebCore::CachedFont::didAddClient):
863         * loader/cache/CachedFont.h:
864         * loader/cache/CachedImage.cpp:
865         (WebCore::CachedImage::didAddClient):
866         (WebCore::CachedImage::didRemoveClient):
867         * loader/cache/CachedImage.h:
868         * loader/cache/CachedRawResource.cpp:
869         (WebCore::CachedRawResource::didAddClient):
870         * loader/cache/CachedRawResource.h:
871         * loader/cache/CachedResource.cpp:
872         (WebCore::CachedResource::addClient):
873         (WebCore::CachedResource::didAddClient):
874         (WebCore::CachedResource::addClientToSet):
875         (WebCore::CachedResource::removeClient):
876         (WebCore::CachedResource::switchClientsToRevalidatedResource):
877         (WebCore::CachedResource::Callback::timerFired):
878         * loader/cache/CachedResource.h:
879         (WebCore::CachedResource::hasClient):
880         (WebCore::CachedResource::didRemoveClient):
881         * loader/cache/CachedSVGDocumentReference.cpp:
882         (WebCore::CachedSVGDocumentReference::~CachedSVGDocumentReference):
883         (WebCore::CachedSVGDocumentReference::load):
884         * loader/cache/CachedXSLStyleSheet.cpp:
885         (WebCore::CachedXSLStyleSheet::didAddClient):
886         * loader/cache/CachedXSLStyleSheet.h:
887         * loader/cache/MemoryCache.cpp:
888         (WebCore::MemoryCache::addImageToCache):
889         (WebCore::MemoryCache::removeImageFromCache):
890         * loader/icon/IconLoader.cpp:
891         (WebCore::IconLoader::startLoading):
892         (WebCore::IconLoader::stopLoading):
893         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
894         (WebCore::WebCoreAVCFResourceLoader::startLoading):
895         (WebCore::WebCoreAVCFResourceLoader::stopLoading):
896         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
897         (WebCore::WebCoreAVFResourceLoader::startLoading):
898         (WebCore::WebCoreAVFResourceLoader::stopLoading):
899         * rendering/RenderImageResource.cpp:
900         (WebCore::RenderImageResource::shutdown):
901         (WebCore::RenderImageResource::setCachedImage):
902         * rendering/RenderLayerFilterInfo.cpp:
903         (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
904         (WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients):
905         * rendering/style/StyleCachedImage.cpp:
906         (WebCore::StyleCachedImage::addClient):
907         (WebCore::StyleCachedImage::removeClient):
908         * svg/SVGFEImageElement.cpp:
909         (WebCore::SVGFEImageElement::clearResourceReferences):
910         (WebCore::SVGFEImageElement::requestImageResource):
911         * svg/SVGFontFaceUriElement.cpp:
912         (WebCore::SVGFontFaceUriElement::~SVGFontFaceUriElement):
913         (WebCore::SVGFontFaceUriElement::loadFont):
914         * svg/SVGUseElement.cpp:
915         (WebCore::SVGUseElement::~SVGUseElement):
916         (WebCore::SVGUseElement::updateExternalDocument):
917         * xml/XSLImportRule.cpp:
918         (WebCore::XSLImportRule::~XSLImportRule):
919         (WebCore::XSLImportRule::setXSLStyleSheet):
920         (WebCore::XSLImportRule::loadSheet):
921         * xml/parser/XMLDocumentParser.cpp:
922         (WebCore::XMLDocumentParser::notifyFinished):
923         * xml/parser/XMLDocumentParserLibxml2.cpp:
924         (WebCore::XMLDocumentParser::~XMLDocumentParser):
925         (WebCore::XMLDocumentParser::endElementNs):
926
927 2016-10-05  Philippe Normand  <pnormand@igalia.com>
928
929         [GStreamer][OWR] GL rendering support
930         https://bugs.webkit.org/show_bug.cgi?id=162972
931
932         Reviewed by Žan Doberšek.
933
934         When GStreamer-GL is enabled the GL context needs to be properly passed
935         to the GStreamer pipeline running within the OpenWebRTC video renderer.
936         This is now supported using a new OpenWebRTC API that allows the
937         renderer to request the context from the application using a callback
938         registered within the renderer.
939
940         The player's GL context/display set-up was refactored to a new
941         method, requestGLContext, which is used as callback for the
942         OpenWebRTC request_context handler.
943
944         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
945         (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
946         (WebCore::MediaPlayerPrivateGStreamerBase::requestGLContext):
947         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
948         (WebCore::MediaPlayerPrivateGStreamerBase::gstGLContext):
949         (WebCore::MediaPlayerPrivateGStreamerBase::gstGLDisplay):
950         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
951         (WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink):
952
953 2016-10-06  Antoine Quint  <graouts@apple.com>
954
955         [Modern Media Controls] Icon service and the IconButton class
956         https://bugs.webkit.org/show_bug.cgi?id=162970
957         <rdar://problem/28631803>
958
959         Reviewed by Dean Jackson.
960
961         We introduce the new IconButton class to display buttons that show an icon
962         in modern media controls. An IconButton uses a CSS mask-image to display the icon
963         such that we may set the actual button color to any value by setting the element's
964         background-color property.
965
966         Icons are obtained through the `iconService` singleton which knows how to load the
967         right icon for the current layout traits and resolution. Icons loaded through the
968         icon service are cached. In a later patch, we will be introducing functionality,
969         through the MediaControlsHost, to load the icon from the WebCore bundle.
970
971         Tests: media/modern-media-controls/icon-button/icon-button-active-state.html
972                media/modern-media-controls/icon-button/icon-button.html
973                media/modern-media-controls/icon-service/icon-service.html
974
975         * Modules/modern-media-controls/controls/button.css:
976         (button):
977         * Modules/modern-media-controls/controls/icon-button.css: Copied from Source/WebCore/Modules/modern-media-controls/controls/button.css.
978         (button.icon):
979         (button.icon:active):
980         * Modules/modern-media-controls/controls/icon-button.js: Added.
981         (IconButton):
982         (IconButton.prototype.get iconName):
983         (IconButton.prototype.set iconName):
984         (IconButton.prototype.handleEvent):
985         (IconButton.prototype.layout):
986         (IconButton.prototype._imageDidLoad):
987         (IconButton.prototype._updateImage):
988         * Modules/modern-media-controls/controls/icon-service.js: Copied from Source/WebCore/Modules/modern-media-controls/controls/layout-item.js.
989         (const.iconService.new.IconService):
990         (const.iconService.new.IconService.prototype.imageForIconNameAndLayoutTraits):
991         (const.iconService.new.IconService.prototype.urlForIconNameAndLayoutTraits):
992         * Modules/modern-media-controls/controls/layout-item.js:
993         * Modules/modern-media-controls/images/iOS/pause@2x.png: Added.
994         * Modules/modern-media-controls/images/iOS/pause@3x.png: Added.
995         * Modules/modern-media-controls/images/iOS/start@2x.png: Added.
996         * Modules/modern-media-controls/images/iOS/start@3x.png: Added.
997         * Modules/modern-media-controls/images/macOS/pause-fullscreen@1x.png: Added.
998         * Modules/modern-media-controls/images/macOS/pause-fullscreen@2x.png: Added.
999         * Modules/modern-media-controls/images/macOS/pause@1x.png: Added.
1000         * Modules/modern-media-controls/images/macOS/pause@2x.png: Added.
1001         * Modules/modern-media-controls/images/macOS/start@1x.png: Added.
1002         * Modules/modern-media-controls/images/macOS/start@2x.png: Added.
1003
1004 2016-10-06  Miguel Gomez  <magomez@igalia.com>
1005
1006         [GTK] Fix build with GSTREAMER_GL enabled and ACCELERATED_2D_CANVAS disabled
1007         https://bugs.webkit.org/show_bug.cgi?id=163008
1008
1009         Reviewed by Carlos Garcia Campos.
1010
1011         Put functions using cairo-gl behind appropriate guards.
1012
1013         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1014         (WebCore::MediaPlayerPrivateGStreamerBase::paintToCairoSurface): Deleted.
1015         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1016
1017 2016-10-06  Miguel Gomez  <magomez@igalia.com>
1018
1019         [GTK] Copying video textures to webgl should not depend on cairo-gl
1020         https://bugs.webkit.org/show_bug.cgi?id=162904
1021
1022         Reviewed by Žan Doberšek.
1023
1024         Perform the texture copy without using cairo-gl.
1025
1026         Covered by existent tests.
1027
1028         * platform/GStreamer.cmake:
1029         Add the new VideoTextureCopierGStreamer class to the build.
1030         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1031         (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
1032         Use VideoTextureCopierGStreamer to perform the copy.
1033         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1034         Add a VideoTextureCopierGStreamer as a class attribute.
1035         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp: Added.
1036         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
1037         (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
1038         (WebCore::VideoTextureCopierGStreamer::updateTextureSpaceMatrix):
1039         Recalculates the matrix used as the texture coordinates transformation.
1040         (WebCore::VideoTextureCopierGStreamer::updateTransformationMatrix):
1041         Recalculates the matrices used as the vertices coordinates transformation.
1042         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
1043         Performs the texture copy by using a shader that applies the rotation needed to follow
1044         the video orientation.
1045         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h: Added.
1046
1047 2016-10-06  Gwang Yoon Hwang  <yoon@igalia.com>
1048
1049         [GTK] Build fix for X11 and GStreamerGL after r183731
1050         https://bugs.webkit.org/show_bug.cgi?id=163000
1051
1052         Reviewed by Philippe Normand.
1053
1054         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1055         Include gstgldisplay_egl.h if platform uses EGL.
1056
1057 2016-10-06  Mario Sanchez Prada  <mario@endlessm.com>
1058
1059         [GStreamer] Can't play any video with GSTREAMER_GL enabled
1060         https://bugs.webkit.org/show_bug.cgi?id=162669
1061
1062         Reviewed by Philippe Normand.
1063
1064         Make sure an EGLDisplay type is passed when creating the GstGlDisplay
1065         for the EGL code path, instead of a native X11 display type, so
1066         that we get a valid GstGlDisplay as a result, not a dummy one.
1067
1068         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1069         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
1070
1071 2016-10-06  Youenn Fablet  <youenn@apple.com>
1072
1073         [Fetch API] Forbid redirection to non-HTTP(s) URL in non-navigation mode.
1074         https://bugs.webkit.org/show_bug.cgi?id=162785
1075
1076         Reviewed by Alex Christensen.
1077
1078         Covered by rebased and existing tests.
1079
1080         Ensuring non-HTTP redirection URLs are not followed at DocumentThreadableLoader level for fetch API only.
1081         This should be applied to all clients at some point, but there is still some uncertainty for data URLs.
1082
1083         Did some refactoring to better separate the case of security checks in case of regular request or redirected request.
1084         This allows in particular to handle more clearly the case of data URLs which are allowed in all modes for regular requests.
1085         But they are not allowed for same-origin redirected requests.
1086
1087         * WebCore.xcodeproj/project.pbxproj:
1088         * loader/DocumentThreadableLoader.cpp:
1089         (WebCore::reportRedirectionWithBadScheme): Reporting bad scheme redirection error.
1090         (WebCore::DocumentThreadableLoader::redirectReceived): Checking that redirection URLs are HTTP(s) in case of Fetch API.
1091         * loader/SubresourceLoader.cpp:
1092         (WebCore::SubresourceLoader::willSendRequestInternal):
1093         * loader/cache/CachedResourceLoader.cpp:
1094         (WebCore::CachedResourceLoader::requestImage):
1095         (WebCore::CachedResourceLoader::checkInsecureContent):
1096         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
1097         (WebCore::isSameOriginDataURL):
1098         (WebCore::CachedResourceLoader::canRequest):
1099         (WebCore::CachedResourceLoader::canRequestAfterRedirection):
1100         (WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox):
1101         (WebCore::CachedResourceLoader::requestResource):
1102         * loader/cache/CachedResourceLoader.h:
1103
1104 2016-10-06  Youenn Fablet  <youenn@apple.com>
1105
1106         [Fetch API] Use ReadableStream pull to transfer binary data to stream when application needs it
1107         https://bugs.webkit.org/show_bug.cgi?id=162892
1108
1109         Reviewed by Alex Christensen.
1110
1111         Covered by existing tests.
1112
1113         Before this patch, FetchResponse was never resolving the start promise.
1114         This way, it could enqueue data, error or close the stream whenever desired.
1115
1116         With this patch, FetchResponse will feed the stream when being asked to.
1117         This allows keeping the data in WebCore until the application needs it.
1118         This is only implemented for network data.
1119         For other data owned by response (blob, text...), data will be enqueued like previously as fast as possible.
1120
1121         Note that FetchResponse can enqueue/error/close the stream at any time since JSFetchResponse has a reference to the stream.
1122         And the stream has a reference to the controller.
1123
1124         In addition to transfer binary chunks to ReadableStream only when needed, WebCore is now aware of the data
1125         stored in the response, which may allow applying backpressure to the network source in the future.
1126
1127         * Modules/fetch/FetchResponse.cpp:
1128         (WebCore::FetchResponse::BodyLoader::didSucceed):
1129         (WebCore::FetchResponse::BodyLoader::didReceiveData): Enqueuing only if stream is pulling.
1130         Otherwise, storing in FetchBodyConsumer. If stream is pulling, we enqueue both buffered data and received chunk.
1131         (WebCore::FetchResponse::consumeBodyAsStream): Resolving pull promise if we enqueued some buffered data.
1132         (WebCore::FetchResponse::closeStream):
1133         (WebCore::FetchResponse::feedStream): If we have some buffered data, we enqueue it. If there is no loader, the stream can be closed.
1134         * Modules/fetch/FetchResponse.h:
1135         * Modules/fetch/FetchResponseSource.cpp:
1136         (WebCore::FetchResponseSource::doPull):
1137         (WebCore::FetchResponseSource::close):
1138         (WebCore::FetchResponseSource::error):
1139         * Modules/fetch/FetchResponseSource.h:
1140         * Modules/streams/ReadableStreamSource.h:
1141         (WebCore::ReadableStreamSource::isPulling): Renamed from isStarting.
1142         (WebCore::ReadableStreamSource::isStarting): Deleted.
1143
1144 2016-10-06  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1145
1146         WebRTC: Add support for the icecandidate event in MediaEndpointPeerConnection
1147         https://bugs.webkit.org/show_bug.cgi?id=162957
1148
1149         Reviewed by Eric Carlson.
1150
1151         Implement MediaEndpointPeerConnection's gotIceCandidate and doneGatheringCandidates
1152         callbacks. These are used by the MediaEndpoint (WebRTC backend implementation) to
1153         notify about ICE events.
1154
1155         Add API to Internals to emulate WebRTC platform events, such as dispatching a set of ICE
1156         candidates followed by a gathering done indication. Initially, only a single action,
1157         "dispatch-fake-ice-candidates", is supported, but the intention is to extend the set of
1158         actions to support more test cases.
1159
1160         Test: fast/mediastream/RTCPeerConnection-icecandidate-event.html
1161
1162         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1163         (WebCore::MediaEndpointPeerConnection::emulatePlatformEvent):
1164         (WebCore::MediaEndpointPeerConnection::gotIceCandidate):
1165         (WebCore::MediaEndpointPeerConnection::doneGatheringCandidates):
1166         * Modules/mediastream/MediaEndpointPeerConnection.h:
1167         * Modules/mediastream/PeerConnectionBackend.h:
1168         * Modules/mediastream/RTCIceTransport.h: Added.
1169         RTCIceCandidate will eventually be part of the JS API, but right now it's
1170         only used to keep track of the ICE states related to a RTCRtpTranscevier.
1171         (WebCore::RTCIceTransport::create):
1172         (WebCore::RTCIceTransport::~RTCIceTransport):
1173         (WebCore::RTCIceTransport::transportState):
1174         (WebCore::RTCIceTransport::setTransportState):
1175         (WebCore::RTCIceTransport::gatheringState):
1176         (WebCore::RTCIceTransport::setGatheringState):
1177         (WebCore::RTCIceTransport::RTCIceTransport):
1178         * Modules/mediastream/RTCPeerConnection.cpp:
1179         (WebCore::RTCPeerConnection::emulatePlatformEvent):
1180         * Modules/mediastream/RTCPeerConnection.h:
1181         * Modules/mediastream/RTCRtpTransceiver.cpp:
1182         (WebCore::RTCRtpTransceiver::RTCRtpTransceiver):
1183         * Modules/mediastream/RTCRtpTransceiver.h:
1184         (WebCore::RTCRtpTransceiver::iceTransport):
1185         * WebCore.xcodeproj/project.pbxproj:
1186         * platform/mediastream/MediaEndpoint.h:
1187         (WebCore::MediaEndpoint::emulatePlatformEvent):
1188         * platform/mediastream/PeerConnectionStates.h:
1189         * platform/mock/MockMediaEndpoint.cpp:
1190         (WebCore::MockMediaEndpoint::MockMediaEndpoint):
1191         (WebCore::MockMediaEndpoint::updateReceiveConfiguration):
1192         (WebCore::MockMediaEndpoint::emulatePlatformEvent):
1193         (WebCore::MockMediaEndpoint::dispatchFakeIceCandidates):
1194         (WebCore::MockMediaEndpoint::iceCandidateTimerFired):
1195         * platform/mock/MockMediaEndpoint.h:
1196         * testing/Internals.cpp:
1197         (WebCore::Internals::emulateRTCPeerConnectionPlatformEvent):
1198         Generic API to signal down to the WebRTC platform mock.
1199         * testing/Internals.h:
1200         * testing/Internals.idl:
1201
1202 2016-10-06  Nan Wang  <n_wang@apple.com>
1203
1204         AX:[Mac] Unable to edit text input, textarea fields in iframe using VO naivgation
1205         https://bugs.webkit.org/show_bug.cgi?id=162999
1206
1207         Reviewed by Chris Fleizach.
1208
1209         In WebKit1, the top web area setting the selection to an input element inside an iframe
1210         will make the input field not editable. The issue is that when the web area and the input element
1211         have different documents, the setSelection function in FrameSelection will set the selection on
1212         the input's frame and cause the caret to disappear. I fixed it by not setting the selection in such case.
1213
1214         Test: accessibility/mac/wk1-set-selected-text-marker-range-input-element.html
1215
1216         * accessibility/AccessibilityRenderObject.cpp:
1217         (WebCore::AccessibilityRenderObject::setSelectedVisiblePositionRange):
1218
1219 2016-10-05  Commit Queue  <commit-queue@webkit.org>
1220
1221         Unreviewed, rolling out r206845.
1222         https://bugs.webkit.org/show_bug.cgi?id=162998
1223
1224         broke el capitan build (Requested by alexchristensen on
1225         #webkit).
1226
1227         Reverted changeset:
1228
1229         "Add Display P3 ColorSpace"
1230         https://bugs.webkit.org/show_bug.cgi?id=162880
1231         http://trac.webkit.org/changeset/206845
1232
1233 2016-10-05  Youenn Fablet  <youenn@apple.com>
1234
1235         Reuse CodeGenerator::UpdateFile in Tools CodeGenerator
1236         https://bugs.webkit.org/show_bug.cgi?id=162960
1237
1238         Reviewed by Alex Christensen.
1239
1240         No change of behavior.
1241
1242         * bindings/scripts/CodeGenerator.pm:
1243         (UpdateFile): Adding FIXME to enable lazy writing when feasible.
1244
1245 2016-10-05  Michael Catanzaro  <mcatanzaro@igalia.com>
1246
1247         [SOUP] HostTLSCertificateSet should not use SHA-1 hashes to compare certificates
1248         https://bugs.webkit.org/show_bug.cgi?id=162965
1249
1250         Reviewed by Carlos Garcia Campos.
1251
1252         Use SHA-256 instead.
1253
1254         No new tests, covered by TestSSL.
1255
1256         * platform/network/soup/SoupNetworkSession.cpp:
1257         (WebCore::HostTLSCertificateSet::computeCertificateHash):
1258
1259 2016-10-05  Michael Catanzaro  <mcatanzaro@igalia.com>
1260
1261         [GTK] Bump Chrome version in Chrome user agent quirk
1262         https://bugs.webkit.org/show_bug.cgi?id=162984
1263
1264         Reviewed by Carlos Garcia Campos.
1265
1266         * platform/gtk/UserAgentGtk.cpp:
1267         (WebCore::buildUserAgentString):
1268
1269 2016-10-05  Dean Jackson  <dino@apple.com>
1270
1271         Add Display P3 ColorSpace
1272         https://bugs.webkit.org/show_bug.cgi?id=162880
1273         <rdar://problem/28598564>
1274
1275         Reviewed by Sam Weinig.
1276
1277         Add a new ColorSpace for Display P3.
1278
1279         This will be tested once the Color class can create
1280         objects that reference other color spaces.
1281
1282         * platform/graphics/ColorSpace.h:
1283         * platform/graphics/cg/GraphicsContextCG.cpp:
1284         (WebCore::displayP3ColorSpaceRef):
1285         * platform/graphics/cg/GraphicsContextCG.h:
1286         (WebCore::cachedCGColorSpace):
1287
1288 2016-10-05  Wenson Hsieh  <wenson_hsieh@apple.com>
1289
1290         Introduce InputEvent bindings in preparation for the input events spec
1291         https://bugs.webkit.org/show_bug.cgi?id=162954
1292
1293         Reviewed by Ryosuke Niwa.
1294
1295         Creates new bindings for InputEvent. Also introduces a runtime switch that allows Node to dispatch InputEvents
1296         rather than generic events of type 'input'. Adds a new test verifying that when the switch is enabled, inputs
1297         and contenteditable divs fire these new InputEvents on input. So far, only inputType is a part of the object
1298         prototype, since we will be implementing this first. getTargetRanges() will follow once the finer details of
1299         StaticRange are hashed out. See https://bugs.webkit.org/show_bug.cgi?id=162947 for more details.
1300
1301         Tests: fast/events/input-events-fired-when-typing.html
1302                fast/events/ios/input-events-fired-when-typing-in-contenteditable.html
1303
1304         * CMakeLists.txt:
1305         * DerivedSources.cpp:
1306         * DerivedSources.make:
1307         * WebCore.xcodeproj/project.pbxproj:
1308         * dom/DOMAllInOne.cpp:
1309         * dom/Event.cpp:
1310         (WebCore::Event::composed):
1311         (WebCore::Event::isInputEvent):
1312         * dom/Event.h:
1313         * dom/EventNames.in:
1314         * dom/InputEvent.cpp: Added.
1315         (WebCore::InputEvent::InputEvent):
1316         * dom/InputEvent.h: Added.
1317         * dom/InputEvent.idl: Added.
1318         * dom/Node.cpp:
1319         (WebCore::Node::dispatchInputEvent):
1320         (WebCore::Node::defaultEventHandler):
1321         * dom/Node.h:
1322         * editing/Editor.cpp:
1323         (WebCore::Editor::setBaseWritingDirection):
1324         * html/HTMLFormControlElement.cpp:
1325         (WebCore::HTMLFormControlElement::dispatchFormControlInputEvent):
1326         * html/HTMLInputElement.cpp:
1327         (WebCore::HTMLInputElement::setEditingValue):
1328         (WebCore::HTMLInputElement::setValueFromRenderer):
1329         * html/HTMLSelectElement.cpp:
1330         (WebCore::HTMLSelectElement::listBoxOnChange):
1331         (WebCore::HTMLSelectElement::dispatchChangeEventForMenuList):
1332         * html/shadow/MediaControlElements.cpp:
1333         (WebCore::MediaControlTimelineElement::defaultEventHandler):
1334         * page/Settings.in:
1335         * testing/InternalSettings.cpp:
1336         (WebCore::InternalSettings::Backup::Backup):
1337         (WebCore::InternalSettings::Backup::restoreTo):
1338         * testing/InternalSettings.h:
1339         * testing/InternalSettings.idl:
1340
1341 2016-10-05  Alex Christensen  <achristensen@webkit.org>
1342
1343         URLParser should parse IPv4 addresses as the last two pieces of an IPv6 address
1344         https://bugs.webkit.org/show_bug.cgi?id=162991
1345
1346         Reviewed by Saam Barati.
1347
1348         The last 32 bits of an IPv6 address can be written in the form of an IPv4 address,
1349         but the syntax is stricter than if it were just an IPv4 address.  There must be 4 pieces,
1350         and each piece must be decimal (no octal or hex allowed).  These should serialize to
1351         regular hex IPv6 addresses.
1352
1353         Covered by new API tests.
1354
1355         * platform/URLParser.cpp:
1356         (WebCore::URLParser::parseIPv4Piece):
1357         (WebCore::URLParser::parseIPv4Host):
1358         (WebCore::URLParser::parseIPv4PieceInsideIPv6):
1359         (WebCore::URLParser::parseIPv4AddressInsideIPv6):
1360         (WebCore::URLParser::parseIPv6Host):
1361         (WebCore::URLParser::parseIPv4Number): Deleted.
1362         * platform/URLParser.h:
1363
1364 2016-10-05  Myles C. Maxfield  <mmaxfield@apple.com>
1365
1366         Put variation fonts work behind a compile-time flag
1367         https://bugs.webkit.org/show_bug.cgi?id=162949
1368
1369         Reviewed by Simon Fraser.
1370
1371         No new tests because there is no behavior change.
1372
1373         * Configurations/FeatureDefines.xcconfig:
1374         * css/CSSComputedStyleDeclaration.cpp:
1375         (WebCore::ComputedStyleExtractor::propertyValue):
1376         * css/CSSFontVariationValue.cpp:
1377         * css/CSSFontVariationValue.h:
1378         * css/CSSPropertyNames.in:
1379         * css/CSSValue.cpp:
1380         (WebCore::CSSValue::equals):
1381         (WebCore::CSSValue::cssText):
1382         (WebCore::CSSValue::destroy):
1383         * css/CSSValue.h:
1384         (WebCore::CSSValue::isFontFeatureValue): Deleted.
1385         (WebCore::CSSValue::isFontVariationValue): Deleted.
1386         * css/StyleBuilderConverter.h:
1387         (WebCore::StyleBuilderConverter::convertFontVariationSettings): Deleted.
1388         * css/StyleBuilderCustom.h:
1389         (WebCore::StyleBuilderCustom::applyInheritFontFeatureSettings): Deleted.
1390         (WebCore::StyleBuilderCustom::applyInheritFontVariationSettings): Deleted.
1391         * css/parser/CSSParser.cpp:
1392         (WebCore::CSSParserContext::CSSParserContext):
1393         (WebCore::operator==):
1394         (WebCore::CSSParser::parseValue):
1395         (WebCore::CSSParser::parseFontVariationSettings): Deleted.
1396         * css/parser/CSSParserMode.h:
1397         * page/Settings.in:
1398         * page/animation/CSSPropertyAnimation.cpp:
1399         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1400         (WebCore::blendFunc): Deleted.
1401         * platform/graphics/FontCache.h:
1402         (WebCore::FontDescriptionKey::FontDescriptionKey):
1403         (WebCore::FontDescriptionKey::operator==):
1404         (WebCore::FontDescriptionKey::computeHash):
1405         * platform/graphics/FontDescription.cpp:
1406         * platform/graphics/FontDescription.h:
1407         (WebCore::FontDescription::operator==):
1408         (WebCore::FontDescription::setFeatureSettings): Deleted.
1409         (WebCore::FontDescription::setVariationSettings): Deleted.
1410         * platform/graphics/FontTaggedSettings.cpp:
1411         (WebCore::operator<<): Deleted.
1412         * platform/graphics/FontTaggedSettings.h:
1413         (WebCore::FontVariationSettings::isEmpty):
1414         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1415         (WebCore::preparePlatformFont):
1416         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1417         (WebCore::cascadeToLastResortAndVariationsFontDescriptor):
1418         * rendering/style/RenderStyle.cpp:
1419         (WebCore::RenderStyle::setFontVariationSettings): Deleted.
1420         * rendering/style/RenderStyle.h:
1421         (WebCore::RenderStyle::fontVariationSettings): Deleted.
1422         * testing/InternalSettings.cpp:
1423         (WebCore::InternalSettings::Backup::Backup):
1424         (WebCore::InternalSettings::Backup::restoreTo):
1425         (WebCore::InternalSettings::variationFontsEnabled):
1426         (WebCore::InternalSettings::setVariationFontsEnabled):
1427         * testing/InternalSettings.h:
1428
1429 2016-10-05  Brent Fulgham  <bfulgham@apple.com>
1430
1431         Unreviewed build fix after r206830
1432
1433         * platform/graphics/win/FontPlatformDataWin.cpp: Add missing include
1434         when building with Direct2D.
1435
1436 2016-10-05  Brent Fulgham  <bfulgham@apple.com>
1437
1438         [Win][Direct2D] Disable some CoreGraphics and CoreAnimation-based logic when building for D2D
1439         https://bugs.webkit.org/show_bug.cgi?id=162977
1440
1441         Reviewed by Alex Christensen.
1442
1443         Currently the Direct2D implementation does not support some of the accelerated compositing
1444         features that require CoreAnimation. During this bring-up, we want to disable these routines
1445         so that we can build and run in (mostly) unaccelerated drawing.
1446
1447         This patch mostly consists of adding "#if USE(CG)" and "#if USE(CA)" to files that are
1448         specific to those implementations.
1449
1450         This change should have no impact on non-Direct2D ports.
1451
1452         No change in behavior for active ports.
1453
1454         * config.h: Turn of CG when building in Direct2D.
1455         * css/CSSFontFaceSource.cpp:
1456         * loader/cache/CachedFont.cpp:
1457         * loader/cache/CachedSVGFont.cpp:
1458         * page/CaptionUserPreferencesMediaAF.cpp:
1459         * page/win/FrameCGWin.cpp:
1460         * page/win/FrameDirect2D.cpp: Added.
1461         * platform/graphics/Font.cpp:
1462         * platform/graphics/FontCache.cpp:
1463         * platform/graphics/FontPlatformData.cpp:
1464         * platform/graphics/GraphicsContext.h:
1465         * platform/graphics/Image.cpp:
1466         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
1467         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1468         * platform/graphics/ca/GraphicsLayerCA.cpp:
1469         * platform/graphics/ca/PlatformCALayer.cpp:
1470         * platform/graphics/ca/TileController.cpp:
1471         * platform/graphics/ca/TileGrid.cpp:
1472         * platform/graphics/ca/TileGrid.h:
1473         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
1474         * platform/graphics/ca/win/LayerChangesFlusher.cpp:
1475         * platform/graphics/ca/win/PlatformCAAnimationWin.cpp:
1476         * platform/graphics/ca/win/PlatformCAAnimationWin.h:
1477         * platform/graphics/ca/win/PlatformCAFiltersWin.cpp:
1478         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1479         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
1480         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
1481         * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
1482         * platform/graphics/cg/GradientCG.cpp:
1483         * platform/graphics/cg/GraphicsContextCG.cpp:
1484         * platform/graphics/cg/ImageBufferCG.cpp:
1485         * platform/graphics/cg/ImageBufferDataCG.cpp:
1486         * platform/graphics/cg/PDFDocumentImage.cpp:
1487         * platform/graphics/cg/PatternCG.cpp:
1488         * platform/graphics/cg/SubimageCacheWithTimer.cpp:
1489         * platform/graphics/win/FontCGWin.cpp:
1490         * platform/graphics/win/FontPlatformDataCGWin.cpp:
1491         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
1492         * platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
1493         * platform/graphics/win/GradientDirect2D.cpp:
1494         * platform/graphics/win/PathDirect2D.cpp: Fix a few build problems I didn't notice
1495         while building without Direct2D active.
1496         * platform/graphics/win/SimpleFontDataCGWin.cpp:
1497         * platform/graphics/win/SimpleFontDataWin.cpp:
1498         * platform/win/DragImageCGWin.cpp:
1499         * platform/win/DragImageDirect2D.cpp: Added.
1500         * rendering/RenderMediaControls.cpp:
1501
1502 2016-10-05  Chris Dumez  <cdumez@apple.com>
1503
1504         KeyboardEvent.getModifierState() should support "CapsLock" modifier
1505         https://bugs.webkit.org/show_bug.cgi?id=162861
1506
1507         Reviewed by Darin Adler.
1508
1509         Add support for "CapsLock" modifier on Mac / iOS for KeyboardEvent's
1510         getModifierState() API, as per:
1511         - https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate
1512
1513         No new tests, updated existing test.
1514
1515         * dom/KeyboardEvent.cpp:
1516         (WebCore::KeyboardEvent::KeyboardEvent):
1517         (WebCore::KeyboardEvent::getModifierState):
1518         * dom/KeyboardEvent.h:
1519         * platform/PlatformEvent.h:
1520         * platform/ios/PlatformEventFactoryIOS.mm:
1521         (WebCore::modifiersForEvent):
1522         * platform/mac/PlatformEventFactoryMac.mm:
1523         (WebCore::keyIdentifierForKeyEvent):
1524
1525 2016-10-05  Michael Catanzaro  <mcatanzaro@igalia.com>
1526
1527         [GTK] Improve OS X UA quirk
1528         https://bugs.webkit.org/show_bug.cgi?id=162613
1529
1530         Reviewed by Carlos Garcia Campos.
1531
1532         Include OS X version number in user agent, like Safari does.
1533
1534         * platform/gtk/UserAgentGtk.cpp:
1535         (WebCore::buildUserAgentString):
1536
1537 2016-10-05  Michael Catanzaro  <mcatanzaro@igalia.com>
1538
1539         [GTK] Improve comment in platformVersionForUAString
1540         https://bugs.webkit.org/show_bug.cgi?id=162612
1541
1542         Reviewed by Carlos Garcia Campos.
1543
1544         * platform/gtk/UserAgentGtk.cpp:
1545         (WebCore::platformVersionForUAString):
1546
1547 2016-10-05  Zalan Bujtas  <zalan@apple.com>
1548
1549         Missing quotation mark when <q> gets reparented.
1550         https://bugs.webkit.org/show_bug.cgi?id=162940
1551
1552         Reviewed by Darin Adler.
1553
1554         When an opening RenderQuote gets removed due to some change in the render tree,
1555         we notify the closing RenderQuote so that it can update its content (") accordingly (and vice versa).
1556         However when the same RenderQuote is added back to the render tree (aka reparenting), we fail to
1557         let the other RenderQuote know about it and its content becomes stale.  
1558         This patch ensures that when either the opening or closing part of the quotation mark gets reparented,
1559         we inform the other, corresponding opening/closing renderer about it.
1560
1561         Test: fast/css-generated-content/missing-quotes-with-dynamic-content.html
1562
1563         * dom/PseudoElement.cpp:
1564         (WebCore::PseudoElement::didAttachRenderers):
1565         * rendering/RenderQuote.cpp:
1566         (WebCore::RenderQuote::insertedIntoTree):
1567         * rendering/RenderQuote.h:
1568
1569 2016-10-05  Alex Christensen  <achristensen@webkit.org>
1570
1571         URLParser should correctly strip unnecessary 0's in IPv6 addresses
1572         https://bugs.webkit.org/show_bug.cgi?id=162979
1573
1574         Reviewed by Brady Eidson.
1575
1576         Covered by new API tests.
1577
1578         * platform/URLParser.cpp:
1579         (WebCore::URLParser::parseIPv6Host):
1580         Strip leading 0's and any 0's before the last 0 if the value is 0.
1581
1582 2016-10-05  Alex Christensen  <achristensen@webkit.org>
1583
1584         UTF-8 encode queries of nonspecial and websocket schemes
1585         https://bugs.webkit.org/show_bug.cgi?id=162956
1586
1587         Reviewed by Geoffrey Garen and Brady Eidson.
1588
1589         The URL spec says in the query state:
1590         'If url is not special or url's scheme is either "ws" or "wss", set encoding to UTF-8.'
1591         This should be determined as soon as we are done parsing the scheme.
1592         
1593         Covered by new API tests.
1594         This also fixes tests like fast/loader/javascript-url-encoding-2.html when URLParser is enabled.
1595
1596         * platform/URLParser.cpp:
1597         (WebCore::isValidSchemeCharacter):
1598         Renamed Scheme to ValidScheme so I can use Scheme as the name of an enum class in the same namespace.
1599         (WebCore::isSpecial):
1600         (WebCore::scheme):
1601         Separate functionality so we can have different behavior for different sets of
1602         ws and wss schemes, special, and non-special schemes.
1603         (WebCore::URLParser::copyURLPartsUntil):
1604         (WebCore::URLParser::parse):
1605         Set isUTF8Encoding to true when we finish parsing the scheme if the scheme is ws, wss, or non-special,
1606         according to spec.  This also matches existing behavior.  This way we will already know whether to go
1607         into UTF8Query or NonUTF8Query state when we see a '?'.
1608         (WebCore::isSpecialScheme): Deleted.
1609
1610 2016-10-05  Alex Christensen  <achristensen@webkit.org>
1611
1612         Prepare to enable URLParser
1613         https://bugs.webkit.org/show_bug.cgi?id=162974
1614
1615         Reviewed by Brady Eidson.
1616
1617         * platform/URL.cpp:
1618         (WebCore::URL::serialize):
1619         When we enable the URLParser, this attempt to make serialized URLs more spec compliant
1620         won't be needed any more.
1621
1622 2016-10-05  Brent Fulgham  <bfulgham@apple.com>
1623
1624         [Win][Direct2D] Add initial D2D Path and Gradient implementation
1625         https://bugs.webkit.org/show_bug.cgi?id=162923
1626
1627         Reviewed by Alex Christensen.
1628
1629         This patch lands a set of new files that implements initial Path
1630         and Gradient features on Windows using Direct2D.
1631
1632         No new tests until complete backend lands.
1633
1634         * platform/graphics/Gradient.h:
1635         * platform/graphics/Path.cpp:
1636         * platform/graphics/Path.h:
1637         * platform/graphics/win/GradientDirect2D.cpp: Added.
1638         * platform/graphics/win/PathDirect2D.cpp: Added.
1639
1640 2016-10-05  Romain Bellessort  <romain.bellessort@crf.canon.fr>
1641
1642         [Readable Streams API] Align function names with spec
1643         https://bugs.webkit.org/show_bug.cgi?id=162967
1644
1645         Reviewed by Darin Adler.
1646
1647         Align function names with spec. Behaviour was already in line with spec, but previous function names had
1648         sometimes been preserved to track the changes more easily. This led to some inconsistencies (for instance,
1649         enqueueInReadableStream was still used even though it works on a controller instead of a stream) and it
1650         also made it more difficult to compare spec and implementation.
1651
1652         No change in behaviour.
1653
1654         * Modules/fetch/FetchInternals.js:
1655         (consumeStream): Updated with new function names.
1656         * Modules/fetch/FetchResponse.js:
1657         (clone): Updated with new function names.
1658         * Modules/streams/ReadableStream.js:
1659         (tee): Updated with new function names.
1660         * Modules/streams/ReadableStreamDefaultController.js:
1661         (enqueue): Updated with new function names.
1662         (error): Updated with new function names.
1663         * Modules/streams/ReadableStreamDefaultReader.js:
1664         (read): Updated with new function names.
1665         * Modules/streams/ReadableStreamInternals.js:
1666         (privateInitializeReadableStreamDefaultController): Updated with new function names.
1667         (readableStreamDefaultControllerError): Updated with new function names.
1668         (readableStreamTee): Updated with new function names.
1669         (readableStreamTeePullFunction): Updated with new function names.
1670         (readableStreamTeeBranch2CancelFunction): Updated with new function names.
1671         (readableStreamError): Updated with new function names.
1672         (readableStreamCancel): Updated with new function names.
1673         (readableStreamDefaultControllerPull): Updated with new function names.
1674         (readableStreamDefaultControllerClose): Updated with new function names.
1675         (readableStreamClose): Updated with new function names.
1676         (readableStreamDefaultControllerEnqueue): Updated with new function names.
1677         (readableStreamDefaultReaderRead): Updated with new function names.
1678
1679 2016-10-05  Chris Dumez  <cdumez@apple.com>
1680
1681         [Bindings] Declare dictionary / enumeration template specializations in the header
1682         https://bugs.webkit.org/show_bug.cgi?id=162929
1683
1684         Reviewed by Darin Adler.
1685
1686         Declare dictionary / enumeration template specializations in the header
1687         so that:
1688         - They can be used from custom bindings code.
1689         - Dictionaries / enumerations can be used to their own IDL files to
1690           share them (Bug 162912).
1691
1692         No new tests, rebaselined bindings tests.
1693
1694         * WebCore.xcodeproj/project.pbxproj:
1695         * bindings/generic/IDLTypes.h:
1696         * bindings/js/JSDOMConvert.h:
1697         * bindings/scripts/CodeGeneratorJS.pm:
1698         (GenerateInterface):
1699         (GenerateEnumerationImplementationContent):
1700         (GenerateEnumerationHeaderContent):
1701         (GenerateDictionaryHeaderContent):
1702         (GenerateHeader):
1703         (GenerateCallbackHeader):
1704         (GenerateCallbackImplementation):
1705         (GenerateDefaultValue): Deleted.
1706         (GenerateDictionaryImplementationContent): Deleted.
1707         (GenerateParametersCheck): Deleted.
1708         * bindings/scripts/test/JS/JSTestObj.cpp:
1709         * bindings/scripts/test/JS/JSTestObj.h:
1710
1711 2016-10-05  Zan Dobersek  <zdobersek@igalia.com>
1712
1713         Rename ENABLE_ENCRYPTED_MEDIA_V2 to ENABLE_LEGACY_ENCRYPTED_MEDIA
1714         https://bugs.webkit.org/show_bug.cgi?id=162903
1715
1716         Reviewed by Alex Christensen.
1717
1718         Rename build guards for the remaining implementation of the legacy EME API
1719         to ENABLE_LEGACY_ENCRYPTED_MEDIA. This will allow for the future implementation
1720         of the near-finished API to be guarded with the simple ENABLE_ENCRYPTED_MEDIA guards.
1721
1722         No new tests -- no change in behavior.
1723
1724         * CMakeLists.txt:
1725         * Configurations/FeatureDefines.xcconfig:
1726         * DerivedSources.cpp:
1727         * DerivedSources.make:
1728         * Modules/encryptedmedia/CDM.cpp:
1729         * Modules/encryptedmedia/CDM.h:
1730         * Modules/encryptedmedia/CDMPrivate.h:
1731         * Modules/encryptedmedia/CDMPrivateClearKey.cpp:
1732         * Modules/encryptedmedia/CDMPrivateClearKey.h:
1733         * Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp:
1734         * Modules/encryptedmedia/CDMPrivateMediaPlayer.h:
1735         * Modules/encryptedmedia/CDMSessionClearKey.cpp:
1736         * Modules/encryptedmedia/CDMSessionClearKey.h:
1737         * Modules/encryptedmedia/MediaKeyMessageEvent.cpp:
1738         * Modules/encryptedmedia/MediaKeyMessageEvent.h:
1739         * Modules/encryptedmedia/MediaKeyMessageEvent.idl:
1740         * Modules/encryptedmedia/MediaKeyNeededEvent.cpp:
1741         * Modules/encryptedmedia/MediaKeyNeededEvent.h:
1742         * Modules/encryptedmedia/MediaKeyNeededEvent.idl:
1743         * Modules/encryptedmedia/MediaKeySession.cpp:
1744         * Modules/encryptedmedia/MediaKeySession.h:
1745         * Modules/encryptedmedia/MediaKeySession.idl:
1746         * Modules/encryptedmedia/MediaKeys.cpp:
1747         * Modules/encryptedmedia/MediaKeys.h:
1748         * Modules/encryptedmedia/MediaKeys.idl:
1749         * bindings/js/JSDictionary.cpp:
1750         * bindings/js/JSDictionary.h:
1751         * dom/Element.idl:
1752         * dom/EventNames.in:
1753         * dom/EventTargetFactory.in:
1754         * html/HTMLMediaElement.cpp:
1755         (WebCore::HTMLMediaElement::~HTMLMediaElement):
1756         (WebCore::HTMLMediaElement::webkitGenerateKeyRequest):
1757         (WebCore::HTMLMediaElement::webkitAddKey):
1758         * html/HTMLMediaElement.h:
1759         * html/HTMLMediaElement.idl:
1760         * html/MediaError.h:
1761         * html/MediaError.idl:
1762         * html/MediaKeyError.h:
1763         * html/MediaKeyError.idl:
1764         * page/Settings.h:
1765         * platform/graphics/CDMSession.h:
1766         * platform/graphics/MediaPlayer.cpp:
1767         * platform/graphics/MediaPlayer.h:
1768         * platform/graphics/MediaPlayerPrivate.h:
1769         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.h:
1770         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
1771         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1772         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1773         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
1774         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.h:
1775         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1776         (WebCore::MediaPlayerPrivateAVFoundationCF::supportsKeySystem):
1777         (WebCore::AVFWrapper::shouldWaitForLoadingOfResource):
1778         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
1779         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.h:
1780         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
1781         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
1782         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
1783         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
1784         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
1785         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h:
1786         * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm:
1787         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1788         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1789         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
1790         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1791         (WebCore::playerKVOProperties):
1792         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1793         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1794         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1795         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
1796         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
1797         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1798         (WebCore::SourceBufferPrivateAVFObjC::willProvideContentKeyRequestInitializationDataForTrackID):
1799         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
1800         * testing/Internals.cpp:
1801         * testing/Internals.h:
1802         * testing/Internals.idl:
1803         * testing/MockCDM.cpp:
1804         * testing/MockCDM.h:
1805
1806 2016-10-05  Daniel Bates  <dabates@apple.com>
1807
1808         Do not follow redirects when sending violation report
1809         https://bugs.webkit.org/show_bug.cgi?id=162520
1810         <rdar://problem/27957639>
1811
1812         Reviewed by Alex Christensen.
1813
1814         Do not follow redirects when sending a Content Security Policy or XSS Auditor violation report
1815         as redirects can be used to forward report details to a third-party.
1816
1817         This changes makes WebKit more closely conform to the reporting requirements in section Reporting
1818         of the Content Security Level 2 standard: <https://w3c.github.io/webappsec-csp/2/#violation-reports>
1819         (Editor's Draft, 25 April 2016).
1820
1821         Tests: http/tests/security/contentSecurityPolicy/report-blocked-uri-and-do-not-follow-redirect-when-sending-report.php
1822                http/tests/security/xssAuditor/report-script-tag-and-do-not-follow-redirect-when-sending-report.html
1823                http/tests/security/xssAuditor/report-script-tag-full-block-and-do-not-follow-redirect-when-sending-report.html
1824
1825         * loader/LoaderStrategy.h: Modified createPingHandle() to take a boolean, shouldFollowRedirects,
1826         whether to follow redirect responses for a ping request.
1827         * loader/PingLoader.cpp:
1828         (WebCore::PingLoader::loadImage): Pass ShouldFollowRedirects::Yes to PingLoader::startPingLoad to
1829         keep our current behavior.
1830         (WebCore::PingLoader::sendPing): Ditto. Note our current behavior of following redirects matches
1831         the behavior described in the section "Hyperlink auditing" of the HTML standard:
1832         <https://html.spec.whatwg.org/multipage/semantics.html#hyperlink-auditing> (23 September 2016).
1833         (WebCore::PingLoader::sendViolationReport): Pass ShouldFollowRedirects::No to PingLoader::startPingLoad
1834         so that we do not follow redirects when sending a violation report.
1835         (WebCore::PingLoader::startPingLoad): Modified to take argument shouldFollowRedirects whether to
1836         follow redirect responses for a ping request.
1837         * loader/PingLoader.h:
1838         * platform/network/PingHandle.h: Add boolean m_shouldFollowRedirects. I grouped this boolean with
1839         the existing boolean, m_shouldUseCredentialStorage, as opposed to appending to the end of the class
1840         definition to avoid increasing object size as clang will coalesces the two bools into a single
1841         machine word. Override ResourceHandleClient::willSendRequest() and ResourceHandleClient::willSendRequestAsync()
1842         to follow a redirect, if applicable. 
1843
1844 2016-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1845
1846         [SOUP] Move global TLS errors handling from ResourceHandle to SoupNetworkSession
1847         https://bugs.webkit.org/show_bug.cgi?id=162910
1848
1849         Reviewed by Alex Christensen.
1850
1851         So that it will be shared with network session code. Also remove setHostAllowsAnyHTTPSCertificate() that we have
1852         never actually used.
1853
1854         * platform/network/ResourceHandle.h:
1855         * platform/network/soup/ResourceHandleSoup.cpp:
1856         (WebCore::tlsErrorsChangedCallback): Use SoupNetworkSession::checkTLSErrors().
1857         * platform/network/soup/SoupNetworkSession.cpp:
1858         (WebCore::HostTLSCertificateSet::add):
1859         (WebCore::HostTLSCertificateSet::contains):
1860         (WebCore::HostTLSCertificateSet::computeCertificateHash):
1861         (WebCore::clientCertificates):
1862         (WebCore::SoupNetworkSession::setShouldIgnoreTLSErrors):
1863         (WebCore::SoupNetworkSession::checkTLSErrors):
1864         (WebCore::SoupNetworkSession::allowSpecificHTTPSCertificateForHost):
1865         * platform/network/soup/SoupNetworkSession.h:
1866
1867 2016-10-05  Carlos Garcia Campos  <cgarcia@igalia.com>
1868
1869         [SOUP] Move request HTTP body handling to ResourceRequestSoup and simplify it
1870         https://bugs.webkit.org/show_bug.cgi?id=162891
1871
1872         Reviewed by Michael Catanzaro.
1873
1874         We are currently adding the HTTP body to the message in ResourceHandleSoup, but we could do it as part of the
1875         ResourceRequest::updateSoupMessage() method, since the HTTP body is indeed part of the request. The code can be
1876         also simplified, especially the handling of files, by using SharedBuffer that already mmaps the file when
1877         possible, instead of using GMappedFile API.
1878
1879         * platform/SharedBuffer.h: Add createSoupBuffer() method.
1880         * platform/network/soup/ResourceHandleSoup.cpp:
1881         (WebCore::createSoupMessageForHandleAndRequest):
1882         (WebCore::milisecondsSinceRequest): Deleted.
1883         (WebCore::ResourceHandle::didStartRequest): Deleted.
1884         (WebCore::startingCallback): Deleted.
1885         (WebCore::networkEventCallback): Deleted.
1886         (WebCore::ResourceHandle::start): Deleted.
1887         (WebCore::ResourceHandle::releaseForDownload): Deleted.
1888         (WebCore::ResourceHandle::timeoutFired): Deleted.
1889         * platform/network/soup/ResourceRequest.h:
1890         * platform/network/soup/ResourceRequestSoup.cpp:
1891         (WebCore::appendEncodedBlobItemToSoupMessageBody): Helper method to append the blob to the request message body.
1892         (WebCore::ResourceRequest::updateSoupMessageBody): Add HTTPBody to the request message body.
1893         (WebCore::ResourceRequest::updateSoupMessage): Call updateSoupMessageBody() to also update the body.
1894         * platform/soup/SharedBufferSoup.cpp:
1895         (WebCore::SharedBuffer::createSoupBuffer): Returns a new SoupBuffer for the SharedBuffer.
1896
1897 2016-10-04  Chris Dumez  <cdumez@apple.com>
1898
1899         Implement KeyboardEvent.code from the UI Event spec
1900         https://bugs.webkit.org/show_bug.cgi?id=149584
1901
1902         Reviewed by Darin Adler.
1903
1904         Add support for Keyboard.code attribute:
1905         - https://w3c.github.io/uievents/#dom-keyboardevent-code
1906         - https://w3c.github.io/uievents-code/
1907
1908         The feature is only enabled on Mac for now as the implementation is
1909         platform-specific and Mac only.
1910
1911         Test: fast/events/keyboardevent-code.html
1912
1913         * dom/KeyboardEvent.cpp:
1914         (WebCore::KeyboardEvent::KeyboardEvent):
1915         * dom/KeyboardEvent.h:
1916         * dom/KeyboardEvent.idl:
1917         * platform/PlatformKeyboardEvent.h:
1918         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1919         (WebCore::PlatformKeyboardEvent::code):
1920         (WebCore::PlatformKeyboardEvent::unmodifiedText): Deleted.
1921         * platform/mac/PlatformEventFactoryMac.h:
1922         * platform/mac/PlatformEventFactoryMac.mm:
1923         (WebCore::codeForKeyEvent):
1924         (WebCore::keyIdentifierForKeyEvent):
1925         * replay/SerializationMethods.cpp:
1926         (JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
1927         (JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
1928
1929 2016-10-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
1930
1931         The dragged image should be the current frame only of the animated image
1932         https://bugs.webkit.org/show_bug.cgi?id=162109
1933
1934         Reviewed by Tim Horton.
1935
1936         Instead of creating an NSImage with all the frames for the dragImage,
1937         create an NSImage with the current frame only.
1938
1939         * dom/DataTransferMac.mm:
1940         (WebCore::DataTransfer::createDragImage): Call snapshotNSImage() to create the dragImage.
1941         * editing/cocoa/HTMLConverter.mm:
1942         (fileWrapperForElement):  Call the Image function with its new name.
1943         * platform/graphics/BitmapImage.h:
1944         * platform/graphics/Image.h:
1945         (WebCore::Image::nsImage): Rename getNSImage() to nsImage().
1946         (WebCore::Image::snapshotNSImage): Returns the NSImage of the current frame.
1947         (WebCore::Image::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
1948         (WebCore::Image::getNSImage): Deleted.
1949         (WebCore::Image::getTIFFRepresentation): Deleted.
1950         * platform/graphics/mac/ImageMac.mm:
1951         (WebCore::BitmapImage::tiffRepresentation): Rename getTIFFRepresentation() to tiffRepresentation().
1952         (WebCore::BitmapImage::nsImage): Rename getNSImage() to nsImage().
1953         (WebCore::BitmapImage::snapshotNSImage): Returns the NSImage of the current frame.
1954         (WebCore::BitmapImage::getTIFFRepresentation): Deleted.
1955         (WebCore::BitmapImage::getNSImage): Deleted.
1956         * platform/mac/CursorMac.mm:
1957         (WebCore::createCustomCursor): Call snapshotNSImage() since the cursor does not animate anyway.
1958         * platform/mac/DragImageMac.mm:
1959         (WebCore::createDragImageFromImage): Use snapshotNSImage() for the dragImage.
1960         * platform/mac/PasteboardMac.mm:
1961         (WebCore::Pasteboard::write): Call the Image function with its new name.
1962
1963 2016-10-04  Andy Estes  <aestes@apple.com>
1964
1965         [iOS] Crash in WebResourceLoaderQuickLookDelegate when the client cancels the navigation to a QuickLook resource
1966         https://bugs.webkit.org/show_bug.cgi?id=162950
1967         <rdar://problem/23759114>
1968
1969         Reviewed by Brady Eidson.
1970
1971         When we receive data from QLPreviewConverter for the first time, we call
1972         ResourceLoader::didReceiveResponse() with the preview NSURLResponse from QuickLook. If the
1973         client decides to cancel this navigation in decidePolicyForResponse(),
1974         WebResourceLoaderQuickLookDelegate will end up with a null _resourceLoader after
1975         didReceiveResponse() returns. This change adds null checks in the methods that use
1976         _resourceLoader after calling -_sendDidReceiveResponseIfNecessary.
1977
1978         New API test: QuickLook.CancelNavigationAfterResponse
1979
1980         * platform/network/ios/QuickLook.mm:
1981         (-[WebResourceLoaderQuickLookDelegate connection:didReceiveDataArray:]): Changed to only
1982         call ResourceLoader::didReceiveDataArray() if _resourceLoader is non-null.
1983         (-[WebResourceLoaderQuickLookDelegate connection:didReceiveData:lengthReceived:]): Ditto for
1984         ResourceLoader::didReceiveData().
1985         (-[WebResourceLoaderQuickLookDelegate connection:didFailWithError:]): Ditto for
1986         ResourceLoader::didFail().
1987
1988 2016-10-04  Chris Dumez  <cdumez@apple.com>
1989
1990         Add support for KeyboardEvent.isComposing attribute
1991         https://bugs.webkit.org/show_bug.cgi?id=162921
1992
1993         Reviewed by Darin Adler.
1994
1995         Add support for KeyboardEvent.isComposing attribute:
1996         - https://www.w3.org/TR/uievents/#dom-keyboardevent-iscomposing
1997         - https://www.w3.org/TR/uievents/#ref-for-dom-keyboardevent-iscomposing-3
1998
1999         Manual test: https://jsfiddle.net/ay92sr08/9/
2000
2001         No new tests, extended existing tests.
2002
2003         * dom/KeyboardEvent.cpp:
2004         (WebCore::KeyboardEvent::KeyboardEvent):
2005         * dom/KeyboardEvent.h:
2006         * dom/KeyboardEvent.idl:
2007
2008 2016-10-03  Ryosuke Niwa  <rniwa@webkit.org>
2009
2010         ShadowRoot interface should have elementFromPoint
2011         https://bugs.webkit.org/show_bug.cgi?id=162882
2012
2013         Reviewed by Chris Dumez.
2014
2015         Add elementFromPoint to ShadowRoot's prototype as specified at:
2016         https://www.w3.org/TR/shadow-dom/#extensions-to-the-documentorshadowroot-mixin
2017         with changes proposed at https://github.com/w3c/csswg-drafts/issues/556
2018
2019         Added TreeScope::retargetToScope which implements 
2020
2021         This patch also factors DocumentOrShadowRoot.idl out of Document and ShadowRoot interfaces to better match
2022         the latest DOM specification: https://dom.spec.whatwg.org/#mixin-documentorshadowroot
2023
2024         Test: fast/shadow-dom/Document-prototype-elementFromPoint.html
2025
2026         * CMakeLists.txt:
2027         * DerivedSources.make:
2028         * WebCore.xcodeproj/project.pbxproj:
2029         * dom/Document.cpp:
2030         (WebCore::Document::nodeFromPoint): Moved to TreeScope.
2031         (WebCore::Document::elementFromPoint): Moved to TreeScope.
2032         * dom/Document.h:
2033         * dom/Document.idl: Moved elementFromPoint and activeElement to DocumentOrShadowRoot.idl.
2034         * dom/DocumentOrShadowRoot.idl: Added.
2035         * dom/EventPath.cpp:
2036         (WebCore::RelatedNodeRetargeter::checkConsistency): Use newly added TreeScope::retargetToScope.
2037         * dom/ShadowRoot.idl: Moved activeElement to DocumentOrShadowRoot.idl.
2038         * dom/TreeScope.cpp:
2039         (WebCore::TreeScope::retargetToScope): Added. Implements https://dom.spec.whatwg.org/#retarget efficiently.
2040         Instead of checking whether A (node) is a shadow-including inclusive ancestor of B (this scope) at each
2041         parent, find the lowest ancestor which contains both A and B, and return the self-inclusive ancestor of B
2042         in that tree. To find the lowest common ancestor in O(n), traverse all ancestors of A and B separately and
2043         do a top-down traversal. The last tree scope in which A's ancestor and B's ancestor match is the lowest
2044         common ancestor.
2045         (WebCore::TreeScope::nodeFromPoint): Moved from Document.
2046         (WebCore::TreeScope::elementFromPoint): Moved from Document. Use retargetToScope and parentInComposedTree
2047         instead of parentNode and ancestorInThisScope to match the semantics proposed in
2048         https://github.com/w3c/csswg-drafts/issues/556
2049         * dom/TreeScope.h:
2050
2051 2016-10-04  Myles C. Maxfield  <mmaxfield@apple.com>
2052
2053         font-family: cursive should map to KaiTi in Chinese
2054         https://bugs.webkit.org/show_bug.cgi?id=162889
2055         <rdar://problem/28363547>
2056
2057         Reviewed by Tim Horton.
2058
2059         According to Bobby Tung, this is a better mapping. Previously, we were
2060         relying on the system fallback mechanism. However, an explicit mapping
2061         is more robust.
2062
2063         Test: fast/text/cursive-zh.html
2064
2065         * page/cocoa/SettingsCocoa.mm:
2066         (WebCore::Settings::initializeDefaultFontFamilies):
2067
2068 2016-10-04  Alex Christensen  <achristensen@webkit.org>
2069
2070         URLParser: query-only URLs relative to file URLs should just add a query
2071         https://bugs.webkit.org/show_bug.cgi?id=162888
2072
2073         Reviewed by Tim Horton.
2074
2075         Covered by new API tests.
2076
2077         * platform/URLParser.cpp:
2078         (WebCore::URLParser::parse):
2079         Like bug 206749 but with queries instead of fragments.
2080
2081 2016-10-04  Alex Christensen  <achristensen@webkit.org>
2082
2083         URLParser should match URL::parse and other browsers when parsing a URL containing only scheme://
2084         https://bugs.webkit.org/show_bug.cgi?id=162909
2085
2086         Reviewed by Tim Horton.
2087
2088         If there's no host in this case we shouldn't fail, but rather make a valid URL with the // in the path.
2089         This matches Chrome, Firefox, and Safari's behavior.
2090         Covered by API tests.
2091
2092         * platform/URLParser.cpp:
2093         (WebCore::URLParser::parse):
2094
2095 2016-10-04  Brent Fulgham  <bfulgham@apple.com>
2096
2097         Unreviewed build fix after r206773.
2098
2099         Exclude Direct2D definitions when building for normal CG Windows.
2100
2101         * platform/graphics/GraphicsContext.h:
2102
2103 2016-10-04  Yusuke Suzuki  <utatane.tea@gmail.com>
2104
2105         [DOMJIT] Introduce DOMJIT::GetterSetter to tell JIT information
2106         https://bugs.webkit.org/show_bug.cgi?id=162916
2107
2108         Reviewed by Filip Pizlo.
2109
2110         * ForwardingHeaders/domjit/DOMJITGetterSetter.h: Added.
2111         * PlatformEfl.cmake:
2112         * PlatformGTK.cmake:
2113         * PlatformMac.cmake:
2114         * PlatformWin.cmake:
2115
2116 2016-10-04  Chris Dumez  <cdumez@apple.com>
2117
2118         Return null when window.open() is popup blocked
2119         https://bugs.webkit.org/show_bug.cgi?id=162897
2120
2121         Reviewed by Michael Catanzaro.
2122
2123         The return value of window.open() when the popup is blocked should be null:
2124         - https://github.com/whatwg/html/pull/1854
2125         - https://github.com/whatwg/html/issues/1851
2126
2127         Firefox / Edge return null.
2128
2129         No new tests, rebaselined existing tests.
2130
2131         * bindings/js/JSDOMWindowCustom.cpp:
2132         (WebCore::JSDOMWindow::open):
2133
2134 2016-10-04  Chris Dumez  <cdumez@apple.com>
2135
2136         [Web IDL] Add support for dictionary inheritance
2137         https://bugs.webkit.org/show_bug.cgi?id=162907
2138
2139         Reviewed by Sam Weinig.
2140
2141         Add support for dictionary inheritance to our Web IDL parser and
2142         bindings generator. Leverage this new support for EventTarget's
2143         EventListenerOptions / AddEventListenerOptions dictionaries, in
2144         order to match the DOM specification:
2145         - https://dom.spec.whatwg.org/#interface-eventtarget
2146
2147         Also update the bindings generator to convert the dictionary
2148         members in lexicographical order, as per:
2149         - https://heycam.github.io/webidl/#es-dictionary (Step 5.1)
2150
2151         No new tests, rebaselined bindings tests.
2152
2153         * bindings/scripts/CodeGenerator.pm:
2154         (GetDictionaryByName):
2155         * bindings/scripts/CodeGeneratorJS.pm:
2156         (GenerateDictionaryImplementationContent):
2157         * bindings/scripts/IDLParser.pm:
2158         (parseDictionary):
2159         * bindings/scripts/test/JS/JSTestObj.cpp:
2160         (WebCore::convertDictionary<TestObj::Dictionary>):
2161         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
2162         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
2163         (WebCore::convertDictionary<AlternateDictionaryName>):
2164         (WebCore::convertDictionary<TestObj::ParentDictionary>):
2165         (WebCore::convertDictionary<TestObj::ChildDictionary>):
2166         * bindings/scripts/test/TestObj.idl:
2167         * dom/EventTarget.idl:
2168
2169 2016-10-04  Brent Fulgham  <bfulgham@apple.com>
2170
2171         [Win][Direct2D] Add initial D2D GraphicsContext implementation
2172         https://bugs.webkit.org/show_bug.cgi?id=162917
2173
2174         Reviewed by Dean Jackson.
2175
2176         This patch lands a set of new files that implement the GraphicsContext
2177         features on Windows using Direct2D.
2178
2179         No new tests until complete backend lands.
2180
2181         * platform/graphics/Color.h: Add new casting operator.
2182         * platform/graphics/FloatSize.h: Ditto.
2183         * platform/graphics/GraphicsContext.cpp: Update for Direct2D
2184         implementation.
2185         * platform/graphics/GraphicsContext.h:
2186         * platform/graphics/win/ColorDirect2D.cpp:
2187         (WebCore::Color::operator D2D1_VECTOR_4F): Added.
2188         * platform/graphics/win/GraphicsContextCGWin.cpp: Add compiler
2189         guard to avoid building when using Direct2D.
2190         * platform/graphics/win/GraphicsContextDirect2D.cpp: Added.
2191         * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h: Added.
2192         * platform/graphics/win/GraphicsContextWin.cpp: Update for Direct2D
2193         includes.
2194         * platform/graphics/win/TransformationMatrixDirect2D.cpp: Fix comment.
2195
2196 2016-10-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2197
2198         [SOUP] Remove SSLPolicyFlags from SoupNetworkSession
2199         https://bugs.webkit.org/show_bug.cgi?id=162906
2200
2201         Reviewed by Michael Catanzaro.
2202
2203         All soup based ports are setting SSLUseSystemCAFile flag unconditionally, so we can just use that when creating
2204         the session like we do for all other construct parameters.
2205
2206         * platform/network/soup/SoupNetworkSession.cpp:
2207         (WebCore::SoupNetworkSession::createTestingSession):
2208         (WebCore::SoupNetworkSession::setupLogger):
2209         (WebCore::SoupNetworkSession::SoupNetworkSession): Deleted.
2210         (WebCore::SoupNetworkSession::clearOldSoupCache): Deleted.
2211         (WebCore::SoupNetworkSession::setHTTPProxy): Deleted.
2212         * platform/network/soup/SoupNetworkSession.h:
2213         (WebCore::SoupNetworkSession::soupSession): Deleted.
2214
2215 2016-10-04  Wenson Hsieh  <wenson_hsieh@apple.com>
2216
2217         Media controls are displayed in the incorrect state momentarily after switching between tabs playing media
2218         https://bugs.webkit.org/show_bug.cgi?id=162766
2219         <rdar://problem/28533523>
2220
2221         Reviewed by Jer Noble.
2222
2223         When showing Now Playing controls for a media session, we should first set up the Now Playing info and
2224         playback state before telling MediaRemote to make the session visible. This is WebKit work in ensuring that
2225         when switching Now Playing sessions by switching tabs, we do not first display an invalid Now Playing state
2226         before updating to the expected state.
2227
2228         Adds 2 new WebKit API tests in NowPlayingControlsTests: NowPlayingControlsHideAfterShowingClearsInfo and
2229         NowPlayingControlsClearInfoAfterSessionIsNoLongerValid.
2230
2231         * platform/audio/PlatformMediaSessionManager.h:
2232         (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingTitle):
2233         (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingDuration):
2234         (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingElapsedTime):
2235         (WebCore::PlatformMediaSessionManager::hasActiveNowPlayingSession): Deleted.
2236         * platform/audio/mac/MediaSessionManagerMac.h:
2237         * platform/audio/mac/MediaSessionManagerMac.mm:
2238         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
2239
2240 2016-10-04  Youenn Fablet  <youenn@apple.com>
2241
2242         [Fetch API] ReadableStream should be errored with TypeError values
2243         https://bugs.webkit.org/show_bug.cgi?id=162895
2244
2245         Reviewed by Alex Christensen.
2246
2247         Test: imported/w3c/web-platform-tests/fetch/api/basic/error-after-response.html
2248
2249         * Modules/fetch/FetchResponse.cpp:
2250         (WebCore::FetchResponse::BodyLoader::didFail): Removing FIXME.
2251         * bindings/js/ReadableStreamDefaultController.h:
2252         (WebCore::ReadableStreamDefaultController::error<String>): Erroring with TypeError values.
2253
2254 2016-10-03  Chris Dumez  <cdumez@apple.com>
2255
2256         Bindings do not throw a TypeError if a required dictionary member is missing
2257         https://bugs.webkit.org/show_bug.cgi?id=162734
2258
2259         Reviewed by Geoffrey Garen.
2260
2261         Bindings should throw a TypeError if a required dictionary member is missing.
2262         For example, if there is a "required long id" member in a dictionary that is
2263         missing, our bindings would prevously pass 0 to the implementation instead
2264         of throwing a TypeError.
2265
2266         Relevant specification:
2267         - https://heycam.github.io/webidl/#es-dictionary
2268
2269         I aligned our bindings generator implementation with the specification,
2270         except for the support for dictionary inheritance that is still missing
2271         and will be addressed in a follow-up patch.
2272
2273         No new tests, I rebaselined the bindings tests and this is already covered
2274         by fast/events/touch/touch-constructor.html on iOS.
2275
2276         * bindings/js/JSCustomElementRegistryCustom.cpp:
2277         (WebCore::JSCustomElementRegistry::define):
2278         * bindings/js/JSDOMConvert.h:
2279         (WebCore::convert): Deleted.
2280         (WebCore::Converter<bool>::convert): Deleted.
2281         (WebCore::Converter<String>::convert): Deleted.
2282         (WebCore::Converter<IDLDOMString>::convert): Deleted.
2283         (WebCore::Converter<IDLUSVString>::convert): Deleted.
2284         (WebCore::Converter<JSC::JSValue>::convert): Deleted.
2285         (WebCore::Converter<int8_t>::convert): Deleted.
2286         (WebCore::Converter<uint8_t>::convert): Deleted.
2287         * bindings/scripts/CodeGeneratorJS.pm:
2288         (GenerateDictionaryImplementationContent):
2289         * bindings/scripts/test/JS/JSTestObj.cpp:
2290         (WebCore::convertDictionary<TestObj::Dictionary>):
2291         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
2292         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
2293         (WebCore::convertDictionary<AlternateDictionaryName>):
2294
2295 2016-10-03  Zalan Bujtas  <zalan@apple.com>
2296
2297         [ListItems] Render tree should be all clean by the end of FrameView::layout().
2298         https://bugs.webkit.org/show_bug.cgi?id=162832
2299
2300         Reviewed by Simon Fraser.
2301
2302         List item markers are inserted into the tree during layout, right before laying out
2303         the list item (that's a big FIXME). At this point we already know what part of the tree
2304         needs to be laid out. Inserting a list item marker does not expand this dirty area.
2305         However whenever we insert a new renderer into the tree, we call setNeedsLayout on the contining block chain.
2306         In certain cases (floating renderers), it could potentially trigger some unintentional markings
2307         and we return from FrameView::layout() with a dirty subtree.
2308
2309         This patch preemptively marks the list item and its marker dirty so that
2310         when the marker is getting inserted into the tree, we stop the marking at the parent.
2311
2312         Not testable.
2313
2314         * rendering/RenderListItem.cpp:
2315         (WebCore::RenderListItem::insertOrMoveMarkerRendererIfNeeded):
2316
2317 2016-10-03  Myles C. Maxfield  <mmaxfield@apple.com>
2318
2319         Implement rendering of font-variation-settings
2320         https://bugs.webkit.org/show_bug.cgi?id=162782
2321
2322         Reviewed by Zalan Bujtas.
2323
2324         (Re-landing after fixing tests.)
2325
2326         Because the heavy lifting for font-variation-settings is done by CoreText, 
2327         this patch is fairly minimal. It simply hooks up the CSS property to CoreText. 
2328
2329         There is an existing bug in CoreText where variations inside fonts do not 
2330         survive the addition of a cascade list. Therefore, FontPlatformData::ctFont() 
2331         needs to work around this (conditionally) by resupplying the variation at 
2332         the same time as the cascade list. The CoreText bug is <rdar://problem/28449441>. 
2333
2334         Tests: fast/text/variations/duplicate.html
2335                fast/text/variations/exist.html
2336                fast/text/variations/inheritance.html
2337                fast/text/variations/order.html
2338                fast/text/variations/outofbounds.html
2339
2340         * platform/graphics/FontCache.h:
2341         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2342         (WebCore::preparePlatformFont):
2343         (WebCore::fontWithFamily):
2344         (WebCore::FontCache::createFontPlatformData):
2345         (WebCore::FontCache::systemFallbackForCharacters):
2346         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2347         (WebCore::cascadeToLastResortAttributesDictionary):
2348         (WebCore::cascadeToLastResortAndVariationsFontDescriptor):
2349         (WebCore::FontPlatformData::ctFont):
2350         (WebCore::cascadeToLastResortFontDescriptor): Deleted.
2351         * platform/graphics/mac/FontCustomPlatformData.cpp:
2352         (WebCore::FontCustomPlatformData::fontPlatformData):
2353         * rendering/RenderThemeIOS.mm:
2354         (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
2355
2356 2016-10-03  Alex Christensen  <achristensen@webkit.org>
2357
2358         URLParser should strip tabs at all locations
2359         https://bugs.webkit.org/show_bug.cgi?id=162836
2360
2361         Reviewed by Geoffrey Garen.
2362
2363         Covered by adding tabs to each location of each API test
2364         except tests that test the encoding of surrogate pairs,
2365         because inserting a tab between the pairs changes the encoding.
2366
2367         * platform/URLParser.cpp:
2368         (WebCore::URLParser::takesTwoAdvancesUntilEnd):
2369         (WebCore::URLParser::parse):
2370         (WebCore::URLParser::parseIPv4Number):
2371         (WebCore::URLParser::parseIPv4Host):
2372         * platform/URLParser.h:
2373
2374 2016-10-03  Antti Koivisto  <antti@apple.com>
2375
2376         Remove Document::elementSheet()
2377         https://bugs.webkit.org/show_bug.cgi?id=162876
2378
2379         Reviewed by Andreas Kling.
2380
2381         This is a Document owned stylesheet that exists as a context for parsing element inline style.
2382         It never contains any rules and is generally confusing.
2383
2384         This patch removes the requirement for a stylesheet to be present for CSSParser to operate in
2385         the correct context. Inline style is now parsed without stylesheet and a context object is
2386         passed instead.
2387
2388         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2389         (WebCore::root):
2390         * bindings/js/JSCSSStyleDeclarationCustom.h:
2391         (WebCore::root): Deleted.
2392         * css/PropertySetCSSStyleDeclaration.cpp:
2393         (WebCore::PropertySetCSSStyleDeclaration::setCssText):
2394         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
2395         (WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal):
2396         (WebCore::PropertySetCSSStyleDeclaration::cssParserContext):
2397         (WebCore::StyleRuleCSSStyleDeclaration::parentStyleSheet):
2398         (WebCore::StyleRuleCSSStyleDeclaration::cssParserContext):
2399         (WebCore::InlineCSSStyleDeclaration::parentStyleSheet):
2400         (WebCore::InlineCSSStyleDeclaration::cssParserContext):
2401         * css/PropertySetCSSStyleDeclaration.h:
2402         (WebCore::PropertySetCSSStyleDeclaration::didMutate): Deleted.
2403         * css/StyleProperties.cpp:
2404         (WebCore::MutableStyleProperties::setProperty):
2405         (WebCore::MutableStyleProperties::setCustomProperty):
2406         (WebCore::MutableStyleProperties::parseDeclaration):
2407         * css/parser/CSSParser.cpp:
2408         (WebCore::CSSParser::parseValue):
2409         (WebCore::CSSParser::parseCustomPropertyValue):
2410         (WebCore::CSSParser::parseInlineStyleDeclaration):
2411         * css/parser/CSSParser.h:
2412         * css/parser/CSSParserImpl.cpp:
2413         (WebCore::CSSParserImpl::parseInlineStyleDeclaration):
2414         * dom/Document.cpp:
2415         (WebCore::Document::~Document):
2416         (WebCore::Document::updateBaseURL):
2417         (WebCore::Document::usesStyleBasedEditability):
2418         (WebCore::Document::setHasElementUsingStyleBasedEditability):
2419         (WebCore::Document::elementSheet): Deleted.
2420         * dom/Document.h:
2421         * dom/StyledElement.cpp:
2422         (WebCore::StyledElement::setInlineStyleFromString):
2423         (WebCore::StyledElement::invalidateStyleAttribute):
2424
2425             The usesStyleBasedEditability bit used to be set via the elementSheet. Instead check for it after inline style mutations.
2426
2427         (WebCore::StyledElement::setInlineStyleProperty):
2428         (WebCore::StyledElement::addPropertyToPresentationAttributeStyle):
2429         * dom/StyledElement.h:
2430         (WebCore::StyledElement::invalidateStyleAttribute): Deleted.
2431         * inspector/InspectorStyleSheet.cpp:
2432         (WebCore::InspectorStyleSheetForInlineStyle::getStyleAttributeRanges):
2433         * svg/SVGAnimateElementBase.cpp:
2434         (WebCore::applyCSSPropertyToTarget):
2435
2436 2016-10-03  Brent Fulgham  <bfulgham@apple.com>
2437
2438         Avoid null dereference when changing focus in design mode.
2439         https://bugs.webkit.org/show_bug.cgi?id=162877
2440         <rdar://problem/28061261>
2441
2442         Reviewed by Chris Dumez.
2443
2444         The bare m_frame pointer in DOMWindow can be cleared when setting focus to a new element. Check
2445         that the m_frame pointer is non-null before using it after calling a routine that could
2446         clear the pointer value.
2447
2448         Test: fast/frames/iframe-focus-crash.html
2449
2450         * page/DOMWindow.cpp:
2451         (WebCore::DOMWindow::focus): Check that the pointer is still non-null after setting the
2452         current focused element to nullptr.
2453
2454 2016-10-03  Chris Dumez  <cdumez@apple.com>
2455
2456         Add support for KeyboardEvent.key attribute
2457         https://bugs.webkit.org/show_bug.cgi?id=36267
2458
2459         Reviewed by Darin Adler.
2460
2461         Add support for KeyboardEvent.key attribute:
2462         - https://w3c.github.io/uievents/#dom-keyboardevent-key
2463
2464         This is behind a compile time flag that is only enabled on Mac and
2465         iOS and the implementation is still missing for other platforms.
2466
2467         Test: fast/events/keyboardevent-key.html
2468
2469         * dom/KeyboardEvent.cpp:
2470         (WebCore::KeyboardEvent::KeyboardEvent):
2471         * dom/KeyboardEvent.h:
2472         * dom/KeyboardEvent.idl:
2473         * platform/PlatformKeyboardEvent.h:
2474         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2475         (WebCore::PlatformKeyboardEvent::key):
2476         * platform/cocoa/KeyEventCocoa.h:
2477         * platform/cocoa/KeyEventCocoa.mm:
2478         (WebCore::keyForCharCode):
2479         * platform/ios/PlatformEventFactoryIOS.h:
2480         * platform/ios/PlatformEventFactoryIOS.mm:
2481         (WebCore::keyForKeyEvent):
2482         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
2483         * platform/mac/PlatformEventFactoryMac.h:
2484         * platform/mac/PlatformEventFactoryMac.mm:
2485         (WebCore::keyForKeyEvent):
2486         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
2487         (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): Deleted.
2488         * replay/SerializationMethods.cpp:
2489         (JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
2490         (JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
2491
2492 2016-10-03  Chris Dumez  <cdumez@apple.com>
2493
2494         Add support for KeyboardEvent.key attribute
2495         https://bugs.webkit.org/show_bug.cgi?id=36267
2496
2497         Reviewed by Darin Adler.
2498
2499         Add support for KeyboardEvent.key attribute:
2500         - https://w3c.github.io/uievents/#dom-keyboardevent-key
2501
2502         This is behind a compile time flag that is only enabled on Mac and
2503         iOS and the implementation is still missing for other platforms.
2504
2505         Test: fast/events/keyboardevent-key.html
2506
2507         * dom/KeyboardEvent.cpp:
2508         (WebCore::KeyboardEvent::KeyboardEvent):
2509         * dom/KeyboardEvent.h:
2510         * dom/KeyboardEvent.idl:
2511         * platform/PlatformKeyboardEvent.h:
2512         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2513         (WebCore::PlatformKeyboardEvent::key):
2514         * platform/cocoa/KeyEventCocoa.h:
2515         * platform/cocoa/KeyEventCocoa.mm:
2516         (WebCore::keyForCharCode):
2517         * platform/ios/PlatformEventFactoryIOS.h:
2518         * platform/ios/PlatformEventFactoryIOS.mm:
2519         (WebCore::keyForKeyEvent):
2520         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
2521         * platform/mac/PlatformEventFactoryMac.h:
2522         * platform/mac/PlatformEventFactoryMac.mm:
2523         (WebCore::keyForKeyEvent):
2524         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
2525         (WebCore::PlatformWheelEventBuilder::PlatformWheelEventBuilder): Deleted.
2526         * replay/SerializationMethods.cpp:
2527         (JSC::EncodingTraits<PlatformKeyboardEvent>::encodeValue):
2528         (JSC::EncodingTraits<PlatformKeyboardEvent>::decodeValue):
2529
2530 2016-10-03  Alex Christensen  <achristensen@webkit.org>
2531
2532         URLParser: fragment-only URLs relative to file URLs should just add a fragment
2533         https://bugs.webkit.org/show_bug.cgi?id=162871
2534
2535         Reviewed by Geoffrey Garen.
2536
2537         Covered by new API tests.
2538
2539         * platform/URLParser.cpp:
2540         (WebCore::URLParser::parse):
2541         Instead of adding ///# after copying the base URL to the query, just add an #.
2542
2543 2016-10-03  Antoine Quint  <graouts@apple.com>
2544
2545         [Modern Media Controls] LayoutItem and Button classes
2546         https://bugs.webkit.org/show_bug.cgi?id=162868
2547         <rdar://problem/28590166>
2548
2549         Reviewed by Dean Jackson.
2550
2551         We introduce the new Button class and its parent class LayoutItem. We will subclass Button
2552         a lot in coming patches, as it provides a way to create a button and provide a delegate to
2553         respond to UI events via the `uiDelegate` property. A Button extends a LayoutItem, another
2554         class that we'll subclass heavily in coming patches, which is simply a LayoutNode with a
2555         `layoutDelegate` which allows to set the node's `layoutTraits`, a bit-mask allowing to
2556         specify layout attributes such as the platform and playback styles. 
2557
2558         Tests: media/modern-media-controls/button/button.html
2559                media/modern-media-controls/layout-item/layout-item.html
2560
2561         * Modules/modern-media-controls/controls/button.css: Added.
2562         (button):
2563         * Modules/modern-media-controls/controls/button.js: Added.
2564         (Button):
2565         (Button.prototype.get enabled):
2566         (Button.prototype.set enabled):
2567         (Button.prototype.handleEvent):
2568         (Button.prototype._handleUIEvent):
2569         * Modules/modern-media-controls/controls/layout-item.js: Added.
2570         (LayoutItem.prototype.get layoutTraits):
2571         (LayoutItem):
2572
2573 2016-10-03  Andy Estes  <aestes@apple.com>
2574
2575         ASSERTION FAILED: url.containsOnlyASCII() in WebCore::checkEncodedString() when parsing an invalid CSS cursor URL
2576         https://bugs.webkit.org/show_bug.cgi?id=162763
2577         <rdar://problem/28572758>
2578
2579         Reviewed by Youenn Fablet.
2580
2581         CSSCursorImageValue copies the URL of its underlying CSSImageValue by using the
2582         ParsedURLString URL constructor on the String returned by CSSImageValue::url(). While
2583         CSSImageValues were always being constructed from a URL implicitly converted to a String,
2584         nothing ensured that the URL was valid. For invalid URLs, URL::string() returns the string
2585         it was constructed with, which might still represent a relative URL or contain non-ASCII
2586         characters, violating the preconditions of the ParsedURLString URL constructor and causing
2587         an assertion to fail in Debug builds.
2588
2589         Fix this by having CSSImageValue store its image URL using a WebCore::URL rather than a
2590         String. CSSCursorImageValue can then copy this URL instead of attempting to re-parse a
2591         possibly-invalid URL string.
2592
2593         Test: fast/css/cursor-with-invalid-url.html
2594
2595         * css/CSSCursorImageValue.cpp:
2596         (WebCore::CSSCursorImageValue::CSSCursorImageValue): Copied m_imageValue.url() into
2597         m_originalURL instead of using the ParsedURLString URL constructor, since
2598         CSSImageValue::url() now returns a WebCore::URL.
2599         (WebCore::CSSCursorImageValue::loadImage): Created a URL from cursorElement->href() by
2600         calling Document::completeURL().
2601         * css/CSSImageValue.cpp:
2602         (WebCore::CSSImageValue::CSSImageValue): Changed to take a URL&& instead of a const String&.
2603         (WebCore::CSSImageValue::loadImage): Stopped calling Document::completeURL(), since m_url is
2604         now a WebCore::URL.
2605         * css/CSSImageValue.h: Changed url() to return a const URL&, and changed m_url to be a URL.
2606         * html/HTMLBodyElement.cpp:
2607         (WebCore::HTMLBodyElement::collectStyleForPresentationAttribute): Removed a call to
2608         URL::string().
2609         * html/HTMLTableElement.cpp:
2610         (WebCore::HTMLTableElement::collectStyleForPresentationAttribute): Ditto.
2611         * html/HTMLTablePartElement.cpp:
2612         (WebCore::HTMLTablePartElement::collectStyleForPresentationAttribute): Ditto.
2613
2614 2016-10-03  Zalan Bujtas  <zalan@apple.com>
2615
2616         Log an error to stderr when FrameView::layout() fails to clean all the renderers.
2617         https://bugs.webkit.org/show_bug.cgi?id=162835
2618
2619         Reviewed by Simon Fraser.
2620
2621         We've come across multiple layout/painting bugs caused by renderers left dirty
2622         after FrameView::layout(). This patch helps catching such issues early.
2623         Once all the blocking bugs are fixed (webkit.org/b/162835), logging should be replaced with ASSERT(). 
2624
2625         Not testable.
2626
2627         * page/FrameView.cpp:
2628         (WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker):
2629         (WebCore::FrameView::layout):
2630
2631 2016-10-03  Brent Fulgham  <bfulgham@apple.com>
2632
2633         [Win][Direct2D] Add D2D Bitmap Image handling code
2634         https://bugs.webkit.org/show_bug.cgi?id=162761
2635
2636         Reviewed by Dean Jackson.
2637
2638         This patch lands a set of new files that implement
2639         Image and BitmapImage features on Windows using
2640         Direct2D.
2641
2642         The desired ID2D1RenderTarget handle is needed by the
2643         image decoder so that it can load the resulting bitmap
2644         into the GPU.
2645
2646         No new tests until complete backend lands.
2647
2648         * platform/graphics/BitmapImage.cpp:
2649         (WebCore::BitmapImage::draw): Tell the Direct2D image decoder
2650         which render target to use.
2651         * platform/graphics/BitmapImage.h:
2652         * platform/graphics/ImageBuffer.cpp:
2653         * platform/graphics/ImageBuffer.h:
2654         * platform/graphics/ImageBufferData.h:
2655         * platform/graphics/ImageFrameCache.cpp:
2656         (WebCore::ImageFrameCache::setRenderTarget): Added.
2657         * platform/graphics/ImageFrameCache.h:
2658         (WebCore::ImageFrameCache::decoder): Added.
2659         * platform/graphics/ImageSource.cpp:
2660         * platform/graphics/ImageSource.h:
2661         (WebCore::ImageSource::setRenderTarget):
2662         * platform/graphics/win/ImageBufferDataDirect2D.cpp: Added.
2663         * platform/graphics/win/ImageBufferDataDirect2D.h: Added.
2664         * platform/graphics/win/ImageBufferDirect2D.cpp: Added.
2665         * platform/graphics/win/ImageCGWin.cpp:
2666         * platform/graphics/win/ImageDecoderDirect2D.cpp: Added.
2667         * platform/graphics/win/ImageDecoderDirect2D.h: Added.
2668         * platform/graphics/win/ImageDirect2D.cpp: Added.
2669         * platform/graphics/win/NativeImageDirect2D.cpp: Added.
2670
2671 2016-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2672
2673         [SOUP] Remove unused methods toSoupMessage from ResourceRequest/Response
2674         https://bugs.webkit.org/show_bug.cgi?id=162867
2675
2676         Reviewed by Sergio Villar Senin.
2677
2678         * platform/network/soup/ResourceRequest.h:
2679         * platform/network/soup/ResourceRequestSoup.cpp:
2680         (WebCore::ResourceRequest::updateSoupMessage):
2681         (WebCore::ResourceRequest::updateFromSoupMessage): Deleted.
2682         * platform/network/soup/ResourceResponse.h:
2683         * platform/network/soup/ResourceResponseSoup.cpp:
2684         (WebCore::ResourceResponse::updateFromSoupMessage): Deleted.
2685
2686 2016-10-03  Youenn Fablet  <youenn@apple.com>
2687
2688         Remove FetchBody::m_isEmpty
2689         https://bugs.webkit.org/show_bug.cgi?id=162857
2690
2691         Reviewed by Alex Christensen.
2692
2693         No change of behavior.
2694
2695         Moving handling of null bodies in FetchBodyOwner, by having an Optional<FetchBody> in FetchBodyOwner.
2696         Moving storage of m_contentType in FetchBodyOwner.
2697
2698         Moving header storage from FetchResponse/FetchRequest to FetchBodyOwner, as it helps updating m_contentType.
2699
2700         * Modules/fetch/FetchBody.cpp: removing m_isEmpty and m_contentType.
2701         (WebCore::FetchBody::extract): Computes the default content-type which is stored in FetchBodyOwner.
2702         (WebCore::FetchBody::blob):
2703         (WebCore::FetchBody::consume):
2704         (WebCore::FetchBody::consumeAsStream):
2705         (WebCore::FetchBody::loadingSucceeded):
2706         (WebCore::FetchBody::bodyForInternalRequest):
2707         (WebCore::FetchBody::clone):
2708         * Modules/fetch/FetchBody.h:
2709         (WebCore::FetchBody::loadingBody):
2710         (WebCore::FetchBody::FetchBody):
2711         * Modules/fetch/FetchBodyOwner.cpp:
2712         (WebCore::FetchBodyOwner::FetchBodyOwner):
2713         (WebCore::FetchBodyOwner::stop):
2714         (WebCore::FetchBodyOwner::arrayBuffer):
2715         (WebCore::FetchBodyOwner::blob):
2716         (WebCore::FetchBodyOwner::cloneBody): Needs to clone m_contentType as well.
2717         (WebCore::FetchBodyOwner::extractBody):
2718         (WebCore::FetchBodyOwner::updateContentType):
2719         (WebCore::FetchBodyOwner::consumeOnceLoadingFinished):
2720         (WebCore::FetchBodyOwner::formData):
2721         (WebCore::FetchBodyOwner::json):
2722         (WebCore::FetchBodyOwner::text):
2723         (WebCore::FetchBodyOwner::loadBlob):
2724         (WebCore::FetchBodyOwner::blobLoadingSucceeded):
2725         (WebCore::FetchBodyOwner::blobLoadingFailed):
2726         (WebCore::FetchBodyOwner::finishBlobLoading):
2727         * Modules/fetch/FetchBodyOwner.h:
2728         (WebCore::FetchBodyOwner::body):
2729         (WebCore::FetchBodyOwner::isBodyNull):
2730         * Modules/fetch/FetchRequest.cpp:
2731         (WebCore::FetchRequest::setBody):
2732         (WebCore::FetchRequest::internalRequest):
2733         (WebCore::FetchRequest::clone):
2734         * Modules/fetch/FetchRequest.h:
2735         (WebCore::FetchRequest::FetchRequest):
2736         * Modules/fetch/FetchResponse.cpp:
2737         (WebCore::FetchResponse::initializeWith):
2738         (WebCore::FetchResponse::FetchResponse):
2739         (WebCore::FetchResponse::cloneForJS):
2740         (WebCore::FetchResponse::fetch):
2741         (WebCore::FetchResponse::BodyLoader::didSucceed):
2742         (WebCore::FetchResponse::BodyLoader::didReceiveResponse):
2743         (WebCore::FetchResponse::BodyLoader::start):
2744         (WebCore::FetchResponse::createReadableStreamSource):
2745         * Modules/fetch/FetchResponse.h:
2746
2747 2016-10-03  Andy Estes  <aestes@apple.com>
2748
2749         ASSERTION FAILED: result in WebCore::CSSParser::parseURI
2750         https://bugs.webkit.org/show_bug.cgi?id=141638
2751         <rdar://problem/27709952>
2752
2753         Reviewed by Andreas Kling.
2754
2755         CSSParser::parseURIInternal() failed to parse unquoted URLs with Unicode escape sequences
2756         greater than 0xFF, even when the destination character type was multi-byte. Fixed by
2757         checking the size of DestCharacterType instead of SrcCharacterType.
2758
2759         Updated fast/css/url-with-multi-byte-unicode-escape.html to test for an unquoted URL.
2760
2761         * css/parser/CSSParser.cpp:
2762         (WebCore::CSSParser::parseURIInternal): For code points greater than 0xFF, only returned
2763         false if sizeof(DestCharacterType) == 1.
2764
2765 2016-10-03  Alex Christensen  <achristensen@webkit.org>
2766
2767         URLParser: empty relative URLs should not copy fragment from the base URL
2768         https://bugs.webkit.org/show_bug.cgi?id=162864
2769
2770         Reviewed by Chris Dumez.
2771
2772         Covered by new API tests.
2773
2774         * platform/URL.cpp:
2775         (WebCore::URL::removeFragmentIdentifier):
2776         Optimize removing fragments, now that it happens more often. We don't need to reparse, 
2777         because the result will always be equal to just a substring when removing the fragment at the end.
2778         * platform/URLParser.cpp:
2779         (WebCore::URLParser::copyASCIIStringUntil):
2780         (WebCore::URLParser::copyURLPartsUntil):
2781         (WebCore::containsOnlyC0ControlOrSpace):
2782         (WebCore::URLParser::URLParser):
2783         (WebCore::URLParser::parse):
2784         * platform/URLParser.h:
2785         Because we are not copying the fragment, we can simplify and remove some unreachable code.
2786
2787 2016-10-03  Chris Dumez  <cdumez@apple.com>
2788
2789         td.scope should only return known values
2790         https://bugs.webkit.org/show_bug.cgi?id=162755
2791
2792         Reviewed by Sam Weinig.
2793
2794         td.scope should only return known values:
2795         - https://html.spec.whatwg.org/#dom-th-scope
2796
2797         Firefox conforms to the specification.
2798
2799         No new tests, rebaselined existing test.
2800
2801         * html/HTMLTableCellElement.cpp:
2802         (WebCore::HTMLTableCellElement::scope):
2803
2804 2016-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2805
2806         [SOUP] Simplify AuthenticationChallenge
2807         https://bugs.webkit.org/show_bug.cgi?id=162784
2808
2809         Reviewed by Alex Christensen.
2810
2811         We don't really need to keep references to the SoupSession and SoupMessage in AuthenticationChallenge, the
2812         SoupNetworkSession callback already forwards the challenge to the right ResourceHandle.
2813
2814         * platform/network/soup/AuthenticationChallenge.h:
2815         (WebCore::AuthenticationChallenge::authenticationClient):
2816         (WebCore::AuthenticationChallenge::soupSession): Deleted.
2817         (WebCore::AuthenticationChallenge::soupMessage): Deleted.
2818         * platform/network/soup/AuthenticationChallengeSoup.cpp:
2819         (WebCore::AuthenticationChallenge::AuthenticationChallenge):
2820         (WebCore::AuthenticationChallenge::platformCompare):
2821         * platform/network/soup/ResourceHandleSoup.cpp:
2822         (WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge):
2823         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2824         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
2825         (WebCore::ResourceHandle::receivedCredential):
2826         (WebCore::ResourceHandle::receivedCancellation):
2827         * platform/network/soup/SoupNetworkSession.cpp:
2828         (WebCore::authenticateCallback):
2829
2830 2016-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2831
2832         [SOUP] Cleanup persistent credential storage code
2833         https://bugs.webkit.org/show_bug.cgi?id=162777
2834
2835         Reviewed by Alex Christensen.
2836
2837         We have this feature behind ENABLE_CREDENTIAL_STORAGE flag, which is confusing, because we use credential
2838         storage unconditionally and this is only about persistent storage. Also the flag assumes libsecret is available,
2839         and since it's only used by GTK sometimes we use GTK ifdefs instead of CREDENTIAL_STORAGE. So, I think we should
2840         use USE(LIBSECRET) instead, and reduce a bit the ifdefs in common soup code. Another problem is that current
2841         implementation is always used, while it should depend on the current network storage session and never used in
2842         ephemeral sessions. This patch moves the code from CredentialBackingStore to NetworkStorageSessionSoup and
2843         modernizes a bit.
2844
2845         * PlatformGTK.cmake: Remove CredentialBackingStore.cpp.
2846         * platform/gtk/GRefPtrGtk.cpp: Use USE(LIBSECRET)
2847         * platform/gtk/GRefPtrGtk.h:
2848         * platform/network/NetworkStorageSession.h:
2849         * platform/network/ResourceHandleInternal.h:
2850         * platform/network/gtk/CredentialBackingStore.cpp: Removed.
2851         * platform/network/gtk/CredentialBackingStore.h: Removed.
2852         * platform/network/soup/NetworkStorageSessionSoup.cpp:
2853         (WebCore::NetworkStorageSession::~NetworkStorageSession):
2854         (WebCore::schemeFromProtectionSpaceServerType):
2855         (WebCore::authTypeFromProtectionSpaceAuthenticationScheme):
2856         (WebCore::NetworkStorageSession::getCredentialFromPersistentStorage):
2857         (WebCore::NetworkStorageSession::saveCredentialToPersistentStorage):
2858         (WebCore::NetworkStorageSession::ensurePrivateBrowsingSession): Deleted.
2859         (WebCore::NetworkStorageSession::switchToNewTestingSession): Deleted.
2860         * platform/network/soup/ResourceHandleSoup.cpp:
2861         (WebCore::gotHeadersCallback):
2862         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
2863         (WebCore::ResourceHandle::receivedCredential):
2864         (WebCore::ResourceHandle::continueDidReceiveAuthenticationChallenge): Deleted.
2865         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential): Deleted.
2866         (WebCore::ResourceHandle::receivedCancellation): Deleted.
2867
2868 2016-10-03  Carlos Garcia Campos  <cgarcia@igalia.com>
2869
2870         Unreviewed. Fix the build with coordinated graphics enabled after r206712.
2871
2872         * page/scrolling/ScrollingStateTree.cpp:
2873         (WebCore::ScrollingStateTree::attachNode):
2874
2875 2016-10-02  Chris Dumez  <cdumez@apple.com>
2876
2877         Add support for KeyboardEvent.getModifierState() operation
2878         https://bugs.webkit.org/show_bug.cgi?id=162855
2879
2880         Reviewed by Darin Adler.
2881
2882         Add support for KeyboardEvent.getModifierState() operation:
2883         - https://w3c.github.io/uievents/#dom-keyboardevent-getmodifierstate
2884
2885         Test: fast/events/constructors/keyboard-event-getModifierState.html
2886
2887         * dom/KeyboardEvent.cpp:
2888         (WebCore::KeyboardEvent::getModifierState):
2889         * dom/KeyboardEvent.idl:
2890
2891 2016-10-02  Chris Dumez  <cdumez@apple.com>
2892
2893         Add support for KeyboardEvent.repeat attribute
2894         https://bugs.webkit.org/show_bug.cgi?id=162854
2895
2896         Reviewed by Darin Adler.
2897
2898         Add support for KeyboardEvent.repeat attribute:
2899         - https://w3c.github.io/uievents/#dom-keyboardevent-repeat
2900
2901         No new tests, extended existing test.
2902
2903         * dom/KeyboardEvent.cpp:
2904         (WebCore::KeyboardEvent::KeyboardEvent):
2905         * dom/KeyboardEvent.h:
2906         * dom/KeyboardEvent.idl:
2907
2908 2016-10-02  Darin Adler  <darin@apple.com>
2909
2910         Rename ExceptionCode-based exception handling to "legacy"
2911         https://bugs.webkit.org/show_bug.cgi?id=162859
2912
2913         Reviewed by Chris Dumez.
2914
2915         RaisesException is now MayThrowLegacyException.
2916
2917         A follow-up patch soon will add MayThrowException for the new style,
2918         where we use ExceptionOr<> as the return type instead of an ExceptionCode
2919         out argument.
2920
2921         * bindings/scripts/CodeGeneratorJS.pm:
2922         Removed the quotation marks from the syntax object->{PropertyName} so the
2923         renaming script could handle it. Tweaked various comments and logic for clarity.
2924         Changed to use the perl "x if y" syntax for brevity in many places.
2925         Renamed with the script and by hand. Added code to skip including the same header
2926         in both the implementation file and the header, just to make generated bindings
2927         slightly smaller and faster to compile. Used "using" instead of "typedef".
2928
2929         * bindings/scripts/IDLAttributes.txt: Updated from old names to new ones.
2930
2931         * Modules/applepay/ApplePaySession.idl:
2932         * Modules/encryptedmedia/MediaKeySession.idl:
2933         * Modules/encryptedmedia/MediaKeys.idl:
2934         * Modules/fetch/FetchHeaders.idl:
2935         * Modules/fetch/FetchRequest.idl:
2936         * Modules/fetch/FetchResponse.idl:
2937         * Modules/indexeddb/IDBCursor.idl:
2938         * Modules/indexeddb/IDBDatabase.idl:
2939         * Modules/indexeddb/IDBFactory.idl:
2940         * Modules/indexeddb/IDBIndex.idl:
2941         * Modules/indexeddb/IDBKeyRange.idl:
2942         * Modules/indexeddb/IDBObjectStore.idl:
2943         * Modules/indexeddb/IDBRequest.idl:
2944         * Modules/indexeddb/IDBTransaction.idl:
2945         * Modules/mediasource/MediaSource.idl:
2946         * Modules/mediasource/SourceBuffer.idl:
2947         * Modules/mediastream/MediaDevices.idl:
2948         * Modules/mediastream/RTCDTMFSender.idl:
2949         * Modules/mediastream/RTCDataChannel.idl:
2950         * Modules/mediastream/RTCIceCandidate.idl:
2951         * Modules/mediastream/RTCPeerConnection.idl:
2952         * Modules/mediastream/RTCRtpSender.idl:
2953         * Modules/mediastream/RTCSessionDescription.idl:
2954         * Modules/navigatorcontentutils/NavigatorContentUtils.idl:
2955         * Modules/notifications/NotificationCenter.idl:
2956         * Modules/webaudio/AnalyserNode.idl:
2957         * Modules/webaudio/AudioBuffer.idl:
2958         * Modules/webaudio/AudioBufferSourceNode.idl:
2959         * Modules/webaudio/AudioContext.idl:
2960         * Modules/webaudio/AudioNode.idl:
2961         * Modules/webaudio/ConvolverNode.idl:
2962         * Modules/webaudio/OfflineAudioContext.idl:
2963         * Modules/webaudio/OscillatorNode.idl:
2964         * Modules/webdatabase/DOMWindowWebDatabase.idl:
2965         * Modules/webdatabase/SQLResultSet.idl:
2966         * Modules/websockets/WebSocket.idl:
2967         * bindings/scripts/test/TestImplements.idl:
2968         * bindings/scripts/test/TestInterface.idl:
2969         * bindings/scripts/test/TestNamedConstructor.idl:
2970         * bindings/scripts/test/TestNondeterministic.idl:
2971         * bindings/scripts/test/TestObj.idl:
2972         * bindings/scripts/test/TestSupplemental.idl:
2973         * bindings/scripts/test/TestTypedefs.idl:
2974         * css/CSSCharsetRule.idl:
2975         * css/CSSMediaRule.idl:
2976         * css/CSSPrimitiveValue.idl:
2977         * css/CSSRule.idl:
2978         * css/CSSStyleDeclaration.idl:
2979         * css/CSSStyleSheet.idl:
2980         * css/CSSSupportsRule.idl:
2981         * css/CSSValue.idl:
2982         * css/FontFace.idl:
2983         * css/FontFaceSet.idl:
2984         * css/MediaList.idl:
2985         * css/WebKitCSSMatrix.idl:
2986         * dom/CharacterData.idl:
2987         * dom/ChildNode.idl:
2988         * dom/CustomElementRegistry.idl:
2989         * dom/DataTransferItemList.idl:
2990         * dom/Document.idl:
2991         * dom/Element.idl:
2992         * dom/EventTarget.idl:
2993         * dom/MessagePort.idl:
2994         * dom/MutationObserver.idl:
2995         * dom/NamedNodeMap.idl:
2996         * dom/Node.idl:
2997         * dom/ParentNode.idl:
2998         * dom/Range.idl:
2999         * dom/ShadowRoot.idl:
3000         * dom/Text.idl:
3001         * fileapi/FileReader.idl:
3002         * fileapi/FileReaderSync.idl:
3003         * html/DOMTokenList.idl:
3004         * html/DOMURL.idl:
3005         * html/HTMLCanvasElement.idl:
3006         * html/HTMLElement.idl:
3007         * html/HTMLEmbedElement.idl:
3008         * html/HTMLFrameElement.idl:
3009         * html/HTMLIFrameElement.idl:
3010         * html/HTMLInputElement.idl:
3011         * html/HTMLMarqueeElement.idl:
3012         * html/HTMLMediaElement.idl:
3013         * html/HTMLObjectElement.idl:
3014         * html/HTMLOptionElement.idl:
3015         * html/HTMLOptionsCollection.idl:
3016         * html/HTMLProgressElement.idl:
3017         * html/HTMLSelectElement.idl:
3018         * html/HTMLTableElement.idl:
3019         * html/HTMLTableRowElement.idl:
3020         * html/HTMLTableSectionElement.idl:
3021         * html/HTMLTextAreaElement.idl:
3022         * html/HTMLVideoElement.idl:
3023         * html/ImageData.idl:
3024         * html/MediaController.idl:
3025         * html/TimeRanges.idl:
3026         * html/URLUtils.idl:
3027         * html/canvas/CanvasGradient.idl:
3028         * html/canvas/CanvasPath.idl:
3029         * html/canvas/CanvasRenderingContext2D.idl:
3030         * html/canvas/OESVertexArrayObject.idl:
3031         * html/canvas/WebGLRenderingContextBase.idl:
3032         * html/track/DataCue.idl:
3033         * html/track/TextTrack.idl:
3034         * html/track/TextTrackCue.idl:
3035         * html/track/VTTCue.idl:
3036         * html/track/VTTRegion.idl:
3037         * loader/appcache/DOMApplicationCache.idl:
3038         * page/Crypto.idl:
3039         * page/DOMSelection.idl:
3040         * page/DOMWindow.idl:
3041         * page/EventSource.idl:
3042         * page/History.idl:
3043         * page/Location.idl:
3044         * page/Performance.idl:
3045         * page/UserMessageHandler.idl:
3046         * page/WindowOrWorkerGlobalScope.idl:
3047         * storage/Storage.idl:
3048         * svg/SVGAltGlyphElement.idl:
3049         * svg/SVGAngle.idl:
3050         * svg/SVGAnimatedBoolean.idl:
3051         * svg/SVGAnimatedEnumeration.idl:
3052         * svg/SVGAnimatedInteger.idl:
3053         * svg/SVGAnimatedNumber.idl:
3054         * svg/SVGAnimatedString.idl:
3055         * svg/SVGAnimationElement.idl:
3056         * svg/SVGColor.idl:
3057         * svg/SVGGlyphRefElement.idl:
3058         * svg/SVGGraphicsElement.idl:
3059         * svg/SVGLength.idl:
3060         * svg/SVGLengthList.idl:
3061         * svg/SVGMatrix.idl:
3062         * svg/SVGNumberList.idl:
3063         * svg/SVGPaint.idl:
3064         * svg/SVGPathSegList.idl:
3065         * svg/SVGPointList.idl:
3066         * svg/SVGPreserveAspectRatio.idl:
3067         * svg/SVGStringList.idl:
3068         * svg/SVGStyleElement.idl:
3069         * svg/SVGTextContentElement.idl:
3070         * svg/SVGTransformList.idl:
3071         * svg/SVGViewSpec.idl:
3072         * testing/InternalSettings.idl:
3073         * testing/Internals.idl:
3074         * workers/DedicatedWorkerGlobalScope.idl:
3075         * workers/Worker.idl:
3076         * xml/DOMParser.idl:
3077         * xml/XMLHttpRequest.idl:
3078         * xml/XPathEvaluator.idl:
3079         * xml/XPathExpression.idl:
3080         * xml/XPathResult.idl:
3081         Allowed the rename script to rename the exception-related extended attributes.
3082
3083         * bindings/scripts/test/JS/JSInterfaceName.cpp:
3084         * bindings/scripts/test/JS/JSInterfaceName.h:
3085         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3086         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
3087         * bindings/scripts/test/JS/JSTestCallback.cpp:
3088         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
3089         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
3090         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
3091         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
3092         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3093         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
3094         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3095         * bindings/scripts/test/JS/JSTestEventConstructor.h:
3096         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3097         * bindings/scripts/test/JS/JSTestEventTarget.h:
3098         * bindings/scripts/test/JS/JSTestException.cpp:
3099         * bindings/scripts/test/JS/JSTestException.h:
3100         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3101         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
3102         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3103         * bindings/scripts/test/JS/JSTestGlobalObject.h:
3104         * bindings/scripts/test/JS/JSTestInterface.cpp:
3105         * bindings/scripts/test/JS/JSTestInterface.h:
3106         * bindings/scripts/test/JS/JSTestIterable.cpp:
3107         * bindings/scripts/test/JS/JSTestIterable.h:
3108         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
3109         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.h:
3110         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3111         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
3112         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3113         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
3114         * bindings/scripts/test/JS/JSTestNode.cpp:
3115         * bindings/scripts/test/JS/JSTestNode.h:
3116         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
3117         * bindings/scripts/test/JS/JSTestNondeterministic.h:
3118         * bindings/scripts/test/JS/JSTestObj.cpp:
3119         * bindings/scripts/test/JS/JSTestObj.h:
3120         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3121         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
3122         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3123         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
3124         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
3125         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
3126         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3127         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
3128         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3129         * bindings/scripts/test/JS/JSTestTypedefs.h:
3130         * bindings/scripts/test/JS/JSattribute.cpp:
3131         * bindings/scripts/test/JS/JSattribute.h:
3132         * bindings/scripts/test/JS/JSreadonly.cpp:
3133         * bindings/scripts/test/JS/JSreadonly.h:
3134         Regenerated.
3135
3136
3137 2016-10-02  Wenson Hsieh  <wenson_hsieh@apple.com>
3138
3139         Media controls for Soundcloud easily falls out of sync with what's actually playing
3140         https://bugs.webkit.org/show_bug.cgi?id=162843
3141         <rdar://problem/28176874>
3142
3143         Reviewed by Beth Dakin.
3144
3145         Currently, audio elements are subject to the same main content restrictions as video elements. This is
3146         problematic on sites where audio elements are really the main content, such as soundcloud. We need a different
3147         heuristic for determining whether audio elements such as these should be allowed to show playback controls.
3148
3149         Furthermore, we currently forbid autoplaying audio from showing controls if it has user gesture restrictions
3150         (i.e. it started playing via script). This is, again, problematic on sites where audio elements are played one
3151         after another (such as on soundcloud). Even though a subsequent audio element may have been triggered via
3152         script, we might want still want to show controls for it if the user has explicitly triggered other elements on
3153         the page to begin playing. However, if the user has not gestured on any media in the page, we still should not
3154         show controls for audio elements that begin playing via script.
3155
3156         Adds two new unit tests to TestWebKitAPI simulating audio playback behavior on soundcloud.
3157
3158         * html/MediaElementSession.cpp:
3159         (WebCore::MediaElementSession::removeBehaviorRestriction):
3160         (WebCore::MediaElementSession::canShowControlsManager):
3161         (WebCore::MediaElementSession::allowsPlaybackControlsForAutoplayingAudio):
3162         * html/MediaElementSession.h:
3163         * page/Page.h:
3164         (WebCore::Page::allowsPlaybackControlsForAutoplayingAudio):
3165         (WebCore::Page::setAllowsPlaybackControlsForAutoplayingAudio):
3166
3167 2016-10-02  Ryan Haddad  <ryanhaddad@apple.com>
3168
3169         Unreviewed, rolling out r206683.
3170
3171         This change caused API test WebKit2.FindMatches to fail on
3172         Mac.
3173
3174         Reverted changeset:
3175
3176         "The dragged image should be the current frame only of the
3177         animated image"
3178         https://bugs.webkit.org/show_bug.cgi?id=162109
3179         http://trac.webkit.org/changeset/206683
3180
3181 2016-10-02  Chris Dumez  <cdumez@apple.com>
3182
3183         Unreviewed, rolling out r206692 and r206718.
3184
3185         Seems to have caused >200 failures on Sierra
3186
3187         Reverted changesets:
3188
3189         "Implement rendering of font-variation-settings"
3190         https://bugs.webkit.org/show_bug.cgi?id=162782
3191         http://trac.webkit.org/changeset/206692
3192
3193         "Tried to fix the build after r206692."
3194         http://trac.webkit.org/changeset/206718
3195
3196 2016-10-02  Dan Bernstein  <mitz@apple.com>
3197
3198         Tried to fix the build after r206692.
3199
3200         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
3201         (WebCore::cascadeToLastResortAndVariationsFontDescriptor):
3202
3203 2016-10-02  Commit Queue  <commit-queue@webkit.org>
3204
3205         Unreviewed, rolling out r206716.
3206         https://bugs.webkit.org/show_bug.cgi?id=162858
3207
3208         It is breaking Mac CMake Debug build (Requested by youenn on
3209         #webkit).
3210
3211         Reverted changeset:
3212
3213         "[Fetch API] Forbid redirection to non-HTTP(s) URL in non-
3214         navigation mode."
3215         https://bugs.webkit.org/show_bug.cgi?id=162785
3216         http://trac.webkit.org/changeset/206716
3217
3218 2016-10-02  Youenn Fablet  <youenn@apple.com>
3219
3220         [Fetch API] Forbid redirection to non-HTTP(s) URL in non-navigation mode.
3221         https://bugs.webkit.org/show_bug.cgi?id=162785
3222
3223         Reviewed by Alex Christensen.
3224
3225         Covered by rebased and existing tests.
3226
3227         Ensuring non-HTTP redirection URLs are not followed at DocumentThreadableLoader level for fetch API only.
3228         This should be applied to all clients at some point, but there is still some uncertainty for data URLs.
3229
3230         Did some refactoring to better separate the case of security checks in case of regular request or redirected request.
3231         This allows in particular to handle more clearly the case of data URLs which are allowed in all modes for regular requests.
3232         But they are not allowed for same-origin redirected requests.
3233
3234         * WebCore.xcodeproj/project.pbxproj:
3235         * loader/DocumentThreadableLoader.cpp:
3236         (WebCore::reportRedirectionWithBadScheme): Reporting bad scheme redirection error.
3237         (WebCore::DocumentThreadableLoader::redirectReceived): Checking that redirection URLs are HTTP(s) in case of Fetch API.
3238         * loader/SubresourceLoader.cpp:
3239         (WebCore::SubresourceLoader::willSendRequestInternal):
3240         * loader/cache/CachedResourceLoader.cpp:
3241         (WebCore::CachedResourceLoader::requestImage):
3242         (WebCore::CachedResourceLoader::checkInsecureContent):
3243         (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy):
3244         (WebCore::isSameOriginDataURL):
3245         (WebCore::CachedResourceLoader::canRequest):
3246         (WebCore::CachedResourceLoader::canRequestAfterRedirection):
3247         (WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox):
3248         (WebCore::CachedResourceLoader::requestResource):
3249         * loader/cache/CachedResourceLoader.h:
3250
3251 2016-10-01  Simon Fraser  <simon.fraser@apple.com>
3252
3253         Support transitions/animations of background-position with right/bottom-relative values
3254         https://bugs.webkit.org/show_bug.cgi?id=162048
3255
3256         Reviewed by Dean Jackson.
3257         
3258         Make transitions between "background-position: 10px 20px" and "background-position: right 10px bottom 20px"
3259         work. We do this by by converting "right 10px" to "calc(100% - 10px)" when blending.
3260         
3261         Also improve logging of calculated lengths, and better animation logging for FillLayer properties.
3262
3263         Test: transitions/background-position-transitions.html
3264
3265         * page/animation/CSSPropertyAnimation.cpp:
3266         (WebCore::FillLayerAnimationPropertyWrapperBase::FillLayerAnimationPropertyWrapperBase): Keep the propertyID
3267         around so logging can use it.
3268         (WebCore::FillLayerAnimationPropertyWrapperBase::property):
3269         (WebCore::FillLayerPropertyWrapperGetter::FillLayerPropertyWrapperGetter):
3270         (WebCore::FillLayerPropertyWrapperGetter::value):
3271         (WebCore::FillLayerPropertyWrapper::FillLayerPropertyWrapper):
3272         (WebCore::createCalculatedLength):
3273         (WebCore::FillLayerPositionPropertyWrapper::FillLayerPositionPropertyWrapper):
3274         (WebCore::FillLayerRefCountedPropertyWrapper::FillLayerRefCountedPropertyWrapper):
3275         (WebCore::FillLayerStyleImagePropertyWrapper::FillLayerStyleImagePropertyWrapper):
3276         (WebCore::FillLayersPropertyWrapper::FillLayersPropertyWrapper):
3277         (WebCore::CSSPropertyAnimation::blendProperties): Blend then log, so that the logging
3278         can show the result.
3279         * platform/CalculationValue.cpp:
3280         (WebCore::CalcExpressionNumber::dump):
3281         (WebCore::CalcExpressionBinaryOperation::dump):
3282         (WebCore::CalcExpressionLength::dump):
3283         (WebCore::CalcExpressionBlendLength::dump):
3284         (WebCore::operator<<):
3285         * platform/CalculationValue.h:
3286         * platform/Length.cpp:
3287         (WebCore::operator<<):
3288
3289 2016-10-01  Simon Fraser  <simon.fraser@apple.com>
3290
3291         Bad cast when CSS position programmatically changed from -webkit-sticky to fixed
3292         https://bugs.webkit.org/show_bug.cgi?id=160826
3293
3294         Reviewed by Zalan Bujtas.
3295         
3296         If a scrolling state tree node changed type (e.g. from sticky to fixed), we'd fail
3297         to recreate the node so keep a node with the wrong type.
3298         
3299         Fix by destroying the node and making a new one with a new ID in this case. The
3300         new ID is necessary to ensure that the scrolling tree is updated.
3301
3302         Test: fast/scrolling/sticky-to-fixed.html
3303
3304         * page/scrolling/ScrollingStateTree.cpp:
3305         (WebCore::ScrollingStateTree::nodeTypeAndParentMatch):
3306         (WebCore::ScrollingStateTree::attachNode):
3307         (WebCore::ScrollingStateTree::stateNodeForID):
3308         * page/scrolling/ScrollingStateTree.h:
3309
3310 2016-10-01  Youenn Fablet  <youenn@apple.com>
3311
3312         removing FetchBoyd::m_type
3313
3314         Remove FetchBody::m_type
3315         https://bugs.webkit.org/show_bug.cgi?id=162841
3316
3317         Reviewed by Sam Weinig.
3318
3319         No change of behavior.
3320
3321         Removing FetchBody::m_type and using m_data in lieu.
3322         Introducing temporarily FetchBody::m_isEmpty to handle the case of null bodies.
3323         Null body handling should be moved to FetchBodyOwner in a follow-up patch.
3324
3325         * Modules/fetch/FetchBody.cpp:
3326         (WebCore::FetchBody::FetchBody):
3327         (WebCore::FetchBody::extract):
3328         (WebCore::FetchBody::arrayBuffer):
3329         (WebCore::FetchBody::blob):
3330         (WebCore::FetchBody::json):
3331         (WebCore::FetchBody::text):
3332         (WebCore::FetchBody::consumeOnceLoadingFinished):
3333         (WebCore::FetchBody::consume):
3334         (WebCore::FetchBody::consumeAsStream):
3335         (WebCore::FetchBody::loadingSucceeded):
3336         (WebCore::FetchBody::bodyForInternalRequest):
3337         (WebCore::FetchBody::clone):
3338         (WebCore::FetchBody::consumeText): Deleted.
3339         (WebCore::FetchBody::consumeBlob): Deleted.
3340         * Modules/fetch/FetchBody.h:
3341         (WebCore::FetchBody::isEmpty):
3342         (WebCore::FetchBody::isBlob):
3343         (WebCore::FetchBody::isFormData):
3344         (WebCore::FetchBody::isArrayBuffer):
3345         (WebCore::FetchBody::isArrayBufferView):
3346         (WebCore::FetchBody::isURLSearchParams):
3347         (WebCore::FetchBody::isText):
3348         (WebCore::FetchBody::FetchBody):
3349         (WebCore::FetchBody::setContentType): Deleted.
3350         (WebCore::FetchBody::urlSearchParamsBody): Deleted.
3351         * Modules/fetch/FetchBodyOwner.cpp:
3352         (WebCore::FetchBodyOwner::consumeOnceLoadingFinished):
3353         (WebCore::FetchBodyOwner::blobLoadingSucceeded):
3354         (WebCore::FetchBodyOwner::finishBlobLoading): Deleted.
3355         * Modules/fetch/FetchBodyOwner.h:
3356         (WebCore::FetchBodyOwner::body): Deleted.
3357         * Modules/fetch/FetchRequest.cpp:
3358         (WebCore::FetchRequest::setBody):
3359         * Modules/fetch/FetchResponse.cpp:
3360         (WebCore::FetchResponse::fetch):
3361         (WebCore::FetchResponse::BodyLoader::didSucceed):
3362         (WebCore::FetchResponse::consume):
3363         (WebCore::FetchResponse::consumeBodyAsStream):
3364         (WebCore::FetchResponse::createReadableStreamSource):
3365         (WebCore::FetchResponse::finishConsumingStream): Deleted.
3366         * Modules/fetch/FetchResponse.h:
3367
3368 2016-09-30  David Kilzer  <ddkilzer@apple.com>
3369
3370         REGRESSION (r203424): WebCore::ImageBuffer::createCompatibleBuffer() in ImageBufferCG.cpp over-releases CGColorSpaceRef objects
3371         <https://webkit.org/b/162823>
3372         <rdar://problem/27723268>
3373
3374         Reviewed by Joseph Pecoraro.
3375
3376         Code is covered by existing tests, but no crashes have been
3377         observed in practice.  May require running one test multiple
3378         times to reproduce.
3379
3380         * platform/graphics/cg/ImageBufferCG.cpp:
3381         (WebCore::ImageBuffer::createCompatibleBuffer): Don't use
3382         adoptCF() when the function doesn't return a +1 retained
3383         CGColorSpaceRef.
3384
3385 2016-09-30  Joonghun Park  <jh718.park@samsung.com>
3386
3387         [EFL] Fix build break since r206661. Unreviewed
3388         https://bugs.webkit.org/show_bug.cgi?id=162825
3389
3390         No new tests, no new behaviours.
3391
3392         * rendering/RenderLayer.cpp:
3393         (WebCore::ClipRects::ClipRects):
3394
3395 2016-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
3396
3397         Declare that our variation fonts work is in progress
3398         https://bugs.webkit.org/show_bug.cgi?id=162816
3399
3400         Reviewed by Simon Fraser.
3401
3402         * features.json:
3403
3404 2016-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
3405
3406         Turn variation fonts on by default
3407         https://bugs.webkit.org/show_bug.cgi?id=162818
3408
3409         Reviewed by Simon Fraser.
3410
3411         No new tests because there is no behavior change.
3412
3413         * page/Settings.in:
3414         * testing/InternalSettings.cpp:
3415         (WebCore::InternalSettings::variationFontsEnabled):
3416
3417 2016-09-30  Myles C. Maxfield  <mmaxfield@apple.com>
3418
3419         Implement rendering of font-variation-settings
3420         https://bugs.webkit.org/show_bug.cgi?id=162782
3421
3422         Reviewed by Zalan Bujtas.
3423
3424         Because the heavy lifting for font-variation-settings is done by CoreText,
3425         this patch is fairly minimal. It simply hooks up the CSS property to CoreText.
3426
3427         There is an existing bug in CoreText where variations inside fonts do not
3428         survive the addition of a cascade list. Therefore, FontPlatformData::ctFont()
3429         needs to work around this (conditionally) by resupplying the variation at
3430         the same time as the cascade list. The CoreText