[MathML] Use more auto for local variables
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-08-02  Frederic Wang  <fwang@igalia.com>
2
3         [MathML] Use more auto for local variables
4         https://bugs.webkit.org/show_bug.cgi?id=160453
5
6         Reviewed by Darin Adler.
7
8         No new tests, behavior is unchanged.
9
10         * mathml/MathMLElement.cpp:
11         (WebCore::MathMLElement::colSpan):
12         (WebCore::MathMLElement::rowSpan):
13         (WebCore::MathMLElement::childShouldCreateRenderer):
14         (WebCore::MathMLElement::defaultEventHandler):
15         * mathml/MathMLSelectElement.cpp:
16         (WebCore::MathMLSelectElement::getSelectedActionChild):
17         (WebCore::MathMLSelectElement::getSelectedSemanticsChild):
18         * rendering/mathml/RenderMathMLFenced.cpp:
19         (WebCore::RenderMathMLFenced::updateFromElement):
20
21 2016-08-02  Ryan Haddad  <ryanhaddad@apple.com>
22
23         Attempt to fix build after r204014.
24
25         Unreviewed build fix.
26
27         * loader/mac/ResourceLoaderMac.mm:
28         (WebCore::ResourceLoader::willCacheResponse):
29
30 2016-08-02  Chris Dumez  <cdumez@apple.com>
31
32         [WebIDL] Implement overload resolution algorithm
33         https://bugs.webkit.org/show_bug.cgi?id=160394
34
35         Reviewed by Darin Adler.
36
37         Implement overload resolution algorithm:
38         - http://heycam.github.io/webidl/#es-overloads
39
40         This means that our support for operation overloading in our IDL is
41         now a lot more extensive than it used to be and is now compliant with
42         the Web IDL specification.
43
44         In particular, overloading should now work for a lot more parameter
45         types which means that:
46         - We should be able to drop some custom bindings code in a follow-up patch.
47         - We will be able to drop the [StrictTypeChecking] attribute which was
48           a hack used to make overloading work for parameters of type DOMString.
49
50         Also, the order of the overloads in the IDL no longer impacts the
51         generated bindings code. It used to be that you needed to put the
52         overloads with the more specific parameter types first in order for the
53         generated bindings code to be somewhat correct.
54
55         No new tests, rebaselined bindings tests.
56
57         * bindings/scripts/CodeGenerator.pm:
58         (IsStringOrEnumType):
59         * bindings/scripts/CodeGeneratorJS.pm:
60         (IsNullableType):
61         (StripNullable):
62         (ComputeEffectiveOverloadSet):
63         (AreTypesDistinguishableForOverloadResolution):
64         (GetDistinguishingArgumentIndex):
65         (GetOverloadThatMatches):
66         (GenerateOverloadedFunction):
67         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
68         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation):
69         * bindings/scripts/test/JS/JSTestObj.cpp:
70         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation):
71         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
72         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
73         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
74         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1):
75         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
76         (WebCore::jsTestObjConstructorFunctionOverloadedMethod12): Deleted.
77         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise): Deleted.
78         * bindings/scripts/test/TestObj.idl:
79         * dom/EventTarget.h:
80         * dom/EventTarget.idl:
81         * html/HTMLOptionsCollection.h:
82         * html/HTMLOptionsCollection.idl:
83         * html/HTMLSelectElement.h:
84         (WebCore::HTMLSelectElement::add):
85         * html/HTMLSelectElement.idl:
86
87 2016-08-02  Myles C. Maxfield  <mmaxfield@apple.com>
88
89         [macOS] Guard workaround in r203314 for only OSes which need it
90         https://bugs.webkit.org/show_bug.cgi?id=160440
91
92         Reviewed by Simon Fraser.
93
94         The workarond introduced in r203314 only needs to be applied on
95         certain OSes.
96
97         No new tests because there is no behavior change.
98
99         * platform/text/mac/TextBoundaries.mm:
100         (WebCore::findNextWordFromIndex):
101
102 2016-08-02  Youenn Fablet  <youenn@apple.com>
103
104         Remove CachedResourceRequest initiatingDocumentLoader
105         https://bugs.webkit.org/show_bug.cgi?id=160449
106
107         Reviewed by Alex Christensen.
108
109         No change of behavior.
110
111         * loader/DocumentLoader.cpp:
112         (WebCore::DocumentLoader::startLoadingMainResource): Removing call to setInitiator.
113         * loader/cache/CachedResourceRequest.cpp:
114         (WebCore::CachedResourceRequest::setInitiator): Deleted.
115         * loader/cache/CachedResourceRequest.h:
116         (WebCore::CachedResourceRequest::initiatingDocumentLoader): Deleted.
117
118 2016-07-28  Frederic Wang  <fwang@igalia.com>
119
120         Move parsing of the form attribute to MathMLOperatorElement
121         https://bugs.webkit.org/show_bug.cgi?id=160239
122
123         Reviewed by Darin Adler.
124
125         We move the parsing of the mo@form attribute to the MathMLOperatorElement class. Note that
126         when the attribute is not explicit, the form may also be guessed by searching into the
127         operator dictionary. Hence we also start moving the determination of the default dictionary
128         properties. Moving the actual parsing of the corresponding attributes will be done in
129         follow-up commits.
130
131         No new tests, already covered by existing tests.
132
133         * mathml/MathMLInlineContainerElement.cpp:
134         (WebCore::MathMLInlineContainerElement::childrenChanged): Make the form of operators dirty
135         if its siblings have changed.
136         * mathml/MathMLOperatorDictionary.cpp:
137         (WebCore::MathMLOperatorDictionary::search): Merge old getEntry functions into one helper
138         function that returns an Optional<Entry>.
139         (WebCore::MathMLOperatorDictionary::getEntry): Deleted
140         * mathml/MathMLOperatorDictionary.h: Declare MathMLOperatorDictionary::find.
141         * mathml/MathMLOperatorElement.cpp:
142         (WebCore::MathMLOperatorElement::dictionaryProperty): We determine the operator form by
143         parsing the corresponding attribute or by using heuristics if that attribute is not
144         specified. We also read dictionary the corresponding dictionary properties.
145         (WebCore::MathMLOperatorElement::flags): Return the flags read from the dictionary.
146         (WebCore::MathMLOperatorElement::defaultLeadingSpace): Return the space read from the dictionary.
147         (WebCore::MathMLOperatorElement::defaultTrailingSpace): Return the space read from the dictionary.
148         (WebCore::MathMLOperatorElement::childrenChanged): Make the dictionary properties dirty.
149         (WebCore::MathMLOperatorElement::parseAttribute): Make the dictionary properties dirty when
150         the form changes.
151         * mathml/MathMLOperatorElement.h: New member to store dictionary properties and expose them.
152         * rendering/mathml/RenderMathMLFencedOperator.cpp:
153         (WebCore::RenderMathMLFencedOperator::setOperatorProperties): We implement the case specific
154         to anonymous mfenced operators here.
155         * rendering/mathml/RenderMathMLFencedOperator.h: Move the m_operatorForm member here and
156         declare the overriden function setOperatorProperties.
157         * rendering/mathml/RenderMathMLOperator.cpp:
158         (WebCore::RenderMathMLOperator::setOperatorProperties): Simplify this code since the logic
159         has been moved to the element classes.
160         (WebCore::RenderMathMLOperator::setOperatorPropertiesFromOpDictEntry): Deleted.
161         * rendering/mathml/RenderMathMLOperator.h: Remove setOperatorPropertiesFromOpDictEntry, make
162         members accessible to RenderMathMLFencedOperator and remove m_operatorForm.
163
164 2016-08-02  Frederic Wang  <fwang.igalia.com>
165
166         Use Optional members to store parsed MathML attributes.
167         https://bugs.webkit.org/show_bug.cgi?id=160400
168
169         Reviewed by Darin Adler.
170
171         Parsed MathML attributes are stored on the element classes using the memoize pattern to
172         minimize the number of parsing updates. Currently, a dirty flag for each member
173         indicate when it must be parsed again. We change this to wrap these members into an
174         Optional<T> container instead, where a null value indicates that the member is dirty.
175
176         No new tests, behavior is unchanged.
177
178         * mathml/MathMLElement.cpp:
179         (WebCore::MathMLElement::cachedMathMLLength):
180         (WebCore::MathMLElement::cachedBooleanAttribute):
181         (WebCore::MathMLElement::parseMathVariantAttribute):
182         (WebCore::MathMLElement::specifiedDisplayStyle):
183         (WebCore::MathMLElement::specifiedMathVariant):
184         * mathml/MathMLElement.h:
185         * mathml/MathMLFractionElement.cpp:
186         (WebCore::MathMLFractionElement::lineThickness):
187         (WebCore::MathMLFractionElement::cachedFractionAlignment):
188         (WebCore::MathMLFractionElement::parseAttribute):
189         * mathml/MathMLFractionElement.h:
190         * mathml/MathMLInlineContainerElement.cpp:
191         (WebCore::MathMLInlineContainerElement::parseAttribute):
192         * mathml/MathMLMathElement.cpp:
193         (WebCore::MathMLMathElement::specifiedDisplayStyle):
194         (WebCore::MathMLMathElement::parseAttribute):
195         * mathml/MathMLOperatorElement.cpp:
196         (WebCore::MathMLOperatorElement::operatorText):
197         * mathml/MathMLPaddedElement.cpp:
198         (WebCore::MathMLPaddedElement::parseAttribute):
199         * mathml/MathMLPaddedElement.h:
200         * mathml/MathMLScriptsElement.cpp:
201         (WebCore::MathMLScriptsElement::parseAttribute):
202         * mathml/MathMLScriptsElement.h:
203         * mathml/MathMLSpaceElement.cpp:
204         (WebCore::MathMLSpaceElement::parseAttribute):
205         * mathml/MathMLSpaceElement.h:
206         * mathml/MathMLTextElement.cpp:
207         (WebCore::MathMLTextElement::parseAttribute):
208         * mathml/MathMLUnderOverElement.cpp:
209         (WebCore::MathMLUnderOverElement::parseAttribute):
210         * mathml/MathMLUnderOverElement.h:
211         * rendering/mathml/MathMLStyle.cpp:
212         (WebCore::MathMLStyle::resolveMathMLStyle):
213         * rendering/mathml/MathMLStyle.h:
214         * rendering/mathml/RenderMathMLToken.cpp:
215         (WebCore::mathVariant):
216         (WebCore::RenderMathMLToken::updateMathVariantGlyph):
217
218 2016-08-02  Youenn Fablet  <youenn@apple.com>
219
220         [Fetch API] Fetch promises should not reject or resolve when ActiveDOMObjects are being stopped
221         https://bugs.webkit.org/show_bug.cgi?id=160420
222
223         Reviewed by Alex Christensen.
224
225         Test: http/tests/fetch/fetch-in-worker-crash.html
226
227         Promises should not be rejected when FetchResponse/FetchRequest are stopped as ActiveDOMObject.
228
229         * Modules/fetch/FetchBody.h:
230         (WebCore::FetchBody::cleanConsumePromise): Allowing to nullify the promise used to consume body.
231         * Modules/fetch/FetchBodyOwner.cpp:
232         (WebCore::FetchBodyOwner::stop): Nullifying the body consume promise if any.
233         * Modules/fetch/FetchResponse.cpp:
234         (WebCore::FetchResponse::BodyLoader::stop): Nullifying the fetch promise if any.
235
236 2016-08-02  Youenn Fablet  <youenn@apple.com>
237
238         [Fetch API] Add support to ReferrerPolicy
239         https://bugs.webkit.org/show_bug.cgi?id=160404
240
241         Reviewed by Alex Christensen.
242
243         Tests: imported/w3c/web-platform-tests/fetch/api/basic/referrer-worker.html
244                imported/w3c/web-platform-tests/fetch/api/basic/referrer.html
245
246         Refactored ThreadableLoader API to take more references.
247
248         Updated loading code in CachedResource to take into account referrer policy, that can be set by fetch API.
249         To enable correct handling of OriginWhenCrossOrigin policy, the computation of the cross-origin status of a request is
250         moved from ResourceLoader to CachedResource.
251
252         Referrer is passed to the loading code through HTTP headers.
253         This was triggering preflighting for Workers request as WorkerThreadableLoader was setting the referrer.
254         It is now done in DocumentThreadableLoader::loadRequest so that preflighting is done before setting the referrer.
255         Note that this referrer setting is only a way to pass a specific referrer value to the loading code.
256         CachedResource code will compute the actual referer value based on the referrer policy.
257         It might be good in the future to have a different way of conveying this information to CachedResource, maybe
258         through CachedResourceRequest.
259
260         * Modules/fetch/FetchLoader.cpp:
261         (WebCore::FetchLoader::start): Refactoring of ThreadableLoader API.
262         * Modules/fetch/FetchRequest.cpp:
263         (WebCore::FetchRequest::internalRequest): Setting referrer if it has a specific value.
264         * fileapi/FileReaderLoader.cpp:
265         (WebCore::FileReaderLoader::start): Ractoring of ThreadableLoader API.
266         * loader/CrossOriginPreflightChecker.cpp:
267         (WebCore::CrossOriginPreflightChecker::startPreflight): Set referrer in the preflight request if any.
268         (WebCore::CrossOriginPreflightChecker::doPreflight): Ditto.
269         * loader/DocumentThreadableLoader.cpp:
270         (WebCore::DocumentThreadableLoader::loadResourceSynchronously): Refactoring of ThreadableLoader API.
271         (WebCore::DocumentThreadableLoader::create): Ditto.
272         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Ditto.
273         (WebCore::DocumentThreadableLoader::loadRequest): Ditto.
274         * loader/DocumentThreadableLoader.h:
275         (WebCore::DocumentThreadableLoader::referrer): Storing referrer in case one is defined.
276         * loader/SubresourceLoader.cpp:
277         (WebCore::SubresourceLoader::init): Removing of cross origin computation since it is done earlier in CachedResource.
278         * loader/ThreadableLoader.cpp:
279         (WebCore::ThreadableLoader::create): Refactoring of ThreadableLoader API.
280         (WebCore::ThreadableLoader::loadResourceSynchronously): Ditto.
281         * loader/ThreadableLoader.h:
282         * loader/ThreadableLoaderClientWrapper.h:
283         (WebCore::ThreadableLoaderClientWrapper::create): Ditto.
284         (WebCore::ThreadableLoaderClientWrapper::ThreadableLoaderClientWrapper): Ditto.
285         * loader/WorkerThreadableLoader.cpp:
286         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader): Ditto.
287         (WebCore::WorkerThreadableLoader::loadResourceSynchronously): Removing setting of referrer in header and passing
288         it as a parameter.
289         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Ditto.
290         * loader/WorkerThreadableLoader.h:
291         (WebCore::WorkerThreadableLoader::create): Refactoring of ThreadableLoader API.
292         * loader/cache/CachedResource.cpp:
293         (WebCore::addAdditionalRequestHeadersToRequest): Computation of referrer based on referrer policy.
294         (WebCore::CachedResource::addAdditionalRequestHeaders): Ditto.
295         (WebCore::CachedResource::load): Computation of cross origin status.
296         (WebCore::CachedResource::varyHeaderValuesMatch):
297         * loader/cache/CachedResource.h:
298         (WebCore::CachedResource::options):
299         * page/EventSource.cpp:
300         (WebCore::EventSource::connect): Refactoring of ThreadableLoader API.
301         * workers/WorkerScriptLoader.cpp:
302         (WebCore::WorkerScriptLoader::loadSynchronously): Ditto.
303         (WebCore::WorkerScriptLoader::loadAsynchronously): Ditto.
304         * xml/XMLHttpRequest.cpp:
305         (WebCore::XMLHttpRequest::createRequest): Ditto.
306
307 2016-08-02  Brady Eidson  <beidson@apple.com>
308
309         Refactor data passed along for a "GetRecord" request.
310         https://bugs.webkit.org/show_bug.cgi?id=160352
311
312         Reviewed by Tim Horton.
313
314         No new tests (No behavior change).
315
316         Adding this new object lets us easily add new data passed along for GetRecord
317         requests going forward.
318
319         * WebCore.xcodeproj/project.pbxproj:
320         * CMakeLists.txt:
321
322         * Modules/indexeddb/IDBObjectStore.cpp:
323         (WebCore::IDBObjectStore::get):
324
325         * Modules/indexeddb/IDBTransaction.cpp:
326         (WebCore::IDBTransaction::requestGetRecord):
327         (WebCore::IDBTransaction::requestIndexRecord):
328         (WebCore::IDBTransaction::getRecordOnServer):
329         * Modules/indexeddb/IDBTransaction.h:
330
331         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
332         (WebCore::IDBClient::IDBConnectionProxy::getRecord):
333         * Modules/indexeddb/client/IDBConnectionProxy.h:
334
335         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
336         (WebCore::IDBClient::IDBConnectionToServer::getRecord):
337         * Modules/indexeddb/client/IDBConnectionToServer.h:
338         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
339
340         * Modules/indexeddb/server/IDBServer.cpp:
341         (WebCore::IDBServer::IDBServer::getRecord):
342         * Modules/indexeddb/server/IDBServer.h:
343
344         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
345         (WebCore::IDBServer::UniqueIDBDatabase::getRecord):
346         * Modules/indexeddb/server/UniqueIDBDatabase.h:
347
348         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
349         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
350         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
351
352         * Modules/indexeddb/shared/IDBGetRecordData.cpp: Added.
353         (WebCore::IDBGetRecordData::isolatedCopy):
354         * Modules/indexeddb/shared/IDBGetRecordData.h: Added.
355         (WebCore::IDBGetRecordData::encode):
356         (WebCore::IDBGetRecordData::decode):
357
358         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
359         (WebCore::InProcessIDBServer::getRecord):
360         * Modules/indexeddb/shared/InProcessIDBServer.h:
361
362 2016-08-01  Youenn Fablet  <youenn@apple.com>
363
364         [Fetch API] Pass directly FetchRequest fetch options to ThreadableLoader
365         https://bugs.webkit.org/show_bug.cgi?id=160407
366
367         Reviewed by Sam Weinig.
368
369         No change of behavior.
370
371         Added a ResourceLoaderOptions constructor that takes a FetchOptions as input.
372         Removed setters and getters of ResourceLoaderOptions as it is a struct.
373         Updated member fields accordingly.
374
375         Updated code accordingly.
376         Removed explicit option setting if it is the same as the default value.
377
378         * Modules/fetch/FetchLoader.cpp:
379         (WebCore::FetchLoader::start):
380         * css/CSSFontFaceSrcValue.cpp:
381         (WebCore::CSSFontFaceSrcValue::cachedFont):
382         * css/CSSImageSetValue.cpp:
383         (WebCore::CSSImageSetValue::cachedImageSet):
384         * css/CSSImageValue.cpp:
385         (WebCore::CSSImageValue::cachedImage):
386         * dom/ScriptElement.cpp:
387         (WebCore::ScriptElement::requestScript):
388         * fileapi/FileReaderLoader.cpp:
389         (WebCore::FileReaderLoader::start):
390         * html/HTMLLinkElement.cpp:
391         (WebCore::HTMLLinkElement::process):
392         * inspector/InspectorNetworkAgent.cpp:
393         (WebCore::InspectorNetworkAgent::loadResource):
394         * loader/CrossOriginPreflightChecker.cpp:
395         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
396         (WebCore::CrossOriginPreflightChecker::startPreflight):
397         * loader/DocumentThreadableLoader.cpp:
398         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
399         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
400         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
401         (WebCore::DocumentThreadableLoader::redirectReceived):
402         (WebCore::DocumentThreadableLoader::didReceiveResponse):
403         (WebCore::DocumentThreadableLoader::preflightSuccess):
404         (WebCore::DocumentThreadableLoader::loadRequest):
405         * loader/ImageLoader.cpp:
406         (WebCore::ImageLoader::updateFromElement):
407         * loader/ResourceLoader.cpp:
408         (WebCore::ResourceLoader::ResourceLoader):
409         (WebCore::ResourceLoader::init):
410         (WebCore::ResourceLoader::start):
411         (WebCore::ResourceLoader::setDefersLoading):
412         (WebCore::ResourceLoader::setDataBufferingPolicy):
413         (WebCore::ResourceLoader::addDataOrBuffer):
414         (WebCore::ResourceLoader::willSendRequestInternal):
415         (WebCore::ResourceLoader::didReceiveResponse):
416         (WebCore::ResourceLoader::didReceiveDataOrBuffer):
417         (WebCore::ResourceLoader::didFinishLoadingOnePart):
418         (WebCore::ResourceLoader::cleanupForError):
419         (WebCore::ResourceLoader::shouldUseCredentialStorage):
420         (WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
421         * loader/ResourceLoader.h:
422         (WebCore::ResourceLoader::shouldSendResourceLoadCallbacks):
423         (WebCore::ResourceLoader::setSendCallbackPolicy):
424         (WebCore::ResourceLoader::shouldSniffContent):
425         (WebCore::ResourceLoader::shouldIncludeCertificateInfo):
426         * loader/ResourceLoaderOptions.h:
427         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
428         (WebCore::ResourceLoaderOptions::sendLoadCallbacks): Deleted.
429         (WebCore::ResourceLoaderOptions::setSendLoadCallbacks): Deleted.
430         (WebCore::ResourceLoaderOptions::sniffContent): Deleted.
431         (WebCore::ResourceLoaderOptions::setSniffContent): Deleted.
432         (WebCore::ResourceLoaderOptions::dataBufferingPolicy): Deleted.
433         (WebCore::ResourceLoaderOptions::setDataBufferingPolicy): Deleted.
434         (WebCore::ResourceLoaderOptions::allowCredentials): Deleted.
435         (WebCore::ResourceLoaderOptions::setAllowCredentials): Deleted.
436         (WebCore::ResourceLoaderOptions::securityCheck): Deleted.
437         (WebCore::ResourceLoaderOptions::setSecurityCheck): Deleted.
438         (WebCore::ResourceLoaderOptions::certificateInfoPolicy): Deleted.
439         (WebCore::ResourceLoaderOptions::setCertificateInfoPolicy): Deleted.
440         (WebCore::ResourceLoaderOptions::contentSecurityPolicyImposition): Deleted.
441         (WebCore::ResourceLoaderOptions::setContentSecurityPolicyImposition): Deleted.
442         (WebCore::ResourceLoaderOptions::defersLoadingPolicy): Deleted.
443         (WebCore::ResourceLoaderOptions::setDefersLoadingPolicy): Deleted.
444         (WebCore::ResourceLoaderOptions::cachingPolicy): Deleted.
445         (WebCore::ResourceLoaderOptions::setCachingPolicy): Deleted.
446         * loader/SubresourceLoader.cpp:
447         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
448         * loader/TextTrackLoader.cpp:
449         (WebCore::TextTrackLoader::load):
450         * loader/cache/CachedRawResource.cpp:
451         (WebCore::CachedRawResource::setDataBufferingPolicy):
452         * loader/cache/CachedResource.cpp:
453         (WebCore::CachedResource::load):
454         * loader/cache/CachedResource.h:
455         (WebCore::CachedResource::shouldSendResourceLoadCallbacks):
456         (WebCore::CachedResource::dataBufferingPolicy):
457         (WebCore::CachedResource::allowsCaching):
458         * loader/cache/CachedResourceLoader.cpp:
459         (WebCore::CachedResourceLoader::canRequest):
460         * loader/cache/CachedResourceRequest.cpp:
461         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
462         * loader/cache/CachedResourceRequest.h:
463         (WebCore::CachedResourceRequest::allowsCaching):
464         * loader/cache/CachedResourceRequestInitiators.cpp:
465         (WebCore::CachedResourceRequestInitiators::CachedResourceRequestInitiators):
466         * loader/cache/CachedResourceRequestInitiators.h:
467         * loader/mac/ResourceLoaderMac.mm:
468         (WebCore::ResourceLoader::willCacheResponse):
469         (WebCore::ResourceLoader::didReceiveDataArray):
470         * page/EventSource.cpp:
471         (WebCore::EventSource::connect):
472         * style/StylePendingResources.cpp:
473         (WebCore::Style::loadPendingImage):
474         (WebCore::Style::loadPendingSVGFilters):
475         * svg/SVGFEImageElement.cpp:
476         (WebCore::SVGFEImageElement::requestImageResource):
477         * svg/SVGFontFaceUriElement.cpp:
478         (WebCore::SVGFontFaceUriElement::loadFont):
479         * svg/SVGUseElement.cpp:
480         (WebCore::SVGUseElement::updateExternalDocument):
481         * workers/WorkerScriptLoader.cpp:
482         (WebCore::WorkerScriptLoader::loadSynchronously):
483         (WebCore::WorkerScriptLoader::loadAsynchronously):
484         * xml/XMLHttpRequest.cpp:
485         (WebCore::XMLHttpRequest::createRequest):
486
487 2016-08-01  Carlos Garcia Campos  <cgarcia@igalia.com>
488
489         [GTK] Move the redirected XComposite window to the web process
490         https://bugs.webkit.org/show_bug.cgi?id=160389
491
492         Reviewed by Žan Doberšek.
493
494         Add helper methods to PlatformDisplayX11 to query X extensions supported by the display.
495
496         * platform/graphics/x11/PlatformDisplayX11.cpp:
497         (WebCore::PlatformDisplayX11::supportsXComposite):
498         (WebCore::PlatformDisplayX11::supportsXDamage):
499         * platform/graphics/x11/PlatformDisplayX11.h:
500
501 2016-08-01  Andreas Kling  <akling@apple.com>
502
503         Shrink MediaQuerySets to fit after parsing.
504         <https://webkit.org/b/160419>
505
506         Reviewed by Antti Koivisto.
507
508         Add shrinkToFit() helpers to MediaQuerySet and MediaQuery
509         and call it after parsing to remove extra capacity from their
510         internal vectors.
511
512         This reduces memory usage by 1.24MB on theverge.com.
513
514         * css/CSSParser.cpp:
515         (WebCore::CSSParser::createMediaRule):
516         * css/MediaList.cpp:
517         (WebCore::MediaQuerySet::parse):
518         (WebCore::MediaQuerySet::shrinkToFit):
519         * css/MediaList.h:
520         * css/MediaQuery.h:
521         (WebCore::MediaQuery::shrinkToFit):
522
523 2016-08-01  Tim Horton  <timothy_horton@apple.com>
524
525         <attachment> action label doesn't wrap, but needs to for some localizations
526         https://bugs.webkit.org/show_bug.cgi?id=160431
527         <rdar://problem/27526464>
528
529         Reviewed by Simon Fraser.
530
531         Test: fast/attachment/attachment-wrapping-action.html
532
533         * rendering/RenderThemeIOS.mm:
534         (WebCore::AttachmentInfo::buildWrappedLines):
535         (WebCore::AttachmentInfo::AttachmentInfo):
536         (WebCore::AttachmentInfo::buildTitleLines): Deleted.
537         Rework buildTitleLines into buildWrappedLines so that we have a
538         generic way to add lines that wrap up to N lines and then center-truncate.
539
540         Make use of it for the action text, and follow the same rules/width as
541         the title text already does.
542
543 2016-08-01  Anders Carlsson  <andersca@apple.com>
544
545         Build fix.
546
547         * WebCore.xcodeproj/project.pbxproj:
548
549 2016-08-01  Anders Carlsson  <andersca@apple.com>
550
551         Another build fix.
552
553         * WebCore.xcodeproj/project.pbxproj:
554
555 2016-08-01  Anders Carlsson  <andersca@apple.com>
556
557         Freeze the last of the HTML Objective-C bindings
558         https://bugs.webkit.org/show_bug.cgi?id=160430
559
560         Reviewed by Tim Horton.
561
562         Also, remove a bunch of form validation related methods that were never exposed/used.
563
564         * DerivedSources.make:
565         * WebCore.xcodeproj/project.pbxproj:
566         * bindings/objc/DOMBlob.h: Added.
567         * bindings/objc/DOMBlob.mm: Added.
568         * bindings/objc/DOMBlobInternal.h: Added.
569         * bindings/objc/DOMDOMTokenList.h: Added.
570         * bindings/objc/DOMDOMTokenList.mm: Added.
571         * bindings/objc/DOMDOMTokenListInternal.h: Added.
572         * bindings/objc/DOMFile.h: Added.
573         * bindings/objc/DOMFile.mm: Added.
574         * bindings/objc/DOMFileInternal.h: Added.
575         * bindings/objc/DOMFileList.h: Added.
576         * bindings/objc/DOMFileList.mm: Added.
577         * bindings/objc/DOMFileListInternal.h: Added.
578         * bindings/objc/DOMHTMLButtonElement.mm:
579         * bindings/objc/DOMHTMLFieldSetElement.mm:
580         * bindings/objc/DOMHTMLInputElement.mm:
581         * bindings/objc/DOMHTMLInputElementPrivate.h:
582         * bindings/objc/DOMHTMLObjectElement.mm:
583         * bindings/objc/DOMHTMLSelectElement.mm:
584         * bindings/objc/DOMHTMLTextAreaElement.mm:
585         * bindings/objc/DOMHTMLTextAreaElementPrivate.h:
586         * bindings/objc/DOMMediaError.h: Added.
587         * bindings/objc/DOMMediaError.mm: Added.
588         * bindings/objc/DOMMediaErrorInternal.h: Added.
589         * bindings/objc/DOMTimeRanges.h: Added.
590         * bindings/objc/DOMTimeRanges.mm: Added.
591         * bindings/objc/DOMTimeRangesInternal.h: Added.
592
593 2016-08-01  Anders Carlsson  <andersca@apple.com>
594
595         Fix build.
596
597         * WebCore.xcodeproj/project.pbxproj:
598
599 2016-08-01  Anders Carlsson  <andersca@apple.com>
600
601         Freeze all the DOMHTML* Objective-C bindings
602         https://bugs.webkit.org/show_bug.cgi?id=160424
603
604         Reviewed by Tim Horton.
605
606         * DerivedSources.make:
607         * WebCore.xcodeproj/project.pbxproj:
608         * bindings/objc/DOMHTMLAnchorElement.h: Added.
609         * bindings/objc/DOMHTMLAnchorElement.mm: Added.
610         * bindings/objc/DOMHTMLAnchorElementInternal.h: Added.
611         * bindings/objc/DOMHTMLAppletElement.h: Added.
612         * bindings/objc/DOMHTMLAppletElement.mm: Added.
613         * bindings/objc/DOMHTMLAppletElementInternal.h: Added.
614         * bindings/objc/DOMHTMLAreaElement.h: Added.
615         * bindings/objc/DOMHTMLAreaElement.mm: Added.
616         * bindings/objc/DOMHTMLAreaElementInternal.h: Added.
617         * bindings/objc/DOMHTMLBRElement.h: Added.
618         * bindings/objc/DOMHTMLBRElement.mm: Added.
619         * bindings/objc/DOMHTMLBRElementInternal.h: Added.
620         * bindings/objc/DOMHTMLBaseElement.h: Added.
621         * bindings/objc/DOMHTMLBaseElement.mm: Added.
622         * bindings/objc/DOMHTMLBaseElementInternal.h: Added.
623         * bindings/objc/DOMHTMLBaseFontElement.h: Added.
624         * bindings/objc/DOMHTMLBaseFontElement.mm: Added.
625         * bindings/objc/DOMHTMLBaseFontElementInternal.h: Added.
626         * bindings/objc/DOMHTMLBodyElement.h: Added.
627         * bindings/objc/DOMHTMLBodyElement.mm: Added.
628         * bindings/objc/DOMHTMLBodyElementInternal.h: Added.
629         * bindings/objc/DOMHTMLButtonElement.h: Added.
630         * bindings/objc/DOMHTMLButtonElement.mm: Added.
631         * bindings/objc/DOMHTMLButtonElementInternal.h: Added.
632         * bindings/objc/DOMHTMLCanvasElement.h: Added.
633         * bindings/objc/DOMHTMLCanvasElement.mm: Added.
634         * bindings/objc/DOMHTMLCanvasElementInternal.h: Added.
635         * bindings/objc/DOMHTMLCollection.h: Added.
636         * bindings/objc/DOMHTMLCollection.mm: Added.
637         * bindings/objc/DOMHTMLCollectionInternal.h: Added.
638         * bindings/objc/DOMHTMLDListElement.h: Added.
639         * bindings/objc/DOMHTMLDListElement.mm: Added.
640         * bindings/objc/DOMHTMLDListElementInternal.h: Added.
641         * bindings/objc/DOMHTMLDirectoryElement.h: Added.
642         * bindings/objc/DOMHTMLDirectoryElement.mm: Added.
643         * bindings/objc/DOMHTMLDirectoryElementInternal.h: Added.
644         * bindings/objc/DOMHTMLDivElement.h: Added.
645         * bindings/objc/DOMHTMLDivElement.mm: Added.
646         * bindings/objc/DOMHTMLDivElementInternal.h: Added.
647         * bindings/objc/DOMHTMLDocument.h: Added.
648         * bindings/objc/DOMHTMLDocument.mm: Added.
649         * bindings/objc/DOMHTMLDocumentInternal.h: Added.
650         * bindings/objc/DOMHTMLElement.h: Added.
651         * bindings/objc/DOMHTMLElement.mm: Added.
652         * bindings/objc/DOMHTMLElementInternal.h: Added.
653         * bindings/objc/DOMHTMLEmbedElement.h: Added.
654         * bindings/objc/DOMHTMLEmbedElement.mm: Added.
655         * bindings/objc/DOMHTMLEmbedElementInternal.h: Added.
656         * bindings/objc/DOMHTMLFieldSetElement.h: Added.
657         * bindings/objc/DOMHTMLFieldSetElement.mm: Added.
658         * bindings/objc/DOMHTMLFieldSetElementInternal.h: Added.
659         * bindings/objc/DOMHTMLFontElement.h: Added.
660         * bindings/objc/DOMHTMLFontElement.mm: Added.
661         * bindings/objc/DOMHTMLFontElementInternal.h: Added.
662         * bindings/objc/DOMHTMLFormElement.h: Added.
663         * bindings/objc/DOMHTMLFormElement.mm: Added.
664         * bindings/objc/DOMHTMLFormElementInternal.h: Added.
665         * bindings/objc/DOMHTMLFrameElement.h: Added.
666         * bindings/objc/DOMHTMLFrameElement.mm: Added.
667         * bindings/objc/DOMHTMLFrameElementInternal.h: Added.
668         * bindings/objc/DOMHTMLFrameSetElement.h: Added.
669         * bindings/objc/DOMHTMLFrameSetElement.mm: Added.
670         * bindings/objc/DOMHTMLFrameSetElementInternal.h: Added.
671         * bindings/objc/DOMHTMLHRElement.h: Added.
672         * bindings/objc/DOMHTMLHRElement.mm: Added.
673         * bindings/objc/DOMHTMLHRElementInternal.h: Added.
674         * bindings/objc/DOMHTMLHeadElement.h: Added.
675         * bindings/objc/DOMHTMLHeadElement.mm: Added.
676         * bindings/objc/DOMHTMLHeadElementInternal.h: Added.
677         * bindings/objc/DOMHTMLHeadingElement.h: Added.
678         * bindings/objc/DOMHTMLHeadingElement.mm: Added.
679         * bindings/objc/DOMHTMLHeadingElementInternal.h: Added.
680         * bindings/objc/DOMHTMLHtmlElement.h: Added.
681         * bindings/objc/DOMHTMLHtmlElement.mm: Added.
682         * bindings/objc/DOMHTMLHtmlElementInternal.h: Added.
683         * bindings/objc/DOMHTMLIFrameElement.h: Added.
684         * bindings/objc/DOMHTMLIFrameElement.mm: Added.
685         * bindings/objc/DOMHTMLIFrameElementInternal.h: Added.
686         * bindings/objc/DOMHTMLImageElement.h: Added.
687         * bindings/objc/DOMHTMLImageElement.mm: Added.
688         * bindings/objc/DOMHTMLImageElementInternal.h: Added.
689         * bindings/objc/DOMHTMLInputElement.h: Added.
690         * bindings/objc/DOMHTMLInputElement.mm: Added.
691         * bindings/objc/DOMHTMLInputElementInternal.h: Added.
692         * bindings/objc/DOMHTMLInputElementPrivate.h: Added.
693         * bindings/objc/DOMHTMLLIElement.h: Added.
694         * bindings/objc/DOMHTMLLIElement.mm: Added.
695         * bindings/objc/DOMHTMLLIElementInternal.h: Added.
696         * bindings/objc/DOMHTMLLabelElement.h: Added.
697         * bindings/objc/DOMHTMLLabelElement.mm: Added.
698         * bindings/objc/DOMHTMLLabelElementInternal.h: Added.
699         * bindings/objc/DOMHTMLLegendElement.h: Added.
700         * bindings/objc/DOMHTMLLegendElement.mm: Added.
701         * bindings/objc/DOMHTMLLegendElementInternal.h: Added.
702         * bindings/objc/DOMHTMLLinkElement.h: Added.
703         * bindings/objc/DOMHTMLLinkElement.mm: Added.
704         * bindings/objc/DOMHTMLLinkElementInternal.h: Added.
705         * bindings/objc/DOMHTMLMapElement.h: Added.
706         * bindings/objc/DOMHTMLMapElement.mm: Added.
707         * bindings/objc/DOMHTMLMapElementInternal.h: Added.
708         * bindings/objc/DOMHTMLMarqueeElement.h: Added.
709         * bindings/objc/DOMHTMLMarqueeElement.mm: Added.
710         * bindings/objc/DOMHTMLMarqueeElementInternal.h: Added.
711         * bindings/objc/DOMHTMLMediaElement.h: Added.
712         * bindings/objc/DOMHTMLMediaElement.mm: Added.
713         * bindings/objc/DOMHTMLMediaElementInternal.h: Added.
714         * bindings/objc/DOMHTMLMenuElement.h: Added.
715         * bindings/objc/DOMHTMLMenuElement.mm: Added.
716         * bindings/objc/DOMHTMLMenuElementInternal.h: Added.
717         * bindings/objc/DOMHTMLMetaElement.h: Added.
718         * bindings/objc/DOMHTMLMetaElement.mm: Added.
719         * bindings/objc/DOMHTMLMetaElementInternal.h: Added.
720         * bindings/objc/DOMHTMLModElement.h: Added.
721         * bindings/objc/DOMHTMLModElement.mm: Added.
722         * bindings/objc/DOMHTMLModElementInternal.h: Added.
723         * bindings/objc/DOMHTMLOListElement.h: Added.
724         * bindings/objc/DOMHTMLOListElement.mm: Added.
725         * bindings/objc/DOMHTMLOListElementInternal.h: Added.
726         * bindings/objc/DOMHTMLObjectElement.h: Added.
727         * bindings/objc/DOMHTMLObjectElement.mm: Added.
728         * bindings/objc/DOMHTMLObjectElementInternal.h: Added.
729         * bindings/objc/DOMHTMLObjectElementPrivate.h: Added.
730         * bindings/objc/DOMHTMLOptGroupElement.h: Added.
731         * bindings/objc/DOMHTMLOptGroupElement.mm: Added.
732         * bindings/objc/DOMHTMLOptGroupElementInternal.h: Added.
733         * bindings/objc/DOMHTMLOptionElement.h: Added.
734         * bindings/objc/DOMHTMLOptionElement.mm: Added.
735         * bindings/objc/DOMHTMLOptionElementInternal.h: Added.
736         * bindings/objc/DOMHTMLOptionsCollection.h: Added.
737         * bindings/objc/DOMHTMLOptionsCollection.mm: Added.
738         * bindings/objc/DOMHTMLOptionsCollectionInternal.h: Added.
739         * bindings/objc/DOMHTMLParagraphElement.h: Added.
740         * bindings/objc/DOMHTMLParagraphElement.mm: Added.
741         * bindings/objc/DOMHTMLParagraphElementInternal.h: Added.
742         * bindings/objc/DOMHTMLParamElement.h: Added.
743         * bindings/objc/DOMHTMLParamElement.mm: Added.
744         * bindings/objc/DOMHTMLParamElementInternal.h: Added.
745         * bindings/objc/DOMHTMLPreElement.h: Added.
746         * bindings/objc/DOMHTMLPreElement.mm: Added.
747         * bindings/objc/DOMHTMLPreElementInternal.h: Added.
748         * bindings/objc/DOMHTMLQuoteElement.h: Added.
749         * bindings/objc/DOMHTMLQuoteElement.mm: Added.
750         * bindings/objc/DOMHTMLQuoteElementInternal.h: Added.
751         * bindings/objc/DOMHTMLScriptElement.h: Added.
752         * bindings/objc/DOMHTMLScriptElement.mm: Added.
753         * bindings/objc/DOMHTMLScriptElementInternal.h: Added.
754         * bindings/objc/DOMHTMLSelectElement.h: Added.
755         * bindings/objc/DOMHTMLSelectElement.mm: Added.
756         * bindings/objc/DOMHTMLSelectElementInternal.h: Added.
757         * bindings/objc/DOMHTMLStyleElement.h: Added.
758         * bindings/objc/DOMHTMLStyleElement.mm: Added.
759         * bindings/objc/DOMHTMLStyleElementInternal.h: Added.
760         * bindings/objc/DOMHTMLTableCaptionElement.h: Added.
761         * bindings/objc/DOMHTMLTableCaptionElement.mm: Added.
762         * bindings/objc/DOMHTMLTableCaptionElementInternal.h: Added.
763         * bindings/objc/DOMHTMLTableCellElement.h: Added.
764         * bindings/objc/DOMHTMLTableCellElement.mm: Added.
765         * bindings/objc/DOMHTMLTableCellElementInternal.h: Added.
766         * bindings/objc/DOMHTMLTableColElement.h: Added.
767         * bindings/objc/DOMHTMLTableColElement.mm: Added.
768         * bindings/objc/DOMHTMLTableColElementInternal.h: Added.
769         * bindings/objc/DOMHTMLTableElement.h: Added.
770         * bindings/objc/DOMHTMLTableElement.mm: Added.
771         * bindings/objc/DOMHTMLTableElementInternal.h: Added.
772         * bindings/objc/DOMHTMLTableRowElement.h: Added.
773         * bindings/objc/DOMHTMLTableRowElement.mm: Added.
774         * bindings/objc/DOMHTMLTableRowElementInternal.h: Added.
775         * bindings/objc/DOMHTMLTableSectionElement.h: Added.
776         * bindings/objc/DOMHTMLTableSectionElement.mm: Added.
777         * bindings/objc/DOMHTMLTableSectionElementInternal.h: Added.
778         * bindings/objc/DOMHTMLVideoElement.h: Added.
779         * bindings/objc/DOMHTMLVideoElement.mm: Added.
780         * bindings/objc/DOMHTMLVideoElementInternal.h: Added.
781
782 2016-08-01  Antti Koivisto  <antti@apple.com>
783
784         REGRESSION(r198943): drop-down menu navigation on fiddlevideo.com doesn't appear on iOS, works on OS X
785         https://bugs.webkit.org/show_bug.cgi?id=160406
786         rdar://problem/26310261
787
788         Reviewed by Simon Fraser.
789
790         On iOS we generate synthetic mouse events from taps. Click event is generated on tap only if the move event
791         doesn't produce visible changes to the document. This is important to make certain types of drop down menus
792         work.
793
794         The information on mutations is passed via WKContentObservation side channel which is updated from varous parts
795         of the code. Newly visible elements are detected CheckForVisibilityChangeOnRecalcStyle during style resolution.
796         This got broken by the style refactoring because it assumes that renderer is mutated along with style computation.
797         However mutation is now a separate step performed by RenderTreeUpdater.
798
799         Fix by moving CheckForVisibilityChange to RenderTreeUpdater.
800
801         Test: fast/content-observation/click-event-suppression-on-content-change.html
802
803         * style/RenderTreeUpdater.cpp:
804         (WebCore::RenderTreeUpdater::Parent::Parent):
805         (WebCore::RenderTreeUpdater::updateElementRenderer):
806         (WebCore::RenderTreeUpdater::tearDownRenderer):
807         (WebCore::elementImplicitVisibility):
808         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange):
809         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
810         * style/StyleTreeResolver.cpp:
811         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
812         (WebCore::Style::TreeResolver::pushParent):
813         (WebCore::Style::TreeResolver::resolveComposedTree):
814         (WebCore::Style::elementImplicitVisibility): Deleted.
815         (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::CheckForVisibilityChangeOnRecalcStyle): Deleted.
816         (WebCore::Style::CheckForVisibilityChangeOnRecalcStyle::~CheckForVisibilityChangeOnRecalcStyle): Deleted.
817
818 2016-08-01  Eric Carlson  <eric.carlson@apple.com>
819
820         [iOS] A video element that does not pause after exiting from fullscreen should be allowed to continue playing inline
821         https://bugs.webkit.org/show_bug.cgi?id=160416
822         <rdar://problem/27409854>
823
824         Reviewed by Alex Christensen.
825
826         * html/HTMLMediaElement.cpp:
827         (WebCore::HTMLMediaElement::exitFullscreen): If playback normally requires fullscreen but the 
828         element was not paused when exiting from fullscreen, set the 'playsinline' attribute so we won't
829         force fullscreen if playback is paused and resumes, and set the 'controls' attribute so the
830         user can control playback.
831
832 2016-08-01  Anders Carlsson  <andersca@apple.com>
833
834         Build fix.
835
836         * WebCore.xcodeproj/project.pbxproj:
837
838 2016-08-01  Eric Carlson  <eric.carlson@apple.com>
839
840         [Mac][iOS] Adopt MediaRemote "seek to playback position"
841         https://bugs.webkit.org/show_bug.cgi?id=160405
842         <rdar://problem/27547583>
843
844         Reviewed by Dean Jackson.
845
846         Test: media/remote-control-command-seek.html
847
848         * Modules/webaudio/AudioContext.h: Update for didReceiveRemoteControlCommand argument change.
849
850         * html/HTMLMediaElement.cpp:
851         (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): Support SeekToPlaybackPositionCommand.
852         Drive by fix, support Stop command.
853         (WebCore::HTMLMediaElement::supportsSeeking): New.
854         * html/HTMLMediaElement.h:
855
856         * platform/RemoteCommandListener.h:
857         (WebCore::RemoteCommandListenerClient::didReceiveRemoteControlCommand): Add command argument.
858         (WebCore::RemoteCommandListenerClient::supportsSeeking): New.
859         (WebCore::RemoteCommandListener::updateSupportedCommands): Ditto.
860         (WebCore::RemoteCommandListener::client): Ditto.
861
862         * platform/audio/PlatformMediaSession.cpp:
863         (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand): Add command argument.
864         (WebCore::PlatformMediaSession::supportsSeeking): New, pass through to client.
865         * platform/audio/PlatformMediaSession.h:
866
867         * platform/audio/PlatformMediaSessionManager.cpp:
868         (WebCore::PlatformMediaSessionManager::setCurrentSession): Tell remote command listener to
869         update supported commands.
870         (WebCore::PlatformMediaSessionManager::currentSession): Make const.
871         (WebCore::PlatformMediaSessionManager::didReceiveRemoteControlCommand): Add command argument.
872         (WebCore::PlatformMediaSessionManager::supportsSeeking): New, pass through to session.
873         * platform/audio/PlatformMediaSessionManager.h:
874
875         * platform/ios/RemoteCommandListenerIOS.h:
876         (WebCore::RemoteCommandListenerIOS::createWeakPtr):
877         * platform/ios/RemoteCommandListenerIOS.mm:
878         (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS): Support changePlaybackPositionCommand.
879         (WebCore::RemoteCommandListenerIOS::~RemoteCommandListenerIOS): Remove seekToTime target.
880         (WebCore::RemoteCommandListenerIOS::updateSupportedCommands): Update changePlaybackPositionCommand.
881
882         * platform/mac/MediaRemoteSoftLink.cpp:
883         * platform/mac/MediaRemoteSoftLink.h:
884
885         * platform/mac/RemoteCommandListenerMac.h:
886         * platform/mac/RemoteCommandListenerMac.mm:
887         (WebCore::RemoteCommandListenerMac::updateSupportedCommands): New, split out of constructor.
888         (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac): Split setup logic out into
889         updateSupportedCommands. Support MRMediaRemoteCommandSeekToPlaybackPosition. Don't assert when
890         receiving an unsupported command, it happens. Return error when a command isn't supported or
891         fails.
892
893         * testing/Internals.cpp:
894         (WebCore::Internals::postRemoteControlCommand): Add command argument parameter. Support
895         seektoplaybackposition.
896         * testing/Internals.h:
897         * testing/Internals.idl:
898
899 2016-08-01  Anders Carlsson  <andersca@apple.com>
900
901         Freeze DOMHTMLTitleElement and DOMHTMLUListElement bindings
902         https://bugs.webkit.org/show_bug.cgi?id=160415
903
904         Reviewed by Sam Weinig.
905
906         * DerivedSources.make:
907         * WebCore.xcodeproj/project.pbxproj:
908         * bindings/objc/DOMHTMLTitleElement.h: Added.
909         * bindings/objc/DOMHTMLTitleElement.mm: Added.
910         * bindings/objc/DOMHTMLTitleElementInternal.h: Added.
911         * bindings/objc/DOMHTMLUListElement.h: Added.
912         * bindings/objc/DOMHTMLUListElement.mm: Added.
913         * bindings/objc/DOMHTMLUListElementInternal.h: Added.
914
915 2016-08-01  Antti Koivisto  <antti@apple.com>
916
917         REGRESSION (r196383): Drop down CSS menus not working on cnet.com, apmex.com
918         https://bugs.webkit.org/show_bug.cgi?id=160390
919
920         Reviewed by Simon Fraser.
921
922         The case here is that we have a rule like
923
924             .enableHover:hover .child { ... }
925
926         and the "enableHover" class is added dynamically. The class change invalidation optimization code would figure out
927         that nothing needs to be invalidated as the class change doesn't make the rule match (since :hover doesn't match).
928
929         However for event driven hover to actually work the hover element needs to have its childrenAffectedByHover bit set.
930         This bits is set when the selector match is attempted, whether it actually matches or not. Since we optimized away
931         the style invalidation we never set the bit either.
932
933         Fix by treating :hover as always matching (==ignored) when collecting rules for invalidation optimization purposes.
934         Dynamic pseudo elements are already treated this way for similar reasons.
935
936         Test: fast/selectors/hover-invalidation-descendant-dynamic.html
937
938         * css/SelectorChecker.cpp:
939         (WebCore::SelectorChecker::checkOne):
940
941             Match always in CollectingRulesIgnoringVirtualPseudoElements mode (now slightly misnamed).
942
943             This mode is used for optimization purposes in StyleInvalidationAnalysis (which we care about here) and
944             StyleSharingResolver. The change is fine for both.
945
946         * cssjit/SelectorCompiler.cpp:
947         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsHovered):
948
949             Same change for the slow path selector checker.
950
951 2016-08-01  Darin Adler  <darin@apple.com>
952
953         [Cocoa] Freeze Objective-C bindings and stop autogenerating them: Step 1 - Convert a single file
954         https://bugs.webkit.org/show_bug.cgi?id=160386
955
956         Reviewed by Anders Carlsson.
957
958         No behavior change, no tests changed. I tested this locally by putting "#error" into the
959         files in the DerivedSources directory to make sure the build doesn't use those files even
960         if there are stale copies still sitting there.
961
962         Moving the bindings from WebCore to the legacy part of WebKit is something we also want to
963         do, but that is quite challenging to do one file at a time, so we will do that later.
964
965         For this first file, I did some hand edits to make the code in a the file a little less
966         peculiar. It's still awkward to have all those JSMainThreadNullState in there; should double
967         check that we really need them.
968
969         An important follow up step will be to cut down on the bindings. We have lots of bindings
970         that are only in the Private.h header, and it would be good to find a way to cut down on those.
971         And on iOS we would like eliminate these bindings entirely since they are not API there.
972
973         * DerivedSources.make: Moved HTMLTextAreaElement from a list we use for both JavaScript and
974         Objective-C DOM bindings to a list we use only for JavaScript bindings.
975         * WebCore.xcodeproj/project.pbxproj: Removed references to generated DOMHTMLTextAreaElement
976         files and instead reference the checked-in copies.
977         * bindings/objc/DOMHTMLTextAreaElement.h: Added.
978         * bindings/objc/DOMHTMLTextAreaElement.mm: Added.
979         * bindings/objc/DOMHTMLTextAreaElementInternal.h: Added.
980         * bindings/objc/DOMHTMLTextAreaElementPrivate.h: Added.
981
982 2016-08-01  Frederic Wang  <fwang@igalia.com>
983
984         Introduce a RenderMathMLFencedOperator class
985         https://bugs.webkit.org/show_bug.cgi?id=160245
986
987         Reviewed by Darin Adler.
988
989         We introduce a class to handle all the code specific to anonymous mfenced operators. In
990         particular many members of the RenderMathMLOperator class are going to be removed while
991         fixing bug 156537 but they may still need to stored and exposed in some way by mfenced
992         operators.
993
994         No new tests, behavior is unchanged.
995
996         * CMakeLists.txt: Add RenderMathMLFencedOperator.
997         * WebCore.xcodeproj/project.pbxproj: Ditto.
998         * rendering/RenderObject.h:
999         (WebCore::RenderObject::isRenderMathMLFencedOperator): Function to allow casting to
1000         RenderMathMLFencedOperator.
1001         * rendering/mathml/RenderMathMLFenced.cpp: Use RenderMathMLFencedOperator instead of
1002         RenderMathMLOperator and use the new name updateOperatorContent.
1003         (WebCore::RenderMathMLFenced::updateFromElement):
1004         (WebCore::RenderMathMLFenced::createMathMLOperator):
1005         (WebCore::RenderMathMLFenced::makeFences):
1006         (WebCore::RenderMathMLFenced::addChild):
1007         * rendering/mathml/RenderMathMLFenced.h: Use RenderMathMLFencedOperator instead of
1008         RenderMathMLOperator.
1009         * rendering/mathml/RenderMathMLFencedOperator.cpp: New class derived from RenderMathMLOperator
1010         (WebCore::RenderMathMLFencedOperator::RenderMathMLFencedOperator): Init form and operator
1011         flags with the specified parameters and init the text content.
1012         (WebCore::RenderMathMLFencedOperator::updateOperatorContent): We move the
1013         RenderMathMLOperator::updateTokenContent function used by anonymous operators here. It is
1014         renamed to avoid build errors due to conflicts with the other
1015         RenderMathMLOperator::updateTokenContent function.
1016         * rendering/mathml/RenderMathMLFencedOperator.h: New class for anonymous mfenced operators
1017         with getter and setter for the m_textContent. Also override RenderMathMLFencedOperator to
1018         allow casting to RenderMathMLFencedOperator.
1019         * rendering/mathml/RenderMathMLOperator.cpp:
1020         (WebCore::RenderMathMLOperator::RenderMathMLOperator): Simplify the constructors. Some
1021         initializations is moved in RenderMathMLOperator.h while other code is moved to
1022         RenderMathMLFencedOperator.
1023         (WebCore::RenderMathMLOperator::textContent): No need to handle the anonymous case here since
1024         it is handled in RenderMathMLFencedOperator.
1025         (WebCore::RenderMathMLOperator::updateTokenContent): We delete the version used for anonymous
1026         operators and move it into RenderMathMLFencedOperator.
1027         * rendering/mathml/RenderMathMLOperator.h: Make the class and some members overridable and
1028         exposed to the derived RenderMathMLFencedOperator class. We also move initialization of some
1029         members here.
1030
1031 2016-08-01  Youenn Fablet  <youennf@gmail.com>
1032
1033         Reduce the number of ResourceRequest copies in DocumentThreadableLoader
1034         https://bugs.webkit.org/show_bug.cgi?id=160338
1035
1036         Reviewed by Darin Adler.
1037
1038         No observable change of behavior.
1039
1040         Updating one of CachedResourceReques constructor to take a ResourceRequest&&.
1041         This allows reducing a ResourceRequest copy in DocumentThreadableLoader.
1042         Updating DocumentLoader and MediaResourceLoader accordingly (future optimization steps may look at making these
1043         two loaders more efficient with regards to Resource Request).
1044
1045         Updating ThreadableLoader to take a ResourceRequest&&.
1046         This allows reducing the number of copies in DocumentThreadableLoader.
1047         Updating clients of ThreadableLoader accordingly.
1048
1049         * Modules/fetch/FetchLoader.cpp:
1050         (WebCore::FetchLoader::start):
1051         * dom/Document.cpp:
1052         (WebCore::Document::didLoadResourceSynchronously):
1053         * dom/Document.h:
1054         * dom/ScriptExecutionContext.cpp:
1055         (WebCore::ScriptExecutionContext::didLoadResourceSynchronously):
1056         * dom/ScriptExecutionContext.h:
1057         * fileapi/FileReaderLoader.cpp:
1058         (WebCore::FileReaderLoader::start):
1059         * inspector/InspectorNetworkAgent.cpp:
1060         (WebCore::InspectorNetworkAgent::loadResource):
1061         * loader/DocumentLoader.cpp:
1062         (WebCore::DocumentLoader::startLoadingMainResource):
1063         * loader/DocumentThreadableLoader.cpp:
1064         (WebCore::DocumentThreadableLoader::loadResourceSynchronously):
1065         (WebCore::DocumentThreadableLoader::create):
1066         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
1067         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
1068         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
1069         (WebCore::DocumentThreadableLoader::redirectReceived):
1070         (WebCore::DocumentThreadableLoader::preflightSuccess):
1071         (WebCore::DocumentThreadableLoader::loadRequest):
1072         * loader/DocumentThreadableLoader.h:
1073         * loader/MediaResourceLoader.cpp:
1074         (WebCore::MediaResourceLoader::requestResource):
1075         * loader/ThreadableLoader.cpp:
1076         (WebCore::ThreadableLoader::create):
1077         (WebCore::ThreadableLoader::loadResourceSynchronously):
1078         * loader/ThreadableLoader.h:
1079         * loader/WorkerThreadableLoader.cpp:
1080         (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
1081         (WebCore::WorkerThreadableLoader::loadResourceSynchronously):
1082         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
1083         * loader/WorkerThreadableLoader.h:
1084         (WebCore::WorkerThreadableLoader::create):
1085         * loader/cache/CachedResourceRequest.cpp:
1086         (WebCore::CachedResourceRequest::CachedResourceRequest):
1087         * loader/cache/CachedResourceRequest.h:
1088         * page/EventSource.cpp:
1089         (WebCore::EventSource::connect):
1090         * workers/WorkerScriptLoader.cpp:
1091         (WebCore::WorkerScriptLoader::loadSynchronously):
1092         (WebCore::WorkerScriptLoader::loadAsynchronously):
1093         * xml/XMLHttpRequest.cpp:
1094         (WebCore::XMLHttpRequest::createRequest):
1095
1096 2016-07-31  Youenn Fablet  <youenn@apple.com>
1097
1098         Fetch Response built-ins should use @makeThisTypeError
1099         https://bugs.webkit.org/show_bug.cgi?id=160290
1100
1101         Reviewed by Darin Adler.
1102
1103         Covered by updated test.
1104
1105         Fixed type error checks.
1106         Making use of @makeThisTypeError to have the correct error message.
1107         Updating arrayBuffer, blob, json and text to return rejected promises in lieu of throwing
1108         in case the 'this' value is not q Response object.
1109
1110         * Modules/fetch/FetchResponse.js:
1111         (clone): Updated instanceof check and making use of @makeThisTypeError.
1112         (arrayBuffer): Ditto.
1113         (blob): Ditto.
1114         (formData): Ditto.
1115         (json): Ditto.
1116         (text): Ditto.
1117
1118 2016-07-31  Adrian Perez de Castro  <aperez@igalia.com>
1119
1120         [GTK] Implement missing WebCore::moveFile() using GLib functions
1121         https://bugs.webkit.org/show_bug.cgi?id=160363
1122
1123         Reviewed by Carlos Garcia Campos.
1124
1125         * platform/glib/FileSystemGlib.cpp:
1126         (WebCore::moveFile): Function added.
1127
1128 2016-07-31  Chris Dumez  <cdumez@apple.com>
1129
1130         Drop [StrictTypeChecking] in cases where it is a no-op
1131         https://bugs.webkit.org/show_bug.cgi?id=160387
1132
1133         Reviewed by Darin Adler.
1134
1135         Drop [StrictTypeChecking] in cases where it is a no-op. After r203949 & r203950,
1136         [StrictTypeChecking] only has an impact when used on operation parameters of
1137         string types and is currently used as a workaround for bugs in our overload
1138         resolution algorithm.
1139
1140         * Modules/mediastream/RTCPeerConnection.idl:
1141         * Modules/mediastream/RTCRtpSender.idl:
1142         * bindings/scripts/test/TestObj.idl:
1143         * bindings/scripts/test/TestTypedefs.idl:
1144         * html/canvas/ANGLEInstancedArrays.idl:
1145         * html/canvas/OESVertexArrayObject.idl:
1146         * html/canvas/WebGL2RenderingContext.idl:
1147         * html/canvas/WebGLDebugShaders.idl:
1148         * html/canvas/WebGLLoseContext.idl:
1149         * html/canvas/WebGLRenderingContextBase.idl:
1150         * svg/SVGAngle.idl:
1151         * svg/SVGColor.idl:
1152         * svg/SVGLength.idl:
1153         * svg/SVGLengthList.idl:
1154         * svg/SVGMatrix.idl:
1155         * svg/SVGNumberList.idl:
1156         * svg/SVGPaint.idl:
1157         * svg/SVGPathSegList.idl:
1158         * svg/SVGPoint.idl:
1159         * svg/SVGPointList.idl:
1160         * svg/SVGStringList.idl:
1161         * svg/SVGTransform.idl:
1162         * svg/SVGTransformList.idl:
1163
1164 2016-07-31  Nan Wang  <n_wang@apple.com>
1165
1166         AX: Add a check for touch event listener on iOS accessibility object
1167         https://bugs.webkit.org/show_bug.cgi?id=160388
1168
1169         Reviewed by Chris Fleizach.
1170
1171         dispatchTouchEvent() is not working correctly within AXPress() sometimes. Need to 
1172         investigate it more in the future. Now, adding a check for the touch event listener
1173         on the object's node so that iOS can handle dispatching the touch event instead.
1174
1175         Test: accessibility/ios-simulator/has-touch-event-listener.html
1176
1177         * accessibility/AccessibilityObject.h:
1178         * accessibility/ios/AccessibilityObjectIOS.mm:
1179         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
1180         (WebCore::AccessibilityObject::hasTouchEventListener):
1181         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1182         (appendStringToResult):
1183         (-[WebAccessibilityObjectWrapper _accessibilityHasTouchEventListener]):
1184         (-[WebAccessibilityObjectWrapper _accessibilityValueIsAutofilled]):
1185
1186 2016-07-30  Chris Dumez  <cdumez@apple.com>
1187
1188         Unreviewed, rebaseline bindings tests.
1189
1190         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1191         (webkit_dom_test_obj_set_property): Deleted.
1192         (webkit_dom_test_obj_get_property): Deleted.
1193         (webkit_dom_test_obj_class_init): Deleted.
1194         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1195         * bindings/scripts/test/JS/JSTestObj.cpp:
1196         (WebCore::jsTestObjStrictTypeCheckingAttribute): Deleted.
1197         (WebCore::jsTestObjStrictFloat): Deleted.
1198         (WebCore::setJSTestObjStrictTypeCheckingAttribute): Deleted.
1199         (WebCore::setJSTestObjStrictFloat): Deleted.
1200         * bindings/scripts/test/ObjC/DOMTestObj.h:
1201         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1202         (-[DOMTestObj strictTypeCheckingAttribute]): Deleted.
1203         (-[DOMTestObj setStrictTypeCheckingAttribute:]): Deleted.
1204         (-[DOMTestObj strictFloat]): Deleted.
1205         (-[DOMTestObj setStrictFloat:]): Deleted.
1206
1207 2016-07-30  Chris Dumez  <cdumez@apple.com>
1208
1209         Enable strict type checking for Window dictionary members
1210         https://bugs.webkit.org/show_bug.cgi?id=160356
1211
1212         Reviewed by Darin Adler.
1213
1214         Enable strict type checking for Window dictionary members. Technically,
1215         we should do strict type checking of all wrapper types but this patch
1216         focuses on Window because it is common to pass a Window dictionary
1217         member to Event constructors.
1218
1219         By strict type checking, I mean that we should throw a TypeError is
1220         the value is not null/undefined and does not implement the Window
1221         interface:
1222         - http://heycam.github.io/webidl/#es-interface
1223
1224         Firefox and Chrome comply with the specification already.
1225
1226         No new tests, updated / rebaselined existing tests.
1227
1228         * bindings/js/JSDictionary.cpp:
1229         (WebCore::JSDictionary::convertValue):
1230
1231 2016-07-30  Chris Dumez  <cdumez@apple.com>
1232
1233         [WebIDL] Enable strict type checking for nullable attribute setters of wrapper types
1234         https://bugs.webkit.org/show_bug.cgi?id=160375
1235
1236         Reviewed by Darin Adler.
1237
1238         Enable strict type checking for nullable attribute setters of wrapper types:
1239         - http://heycam.github.io/webidl/#es-nullable-type
1240         - http://heycam.github.io/webidl/#es-interface
1241
1242         For such attributes, if the JS tries to assign a value that is not null /
1243         undefined and does not have the expected wrapper type, then we now throw a
1244         TypeError instead of silently converting the value to null.
1245
1246         This behavior is consistent with Chrome and Firefox. It also helps identify
1247         bugs in JavaScript code.
1248
1249         No new tests, updated existing tests.
1250
1251         * Modules/webaudio/AudioBufferSourceNode.idl:
1252         * bindings/scripts/CodeGeneratorJS.pm:
1253         (GenerateImplementation):
1254         * bindings/scripts/test/JS/JSTestObj.cpp:
1255         (WebCore::setJSTestObjTestNullableObjAttr):
1256         (WebCore::setJSTestObjMutablePoint):
1257         (WebCore::setJSTestObjImmutablePoint):
1258         * bindings/scripts/test/TestObj.idl:
1259         * dom/Document.idl:
1260         * html/HTMLTableElement.idl:
1261         * svg/SVGAngle.idl:
1262         * svg/SVGAnimatedBoolean.idl:
1263         * svg/SVGAnimatedEnumeration.idl:
1264         * svg/SVGAnimatedInteger.idl:
1265         * svg/SVGAnimatedNumber.idl:
1266         * svg/SVGLength.idl:
1267         * svg/SVGMatrix.idl:
1268         * svg/SVGNumber.idl:
1269         * svg/SVGPathSegArcAbs.idl:
1270         * svg/SVGPathSegArcRel.idl:
1271         * svg/SVGPathSegCurvetoCubicAbs.idl:
1272         * svg/SVGPathSegCurvetoCubicRel.idl:
1273         * svg/SVGPathSegCurvetoCubicSmoothAbs.idl:
1274         * svg/SVGPathSegCurvetoCubicSmoothRel.idl:
1275         * svg/SVGPathSegCurvetoQuadraticAbs.idl:
1276         * svg/SVGPathSegCurvetoQuadraticRel.idl:
1277         * svg/SVGPathSegCurvetoQuadraticSmoothAbs.idl:
1278         * svg/SVGPathSegCurvetoQuadraticSmoothRel.idl:
1279         * svg/SVGPathSegLinetoAbs.idl:
1280         * svg/SVGPathSegLinetoHorizontalAbs.idl:
1281         * svg/SVGPathSegLinetoHorizontalRel.idl:
1282         * svg/SVGPathSegLinetoRel.idl:
1283         * svg/SVGPathSegLinetoVerticalAbs.idl:
1284         * svg/SVGPathSegLinetoVerticalRel.idl:
1285         * svg/SVGPathSegMovetoAbs.idl:
1286         * svg/SVGPathSegMovetoRel.idl:
1287         * svg/SVGPoint.idl:
1288         * svg/SVGPreserveAspectRatio.idl:
1289         * svg/SVGRect.idl:
1290
1291 2016-07-30  Youenn Fablet  <youenn@apple.com>
1292
1293         Synchronous preflight should check for successful responses
1294         https://bugs.webkit.org/show_bug.cgi?id=159350
1295
1296         Reviewed by Darin Adler.
1297
1298         Test: http/tests/xmlhttprequest/access-control-preflight-not-successful.html
1299
1300         * loader/CrossOriginPreflightChecker.cpp:
1301         (WebCore::CrossOriginPreflightChecker::doPreflight): Adding successful response check for synchronous
1302         preflighting.
1303
1304 2016-07-30  Chris Dumez  <cdumez@apple.com>
1305
1306         [WebIDL] Enable strict type checking for operations' nullable parameters of wrapper types
1307         https://bugs.webkit.org/show_bug.cgi?id=160374
1308
1309         Reviewed by Youenn Fablet.
1310
1311         Enable strict type checking for operations' nullable parameters of
1312         wrapper types to comply with the Web IDL specification:
1313         - http://heycam.github.io/webidl/#es-nullable-type
1314         - http://heycam.github.io/webidl/#es-interface
1315
1316         For such parameters, if the JS passes a value that is not null /
1317         undefined and does not have the expected wrapper type, then we now
1318         throw a TypeError instead of silently converting the value to null.
1319
1320         This behavior is consistent with Chrome and Firefox. It also helps
1321         identify bugs in JavaScript code.
1322
1323         No new tests, rebaselined existing tests.
1324
1325         * bindings/scripts/CodeGeneratorJS.pm:
1326         (GenerateParametersCheck):
1327         * bindings/scripts/test/JS/JSTestObj.cpp:
1328         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapper):
1329         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapperIsNull):
1330         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolver):
1331         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
1332         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
1333         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6):
1334         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
1335         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
1336         (WebCore::jsTestObjPrototypeFunctionConvert2):
1337         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
1338         (WebCore::jsTestObjPrototypeFunctionConditionalMethod3): Deleted.
1339         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5): Deleted.
1340         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod): Deleted.
1341         (WebCore::jsTestObjPrototypeFunctionOrange): Deleted.
1342
1343 2016-07-29  Chris Dumez  <cdumez@apple.com>
1344
1345         Window's named properties should be exposed on a WindowProperties object in its prototype
1346         https://bugs.webkit.org/show_bug.cgi?id=160354
1347
1348         Reviewed by Gavin Barraclough.
1349
1350         Window's named properties should be exposed on a WindowProperties object
1351         in its prototype:
1352         - http://heycam.github.io/webidl/#named-properties-object
1353
1354         Firefox and Chrome both comply with the specification. However, WebKit
1355         had no "WindowProperties" object in the Window prototype chain and the
1356         named properties are exposed on the Window object itself.
1357
1358         No new tests, rebaselined existing tests.
1359
1360         * CMakeLists.txt:
1361         * WebCore.xcodeproj/project.pbxproj:
1362         * bindings/js/JSBindingsAllInOne.cpp:
1363         * bindings/js/JSDOMWindowCustom.cpp:
1364         (WebCore::JSDOMWindow::getOwnPropertySlot):
1365         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
1366         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): Deleted.
1367         (WebCore::JSDOMWindow::put): Deleted.
1368         (WebCore::JSDOMWindow::putByIndex): Deleted.
1369         (WebCore::JSDOMWindow::getEnumerableLength): Deleted.
1370         * bindings/js/JSDOMWindowProperties.cpp: Added.
1371         (WebCore::jsDOMWindowPropertiesGetOwnPropertySlotNamedItemGetter):
1372         (WebCore::JSDOMWindowProperties::getOwnPropertySlot):
1373         (WebCore::JSDOMWindowProperties::getOwnPropertySlotByIndex):
1374         * bindings/js/JSDOMWindowProperties.h: Added.
1375         (WebCore::JSDOMWindowProperties::create):
1376         (WebCore::JSDOMWindowProperties::createStructure):
1377         (WebCore::JSDOMWindowProperties::JSDOMWindowProperties):
1378         * bindings/js/JSDOMWindowShell.cpp:
1379         (WebCore::JSDOMWindowShell::setWindow):
1380
1381 2016-07-29  Daniel Bates  <dabates@apple.com>
1382
1383         Crash under HTMLMediaElement::{resolve, reject}PendingPlayPromises() when playback is interrupted
1384         https://bugs.webkit.org/show_bug.cgi?id=160366
1385         <rdar://problem/27317407>
1386
1387         Reviewed by Eric Carlson.
1388
1389         Fixes a crash/assertion failure in DeferredWrapper::{resolve, rejectWithValue}() caused by a Promise
1390         being settled twice. In particular, if a system interruption occurs when media.play() is invoked
1391         the returned Promise may ultimately be settled twice upon cessation of the interruption.
1392
1393         A Promise can be settled (resolved) exactly once. When a system interruption occurs media
1394         playback is paused and resumes on cessation of the interruption. Currently we also immediately
1395         reject the Promise p retuned by media.play() if the interruption occurs during its invocation.
1396         So, when we resume playback on cessation of an interruption we try to resolve p again. But a
1397         Promise can only be resolved once and hence we violate the assertions that p has both a valid
1398         reference to a JSPromiseDeferred object and a reference to the global object of the page.
1399
1400         Tests: media/non-existent-video-playback-interrupted.html
1401                media/video-playback-interrupted.html
1402
1403         * html/HTMLMediaElement.cpp:
1404         (WebCore::HTMLMediaElement::play): Modified to reject the Promise and return immediately if
1405         playInternal() returns false.
1406         (WebCore::HTMLMediaElement::playInternal): Treat an interruption as success and return true
1407         so that HTMLMediaElement::play() adds the Promise to the end of the list of pending promises.
1408         We treat an interruption as a success because we will resume playback (assuming the media
1409         can be loaded and is well-formed) upon cessation of the interruption and therefore can either
1410         fulfill or reject the Promise object returned by media.play().
1411
1412 2016-07-29  Daniel Bates  <dabates@apple.com>
1413
1414         [iOS] HTMLMediaElement::updateVolume() calls MediaPlayer::volume() on null media player
1415         https://bugs.webkit.org/show_bug.cgi?id=160353
1416
1417         Reviewed by Eric Carlson.
1418
1419         Using testing functions HTMLMediaElement::updateVolume() can be called on a <video> element
1420         without an associated video. We should support this usage on iOS just as we do for non-iOS
1421         ports.
1422
1423         The use of testing functions to call HTMLMediaElement::updateVolume() on a <video> element
1424         without an associated video is demonstrated by the test LayoutTests/media/video-muted-after-setting-page-muted-state.html.
1425
1426         * html/HTMLMediaElement.cpp:
1427         (WebCore::HTMLMediaElement::updateVolume):
1428
1429 2016-07-29  Wenson Hsieh  <wenson_hsieh@apple.com>
1430
1431         Media controls are not displayed for some autoplaying videos at certain browser dimensions
1432         https://bugs.webkit.org/show_bug.cgi?id=160360
1433         <rdar://problem/27179484>
1434
1435         Reviewed by Myles C. Maxfield.
1436
1437         Previously, if a video's aspect ratio fell outside of the range [0.5, 1.8], we would
1438         not consider it main content and would subsequently not show media controls for it.
1439         This meant that on many websites that scale video dimensions to match the mainframe,
1440         if the mainframe is too wide (e.g. full bounds on a widescreen display) we would not
1441         consider the video to be main content. To fix this, we only consider aspect ratio to
1442         be a requirement if the video does not already take up most of the space in the
1443         mainframe.
1444
1445         Covered by two new TestWebKitAPI unit tests.
1446
1447         * html/MediaElementSession.cpp:
1448         (WebCore::isElementLargeRelativeToMainFrame):
1449         (WebCore::isElementLargeEnoughForMainContent):
1450
1451 2016-07-29  Zalan Bujtas  <zalan@apple.com>
1452
1453         Do not set negative rate on AVSampleBufferRenderSynchronizer.
1454         https://bugs.webkit.org/show_bug.cgi?id=160326
1455         <rdar://problem/27355214>
1456
1457         Reviewed by Eric Carlson.
1458
1459         Test: http/tests/media/media-source/mediasource-play-then-seek-back-with-remote-control.html
1460
1461         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1462         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setRateDouble):
1463
1464 2016-07-29  Myles C. Maxfield  <mmaxfield@apple.com>
1465
1466         Backspace key removes only the rainbow from the rainbow flag
1467         https://bugs.webkit.org/show_bug.cgi?id=160349
1468         <rdar://problem/27594995>
1469
1470         Reviewed by Dean Jackson.
1471
1472         In r203330 I added support for new emoji group candidates. I accidentally
1473         missed one of the new emoji code points.
1474
1475         Test: editing/deleting/delete-emoji.html
1476
1477         * platform/text/CharacterProperties.h:
1478         (WebCore::isEmojiGroupCandidate):
1479
1480 2016-07-29  Nan Wang  <n_wang@apple.com>
1481
1482         AX: Media controls accessibility improvement
1483         https://bugs.webkit.org/show_bug.cgi?id=160223
1484         <rdar://problem/27558003>
1485
1486         Reviewed by Eric Carlson.
1487
1488         Changes in this patch:
1489         1. Added a change observer for volume slider so that it will handle accessibility 
1490            increment/decrement functions correctly.
1491         2. Update the timer div's aria-label when time changes.
1492         3. Added a keydown handler for left/right arrow adjusting the timeline, so that the
1493            value increment/decrement in a reasonable way.
1494         4. Changed the mute button's role to checkbox since it only has on/off states.
1495
1496         Test: media/media-controls-accessibility.html
1497
1498         * Modules/mediacontrols/mediaControlsApple.js:
1499         (Controller.prototype.createControls):
1500         (Controller.prototype.updatePictureInPictureButton):
1501         (Controller.prototype.timelineStepFromVideoDuration):
1502         (Controller.prototype.incrementTimelineValue):
1503         (Controller.prototype.decrementTimelineValue):
1504         (Controller.prototype.showInlinePlaybackPlaceholderWhenSafe):
1505         (Controller.prototype.handleTimelineMouseUp):
1506         (Controller.prototype.handleTimelineKeyDown):
1507         (Controller.prototype.handleMuteButtonClicked):
1508         (Controller.prototype.handleMinButtonClicked):
1509         (Controller.prototype.handleMaxButtonClicked):
1510         (Controller.prototype.updateVideoVolume):
1511         (Controller.prototype.handleVolumeSliderInput):
1512         (Controller.prototype.handleVolumeSliderChange):
1513         (Controller.prototype.handleVolumeSliderMouseDown):
1514         (Controller.prototype.updateTime):
1515         (Controller.prototype.updateControlsWhileScrubbing):
1516         (Controller.prototype.updateVolume):
1517
1518 2016-07-29  Mark Lam  <mark.lam@apple.com>
1519
1520         Remove an unused line of code.
1521         https://bugs.webkit.org/show_bug.cgi?id=160350
1522
1523         Reviewed by Simon Fraser.
1524
1525         No new tests because there's no behavior change.  Just removing dead code.
1526
1527         SVGInlineTextBox::paintText() instantiates a local variable selectionTextRun. 
1528         Thanks to analysis by Said Abou-Hallawa, we know that selectionTextRun
1529         was introduced in https://trac.webkit.org/changeset/61393, but was later
1530         rendered unused in https://trac.webkit.org/changeset/62099 because we
1531         switched to using paintTextWithShadows() with the selectionStyle.  Hence,
1532         selectionTextRun can be removed.
1533
1534         * rendering/svg/SVGInlineTextBox.cpp:
1535         (WebCore::SVGInlineTextBox::paintText):
1536
1537 2016-07-29  Eric Carlson  <eric.carlson@apple.com>
1538
1539         Change internal AVCaptureDeviceType typedef name
1540         https://bugs.webkit.org/show_bug.cgi?id=160345
1541         <rdar://problem/27610935>
1542
1543         Reviewed by Dean Jackson.
1544
1545         * platform/mediastream/mac/AVAudioCaptureSource.mm:
1546         (WebCore::AVAudioCaptureSource::create): AVCaptureDeviceType -> AVCaptureDeviceTypedef
1547         (WebCore::AVAudioCaptureSource::AVAudioCaptureSource): Ditto.
1548
1549         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1550         (WebCore::AVCaptureDeviceManager::captureDeviceList): Ditto.
1551         (WebCore::shouldConsiderDeviceInDeviceList): Ditto.
1552         (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList): Ditto.
1553         (WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints): Ditto.
1554         (WebCore::AVCaptureDeviceManager::deviceConnected): Ditto.
1555         (WebCore::AVCaptureDeviceManager::deviceDisconnected): Ditto.
1556         (-[WebCoreAVCaptureDeviceManagerObserver deviceDisconnected:]): Ditto.
1557
1558         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1559         (WebCore::globaVideoCaptureSerialQueue): Ditto.
1560         (WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Ditto.
1561
1562         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1563         (WebCore::AVVideoCaptureSource::create): Ditto.
1564         (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto.
1565
1566 2016-07-28  Dean Jackson  <dino@apple.com>
1567
1568         color-gamut media query returns incorrect results
1569         https://bugs.webkit.org/show_bug.cgi?id=160166
1570         <rdar://problem/27537577>
1571
1572         Reviewed by Darin Adler.
1573
1574         While I was unable to reproduce the originator's issue,
1575         we communicated via email and it might have been related
1576         to a customized color space calibration on an external
1577         display.
1578
1579         Anyway, I took this opportunity to update to use the
1580         more appropriate API for detection on macOS Sierra.
1581
1582         Covered by the existing fast/media/mq-color-gamut.html test.
1583
1584         * platform/mac/PlatformScreenMac.mm:
1585         (WebCore::screenSupportsExtendedColor): Use NSScreen canRepresentDisplayGamut.
1586
1587 2016-07-29  George Ruan  <gruan@apple.com>
1588
1589         HTMLVideoElement with MediaStream src shows paused image when all video tracks are disabled
1590         https://bugs.webkit.org/show_bug.cgi?id=160222
1591         <rdar://problem/27557313>
1592
1593         Reviewed by Eric Carlson.
1594
1595         Tests: fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html
1596                fast/mediastream/MediaStream-video-element-video-tracks-disabled.html
1597
1598         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
1599         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1600         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Change criteria to enqueue a
1601         Sample Buffer to the AVSampleBufferDisplayLayer to allow an initial frame to be shown.
1602         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::shouldEnqueueVideoSampleBuffer): Allow an initial frame to be shown.
1603         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushAndRemoveVideoSampleBuffers): Removes all buffers from the
1604         AVSampleBufferDisplayLayer.
1605         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Make the AVSampleBufferDisplayLayer's background black.
1606         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Remove all buffers from the AVSampleBufferDisplayLayer
1607         when state of MediaPlayerPrivateMediaStreamAVFObjC is changed to None of PaintItBlack.
1608         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updatePausedImage): Updates paused image.
1609         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Calls updatePausedImage.
1610         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext): Allow an initial frame to be painted to canvas.
1611
1612 2016-07-29  Youenn Fablet  <youenn@apple.com>
1613
1614         [Fetch API] Activate credentials mode
1615         https://bugs.webkit.org/show_bug.cgi?id=160292
1616
1617         Reviewed by Alex Christensen.
1618
1619         Covered by updated and rebased tests.
1620
1621         Previously the allowCredentials option was computed by DocumentThreadableLoader clients.
1622         This option is really similar to the credentials flag in the fetch specification and should be handled at lower levels.
1623         In the future, it might be good to retire that option.
1624
1625         In case of Omit mode, we need to explicitely disable cookies in DocumentThreadableLoader.
1626         This should be updated so that ResourceLoader does it, depending on credential flag being set or not.
1627
1628         Updated DocumentThreadableLoader clients to only use FetchOptions::Credentials.
1629         This allows to link code more easely to specification.
1630
1631         * Modules/fetch/FetchLoader.cpp:
1632         (WebCore::FetchLoader::start): Removing use of allowCredentials option. Using FetchOptions::Credentials instead.
1633         * fileapi/FileReaderLoader.cpp:
1634         (WebCore::FileReaderLoader::start): Ditto.
1635         * inspector/InspectorNetworkAgent.cpp:
1636         (WebCore::InspectorNetworkAgent::loadResource): Ditto.
1637         * loader/DocumentThreadableLoader.cpp:
1638         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Computing allowCredentials from FetchOptions::Credentials.
1639         (WebCore::DocumentThreadableLoader::loadRequest): Enabling cookie only if allowed to use credentials. This is in
1640         particular useful for FetchOptions::Credentials::Omit mode.
1641         * page/EventSource.cpp:
1642         (WebCore::EventSource::connect): Removing use of allowCredentials option. Using FetchOptions::Credentials instead.
1643         * workers/WorkerScriptLoader.cpp:
1644         (WebCore::WorkerScriptLoader::loadSynchronously): Ditto.
1645         (WebCore::WorkerScriptLoader::loadAsynchronously): Ditto.
1646         * xml/XMLHttpRequest.cpp: Ditto.
1647         (WebCore::XMLHttpRequest::createRequest):
1648
1649 2016-07-29  Youenn Fablet  <youenn@apple.com>
1650
1651         CrossOrigin preflight checker should compute the right Access-Control-Request-Headers value
1652         https://bugs.webkit.org/show_bug.cgi?id=160028
1653
1654         Reviewed by Alex Christensen.
1655
1656         Covered by updated test.
1657
1658         Computing Access-Control-Request-Headers value according https://fetch.spec.whatwg.org/#cors-preflight-fetch:
1659         - Remove safe headers
1660         - lowercase header names
1661         - sort lexicographically header names
1662         The only difference is that we keep separating headers with ', ' instead of ',' as per the spec.
1663         Also, some headers that might be safe are still marked as unsafe (DPR, Downlink...).
1664
1665         Moved setting of Origin header after preflighting, consistently with fetch spec.
1666
1667         * loader/CrossOriginAccessControl.cpp:
1668         (WebCore::createAccessControlPreflightRequest): Implementing new computation of Access-Control-Request-Headers.
1669         * loader/DocumentThreadableLoader.cpp:
1670         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest): Removing call to updateRequestForAccessControl (which sets Origin header value).
1671         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest): Adding call to updateRequestForAccessControl.
1672         (WebCore::DocumentThreadableLoader::preflightSuccess): Ditto.
1673         * platform/network/HTTPParsers.cpp:
1674         (WebCore::isCrossOriginSafeRequestHeader): Helper routine to implement https://fetch.spec.whatwg.org/#cors-safelisted-request-header.
1675         * platform/network/HTTPParsers.h:
1676
1677 2016-07-29  Frederic Wang  <fwang@igalia.com>
1678
1679         Parse the operator text on the MathMLOperatorElement class.
1680         https://bugs.webkit.org/show_bug.cgi?id=160241
1681
1682         Reviewed by Darin Adler.
1683
1684         The text of the MathML operators is important to determine form or dictionary properties and
1685         hence provide default values when no explicit attributes are privided. Since that text only
1686         depends on the MathML DOM content, it makes sense to move its parsing into
1687         MathMLOperatorElement. Anonymous operators created by the mfenced elements still need to be
1688         handled specially and this will be true for all the operator properties that can just be
1689         determined in MathMLOperatorElement. Hence in a follow-up patch we will introduce a class
1690         to move all the code specific to mfenced in a class derived from RenderMathMLOperator while
1691         we continue to move the corresponding code for non-anonymous into MathMLOperatorElement.
1692
1693         No new tests, behavior is unchanged.
1694
1695         * mathml/MathMLOperatorElement.cpp: Include header for hyphenMinus/minusSign characters.
1696         (WebCore::MathMLOperatorElement::parseOperatorText): Move that code from rebuildTokenContent
1697         (WebCore::MathMLOperatorElement::operatorText): Helper function to get the cached text.
1698         (WebCore::MathMLOperatorElement::childrenChanged): Make the cached text dirty.
1699         * mathml/MathMLOperatorElement.h: Update defitions and add a member for the operator text.
1700         * mathml/MathMLTextElement.h: Make childrenChanged overridable.
1701         * rendering/mathml/RenderMathMLOperator.cpp:
1702         (WebCore::RenderMathMLOperator::element): Helper function to cast to a MathMLOperatorElement.
1703         (WebCore::RenderMathMLOperator::textContent): Helper function to call
1704         MathMLOperatorElement::operatorText or fallback to m_textContent for anonymous operators.
1705         m_textContent and this special case can be moved into a derived class later.
1706         (WebCore::RenderMathMLOperator::setOperatorProperties): Call textContent().
1707         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Ditto.
1708         (WebCore::RenderMathMLOperator::rebuildTokenContent): Remove the string parameter and the
1709         parsing of the operator text.
1710         (WebCore::RenderMathMLOperator::updateTokenContent): Call textContent(). The special function
1711         for anonymous operators also parses the text content but this could be moved into a derived
1712         class later.
1713         (WebCore::RenderMathMLOperator::shouldAllowStretching): Call textContent().
1714         (WebCore::RenderMathMLOperator::useMathOperator): Ditto.
1715         (WebCore::RenderMathMLOperator::RenderMathMLOperator): No need to initialize m_textContent
1716         as it is not used anymore for non-anonymous renderers.
1717         * rendering/mathml/RenderMathMLOperator.h: Update definitions and call textContent().
1718
1719 2016-07-28  Youenn Fablet  <youenn@apple.com>
1720
1721         Binding generator should expose the visible interface name in error messages
1722         https://bugs.webkit.org/show_bug.cgi?id=160192
1723
1724         Reviewed by Darin Adler.
1725
1726         Covered by updated layout and binding tests.
1727
1728         * bindings/scripts/CodeGeneratorJS.pm:
1729         (GenerateImplementation): Using visibleInterfaceName instead of interfaceName.
1730         (GenerateFunctionCastedThis): Ditto.
1731         (GenerateParametersCheck): Ditto.
1732         (GenerateConstructorDefinition): Ditto.
1733         * bindings/scripts/test/JS/JSTestObj.cpp: Rebased.
1734         * bindings/scripts/test/TestObj.idl: Adding ConstructorCallWith to exercice change in GenerateConstructorDefinition.
1735
1736 2016-07-28  Carlos Garcia Campos  <cgarcia@igalia.com>
1737
1738         Split calculateCacheSizes in two methods
1739         https://bugs.webkit.org/show_bug.cgi?id=160237
1740
1741         Reviewed by Darin Adler.
1742
1743         Rename getVolumeFreeSizeForPath as volumeFreeSizeForPath and make it available to all platforms adding an
1744         implementation for mac.
1745
1746         * platform/FileSystem.h:
1747         * platform/efl/FileSystemEfl.cpp:
1748         (WebCore::volumeFreeSizeForPath):
1749         (WebCore::getVolumeFreeSizeForPath): Deleted.
1750         * platform/glib/FileSystemGlib.cpp:
1751         (WebCore::volumeFreeSizeForPath):
1752         (WebCore::getVolumeFreeSizeForPath): Deleted.
1753         * platform/mac/FileSystemMac.mm:
1754         (WebCore::volumeFreeSizeForPath):
1755         * platform/win/FileSystemWin.cpp:
1756         (WebCore::volumeFreeSizeForPath):
1757
1758 2016-07-28  Myles C. Maxfield  <mmaxfield@apple.com>
1759
1760         Remove deprecated SPI for video inline / fullscreen controls
1761         https://bugs.webkit.org/show_bug.cgi?id=160318
1762
1763         Reviewed by Tim Horton.
1764
1765         r203752 deprecated the SPI allowsInlineMediaPlaybackWithPlaysInlineAttribute
1766         and allowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute (in favor of
1767         inlineMediaPlaybackRequiresPlaysInlineAttribute). This patch removes the
1768         deprecated SPI symbols.
1769
1770         No new tests because there is no behavior change.
1771
1772         * page/Settings.cpp:
1773         * page/Settings.in:
1774         * testing/InternalSettings.cpp:
1775         (WebCore::InternalSettings::Backup::Backup): Deleted.
1776         (WebCore::InternalSettings::Backup::restoreTo): Deleted.
1777         (WebCore::InternalSettings::setAllowsInlineMediaPlaybackWithPlaysInlineAttribute): Deleted.
1778         (WebCore::InternalSettings::setAllowsInlineMediaPlaybackWithWebKitPlaysInlineAttribute): Deleted.
1779         * testing/InternalSettings.h:
1780         * testing/InternalSettings.idl:
1781
1782 2016-07-28  Chris Dumez  <cdumez@apple.com>
1783
1784         Add support for Element.getAttributeNames()
1785         https://bugs.webkit.org/show_bug.cgi?id=160327
1786
1787         Reviewed by Alex Christensen.
1788
1789         Add support for Element.getAttributeNames():
1790         - https://dom.spec.whatwg.org/#dom-element-getattributenames
1791
1792         Firefox already supports this, Chrome 52 does not yet.
1793
1794         Test: fast/dom/Element/getAttributeNames.html
1795
1796         * bindings/js/JSDOMBinding.h:
1797         (WebCore::JSValueTraits<AtomicString>::arrayJSValue):
1798         * dom/Element.cpp:
1799         (WebCore::Element::getAttributeNames):
1800         * dom/Element.h:
1801         * dom/Element.idl:
1802
1803 2016-07-28  Chris Dumez  <cdumez@apple.com>
1804
1805         window.open.length should be 0
1806         https://bugs.webkit.org/show_bug.cgi?id=160323
1807
1808         Reviewed by Darin Adler.
1809
1810         window.open.length should be 0 as all its parameters are optional:
1811         - https://html.spec.whatwg.org/multipage/browsers.html#the-window-object
1812
1813         It is 2 in WebKit. Firefox and Chrome agree with the specification and return 0.
1814
1815         No new tests, rebaselined existing test.
1816
1817         * bindings/js/JSDOMWindowCustom.cpp:
1818         (WebCore::JSDOMWindow::open):
1819         Minor code optimization.
1820
1821         * page/DOMWindow.idl:
1822         Update IDL to match the specification and our custom implementation.
1823         This makes us return the right "length" value.
1824
1825 2016-07-28  Chris Dumez  <cdumez@apple.com>
1826
1827         Parameters to Event.initEvent() should be mandatory
1828         https://bugs.webkit.org/show_bug.cgi?id=160320
1829
1830         Reviewed by Darin Adler.
1831
1832         Parameters to Event.initEvent() should be mandatory:
1833         - https://dom.spec.whatwg.org/#interface-event
1834
1835         Firefox agrees with the specification. Chrome does not.
1836
1837         No new tests, rebaselined existing tests.
1838
1839         * dom/Event.idl:
1840
1841 2016-07-28  Anders Carlsson  <andersca@apple.com>
1842
1843         Move a Mail.app workaround closer to where it's actually needed
1844         https://bugs.webkit.org/show_bug.cgi?id=160317
1845
1846         Reviewed by Tim Horton.
1847
1848         * loader/FrameLoader.cpp:
1849         (WebCore::FrameLoader::loadArchive):
1850         * platform/network/cf/ResourceRequest.h:
1851         * platform/network/cocoa/ResourceRequestCocoa.mm:
1852         (WebCore::ResourceRequest::applyWebArchiveHackForMail): Deleted.
1853         * platform/network/mac/ResourceRequestMac.mm:
1854         (WebCore::ResourceRequest::applyWebArchiveHackForMail): Deleted.
1855
1856 2016-07-28  Chris Dumez  <cdumez@apple.com>
1857
1858         2 first parameters to window.postMessage() should be mandatory
1859         https://bugs.webkit.org/show_bug.cgi?id=160319
1860
1861         Reviewed by Darin Adler.
1862
1863         2 first parameters to window.postMessage() should be mandatory:
1864         - https://html.spec.whatwg.org/multipage/browsers.html#the-window-object
1865
1866         Firefox and Chrome agree with the specification.
1867
1868         No new tests, rebaselined existing test.
1869
1870         * bindings/js/JSDOMWindowCustom.cpp:
1871         (WebCore::handlePostMessage):
1872
1873 2016-07-28  Chris Dumez  <cdumez@apple.com>
1874
1875         First parameter to canvas.getContext() / probablySupportsContext() should be mandatory
1876         https://bugs.webkit.org/show_bug.cgi?id=160312
1877
1878         Reviewed by Darin Adler.
1879
1880         First parameter to canvas.getContext() / probablySupportsContext()
1881         should be mandatory:
1882         - http://w3c.github.io/html/semantics-scripting.html#the-canvas-element
1883
1884         Firefox and Chrome agree with the specification for getContext().
1885         Neither of them supports probablySupportsContext().
1886
1887         No new tests, rebaselined existing tests.
1888
1889         * bindings/js/JSHTMLCanvasElementCustom.cpp:
1890         (WebCore::JSHTMLCanvasElement::getContext):
1891         (WebCore::JSHTMLCanvasElement::probablySupportsContext):
1892         * html/HTMLCanvasElement.idl:
1893
1894 2016-07-28  Chris Dumez  <cdumez@apple.com>
1895
1896         Parameter to table.deleteRow() / body.deleteRow() should be mandatory
1897         https://bugs.webkit.org/show_bug.cgi?id=160307
1898
1899         Reviewed by Ryosuke Niwa.
1900
1901         Parameter to table.deleteRow() / body.deleteRow() should be mandatory:
1902         - https://html.spec.whatwg.org/multipage/tables.html#the-table-element
1903         - https://html.spec.whatwg.org/multipage/tables.html#htmltablesectionelement
1904
1905         Firefox and Chrome agree with the specification.
1906
1907         No new tests, rebaselined existing test.
1908
1909         * html/HTMLTableElement.idl:
1910         * html/HTMLTableSectionElement.idl:
1911
1912 2016-07-28  Commit Queue  <commit-queue@webkit.org>
1913
1914         Unreviewed, rolling out r203826.
1915         https://bugs.webkit.org/show_bug.cgi?id=160314
1916
1917         The test added with this change fails on El Capitan WK2.
1918         (Requested by ryanhaddad on #webkit).
1919
1920         Reverted changeset:
1921
1922         "HTMLVideoElement with MediaStream src shows paused image when
1923         all video tracks are disabled"
1924         https://bugs.webkit.org/show_bug.cgi?id=160222
1925         http://trac.webkit.org/changeset/203826
1926
1927 2016-07-28  Chris Dumez  <cdumez@apple.com>
1928
1929         2 first parameters to input.setSelectionRange() should be mandatory
1930         https://bugs.webkit.org/show_bug.cgi?id=160310
1931
1932         Reviewed by Alex Christensen.
1933
1934         2 first parameters to input.setSelectionRange() should be mandatory:
1935         - https://html.spec.whatwg.org/multipage/forms.html#htmlinputelement
1936
1937         Calling this method without the 2 first parameters makes little
1938         sense.
1939
1940         Firefox agrees with the specification, Chrome does not.
1941
1942         No new tests, rebaselined existing test.
1943
1944         * bindings/js/JSHTMLInputElementCustom.cpp:
1945         (WebCore::JSHTMLInputElement::setSelectionRange):
1946         * html/HTMLInputElement.idl:
1947
1948 2016-07-28  Anders Carlsson  <andersca@apple.com>
1949
1950         Remove an unnecessary comment from UUID.h
1951         https://bugs.webkit.org/show_bug.cgi?id=160313
1952
1953         Reviewed by Simon Fraser.
1954
1955         * platform/UUID.h:
1956
1957 2016-07-28  Chris Dumez  <cdumez@apple.com>
1958
1959         Parameter to tr.deleteCell() should be mandatory
1960         https://bugs.webkit.org/show_bug.cgi?id=160308
1961
1962         Reviewed by Ryosuke Niwa.
1963
1964         Parameter to tr.deleteCell() should be mandatory:
1965         - https://html.spec.whatwg.org/multipage/tables.html#htmltablerowelement
1966
1967         Firefox and Chrome agree with the specification.
1968
1969         No new tests, rebaselined existing tests.
1970
1971         * html/HTMLTableRowElement.idl:
1972
1973 2016-07-28  Chris Dumez  <cdumez@apple.com>
1974
1975         [Bindings] "length" value of overloaded operations may be wrong
1976         https://bugs.webkit.org/show_bug.cgi?id=160303
1977
1978         Reviewed by Ryosuke Niwa.
1979
1980         "length" value of overloaded operations may be wrong because we fail to
1981         account for overloads when computing the length of a function:
1982         - https://heycam.github.io/webidl/#es-operations
1983
1984         No new tests, rebaselined existing test.
1985
1986         * bindings/scripts/CodeGeneratorJS.pm:
1987         (GetFunctionLength):
1988         * bindings/scripts/test/JS/JSTestObj.cpp:
1989
1990 2016-07-28  George Ruan  <gruan@apple.com>
1991
1992         HTMLVideoElement with MediaStream src shows paused image when all video tracks are disabled
1993         https://bugs.webkit.org/show_bug.cgi?id=160222
1994         <rdar://problem/27557313>
1995
1996         Reviewed by Eric Carlson.
1997
1998         Tests: fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html
1999                fast/mediastream/MediaStream-video-element-video-tracks-disabled.html
2000
2001         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
2002         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
2003         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Change criteria to enqueue a
2004         Sample Buffer to the AVSampleBufferDisplayLayer to allow an initial frame to be shown.
2005         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::shouldEnqueueVideoSampleBuffer): Allow an initial frame to be shown.
2006         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushAndRemoveVideoSampleBuffers): Removes all buffers from the
2007         AVSampleBufferDisplayLayer.
2008         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Make the AVSampleBufferDisplayLayer's background black.
2009         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Remove all buffers from the AVSampleBufferDisplayLayer
2010         when state of MediaPlayerPrivateMediaStreamAVFObjC is changed to None of PaintItBlack.
2011         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updatePausedImage): Updates paused image.
2012         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Calls updatePausedImage.
2013         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext): Allow an initial frame to be painted to canvas.
2014
2015 2016-07-28  Dean Jackson  <dino@apple.com>
2016
2017         REGRESSION (r202880): Default controls pip glyph inverted
2018         https://bugs.webkit.org/show_bug.cgi?id=160304
2019         <rdar://problem/27578447>
2020
2021         Reviewed by Eric Carlson.
2022
2023         I accidentally committed the "Exit Picture-in-picture" glyph
2024         for the "Enter Picture-in-picture" buttons :(
2025
2026         * Modules/mediacontrols/mediaControlsApple.css:
2027         (video::-webkit-media-controls-panel .picture-in-picture-button):
2028         Use the correct artwork.
2029
2030 2016-07-28  Chris Dumez  <cdumez@apple.com>
2031
2032         First parameter to SVGDocument.createEvent() should be mandatory
2033         https://bugs.webkit.org/show_bug.cgi?id=160296
2034
2035         Reviewed by Alex Christensen.
2036
2037         First parameter to SVGDocument.createEvent() should be mandatory:
2038         - https://www.w3.org/TR/SVG2/struct.html#InterfaceDocumentExtensions
2039         - https://dom.spec.whatwg.org/#document
2040
2041         This patch drops createEvent() from SVGDocument so that the spec-compliant
2042         Document.createEvent() is used instead. In the specification, SVGDocument
2043         no longer exists and is a simple Document.
2044
2045         Firefox and Chrome agree with the specification.
2046
2047         Test: svg/dom/SVGDocument-createEvent.html
2048
2049         * svg/SVGDocument.idl:
2050
2051 2016-07-28  Chris Dumez  <cdumez@apple.com>
2052
2053         Parameters to CanvasGradient.addColorStop() should be mandatory
2054         https://bugs.webkit.org/show_bug.cgi?id=160297
2055
2056         Reviewed by Alex Christensen.
2057
2058         Parameters to CanvasGradient.addColorStop() should be mandatory:
2059         - https://html.spec.whatwg.org/multipage/scripting.html#canvasgradient
2060
2061         Firefox and Chrome agree with the specification.
2062
2063         No new tests, rebaselined existing test.
2064
2065         * html/canvas/CanvasGradient.idl:
2066
2067 2016-07-28  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2068
2069         [Streams API] Replace ReadableStreamController by ReadableStreamDefaultController
2070         https://bugs.webkit.org/show_bug.cgi?id=160242
2071
2072         Reviewed by Youenn Fablet.
2073
2074         Replaced ReadableStreamController by ReadableStreamDefaultController to align
2075         with updated Streams API specification.
2076
2077         No change in functionality.
2078
2079         * CMakeLists.txt:
2080         * DerivedSources.cpp:
2081         * DerivedSources.make:
2082         * Modules/streams/ReadableStream.js:
2083         (initializeReadableStream):
2084         * Modules/streams/ReadableStreamDefaultController.idl: Renamed from Source/WebCore/Modules/streams/ReadableStreamController.idl.
2085         * Modules/streams/ReadableStreamDefaultController.js: Renamed from Source/WebCore/Modules/streams/ReadableStreamController.js.
2086         (enqueue):
2087         (error):
2088         (close):
2089         (desiredSize):
2090         * Modules/streams/ReadableStreamInternals.js:
2091         (privateInitializeReadableStreamDefaultController):
2092         (isReadableStreamDefaultController):
2093         * Modules/streams/ReadableStreamSource.h:
2094         (WebCore::ReadableStreamSource::controller):
2095         (WebCore::ReadableStreamSource::start):
2096         * Modules/streams/ReadableStreamSource.idl:
2097         * WebCore.xcodeproj/project.pbxproj:
2098         * bindings/js/JSDOMGlobalObject.cpp:
2099         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
2100         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
2101         (WebCore::constructJSReadableStreamDefaultController):
2102         (WebCore::JSBuiltinReadableStreamDefaultControllerPrivateConstructor::initializeExecutable):
2103         (WebCore::createReadableStreamDefaultControllerPrivateConstructor):
2104         * bindings/js/JSReadableStreamPrivateConstructors.h:
2105         * bindings/js/JSReadableStreamSourceCustom.cpp:
2106         (WebCore::JSReadableStreamSource::start):
2107         * bindings/js/ReadableStreamDefaultController.cpp: Renamed from Source/WebCore/bindings/js/ReadableStreamController.cpp.
2108         (WebCore::callFunction):
2109         (WebCore::ReadableStreamDefaultController::invoke):
2110         (WebCore::ReadableStreamDefaultController::isControlledReadableStreamLocked):
2111         * bindings/js/ReadableStreamDefaultController.h: Renamed from Source/WebCore/bindings/js/ReadableStreamController.h.
2112         (WebCore::ReadableStreamDefaultController::ReadableStreamDefaultController):
2113         (WebCore::ReadableStreamDefaultController::close):
2114         (WebCore::ReadableStreamDefaultController::error):
2115         (WebCore::ReadableStreamDefaultController::enqueue):
2116         (WebCore::ReadableStreamDefaultController::globalObject):
2117         (WebCore::ReadableStreamDefaultController::error<String>):
2118         * bindings/js/WebCoreBuiltinNames.h:
2119
2120 2016-07-28  Youenn Fablet  <youenn@apple.com>
2121
2122         Compute fetch response type in case of cross-origin requests
2123         https://bugs.webkit.org/show_bug.cgi?id=158565
2124
2125         Reviewed by Alex Christensen.
2126
2127         Covered by rebased tests.
2128
2129         Implementing Response filtering based on Response tainting in ResourceResponse.
2130         Refactoring code in FetchHeaders and CrossOriginAccessControl.cpp accordingly.
2131
2132         Computing response tainting in SubresourceLoader for all resources.
2133         This is used by DocumentThreadableLoader which now filters responses accordingly for all its clients including fetch and XHR.
2134
2135         Response tainting notably allows computing the response type and filtering out headers in case of cross origin responses.
2136
2137         Removing the filtering implemented in XMLHttpRequest as this is done before it gets access to the headers.
2138         This is triggering some rebasing in the XHR tests as error messages triggered by trying to access unsafe headers no longer happen.
2139
2140         This filtering currently requires creating a new ResourceResponse object from the one sent from CachedResource.
2141         This is done so as the same ResourceResponse may be reused accross loads and may be filtered differently by given to two different DocumentThreadableLoader
2142         This can be mitigated in the future by changing ThreadableLoaderClient API to pass a ResourceResponse&&.
2143
2144         * Modules/fetch/FetchHeaders.cpp: Moving header checking in HTTParsers.h/.cpp
2145         (WebCore::isForbiddenHeaderName): Deleted.
2146         (WebCore::isForbiddenResponseHeaderName): Deleted.
2147         (WebCore::isSimpleHeader): Deleted.
2148         * loader/CrossOriginAccessControl.cpp:
2149         (WebCore::parseAccessControlExposeHeadersAllowList): Deleted.
2150         * loader/CrossOriginAccessControl.h: Moving header checking in HTTParsers.h/.cpp
2151         * loader/DocumentThreadableLoader.cpp:
2152         (WebCore::DocumentThreadableLoader::responseReceived):
2153         (WebCore::DocumentThreadableLoader::didReceiveResponse): Doing response filtering. Since underlying loaders are
2154         not yet aware that fetch mode may be cors (it is always no-cors currently), the tainting needs to be updated.
2155         (WebCore::DocumentThreadableLoader::loadRequest): Computing response tainting in case of synchronous calls to ensure headers are filtered for synchronous XHR.
2156         * loader/DocumentThreadableLoader.h:
2157         * loader/SubresourceLoader.cpp:
2158         (WebCore::SubresourceLoader::init): Getting origin from its resource and setting response tainting accordingly
2159         (WebCore::SubresourceLoader::willSendRequestInternal): Always calling checkRedirectionCrossOriginAccessControl
2160         to ensure response tainting is computed, even for no-cors resources.
2161         (WebCore::SubresourceLoader::didReceiveResponse):
2162         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl): Computing response tainting in case of redirection.
2163         * loader/SubresourceLoader.h:
2164         * loader/cache/CachedResource.cpp:
2165         (WebCore::CachedResource::load): Computing resource origin from the HTTP headers or from the document if none is
2166         set in the HTTP headers.
2167         (WebCore::CachedResource::setCrossOrigin): Helper routine to set response tainting.
2168         (WebCore::CachedResource::isCrossOrigin): Helper routine to know whether resource is cross origin
2169         (WebCore::CachedResource::isClean):
2170         (WebCore::CachedResource::setResponse): Removing m_responseType
2171         * loader/cache/CachedResource.h:
2172         (WebCore::CachedResource::responseTainting):
2173         (WebCore::CachedResource::origin):
2174         (WebCore::CachedResource::setOpaqueRedirect): Deleted.
2175         * platform/network/HTTPParsers.cpp: Implementing safe response header checking
2176         (WebCore::parseAccessControlExposeHeadersAllowList):
2177         (WebCore::isForbiddenHeaderName):
2178         (WebCore::isForbiddenResponseHeaderName):
2179         (WebCore::isSimpleHeader):
2180         (WebCore::isCrossOriginSafeHeader):
2181         * platform/network/HTTPParsers.h:
2182         * platform/network/ResourceRequestBase.cpp:
2183         (WebCore::ResourceRequestBase::hasHTTPOrigin): Added.
2184         (WebCore::ResourceRequestBase::clearHTTPOrigin):
2185         * platform/network/ResourceRequestBase.h:
2186         * platform/network/ResourceResponseBase.cpp: Implementation of response filtering.
2187         (WebCore::ResourceResponseBase::filterResponse):
2188         * platform/network/ResourceResponseBase.h:
2189         * xml/XMLHttpRequest.cpp:
2190         (WebCore::isSetCookieHeader): Deleted.
2191         (WebCore::XMLHttpRequest::getAllResponseHeaders): Removing header filtering since DocumentThreadableLoader does it.
2192         (WebCore::XMLHttpRequest::getResponseHeader): Ditto.
2193
2194 2016-07-27  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2195
2196         [Streams API] Use makeThisTypeError in ReadableStreamDefaultReader.js
2197         https://bugs.webkit.org/show_bug.cgi?id=160254
2198
2199         Reviewed by Darin Adler.
2200
2201         Use makeThisTypeError and makeGetterTypeError in ReadableStreamDefaultReader.js
2202
2203         No change in functionality.
2204
2205         * Modules/streams/ReadableStreamDefaultReader.js:
2206         (cancel):
2207         (read):
2208         (releaseLock):
2209         (closed):
2210
2211 2016-07-27  Fujii Hironori  <Hironori.Fujii@sony.com>
2212
2213         [soup] Incorrect usage of relaxAdoptionRequirement in the constructor of SocketStreamHandle
2214         https://bugs.webkit.org/show_bug.cgi?id=160281
2215
2216         Reviewed by Carlos Garcia Campos.
2217
2218         No new tests (No behavior change).
2219
2220         Incrementing refcount in a constructor causes an assertion failure
2221         that it's not adopted yet.  So, relaxAdoptionRequirement() was
2222         used to avoid the problem in the constructors of
2223         SocketStreamHandle.  This is a incorrect solution. The correct
2224         solution is to make SocketStreamHandle::create() increment the
2225         refcount after calling the constructor.
2226
2227         * platform/network/soup/SocketStreamHandle.h: Removed the second
2228         constructor of SocketStreamHandle which is not used anymore.
2229         Uninlined create() because this is not trivial anymore.
2230         * platform/network/soup/SocketStreamHandleSoup.cpp:
2231         (WebCore::SocketStreamHandle::create): Do the rest of jobs which
2232         was done by the constructors.
2233         (WebCore::SocketStreamHandle::SocketStreamHandle): Move the jobs
2234         after initialization to create().
2235         Removed the second constructor.
2236
2237 2016-07-27  Chris Dumez  <cdumez@apple.com>
2238
2239         First parameter to HTMLMediaElement.canPlayType() should be mandatory
2240         https://bugs.webkit.org/show_bug.cgi?id=160275
2241
2242         Reviewed by Ryosuke Niwa.
2243
2244         First parameter to HTMLMediaElement.canPlayType() should be mandatory:
2245         - https://html.spec.whatwg.org/multipage/embedded-content.html#htmlmediaelement
2246
2247         Firefox and Chrome agree with the specification.
2248
2249         No new tests, rebaselined existing tests.
2250
2251         * html/HTMLMediaElement.idl:
2252
2253 2016-07-27  Chris Dumez  <cdumez@apple.com>
2254
2255         First parameter to setTimeout() / setInterval() should be mandatory
2256         https://bugs.webkit.org/show_bug.cgi?id=160277
2257
2258         Reviewed by Darin Adler.
2259
2260         First parameter to setTimeout() / setInterval() should be mandatory:
2261         - https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
2262
2263         Firefox and Chrome agree with the specification.
2264
2265         No new tests, rebaselined existing test.
2266
2267         * bindings/js/JSDOMWindowCustom.cpp:
2268         (WebCore::JSDOMWindow::setTimeout):
2269         (WebCore::JSDOMWindow::setInterval):
2270         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
2271         (WebCore::JSWorkerGlobalScope::setTimeout):
2272         (WebCore::JSWorkerGlobalScope::setInterval):
2273
2274 2016-07-27  Chris Dumez  <cdumez@apple.com>
2275
2276         Parameters to insertAdjacentText() / insertAdjacentHTML() should be mandatory
2277         https://bugs.webkit.org/show_bug.cgi?id=160274
2278
2279         Reviewed by Darin Adler.
2280
2281         Parameters to insertAdjacentText() / insertAdjacentHTML() should be mandatory:
2282         - https://dom.spec.whatwg.org/#element
2283         - https://www.w3.org/TR/DOM-Parsing/#extensions-to-the-element-interface
2284
2285         Firefox and Chrome agree with the specification (although Firefox does not
2286         have insertAdjacentText()).
2287
2288         Test: fast/dom/Element/insertAdjacentText-parameters.html
2289
2290         * html/HTMLElement.idl:
2291
2292 2016-07-27  Beth Dakin  <bdakin@apple.com>
2293
2294         Add localizable strings for inserting list types
2295         https://bugs.webkit.org/show_bug.cgi?id=160233
2296         -and corresponding-
2297         rdar://problem/26102954
2298
2299         Reviewed by Dan Bernstein.
2300
2301         * English.lproj/Localizable.strings:
2302         * platform/LocalizedStrings.cpp:
2303         (WebCore::insertListTypeNone):
2304         (WebCore::insertListTypeNoneAccessibilityTitle):
2305         (WebCore::insertListTypeBulleted):
2306         (WebCore::insertListTypeBulletedAccessibilityTitle):
2307         (WebCore::insertListTypeNumbered):
2308         (WebCore::insertListTypeNumberedAccessibilityTitle):
2309         * platform/LocalizedStrings.h:
2310
2311 2016-07-27  Chris Dumez  <cdumez@apple.com>
2312
2313         Parameters to DOMParser.parseFromString() should be mandatory
2314         https://bugs.webkit.org/show_bug.cgi?id=160268
2315
2316         Reviewed by Ryosuke Niwa.
2317
2318         Parameters to DOMParser.parseFromString() should be mandatory:
2319         - https://www.w3.org/TR/DOM-Parsing/#the-domparser-interface
2320
2321         Firefox and Chrome agree with the specification.
2322
2323         Test: fast/parser/DOMParser-parameters.html
2324
2325         * xml/DOMParser.idl:
2326
2327 2016-07-27  Eric Carlson  <eric.carlson@apple.com>
2328
2329         Captions do not render in PiP window when element is hidden
2330         https://bugs.webkit.org/show_bug.cgi?id=160265
2331         <rdar://problem/27556788>
2332
2333         Reviewed by Simon Fraser.
2334
2335         * html/shadow/MediaControlElements.cpp:
2336         (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage): Pass new flag so
2337         caption layers are always rendered.
2338
2339         * rendering/RenderLayer.cpp:
2340         (WebCore::RenderLayer::paintLayerContents): Paint non-visible layers when PaintLayerIgnoreVisibility
2341         flag is set.
2342         * rendering/RenderLayer.h: Define PaintLayerIgnoreVisibility.
2343
2344 2016-07-27  Chris Dumez  <cdumez@apple.com>
2345
2346         Parameter to named property getter should be mandatory
2347         https://bugs.webkit.org/show_bug.cgi?id=160269
2348
2349         Reviewed by Ryosuke Niwa.
2350
2351         Parameter to named property getter should be mandatory:
2352         - https://heycam.github.io/webidl/#idl-named-properties
2353
2354         No new tests, rebaselined existing test.
2355
2356         * Modules/mediastream/RTCStatsResponse.idl:
2357         * bindings/scripts/test/TestOverrideBuiltins.idl:
2358         * html/HTMLOptionsCollection.idl:
2359         * html/HTMLSelectElement.idl:
2360         * plugins/DOMMimeTypeArray.idl:
2361         * plugins/DOMPlugin.idl:
2362         * plugins/DOMPluginArray.idl:
2363
2364 2016-07-27  Chris Dumez  <cdumez@apple.com>
2365
2366         First parameter to Range.createContextualFragment() should be mandatory
2367         https://bugs.webkit.org/show_bug.cgi?id=160266
2368
2369         Reviewed by Ryosuke Niwa.
2370
2371         First parameter to Range.createContextualFragment() should be mandatory:
2372         - https://w3c.github.io/DOM-Parsing/#extensions-to-the-range-interface
2373
2374         Firefox and Chrome agree with the specification.
2375
2376         No new tests, rebaselined existing test.
2377
2378         * dom/Range.idl:
2379
2380 2016-07-27  Chris Dumez  <cdumez@apple.com>
2381
2382         Align MediaList with the CSSOM specification
2383         https://bugs.webkit.org/show_bug.cgi?id=160257
2384
2385         Reviewed by Ryosuke Niwa.
2386
2387         Align MediaList with the CSSOM specification:
2388         - https://www.w3.org/TR/cssom-1/#the-medialist-interface
2389
2390         In particular, the parameter to item() / deleteMedium() and
2391         appendMedium() is now mandatory.
2392
2393         Firefox and Chrome agree with the specification.
2394
2395         Test: fast/css/MediaList-mediaText-null.html
2396               fast/css/MediaList-parameters.html
2397
2398         * css/MediaList.idl:
2399
2400 2016-07-27  Jeremy Jones  <jeremyj@apple.com>
2401
2402         Fullscreen video zoom button does not work after rotating when aspect ratio matches display.
2403         https://bugs.webkit.org/show_bug.cgi?id=160263
2404         rdar://problem/27368872
2405
2406         Reviewed by Eric Carlson.
2407
2408         When video and display aspect ratio match, and rotating from landscape to protrait, the transform used in layout
2409         will be Identity. This means checking the transform for identity is an insufficient test to see if the bounds
2410         need to be resolved.
2411
2412         Instead, always attempt to resolve the bounds and do a more accurate test while doing so.
2413
2414         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2415         (-[WebAVPlayerLayer layoutSublayers]):
2416         (-[WebAVPlayerLayer resolveBounds]):
2417
2418 2016-07-27  Anders Carlsson  <andersca@apple.com>
2419
2420         Stop accepting the deprecated "requiredShippingAddressFields" and "requiredBillingAddressFields" properties
2421         https://bugs.webkit.org/show_bug.cgi?id=160264
2422         rdar://problem/27574519
2423
2424         Reviewed by Simon Fraser.
2425
2426         * Modules/applepay/ApplePaySession.cpp:
2427         (WebCore::createPaymentRequest):
2428         (WebCore::isValidPaymentRequestPropertyName):
2429
2430 2016-07-27  Chris Dumez  <cdumez@apple.com>
2431
2432         First parameter to indexed property getters should be mandatory
2433         https://bugs.webkit.org/show_bug.cgi?id=160259
2434
2435         Reviewed by Ryosuke Niwa.
2436
2437         First parameter to indexed property getters should be mandatory:
2438         - https://heycam.github.io/webidl/#idl-indexed-properties
2439
2440         No new tests, rebaselined existing tests.
2441
2442         * Modules/gamepad/deprecated/GamepadList.idl:
2443         * bindings/js/JSHTMLAllCollectionCustom.cpp:
2444         (WebCore::JSHTMLAllCollection::item):
2445         * css/CSSRuleList.idl:
2446         * css/CSSValueList.idl:
2447         * css/StyleSheetList.idl:
2448         * css/WebKitCSSFilterValue.idl:
2449         * css/WebKitCSSTransformValue.idl:
2450         * dom/ClientRectList.idl:
2451         * dom/DOMStringList.idl:
2452         * dom/DataTransferItemList.idl:
2453         * html/HTMLAllCollection.idl:
2454         * plugins/DOMMimeTypeArray.idl:
2455         * plugins/DOMPlugin.idl:
2456         * plugins/DOMPluginArray.idl:
2457
2458 2016-07-27  Javier Fernandez  <jfernandez@igalia.com>
2459
2460         [css-grid] The isValidTransition function must not alter the GridSizingData object
2461         https://bugs.webkit.org/show_bug.cgi?id=160252
2462
2463         Reviewed by Darin Adler.
2464
2465         It's not correct that a function which purpose is to check out the
2466         validity of a state modifies such state.
2467
2468         That code was there to allow the extra row track sizing iteration
2469         in the case of a grid container with indefinite height. We need to
2470         do that in order to figure out its intrinsic height, which will be
2471         used then to properly sizing the row tracks.
2472
2473         Since the intrinsic height computation uses directly the
2474         computeUsedBreadthOfGridTracks function, it does not alter the
2475         algorithm state-machine, hence, we can safely remove this code,
2476         which was incorrect in any case.
2477
2478         No new tests, it's just a refactoring with no functionality change.
2479
2480         * rendering/RenderGrid.cpp:
2481         (WebCore::RenderGrid::GridSizingData::isValidTransition):
2482
2483 2016-07-27  Chris Dumez  <cdumez@apple.com>
2484
2485         First parameter to Document.execCommand() / queryCommand*() should be mandatory
2486         https://bugs.webkit.org/show_bug.cgi?id=160258
2487
2488         Reviewed by Darin Adler.
2489
2490         First parameter to Document.execCommand() / queryCommand*() should be mandatory:
2491         - https://w3c.github.io/editing/execCommand.html
2492
2493         Firefox and Chrome agree with the specification.
2494
2495         Test: fast/dom/Document/editing-parameters.html
2496
2497         * dom/Document.idl:
2498
2499 2016-07-27  Chris Dumez  <cdumez@apple.com>
2500
2501         Align CSSSupportsRule with the specification
2502         https://bugs.webkit.org/show_bug.cgi?id=160256
2503
2504         Reviewed by Darin Adler.
2505
2506         Align CSSSupportsRule with the specification:
2507         - https://drafts.csswg.org/css-conditional-3/#csssupportsrule
2508
2509         In particular:
2510         - Make the parameters to insertRule() / deleteRule() mandatory
2511         - Expose CSSSupportsRule on the global Window object
2512
2513         Both Firefox and Chrome agree with the specification here.
2514
2515         Test: fast/css/CSSSupportsRule-parameters.html
2516
2517         * css/CSSSupportsRule.idl:
2518
2519 2016-07-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2520
2521         [Soup] Test http/tests/xmlhttprequest/auth-reject-protection-space.html fails since added in r203743
2522         https://bugs.webkit.org/show_bug.cgi?id=160235
2523
2524         Reviewed by Michael Catanzaro.
2525
2526         It times out in release and crashes in debug due to an ASSERT_NOT_REACHED(). The soup backend doesn't really
2527         support rejecting the protection space and continuing with the next one, but we can at least continue with the
2528         request without crendential to make the test pass.
2529
2530         * platform/network/soup/ResourceHandleSoup.cpp:
2531         (WebCore::ResourceHandle::receivedChallengeRejection):
2532
2533 2016-07-27  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2534
2535         [Streams API] Replace ReadableStreamReader by ReadableStreamDefaultReader
2536         https://bugs.webkit.org/show_bug.cgi?id=160194
2537
2538         Reviewed by Youenn Fablet.
2539
2540         Replaced ReadableStreamReader by ReadableStreamDefaultReader to align
2541         with updated Streams API specification.
2542
2543         No change in functionality.
2544
2545         * CMakeLists.txt:
2546         * DerivedSources.cpp:
2547         * DerivedSources.make:
2548         * Modules/fetch/FetchInternals.js:
2549         (consumeStream):
2550         * Modules/fetch/FetchResponse.js:
2551         (body):
2552         * Modules/streams/ReadableStream.js:
2553         (getReader):
2554         * Modules/streams/ReadableStreamDefaultReader.idl: Renamed from Source/WebCore/Modules/streams/ReadableStreamReader.idl.
2555         * Modules/streams/ReadableStreamDefaultReader.js: Renamed from Source/WebCore/Modules/streams/ReadableStreamReader.js.
2556         (cancel):
2557         (read):
2558         (releaseLock):
2559         (closed):
2560         * Modules/streams/ReadableStreamInternals.js:
2561         (privateInitializeReadableStreamDefaultReader):
2562         (teeReadableStream):
2563         (teeReadableStreamPullFunction):
2564         (isReadableStreamDefaultReader):
2565         (closeReadableStream):
2566         (readFromReadableStreamDefaultReader):
2567         * WebCore.xcodeproj/project.pbxproj:
2568         * bindings/js/JSDOMGlobalObject.cpp:
2569         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
2570         (WebCore::JSDOMGlobalObject::finishCreation):
2571         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
2572         (WebCore::constructJSReadableStreamDefaultReader):
2573         (WebCore::JSBuiltinReadableStreamDefaultReaderPrivateConstructor::initializeExecutable):
2574         (WebCore::createReadableStreamDefaultReaderPrivateConstructor):
2575         * bindings/js/JSReadableStreamPrivateConstructors.h:
2576         * bindings/js/WebCoreBuiltinNames.h:
2577         * features.json:
2578
2579 2016-07-27  Javier Fernandez  <jfernandez@igalia.com>
2580
2581         [css-grid] Handle alignment with orthogonal flows
2582         https://bugs.webkit.org/show_bug.cgi?id=159295
2583
2584         Reviewed by Darin Adler.
2585
2586         Now that grid sizing and positioning issues wrt orthogonal flows have
2587         been clarified in the last spec draft, we can adapt now our alignment
2588         logic to work with orthogonal flows.
2589
2590         Even though basic alignment would work with orthogonal flows with
2591         this patch, we still doesn't allow stretching in that case. I'll provide a
2592         patch for that feature since it's a complex logic and better have an
2593         isolated change.
2594
2595         Tests: fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows-vertical-lr.html
2596                fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows-vertical-rl.html
2597                fast/css-grid-layout/grid-item-alignment-with-orthogonal-flows.html
2598
2599         * rendering/RenderGrid.cpp:
2600         (WebCore::computeOverflowAlignmentOffset): Using 'size' instead of 'breadth' as concept.
2601         (WebCore::RenderGrid::columnAxisPositionForChild): Dealing with orthogonal flow cases.
2602         (WebCore::RenderGrid::rowAxisPositionForChild): Dealing with orthogonal flow cases.
2603         (WebCore::RenderGrid::columnAxisOffsetForChild): Using 'size' instead of 'breadth' as concept.
2604         (WebCore::RenderGrid::rowAxisOffsetForChild): Using 'size' instead of 'breadth' as concept.
2605         (WebCore::RenderGrid::findChildLogicalPosition): Dealing with orthogonal flow cases.
2606
2607 2016-07-26  Youenn Fablet  <youenn@apple.com>
2608
2609         [Fetch API] Response constructor should be able to take a ReadableStream as body
2610         https://bugs.webkit.org/show_bug.cgi?id=159804
2611
2612         Reviewed by Alex Christensen.
2613
2614         Covered by existing and updated tests.
2615
2616         Introduced FetchBodyConsumer to encapsulate the code responsible to adapt FetchBody internal data to the requests made by user scripts.
2617         This refactoring eases the handling of internal data coming from ReadableStream.
2618
2619         FetchLoader is now delegating conversion from the data to its m_consumer field.
2620         If m_consumer is null, FetchLoader calls FetchLoaderClient::didReceiveData (streaming reception mode).
2621         Clients of FetchLoader needs to pass a FetchBodyConsumer to the FetchLoader to do the data adaptation at loader creation time.
2622
2623         Added support for body data passed as a ReadableStream to Response.
2624         This requires to set @body internal slot of the Response object in the constructor initialization JS built-in.
2625
2626         To actually use that data, Body accessors are also implemented as JS built-in for Response.
2627         Since there is no need to do so for Request, FetchResponse is no longer marked as implementing FetchBody but all
2628         FetchBody IDL description is inlined in FetchResponse.idl.
2629
2630         For each body accessor (arrayBuffer, blob, json, text), the corresponding JS built-in checks whether @body internal slot is set.
2631         If that is not the case, regular handling is done through a new private method called @consume.
2632         If @body internal slot is set, chunks are pumped from the ReadableStream using ReadableStream internal built-ins functions.
2633         Data handling is done in C++ through the private methods @startConsumingStream, @consumeChunk and @finishConsumingStream.
2634
2635         To support cloning of Response with bodies, clone method is also implemented as a JS built-in.
2636         Main clone is done through @cloneFoJS private method implemented in C++.
2637         JS built-in clone code does the teeing of the ReadableStream using ReadableStream JS built-in internal functions.
2638
2639         Introducing a new ReadableStream type for FetchBody to cope with body being stored in a ReadableStream.
2640
2641         Introducing a new Loaded type for FetchBody to cope with body being stored in the FetchBodyConsumer owned by FetchBody.
2642         This allows removing the conversion of data to JSC::ArrayBuffer which was done by defaut at the end of Fetch loading if user script did not request data before.
2643         At the end of a load, the data remains in FetchBodyConsumer and the body is marked as Loaded.
2644         If the user wants to get the data after data finished being loaded, FetchBodyConsumer will do the required conversions.
2645
2646         Introducing DeferredWrapper::resolveWithNewValue to handle the case of resolving promises with new objects.
2647         This allows directly using toJSNewlyCreated instead of toJS.
2648
2649         * CMakeLists.txt: Adding FetchBodyConsumer.cpp. Removing WebCoreJSBuiltins.cpp from CMake list as it is not needed.
2650         * Modules/fetch/FetchBody.cpp: Moving data adaptation code to FetchBodyConsumer.
2651         (WebCore::FetchBody::extract):
2652         (WebCore::FetchBody::arrayBuffer):
2653         (WebCore::FetchBody::blob): Setting contentType in FetchBodyConsumer to handle proper creation of blob.
2654         (WebCore::FetchBody::json):
2655         (WebCore::FetchBody::text):
2656         (WebCore::FetchBody::consume): Refactoring and added case of Loaded bodies.
2657         (WebCore::FetchBody::consumeAsStream): Ditto.
2658         (WebCore::FetchBody::consumeArrayBuffer):
2659         (WebCore::FetchBody::consumeText):
2660         (WebCore::FetchBody::consumeBlob):
2661         (WebCore::FetchBody::loadingFailed):
2662         (WebCore::FetchBody::loadingSucceeded):
2663         (WebCore::FetchBody::loadingType): Deleted.
2664         (WebCore::blobFromArrayBuffer): Deleted.
2665         (WebCore::FetchBody::fulfillTextPromise): Deleted.
2666         (WebCore::FetchBody::loadedAsArrayBuffer): Deleted.
2667         (WebCore::FetchBody::loadedAsText): Deleted.
2668         * Modules/fetch/FetchBody.h:
2669         (WebCore::FetchBody::consumer):
2670         * Modules/fetch/FetchBodyConsumer.cpp: Added, responsible of data adaptation.
2671         (WebCore::blobFromData):
2672         (WebCore::FetchBodyConsumer::resolveWithData):
2673         (WebCore::FetchBodyConsumer::resolve):
2674         (WebCore::FetchBodyConsumer::append):
2675         (WebCore::FetchBodyConsumer::takeData):
2676         (WebCore::FetchBodyConsumer::takeAsArrayBuffer):
2677         (WebCore::FetchBodyConsumer::takeAsBlob):
2678         (WebCore::FetchBodyConsumer::takeAsText):
2679         * Modules/fetch/FetchBodyConsumer.h: Added.
2680         (WebCore::FetchBodyConsumer::FetchBodyConsumer):
2681         (WebCore::FetchBodyConsumer::setContentType):
2682         (WebCore::FetchBodyConsumer::setType):
2683         (WebCore::FetchBodyConsumer::type):
2684         (WebCore::FetchBodyConsumer::clean):
2685         (WebCore::FetchBodyConsumer::hasData):
2686         * Modules/fetch/FetchBodyOwner.cpp:
2687         (WebCore::FetchBodyOwner::loadBlob):
2688         (WebCore::FetchBodyOwner::blobLoadingSucceeded):
2689         (WebCore::FetchBodyOwner::loadedBlobAsText): Deleted.
2690         * Modules/fetch/FetchBodyOwner.h:
2691         (WebCore::FetchBodyOwner::loadedBlobAsArrayBuffer): Deleted.
2692         * Modules/fetch/FetchInternals.js:
2693         (consumeStream): Pump ReadableStream data and send it to FetchResponse to be converted according user need.
2694         * Modules/fetch/FetchLoader.cpp:
2695         (WebCore::FetchLoader::FetchLoader): FetchLoader is simplified as it has two nodes: consumer mode in which case
2696         data is sent to the consumer and no-consumer mode in which case data is passed to loader client. The second mode
2697         is used to conveyy data to ReadableStream source.
2698         (WebCore::FetchLoader::stop):
2699         (WebCore::FetchLoader::startStreaming):
2700         (WebCore::FetchLoader::didReceiveData):
2701         (WebCore::FetchLoader::didFinishLoading): Deleted.
2702         * Modules/fetch/FetchLoader.h:
2703         * Modules/fetch/FetchLoaderClient.h:
2704         (WebCore::FetchLoaderClient::didFinishLoadingAsText): Deleted.
2705         (WebCore::FetchLoaderClient::didFinishLoadingAsArrayBuffer): Deleted.
2706         * Modules/fetch/FetchResponse.cpp:
2707         (WebCore::FetchResponse::cloneForJS):
2708         (WebCore::FetchResponse::BodyLoader::didSucceed):
2709         (WebCore::FetchResponse::BodyLoader::start):
2710         (WebCore::FetchResponse::consume): Introduced to consume data stored in body and not in ReadableStream.
2711         (WebCore::FetchResponse::startConsumingStream): Introduced to start process of consuming data stored in the ReadableStream.
2712         (WebCore::FetchResponse::consumeChunk): Reception of ReadableStream data.
2713         (WebCore::FetchResponse::finishConsumingStream): Doing the final conversion.
2714         (WebCore::FetchResponse::clone): Deleted.
2715         (WebCore::FetchResponse::BodyLoader::didFinishLoadingAsArrayBuffer): Deleted.
2716         * Modules/fetch/FetchResponse.h:
2717         * Modules/fetch/FetchResponse.idl: Inlining of FetchBody methods/attributes and adding private methods.
2718         * Modules/fetch/FetchResponse.js:
2719         (initializeFetchResponse):
2720         (clone):
2721         (arrayBuffer):
2722         (blob):
2723         (formData):
2724         (json):
2725         (text):
2726         * WebCore.xcodeproj/project.pbxproj:
2727         * bindings/js/JSDOMPromise.h:
2728         (WebCore::DeferredWrapper::resolveWithNewValue):
2729         * bindings/js/WebCoreBuiltinNames.h:
2730
2731 2016-07-26  Youenn Fablet  <youennf@gmail.com>
2732
2733         JS Built-ins should throw this-error messages consistently with binding generated code
2734         https://bugs.webkit.org/show_bug.cgi?id=160191
2735
2736         Reviewed by Darin Adler.
2737
2738         Introducing @makeThisTypeError and @makeGetterTypeError to create TypeError objects with a consistent error message.
2739         Making use of these functions in streams API and fetch API related built-in code.
2740
2741         Refactored JSDOMBinding.cpp code by adding makeThisTypeErrorMessage and makeGetterTypeErrorMessage helper routines
2742         These routines are used by both new built-in functions as well as binding generated code helper routine.
2743
2744         Tests: fetch/fetch-error-messages.html
2745                streams/readable-stream-error-messages.html
2746
2747         * Modules/fetch/FetchResponse.js:
2748         (body): Adding an explicit check so that the error message is right. The previous error message was related to the call of Response.@isDisturbed.
2749         * Modules/streams/ReadableStream.js:
2750         (cancel):
2751         (getReader):
2752         (pipeTo):
2753         (tee):
2754         (locked):
2755         * Modules/streams/ReadableStreamController.js:
2756         (enqueue):
2757         (error):
2758         (close):
2759         (desiredSize):
2760         * Modules/streams/ReadableStreamReader.js:
2761         (cancel):
2762         (read):
2763         (releaseLock):
2764         (closed):
2765         * bindings/js/JSDOMBinding.cpp:
2766         (WebCore::makeGetterTypeErrorMessage):
2767         (WebCore::throwGetterTypeError):
2768         (WebCore::makeThisTypeErrorMessage):
2769         (WebCore::throwThisTypeError):
2770         (WebCore::throwSequenceTypeError): Deleted.
2771         (WebCore::throwSetterTypeError): Deleted.
2772         * bindings/js/JSDOMBinding.h:
2773         * bindings/js/JSDOMGlobalObject.cpp:
2774         (WebCore::makeThisTypeErrorForBuiltins):
2775         (WebCore::makeGetterTypeErrorForBuiltins):
2776         (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
2777         * bindings/js/WebCoreBuiltinNames.h:
2778
2779 2016-07-26  Carlos Garcia Campos  <cgarcia@igalia.com>
2780
2781         Unreviewed. Fix GTK+ distcheck build.
2782
2783         wtf/spi/darwin/dyldSPI.h is not included in GTK+ release tarballs.
2784
2785         * html/HTMLObjectElement.cpp: Include wtf/spi/darwin/dyldSPI.h only for iOS.
2786         * html/MediaElementSession.cpp: Ditto.
2787
2788 2016-07-26  Myles C. Maxfield  <mmaxfield@apple.com>
2789
2790         [iOS] SF-Heavy is inaccessible by web content
2791         https://bugs.webkit.org/show_bug.cgi?id=160186
2792         <rdar://problem/27434423>
2793
2794         Reviewed by Dean Jackson.
2795
2796         Once we create the system font, we need to modify it with the appropriate weight.
2797         This is because the CoreText API we use to get the system font on iOS does not
2798         let us choose the exact weight we want.
2799
2800         Test: fast/text/system-font-weight.html
2801
2802         * platform/graphics/ios/FontCacheIOS.mm:
2803         (WebCore::baseSystemFontDescriptor):
2804         (WebCore::systemFontModificationAttributes):
2805         (WebCore::systemFontDescriptor):
2806         (WebCore::platformFontWithFamilySpecialCase):
2807         * platform/spi/cocoa/CoreTextSPI.h:
2808
2809 2016-07-26  Fujii Hironori  <Hironori.Fujii@sony.com>
2810
2811         [GTK] ASSERTION FAILED: !m_adoptionIsRequired when Inspector Server is connected
2812         https://bugs.webkit.org/show_bug.cgi?id=160229
2813
2814         Reviewed by Carlos Garcia Campos.
2815
2816         An assertion fails because refcount of SocketStreamHandle is
2817         incremented before adoptRef, in the constructor of
2818         SocketStreamHandle.  The constructor of SocketStreamHandle needs
2819         to increment recount because it passes this pointer to libsoup.
2820
2821         * platform/network/soup/SocketStreamHandleSoup.cpp:
2822         (WebCore::SocketStreamHandle::SocketStreamHandle): Do
2823         relaxAdoptionRequirement() as well as the another constructor.
2824
2825 2016-07-26  Chris Dumez  <cdumez@apple.com>
2826
2827         Move 'dir' attribute from HTMLDocument to Document
2828         https://bugs.webkit.org/show_bug.cgi?id=160231
2829
2830         Reviewed by Sam Weinig.
2831
2832         Move 'dir' attribute from HTMLDocument to Document to match the
2833         specification:
2834         - https://html.spec.whatwg.org/multipage/dom.html#document
2835
2836         Both Firefox and Chrome have 'dir' on Document already.
2837
2838         No new tests, rebaselined existing test.
2839
2840         * dom/Document.cpp:
2841         (WebCore::Document::dir):
2842         (WebCore::Document::setDir):
2843         * dom/Document.h:
2844         * dom/Document.idl:
2845         * html/HTMLDocument.cpp:
2846         (WebCore::HTMLDocument::dir): Deleted.
2847         (WebCore::HTMLDocument::setDir): Deleted.
2848         * html/HTMLDocument.h:
2849         * html/HTMLDocument.idl:
2850
2851 2016-07-26  Chris Dumez  <cdumez@apple.com>
2852
2853         Second parameter to History.pushState() / replaceState() should be mandatory
2854         https://bugs.webkit.org/show_bug.cgi?id=160230
2855
2856         Reviewed by Sam Weinig.
2857
2858         Second parameter to History.pushState() / replaceState() should be mandatory:
2859         - https://html.spec.whatwg.org/multipage/browsers.html#history-3
2860
2861         Firefox and Chrome agree with the specification.
2862
2863         No new tests, rebaselined existing test.
2864
2865         * bindings/js/JSHistoryCustom.cpp:
2866         (WebCore::JSHistory::pushState):
2867         (WebCore::JSHistory::replaceState):
2868         * page/History.idl:
2869
2870 2016-07-26  Chris Dumez  <cdumez@apple.com>
2871
2872         Align Node.isEqualNode() with the specification
2873         https://bugs.webkit.org/show_bug.cgi?id=160224
2874
2875         Reviewed by Sam Weinig.
2876
2877         Align our implementation for Node.isEqualNode() to match more closely
2878         the text of the specification:
2879         - https://dom.spec.whatwg.org/#dom-node-isequalnode
2880         - https://dom.spec.whatwg.org/#concept-node-equals
2881
2882         This also fixes a bug where isEqualNode() would sometimes return false
2883         wrongly for elements because we were comparing the value returned by
2884         nodeName() which returns the tagName of elements. The issue was that
2885         the tagName's case may differ depending on the element being in an
2886         HTMLDocument or not. We now compare Element::tagQName() instead which
2887         ends up comparing namespace / namespace prefix and localName, as per
2888         the specification. The new behavior matches Firefox and Chrome and
2889         helps us pass an extra W3C test.
2890
2891         No new tests, rebaselined existing test.
2892
2893         * dom/Node.cpp:
2894         (WebCore::Node::isEqualNode):
2895
2896 2016-07-26  Simon Fraser  <simon.fraser@apple.com>
2897
2898         Sort the project files.
2899
2900         * WebCore.xcodeproj/project.pbxproj:
2901
2902 2016-07-26  Chris Dumez  <cdumez@apple.com>
2903
2904         Align CSSKeyframesRule with the specification
2905         https://bugs.webkit.org/show_bug.cgi?id=160219
2906
2907         Reviewed by Darin Adler.
2908
2909         Align CSSKeyframesRule with the specification:
2910         - https://drafts.csswg.org/css-animations/#interface-csskeyframesrule
2911
2912         In particular, the parameter to insertRule() / appendRule() /
2913         deleteRule() / findRule() should be mandatory. Both Firefox and Chrome
2914         agree with the specification here.
2915
2916         Also, the CSSKeyframesRule.name attribute should not be nullable.
2917         Chrome agrees with the specification. However, Firefox, has the
2918         attribute nullable. This patch aligns our behavior with Chrome and
2919         the specification.
2920
2921         Tests: animations/CSSKeyframesRule-name-null.html
2922                animations/CSSKeyframesRule-parameters.html
2923
2924         * css/CSSKeyframesRule.h:
2925         (WebCore::StyleRuleKeyframes::name):
2926         (WebCore::StyleRuleKeyframes::setName):
2927         * css/CSSKeyframesRule.idl:
2928
2929 2016-07-26  Myles C. Maxfield  <mmaxfield@apple.com>
2930
2931         [iPhone] Playing a video on tudou.com plays only sound, no video
2932         https://bugs.webkit.org/show_bug.cgi?id=160178
2933         <rdar://problem/27535468>
2934
2935         Reviewed by Eric Carlson and Dan Bernstein.
2936
2937         This patch re-implements r203520 in a much simpler way which doesn't involve a new SPI.
2938         The biggest problem with r203520 is that it make it impossible for a WKWebView to match
2939         MobileSafari's behavior. Instead of adding this new SPI, a simple version check should
2940         be used to keep old apps working.
2941
2942         The new behavior is characterized by the following table:
2943
2944                                              |                iOS                 |      Non-iOS
2945         =============================================================================================
2946         requiresPlayInlineAttribute == true  | Old app: honor -webkit-playsinline | honor playsinline
2947                                              | New app: honor playsinline         | honor playsinline
2948         ---------------------------------------------------------------------------------------------
2949         requiresPlayInlineAttribute == false | Always inline                      | Always inline
2950
2951         Specifically, this patch reverts r203545 which is the commit which actually removes
2952         the old SPI. As soon as Safari is migrated back to this old SPI, I'll remove the two
2953         new SPIs added in r203520.
2954
2955         Tests: media/video-playsinline.html
2956                media/video-webkit-playsinline.html
2957
2958         * html/MediaElementSession.cpp:
2959         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
2960         * page/Settings.cpp:
2961         * page/Settings.in:
2962         * testing/InternalSettings.cpp:
2963         (WebCore::InternalSettings::Backup::Backup):
2964         (WebCore::InternalSettings::Backup::restoreTo):
2965         (WebCore::InternalSettings::setInlineMediaPlaybackRequiresPlaysInlineAttribute):
2966         * testing/InternalSettings.h:
2967         * testing/InternalSettings.idl:
2968
2969 2016-07-26  Zalan Bujtas  <zalan@apple.com>
2970
2971         Move RenderView::shouldDisableLayoutStateForSubtree to SubtreeLayoutStateMaintainer.
2972         https://bugs.webkit.org/show_bug.cgi?id=160215
2973
2974         Reviewed by Darin Adler and Simon Fraser.
2975
2976         No change in functionality.
2977
2978         * page/FrameView.cpp:
2979         (WebCore::SubtreeLayoutStateMaintainer::SubtreeLayoutStateMaintainer):
2980         * rendering/RenderView.cpp:
2981         (WebCore::RenderView::shouldDisableLayoutStateForSubtree):
2982         * rendering/RenderView.h:
2983
2984 2016-07-26  Simon Fraser  <simon.fraser@apple.com>
2985
2986         Allow LOG macros to be used outside the namespace, and other logging cleanup
2987         https://bugs.webkit.org/show_bug.cgi?id=160216
2988
2989         Reviewed by Anders Carlsson.
2990
2991         Fix some issues with the LOG macros.
2992         
2993         First, they were not usable outside the WebKit namespace in WebKit2 code. Fix by moving
2994         its log channels outside of the namespace (they are protected by a unique prefix anyway).
2995         
2996         Second, allow LOG_WITH_STREAM to be used in WebKit2 by moving that and a helper macro
2997         into LogMacros.h, which is exported from WebCore as a private header.
2998         
2999         Third, split the Logging.h header into two. Logging.h remains for framework-internal
3000         log channels and log macros. Add LogInitialization.h which is external, and used to
3001         initialize the channels.
3002         
3003         Finally unify "initializeLogChannels" and "initializeLoggingChannels" terminology everywhere.
3004
3005         * WebCore.xcodeproj/project.pbxproj:
3006         * platform/LogInitialization.h: Added.
3007         * platform/LogMacros.h: Added.
3008         * platform/Logging.cpp:
3009         (WebCore::initializeLogChannelsIfNecessary):
3010         (WebCore::initializeLoggingChannelsIfNecessary): Deleted.
3011         * platform/Logging.h:
3012         * testing/js/WebCoreTestSupport.cpp:
3013         (WebCoreTestSupport::initializeLogChannelsIfNecessary):
3014         (WebCoreTestSupport::initializeLoggingChannelsIfNecessary): Deleted.
3015         * testing/js/WebCoreTestSupport.h:
3016
3017 2016-07-26  Anders Carlsson  <andersca@apple.com>
3018
3019         onpaymentauthorized callback not received when authorizing for a second time
3020         https://bugs.webkit.org/show_bug.cgi?id=160218
3021         rdar://problem/27527151
3022
3023         Reviewed by Tim Horton.
3024
3025         Only null out the active session if the status is a final state status.
3026
3027         * Modules/applepay/PaymentCoordinator.cpp:
3028         (WebCore::PaymentCoordinator::completePaymentSession):
3029
3030 2016-07-26  Chris Dumez  <cdumez@apple.com>
3031
3032         Range.prototype.compareBoundaryPoints.length should be 2
3033         https://bugs.webkit.org/show_bug.cgi?id=160217
3034
3035         Reviewed by Sam Weinig.
3036
3037         Range.prototype.compareBoundaryPoints.length:
3038         - https://dom.spec.whatwg.org/#interface-range
3039
3040         We had a bug in our IDL which caused length to be 0 even though
3041         both parameters were effectively mandatory.
3042
3043         No new tests, rebaselined existing test.
3044
3045         * dom/Range.idl:
3046
3047 2016-07-26  Chris Dumez  <cdumez@apple.com>
3048
3049         Align CSSStyleDeclaration with the specification
3050         https://bugs.webkit.org/show_bug.cgi?id=160214
3051
3052         Reviewed by Darin Adler.
3053
3054         Align CSSStyleDeclaration with the specification:
3055         - https://drafts.csswg.org/cssom/#the-cssstyledeclaration-interface
3056
3057         In particular, the parameters to removeProperty() / item() and
3058         getPropertyPriority() should be mandatory.
3059
3060         Firefox and Chrome match the specification.
3061
3062         Tests: fast/css/CSSStyleDeclaration-cssText-null.html
3063                fast/css/CSSStyleDeclaration-parameters.html
3064
3065         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3066         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
3067         * css/CSSStyleDeclaration.idl:
3068
3069 2016-07-26  David Kilzer <ddkilzer@apple.com>
3070
3071         Networking process crash due to missing -[WebCoreAuthenticationClientAsChallengeSender performDefaultHandlingForAuthenticationChallenge:] implementation
3072         https://bugs.webkit.org/show_bug.cgi?id=156947
3073         <rdar://problem/23325160>
3074
3075         Reviewed by Alex Christensen.
3076
3077         Test: http/tests/xmlhttprequest/auth-reject-protection-space.html
3078
3079         * platform/network/mac/AuthenticationMac.mm:
3080         (-[WebCoreAuthenticationClientAsChallengeSender performDefaultHandlingForAuthenticationChallenge:]): Added.
3081         (-[WebCoreAuthenticationClientAsChallengeSender rejectProtectionSpaceAndContinueWithChallenge:]): Added.
3082
3083 2016-07-26  Chris Dumez  <cdumez@apple.com>
3084
3085         Parameters to CSSStyleSheet.insertRule() / deleteRule() should be mandatory
3086         https://bugs.webkit.org/show_bug.cgi?id=160210
3087
3088         Reviewed by Darin Adler.
3089
3090         Parameters to CSSStyleSheet.insertRule() / deleteRule() should be mandatory:
3091         - https://drafts.csswg.org/cssom/#cssstylesheet
3092
3093         They are mandatory in Firefox.
3094         They are mandatory in Chrome except for the second parameter of insertRule()
3095         which merely logs a deprecation warning.
3096
3097         This patch aligns our behavior with Chrome to move towards to specification
3098         while limiting the risk of breakage.
3099
3100         Test: fast/css/stylesheet-parameters.html
3101
3102         * css/CSSStyleSheet.cpp:
3103         (WebCore::CSSStyleSheet::deprecatedInsertRule):
3104         * css/CSSStyleSheet.h:
3105         * css/CSSStyleSheet.idl:
3106
3107 2016-07-26  George Ruan  <gruan@apple.com>
3108
3109         HTMLVideoElement frames do not update on iOS when src is a MediaStream blob
3110         https://bugs.webkit.org/show_bug.cgi?id=159833
3111         <rdar://problem/27379487>
3112
3113         Reviewed by Eric Carlson.
3114
3115         Test: fast/mediastream/MediaStream-video-element-displays-buffer.html
3116
3117         * WebCore.xcodeproj/project.pbxproj:
3118         * platform/cf/CoreMediaSoftLink.cpp: Add CMSampleBufferCreateReadyWithImageBuffer and CMVideoFormatDescriptionCreateForImageBuffer
3119         softlink.
3120         * platform/cf/CoreMediaSoftLink.h: Ditto.
3121         * platform/cocoa/CoreVideoSoftLink.cpp: Add CVPixelBufferCreate, kCVPixelBufferCGBitmapContextCompatibilityKey, and
3122         kCVPixelBufferCGImageCompatibilityKey.
3123         * platform/cocoa/CoreVideoSoftLink.h: Ditto.
3124         * platform/graphics/avfoundation/MediaSampleAVFObjC.h: Change create to return a Ref<T> instead
3125         of RefPtr<T>.
3126         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: Make observer of
3127         MediaStreamTrackPrivate and make MediaPlayer use an AVSampleBufferDisplayLayer instead of CALayer.
3128         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Ditto.
3129         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): Clean up
3130         observers and AVSampleBufferDisplayLayer.
3131         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::isAvailable): Ensures AVSampleBufferDisplayLayer
3132         is available.
3133         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueAudioSampleBufferFromTrack): Placeholder.
3134         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSampleBufferFromTrack): Responsible
3135         for enqueuing sample buffers to the active video track.
3136         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer): Ensures that an AVSampleBufferDisplayLayer
3137         exists.
3138         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::destroyLayer): Destroys the AVSampleBufferDisplayLayer.
3139         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::platformLayer): Replace CALayer with AVSampleBufferDisplayLayer.
3140         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode): Ditto.
3141         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Call updateReadyState as a deferred task.
3142         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState): readyState is bumped to HAVE_ENOUGH_DATA
3143         only when the MediaPlayerPrivateMediaStreamAVFObjC has received a media sample.
3144         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::sampleBufferUpdated): Called from MediaStreamTrackPrivate when a
3145         new SampleBuffer is available.
3146         (WebCore::updateTracksOfType): Manage adding and removing self as observer from tracks.
3147         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks): Replace CALayer with AVSampleBufferDisplayLayer
3148         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::acceleratedRenderingStateChanged): Copied from
3149         MediaPlayerPrivateMediaSourceAVFObjC.mm
3150         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Deleted CALayer.
3151         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Deleted process of updating CALayer.
3152         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateIntrinsicSize): Deleted CALayer.
3153         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::createPreviewLayers): Deleted.
3154         * platform/mediastream/MediaStreamPrivate.cpp:
3155         (WebCore::MediaStreamPrivate::updateActiveVideoTrack): Remove redundant check.
3156         * platform/mediastream/MediaStreamTrackPrivate.cpp:
3157         (WebCore::MediaStreamTrackPrivate::sourceHasMoreMediaData): Called from RealtimeMediaSource when a new SampleBuffer
3158         is available.
3159         * platform/mediastream/MediaStreamTrackPrivate.h:
3160         (WebCore::MediaStreamTrackPrivate::Observer::sampleBufferUpdated): Relays to MediaPlayerPrivateMediaStreamAVFObjC that
3161         a new SampleBuffer is available to enqueue to the AVSampleBufferDisplayLayer.
3162         * platform/mediastream/RealtimeMediaSource.cpp:
3163         (WebCore::RealtimeMediaSource::settingsDidChange): Fix grammatical mistake in function name settingsDidChanged().
3164         (WebCore::RealtimeMediaSource::mediaDataUpdated): Relays to all observers that a new SampleBuffer is available.
3165         (WebCore::RealtimeMediaSource::settingsDidChanged): Deleted.
3166         * platform/mediastream/RealtimeMediaSource.h:
3167         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3168         (WebCore::AVVideoCaptureSource::processNewFrame): Calls mediaDataUpdated when a new SampleBuffer is captured.
3169         * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
3170         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
3171         (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): Convert CVPixelBuffer to CMSampleBuffer.
3172         (WebCore::MockRealtimeVideoSourceMac::pixelBufferFromCGImage): Convert CGImage to CVPixelBuffer.
3173         (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): Creates a CMSampleBuffer from current imageBuffer and
3174         sends the CMSampleBuffer to MediaPlayerPrivateMediaStreamAVFObjC
3175         * platform/mock/MockRealtimeVideoSource.cpp:
3176         (WebCore::MockRealtimeVideoSource::setFrameRate): Fix grammar of settingsDidChanged() to settingsDidChange().
3177         (WebCore::MockRealtimeVideoSource::setSize): Ditto.
3178         (WebCore::MockRealtimeVideoSource::generateFrame): Call updateSampleBuffer().
3179         * platform/mock/MockRealtimeVideoSource.h: Change elapsedTime() from private to protected.
3180         (WebCore::MockRealtimeVideoSource::updateSampleBuffer): Overriden by MockRealtimeVideoSourceMac.
3181
3182 2016-07-26  Zalan Bujtas  <zalan@apple.com>
3183
3184         Move ControlStates HashMap to RenderBox.
3185         https://bugs.webkit.org/show_bug.cgi?id=160206
3186
3187         Reviewed by Simon Fraser.
3188
3189         Move and modernize it.
3190
3191         No change in functionality.
3192
3193         * platform/ControlStates.h:
3194         (WebCore::ControlStates::ControlStates): Deleted.
3195         * rendering/RenderBox.cpp:
3196         (WebCore::controlStatesRendererMap):
3197         (WebCore::controlStatesForRenderer):
3198         (WebCore::removeControlStatesForRenderer):
3199         (WebCore::RenderBox::~RenderBox):
3200         (WebCore::RenderBox::paintBoxDecorations):
3201         * rendering/RenderElement.cpp:
3202         (WebCore::controlStatesRendererMap): Deleted.
3203         (WebCore::RenderElement::hasControlStatesForRenderer): Deleted.
3204         (WebCore::RenderElement::controlStatesForRenderer): Deleted.
3205         (WebCore::RenderElement::removeControlStatesForRenderer): Deleted.
3206         (WebCore::RenderElement::addControlStatesForRenderer): Deleted.
3207         * rendering/RenderElement.h:
3208
3209 2016-07-26  Eric Carlson  <eric.carlson@apple.com>
3210
3211         Occasional crash in WebCore::RenderVTTCue::initializeLayoutParameters
3212         https://bugs.webkit.org/show_bug.cgi?id=160208
3213
3214         Reviewed by Darin Adler.
3215
3216         * rendering/RenderVTTCue.cpp:
3217         (WebCore::RenderVTTCue::initializeLayoutParameters): Return when firstChild is NULL so a
3218         release build will not crash.
3219
3220 2016-07-26  Chris Dumez  <cdumez@apple.com>
3221
3222         Parameters to CustomEvent.initCustomEvent() should be mandatory
3223         https://bugs.webkit.org/show_bug.cgi?id=160205
3224
3225         Reviewed by Ryosuke Niwa.
3226
3227         Parameters to CustomEvent.initCustomEvent() should be mandatory:
3228         - https://dom.spec.whatwg.org/#interface-customevent
3229
3230         Firefox and Chrome agree with the specification.
3231
3232         No new tests, rebaselined existing test.
3233
3234         * dom/CustomEvent.idl:
3235
3236 2016-07-26  Chris Dumez  <cdumez@apple.com>
3237
3238         Second parameter to Range.isPointInRange() / comparePoint() should be mandatory
3239         https://bugs.webkit.org/show_bug.cgi?id=160202
3240
3241         Reviewed by Ryosuke Niwa.
3242
3243         Second parameter to Range.isPointInRange() / comparePoint() should be mandatory
3244         and be of type "unsigned long":
3245         - https://dom.spec.whatwg.org/#interface-range
3246
3247         Firefox and Chrome agree with the specification.
3248
3249         No new tests, rebaselined existing tests.
3250
3251         * accessibility/AXObjectCache.cpp:
3252         (WebCore::AXObjectCache::traverseToOffsetInRange):
3253         * dom/DocumentMarkerController.cpp:
3254         (WebCore::DocumentMarkerController::removeMarkers):
3255         (WebCore::DocumentMarkerController::markersInRange):
3256         (DocumentMarkerController::setMarkersActive):
3257         * dom/Range.cpp:
3258         (WebCore::Range::isPointInRange):
3259         (WebCore::Range::comparePoint):
3260         (WebCore::Range::compareBoundaryPoints):
3261         (WebCore::Range::toString):
3262         (WebCore::Range::absoluteTextRects):
3263         (WebCore::Range::absoluteTextQuads):
3264         (WebCore::boundaryTextNodesMerged):
3265         (WebCore::Range::getBorderAndTextQuads):
3266         * dom/Range.h:
3267         (WebCore::Range::startOffset):
3268         (WebCore::Range::endOffset):
3269         * dom/Range.idl:
3270         * dom/RangeBoundaryPoint.h:
3271         (WebCore::RangeBoundaryPoint::ensureOffsetIsValid):
3272         (WebCore::RangeBoundaryPoint::toPosition):
3273         (WebCore::RangeBoundaryPoint::offset):
3274         (WebCore::RangeBoundaryPoint::setOffset):
3275         (WebCore::RangeBoundaryPoint::setToBeforeChild):
3276         (WebCore::RangeBoundaryPoint::setToAfterChild):
3277         (WebCore::RangeBoundaryPoint::setToEndOfNode):
3278         (WebCore::RangeBoundaryPoint::childBeforeWillBeRemoved):
3279         (WebCore::RangeBoundaryPoint::invalidateOffset):
3280
3281 2016-07-26  Youenn Fablet  <youenn@apple.com>
3282
3283         [Fetch API] Add support for fetch mode, in particular cors
3284         https://bugs.webkit.org/show_bug.cgi?id=156753
3285
3286         Reviewed by Darin Adler.
3287
3288         Covered by rebased tests.
3289
3290         * Modules/fetch/FetchLoader.cpp:
3291         (WebCore::FetchLoader::start): Passing fetch mode to ThreadableLoader.
3292         Disabling as a temp fix credentials in case of CORS mode as credential options is not yet supported and would make several tests fail.
3293
3294 2016-07-26  Chris Dumez  <cdumez@apple.com>
3295
3296         Align NamedNodeMap with the specification
3297         https://bugs.webkit.org/show_bug.cgi?id=160204
3298
3299         Reviewed by Darin Adler.
3300
3301         Align NamedNodeMap with the specification:
3302         - https://dom.spec.whatwg.org/#interface-namednodemap
3303
3304         In particular, mark parameters as mandatory when they should be, and
3305         use tighter "Attr" typing instead of Node.
3306
3307         Chrome and Firefox agree with the specification.
3308
3309         Test: fast/dom/NamedNodeMap-parameters.html
3310
3311         * dom/NamedNodeMap.cpp:
3312         (WebCore::NamedNodeMap::getNamedItem):
3313         (WebCore::NamedNodeMap::getNamedItemNS):
3314         (WebCore::NamedNodeMap::removeNamedItem):
3315         (WebCore::NamedNodeMap::removeNamedItemNS):
3316         (WebCore::NamedNodeMap::setNamedItem):
3317         (WebCore::NamedNodeMap::item):
3318         * dom/NamedNodeMap.h:
3319         * dom/NamedNodeMap.idl:
3320
3321 2016-07-26  Said Abou-Hallawa  <sabouhallawa@apple.com>
3322
3323         Infinite Canvas context save() causes WebKit to crash
3324         https://bugs.webkit.org/show_bug.cgi?id=159586
3325         <rdar://problem/26759984>
3326
3327         Reviewed by Simon Fraser.
3328
3329         Limit the size of the canvas context state stack to 1024 * 16 saves. All
3330         the saves which come after that limit will stay unrealized. The restore() 
3331         should not have any effect till there is no unrealized saves.
3332          
3333         Test: fast/canvas/canvas-context-save-limit.html
3334
3335         * html/canvas/CanvasRenderingContext2D.cpp:
3336         (WebCore::CanvasRenderingContext2D::realizeSaves):
3337         (WebCore::CanvasRenderingContext2D::realizeSavesLoop):
3338         * html/canvas/CanvasRenderingContext2D.h: 
3339
3340 2016-07-26  Youenn Fablet  <youenn@apple.com>
3341
3342         DOMTokenList should be iterable
3343         https://bugs.webkit.org/show_bug.cgi?id=160183
3344
3345         Reviewed by Chris Dumez.
3346
3347         DOMTokenList should be iterable as per https://dom.spec.whatwg.org/#interface-domtokenlist
3348
3349         Test: fast/dom/domTokenListIterator.html
3350
3351         * html/DOMTokenList.idl: Added iterable to the interface description.
3352
3353 2016-07-26  Commit Queue  <commit-queue@webkit.org>
3354
3355         Unreviewed, rolling out r203719.
3356         https://bugs.webkit.org/show_bug.cgi?id=160200
3357
3358         It is breaking win build (Requested by youenn on #webkit).
3359
3360         Reverted changeset:
3361
3362         "[Fetch API] Response constructor should be able to take a
3363         ReadableStream as body"
3364         https://bugs.webkit.org/show_bug.cgi?id=159804
3365         http://trac.webkit.org/changeset/203719
3366
3367 2016-07-26  John Wilander  <wilander@apple.com>
3368
3369         Stop supporting compressed character sets BOCU-1 and SCSU
3370         https://bugs.webkit.org/show_bug.cgi?id=159581
3371
3372         Reviewed by Brent Fulgham.
3373
3374         WebKit should not support the compressed character sets BOCU-1 and SCSU.
3375         Chrome and Firefox don't and these old formats may pass server-side character
3376         filters while still rendering in WebKit.
3377
3378         The HTML specification says "The above prohibits supporting, for example,
3379         CESU-8, UTF-7, BOCU-1, SCSU, EBCDIC, and UTF-32."
3380         https://html.spec.whatwg.org/#character-encodings
3381
3382         Tests: http/tests/misc/char-encoding-bocu-1-blacklisted.html
3383                http/tests/misc/char-encoding-scsu-blacklisted.html
3384
3385         * platform/text/TextEncodingRegistry.cpp:
3386             Blacklisted BOCU-1 and SCSU character sets.
3387
3388 2016-07-26  Carlos Garcia Campos  <cgarcia@igalia.com>
3389
3390         ASSERTION FAILED: !m_frame->page()->defersLoading() || InspectorInstrumentation::isDebuggerPaused(m_frame)
3391         https://bugs.webkit.org/show_bug.cgi?id=160193
3392
3393         Reviewed by Michael Catanzaro.
3394
3395         This is happening in the GTK+ Debug bot when running test loader/load-defer.html (note that the assert is inside
3396         a !USE(CF) block).
3397         The test is creating an iframe with load deferred, then in a timeout it disables the deferred load and checks
3398         that the load actually happens. What happens is that the initial empty document is what calls
3399         DocumentLoader::finishedLoading() when load is still deferred. The onload handler is not called because load
3400         events are disabled for the initial empty document in SubframeLoader::loadSubframe(), but
3401         DocumentLoader::finishedLoading() is called unconditionally from maybeLoadEmpty(). I think it's fine to call
3402         DocumentLoader::finishedLoading() for the initial empty document even when load is deferred, so we can simply
3403         update the assert to handle that case.
3404
3405         * loader/DocumentLoader.cpp:
3406         (WebCore::DocumentLoader::finishedLoading): Do not assert if called for the initial empty document when load is
3407         deferred.
3408
3409 2016-07-26  Youenn Fablet  <youenn@apple.com>
3410
3411         Remove ClientCredentialPolicy cross-origin option from ResourceLoaderOptions
3412         https://bugs.webkit.org/show_bug.cgi?id=159413
3413
3414         Reviewed by Alex Christensen.
3415
3416         ClientCredentialPolicy had three values (not ask, ask, ask only for same origin).
3417         The distinction between allowing cross-origin or same-origin credentials is misleading as it is not supported
3418         for synchronous loads and not supported by Network process.
3419         It is best replaced by a boolean option (ask or not ask).
3420
3421         Sa