Web Inspector: XHR with text but responseType = "blob" shows blank content
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-08-31  Joseph Pecoraro  <pecoraro@apple.com>
2
3         Web Inspector: XHR with text but responseType = "blob" shows blank content
4         https://bugs.webkit.org/show_bug.cgi?id=161422
5         <rdar://problem/28066869>
6
7         Reviewed by Brian Burg.
8
9         Test: inspector/network/xhr-json-blob-has-content.html
10
11         When an XMLHttpRequest finished loading it was always setting the Inspector's
12         content for that load at the end. However, if the XHR was loading binary data
13         then it was passing an empty string to the inspector and overwriting the
14         data the inspector already had for the resource. Avoid this overwriting.
15
16         * xml/XMLHttpRequest.cpp:
17         (WebCore::XMLHttpRequest::didFinishLoading):
18         When loading binary content we have no decoded text to send to the inspector.
19
20         * inspector/InspectorInstrumentation.cpp:
21         (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
22         * inspector/InspectorInstrumentation.h:
23         (WebCore::InspectorInstrumentation::didFinishXHRLoading):
24         Switch to an Optional string, and if it is not available don't
25         call through to the NetworkAgent expecting decoded text.
26
27         * inspector/InspectorNetworkAgent.cpp:
28         (WebCore::InspectorNetworkAgent::didFinishXHRLoading):
29         * inspector/InspectorNetworkAgent.h:
30         Improve variable name.
31
32 2016-08-31  Alex Christensen  <achristensen@webkit.org>
33
34         Add runtime flag for using URLParser
35         https://bugs.webkit.org/show_bug.cgi?id=161363
36
37         Reviewed by Sam Weinig.
38
39         No new tests.  No change in default behavior.
40
41         * PlatformMac.cmake:
42         * platform/URL.cpp:
43         (WebCore::URL::URL):
44         (WebCore::URL::init):
45         (WebCore::URL::setProtocol):
46         (WebCore::URL::setHost):
47         (WebCore::URL::removePort):
48         (WebCore::URL::setPort):
49         (WebCore::URL::setHostAndPort):
50         (WebCore::URL::setUser):
51         (WebCore::URL::setPass):
52         (WebCore::URL::setFragmentIdentifier):
53         (WebCore::URL::removeFragmentIdentifier):
54         (WebCore::URL::setQuery):
55         (WebCore::URL::setPath):
56         (WebCore::URL::parse):
57         * platform/URLParser.cpp:
58         (WebCore::URLParser::parse):
59         (WebCore::URLParser::setEnabled):
60         (WebCore::URLParser::enabled):
61         * platform/URLParser.h:
62         * platform/cf/URLCF.cpp:
63         (WebCore::URL::URL):
64         * platform/cocoa/URLParserCocoa.mm: Added.
65         (WebCore::URLParser::URLParserEnabled):
66         * platform/mac/URLMac.mm:
67         (WebCore::URL::URL):
68
69 2016-08-31  Youenn Fablet  <youenn@apple.com>
70
71         [Fetch API] Fetch API should be able to load data URL in Same Origin mode
72         https://bugs.webkit.org/show_bug.cgi?id=161434
73
74         Reviewed by Sam Weinig.
75
76         Tests: imported/w3c/web-platform-tests/fetch/api/redirect/redirect-to-dataurl-worker.html
77                imported/w3c/web-platform-tests/fetch/api/redirect/redirect-to-dataurl.html
78         Covered also by added sub-test.
79
80         Moving SameDataURLOrigin option from ThreadableLoaderOptions to ResourceLoaderOptions.
81         This allows doing some of the checks in CachedResourceLoader/CachedResource.
82         This also allows setting this options in CachedResourceLoader clients, ImageLoader in that case.
83
84         * Modules/fetch/FetchLoader.cpp:
85         (WebCore::FetchLoader::start): Setting sameOriginDataURL as ResourceLoader option.
86         * loader/ImageLoader.cpp:
87         (WebCore::ImageLoader::updateFromElement): Setting sameOriginDataURL as specificied in
88         https://html.spec.whatwg.org/multipage/embedded-content.html#the-img-element.
89         * loader/ResourceLoaderOptions.h: Adding sameOriginDataURL as ResourceLoader option.
90         * loader/ThreadableLoader.cpp:
91         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Removing sameOriginDataURL option.
92         * loader/ThreadableLoader.h:
93         * loader/WorkerThreadableLoader.cpp: Setting sameOriginDataURL as ResourceLoader option.
94         (WebCore::LoaderTaskOptions::LoaderTaskOptions):
95         * loader/cache/CachedResource.cpp:
96         (WebCore::CachedResource::load): If resource URL is a data url, we previously marked the resource as same origin.
97         We only do that now if the sameOriginDataURL flag is set as per fetch specification.
98         See https://fetch.spec.whatwg.org/#main-fetch.
99         * loader/cache/CachedResourceLoader.cpp:
100         (WebCore::isSameOriginDataURL): Helper function.
101         (WebCore::CachedResourceLoader::canRequest): Allowing same origin loads of data URLs if flag is set and no redirection happens.
102         See https://fetch.spec.whatwg.org/#http-redirect-fetch for why we check redirection.
103
104 2016-08-31  Ryosuke Niwa  <rniwa@webkit.org>
105
106         HTML constructor must throw when newTarget is itself
107         https://bugs.webkit.org/show_bug.cgi?id=161430
108
109         Reviewed by Antti Koivisto.
110
111         Per https://github.com/w3c/webcomponents/issues/541, we must throw a TypeError when the HTMLElement constructor
112         is called with new.target set to itself (i.e. new HTMLElement after registering it with a custom element).
113
114         Note that we can't check this at the time of customElements.define because it could be a Proxy object.
115
116         Also see: https://html.spec.whatwg.org/#html-element-constructors
117
118         Tests: fast/custom-elements/CustomElementRegistry.html
119                fast/custom-elements/HTMLElement-constructor.html
120
121         * bindings/js/JSHTMLElementCustom.cpp:
122         (WebCore::constructJSHTMLElement): Throw a TypeError when NewTarget is HTMLElement constructor itself.
123
124 2016-08-31  Ryosuke Niwa  <rniwa@webkit.org>
125
126         Rebaseline binding tests after r205257.
127
128         * bindings/scripts/test/JS/JSTestObj.cpp:
129         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
130         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
131         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
132         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
133         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
134         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
135         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
136         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):
137
138 2016-08-31  Ryosuke Niwa  <rniwa@webkit.org>
139
140         Add the check for reentrancy to CustomElementRegistry
141         https://bugs.webkit.org/show_bug.cgi?id=161423
142
143         Reviewed by Antti Koivisto.
144
145         Added the "element definition is running" flag to JSCustomElementRegistry:
146         https://html.spec.whatwg.org/multipage/scripting.html#element-definition-is-running
147
148         And added an exception for when this flag is set during JSCustomElementRegistry::define:
149         https://html.spec.whatwg.org/multipage/scripting.html#dom-customelementregistry-define
150
151         Tests: fast/custom-elements/CustomElementRegistry.html
152
153         * bindings/js/JSCustomElementRegistryCustom.cpp:
154         (WebCore::JSCustomElementRegistry::define): Throw NotSupportedError when m_elementDefinitionIsRunning is true.
155         * dom/CustomElementRegistry.h:
156         (WebCore::CustomElementRegistry::elementDefinitionIsRunning): Added.
157
158 2016-08-30  Ryosuke Niwa  <rniwa@webkit.org>
159
160         Avoid using strong reference in JSDOMPromiseā€™s DeferredWrapper
161         https://bugs.webkit.org/show_bug.cgi?id=161426
162         <rdar://problem/28091123>
163
164         Reviewed by Geoffrey Garen.
165
166         Replace JSC::Strong in DeferredWrapper by JSC::Weak, and make the global object own JSPromiseDeferred.
167
168         DeferredWrapper adds itself to JSDOMGlobalObject's newly added HashSet when it's created and clears itself
169         from the HashSet inside its destructor as well as when the promise is resolved or rejected.
170         This is so that JSDOMGlobalObject's visitChildren can visit every live DeferredWrapper.
171
172         Because this operation is rather expense, this patch turns DeferredWrapper into a RefCounted object to avoid
173         HashMap churns. Most of code changes in this patch is due to this type change, and the fact lambda cannot
174         capture Ref<DeferredWrapper> since its copy constructor doesn't exist.
175
176         We also create a write barrier from the global object to JSPromiseDeferred so that they won't be collected
177         during an eden collection when it happens before JSDOMGlobalObject's visitChildren is invoked.
178
179         Note that it's possible for the entire DOM wrapper world of the promise to go away before the promise is
180         resolved or rejected by a ref-counted C++ object. In this case, m_deferred and m_globalObject become dead.
181         Various member resolve* and reject functions of DeferredWrapper have been modified to check this condition.
182
183         Because JSDOMGlobalObject can be finalized before DeferredWrapper is finalized. DeferredWrapper's destructor,
184         which calls DeferredWrapper::clear, should only remove itself from m_globalObject when m_globalObject is alive.
185
186         Finally, this patch makes DeferredWrapper inherit from ActiveDOMCallback so that it won't try to execute scripts
187         when the active DOM objects have been suspended; e.g. after a page navigation.
188
189         No new tests since there should be no author/user visible behavioral change.
190
191         * Modules/applepay/ApplePaySession.cpp:
192         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
193         * Modules/applepay/ApplePaySession.h:
194         * Modules/fetch/DOMWindowFetch.cpp:
195         (WebCore::DOMWindowFetch::fetch):
196         * Modules/fetch/DOMWindowFetch.h:
197         * Modules/fetch/FetchBody.cpp:
198         (WebCore::FetchBody::arrayBuffer):
199         (WebCore::FetchBody::blob):
200         (WebCore::FetchBody::json):
201         (WebCore::FetchBody::text):
202         (WebCore::FetchBody::consume):
203         (WebCore::FetchBody::consumeArrayBuffer):
204         (WebCore::FetchBody::consumeArrayBufferView):
205         (WebCore::FetchBody::consumeText):
206         (WebCore::FetchBody::consumeBlob):
207         (WebCore::FetchBody::loadingFailed):
208         (WebCore::FetchBody::loadingSucceeded):
209         * Modules/fetch/FetchBody.h:
210         (WebCore::FetchBody::formData):
211         (WebCore::FetchBody::cleanConsumePromise):
212         (WebCore::FetchBody): Use RefPtr<DeferredWrapper> instead of Optional<DeferredWrapper> now that DeferredWrapper
213         is ref counted. Perhaps we could use Optional<Ref<DeferredWrapper>> here but that seemed rather verbose.
214         * Modules/fetch/FetchBodyConsumer.cpp:
215         (WebCore::FetchBodyConsumer::resolveWithData):
216         (WebCore::FetchBodyConsumer::resolve):
217         * Modules/fetch/FetchBodyConsumer.h:
218         * Modules/fetch/FetchBodyOwner.cpp:
219         (WebCore::FetchBodyOwner::arrayBuffer):
220         (WebCore::FetchBodyOwner::blob):
221         (WebCore::FetchBodyOwner::formData):
222         (WebCore::FetchBodyOwner::json):
223         (WebCore::FetchBodyOwner::text):
224         * Modules/fetch/FetchBodyOwner.h:
225         * Modules/fetch/FetchResponse.cpp:
226         (WebCore::FetchResponse::consume):
227         (WebCore::FetchResponse::finishConsumingStream):
228         * Modules/fetch/FetchResponse.h:
229         * Modules/fetch/WorkerGlobalScopeFetch.cpp:
230         (WebCore::WorkerGlobalScopeFetch::fetch):
231         * Modules/fetch/WorkerGlobalScopeFetch.h:
232         * Modules/mediastream/UserMediaPermissionCheck.h:
233         * WebCore.xcodeproj/project.pbxproj:
234         * bindings/js/JSDOMGlobalObject.cpp:
235         (WebCore::JSDOMGlobalObject::~JSDOMGlobalObject): Added.
236         (WebCore::JSDOMGlobalObject::visitChildren): Added visits to each JSPromiseDeferred owned by this global object.
237         * bindings/js/JSDOMGlobalObject.h:
238         (WebCore::JSDOMGlobalObject::deferredWrappers): Added. This map is only used by JSDOMGlobalObject's visitChildren.
239         * bindings/js/JSDOMPromise.cpp:
240         (WebCore::DeferredWrapper::DeferredWrapper):
241         (WebCore::DeferredWrapper::~DeferredWrapper): Calls clear. When the global object has already been finalized,
242         m_globalObject is dead. In that case, there is no need to remove itself from the global object. When m_deferred
243         has been cleared, either clear() has already been called (1) or the callback is dead (2). Since (2) happens only
244         when the global object itself is dead (as its visitChildren would have visited m_deferred otherwise), again, there
245         is no need to remove itself from global object.
246         (WebCore::DeferredWrapper::clear): Added. Clears m_deferred and removes itself from JSDOMGlobalObject.
247         (WebCore::DeferredWrapper::contextDestroyed): ScriptExecutionContext has been destroyed. We must call clear().
248         (WebCore::DeferredWrapper::callFunction): Check canInvokeCallback in ActiveDOMCallback.
249         (WebCore::DeferredWrapper::reject): Exit early when isSuspended() is true. See below.
250         (WebCore::rejectPromiseWithExceptionIfAny):
251         (WebCore::fulfillPromiseWithJSON):
252         (WebCore::fulfillPromiseWithArrayBuffer):
253         * bindings/js/JSDOMPromise.h:
254         (WebCore::DeferredWrapper::create): Added.
255         (WebCore::DeferredWrapper::isSuspended): Added. Returns true iff the DOM wrapper world has gone away or active DOM
256         objects have been suspended.
257         (WebCore::DeferredWrapper::globalObject): Made this inline.
258         (WebCore::DeferredWrapper::visitAggregate): Added. Called by JSDOMGlobalObject::visitChildren.
259         (WebCore::DOMPromise::resolve):
260         (WebCore::DOMPromise::reject):
261         (WebCore::DeferredWrapper::resolveWithValue): Exit early when isSuspended() is true.
262         (WebCore::DeferredWrapper::resolveWithNewlyCreated): Ditto.
263         (WebCore::DeferredWrapper::rejectWithValue): Ditto.
264         (WebCore::DeferredWrapper::resolve): Ditto.
265         (WebCore::DeferredWrapper::reject): Ditto.
266         * bindings/js/JSFontFaceCustom.cpp:
267         (WebCore::JSFontFace::loaded):
268         * bindings/js/JSFontFaceSetCustom.cpp:
269         (WebCore::JSFontFaceSet::ready):
270         * bindings/js/JSMediaDevicesCustom.cpp:
271         (WebCore::JSMediaDevices::getUserMedia):
272         * bindings/js/JSReadableStreamSourceCustom.cpp:
273         (WebCore::JSReadableStreamSource::start):
274         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
275         (WebCore::JSWebKitSubtleCrypto::encrypt):
276         (WebCore::JSWebKitSubtleCrypto::decrypt):
277         (WebCore::JSWebKitSubtleCrypto::sign):
278         (WebCore::JSWebKitSubtleCrypto::verify):
279         (WebCore::JSWebKitSubtleCrypto::digest):
280         (WebCore::JSWebKitSubtleCrypto::generateKey):
281         (WebCore::JSWebKitSubtleCrypto::importKey):
282         (WebCore::JSWebKitSubtleCrypto::exportKey):
283         (WebCore::JSWebKitSubtleCrypto::wrapKey):
284         (WebCore::JSWebKitSubtleCrypto::unwrapKey):
285         * bindings/scripts/CodeGeneratorJS.pm:
286         (GenerateReturnParameters):
287
288 2016-08-31  Youenn Fablet  <youenn@apple.com>
289
290         [Fetch API] Request construction failure should not set "bodyUsed"
291         https://bugs.webkit.org/show_bug.cgi?id=161432
292
293         Reviewed by Alex Christensen.
294
295         Covered by added sub-test coming from chromium fetch test suite.
296
297         * Modules/fetch/FetchRequest.cpp:
298         (WebCore::methodCanHaveBody):
299         (WebCore::FetchRequest::setBody): Check whether request can have a body before disturbing the passed request.
300         (WebCore::validateBodyAndMethod): Deleted.
301
302 2016-08-31  Youenn Fablet  <youenn@apple.com>
303
304         [Fetch API] Response bodyUsed should check for its body disturbed state
305         https://bugs.webkit.org/show_bug.cgi?id=161429
306
307         Reviewed by Alex Christensen.
308
309         Test: http/tests/fetch/bodyUsed-worker.html
310
311         Implementing bodyUsed as a JS Builtin.
312         This allows using directly @isReadableStreamDisturbed if response has a body.
313
314         Renaming isDisturbed to isDisturbedOrLocked to better match fetch spec terminology.
315
316         * Modules/fetch/FetchBodyOwner.cpp:
317         (WebCore::FetchBodyOwner::isDisturbedOrLocked): Renaming isDisturbed to isDisturbedOrLocked.
318         (WebCore::FetchBodyOwner::arrayBuffer): Ditto.
319         (WebCore::FetchBodyOwner::blob): Ditto.
320         (WebCore::FetchBodyOwner::formData): Ditto.
321         (WebCore::FetchBodyOwner::json): Ditto.
322         (WebCore::FetchBodyOwner::text): Ditto.
323         (WebCore::FetchBodyOwner::isDisturbed): Ditto.
324         * Modules/fetch/FetchBodyOwner.h:
325         (WebCore::FetchBodyOwner::isDisturbed): Ditto.
326         * Modules/fetch/FetchRequest.cpp:
327         (WebCore::FetchRequest::initializeWith): Ditto.
328         (WebCore::FetchRequest::clone): Ditto.
329         * Modules/fetch/FetchResponse.cpp:
330         (WebCore::FetchResponse::cloneForJS): Ditto.
331         (WebCore::FetchResponse::createReadableStreamSource): Only asserting for isDisturbed.
332         * Modules/fetch/FetchResponse.idl: Marking bodyUsed as JS builtin.
333         * Modules/fetch/FetchResponse.js: Adding bodyUsed.
334         (bodyUsed):
335         (clone):
336
337 2016-08-31  Youenn Fablet  <youenn@apple.com>
338
339         [Fetch API] Blob type should be correctly set in case of empty body
340         https://bugs.webkit.org/show_bug.cgi?id=161431
341
342         Reviewed by Alex Christensen.
343
344         Tests: http/tests/fetch/fetch-as-blob-worker.html
345                http/tests/fetch/fetch-as-blob.html
346
347         * Modules/fetch/FetchBodyConsumer.cpp:
348         (WebCore::FetchBodyConsumer::takeAsBlob): Set blob type with contentType even if blob has no data.
349         * Modules/fetch/FetchBodyOwner.cpp:
350         (WebCore::FetchBodyOwner::blob): Ditto for empty bodies.
351
352 2016-08-31  Andreas Kling  <akling@apple.com>
353
354         DOM event handling should pass Event around by reference.
355         <https://webkit.org/b/161398>
356
357         Reviewed by Chris Dumez.
358
359         Start with making Node::defaultEventHandler() take an Event& instead of an Event*,
360         and then spread out from there, propagating the referenceness.
361
362         * dom/Element.cpp:
363         (WebCore::Element::isKeyboardFocusable):
364         * dom/Element.h:
365         * dom/EventDispatcher.cpp:
366         (WebCore::callDefaultEventHandlersInTheBubblingOrder):
367         * dom/Node.cpp:
368         (WebCore::Node::dispatchDOMActivateEvent):
369         (WebCore::Node::defaultEventHandler):
370         * dom/Node.h:
371         * editing/Editor.cpp:
372         (WebCore::Editor::handleKeyboardEvent):
373         (WebCore::Editor::handleInputMethodKeydown):
374         (WebCore::Editor::handleTextEvent):
375         * editing/Editor.h:
376         * html/BaseCheckableInputType.cpp:
377         (WebCore::BaseCheckableInputType::handleKeydownEvent):
378         (WebCore::BaseCheckableInputType::handleKeypressEvent):
379         * html/BaseCheckableInputType.h:
380         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
381         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
382         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent):
383         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeypressEvent):
384         (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeyupEvent):
385         * html/BaseChooserOnlyDateAndTimeInputType.h:
386         * html/BaseClickableWithKeyInputType.cpp:
387         (WebCore::BaseClickableWithKeyInputType::handleKeydownEvent):
388         (WebCore::BaseClickableWithKeyInputType::handleKeypressEvent):
389         (WebCore::BaseClickableWithKeyInputType::handleKeyupEvent):
390         * html/BaseClickableWithKeyInputType.h:
391         * html/BaseDateAndTimeInputType.cpp:
392         (WebCore::BaseDateAndTimeInputType::isKeyboardFocusable):
393         * html/BaseDateAndTimeInputType.h:
394         * html/CheckboxInputType.cpp:
395         (WebCore::CheckboxInputType::handleKeyupEvent):
396         * html/CheckboxInputType.h:
397         * html/ColorInputType.cpp:
398         (WebCore::ColorInputType::handleDOMActivateEvent):
399         * html/ColorInputType.h:
400         * html/FileInputType.cpp:
401         (WebCore::FileInputType::handleDOMActivateEvent):
402         * html/FileInputType.h:
403         * html/HTMLAnchorElement.cpp:
404         (WebCore::HTMLAnchorElement::isKeyboardFocusable):
405         (WebCore::HTMLAnchorElement::defaultEventHandler):
406         (WebCore::HTMLAnchorElement::handleClick):
407         (WebCore::HTMLAnchorElement::eventType):
408         (WebCore::isEnterKeyKeydownEvent):
409         * html/HTMLAnchorElement.h:
410         * html/HTMLAreaElement.cpp:
411         (WebCore::HTMLAreaElement::isKeyboardFocusable):
412         * html/HTMLAreaElement.h:
413         * html/HTMLButtonElement.cpp:
414         (WebCore::HTMLButtonElement::defaultEventHandler):
415         * html/HTMLButtonElement.h:
416         * html/HTMLFormControlElement.cpp:
417         (WebCore::HTMLFormControlElement::isKeyboardFocusable):
418         * html/HTMLFormControlElement.h:
419         * html/HTMLFormElement.cpp:
420         (WebCore::HTMLFormElement::submitImplicitly):
421         (WebCore::submitElementFromEvent):
422         (WebCore::HTMLFormElement::validateInteractively):
423         (WebCore::HTMLFormElement::prepareForSubmission):
424         * html/HTMLFormElement.h:
425         * html/HTMLFrameOwnerElement.cpp:
426         (WebCore::HTMLFrameOwnerElement::isKeyboardFocusable):
427         * html/HTMLFrameOwnerElement.h:
428         * html/HTMLFrameSetElement.cpp:
429         (WebCore::HTMLFrameSetElement::defaultEventHandler):
430         * html/HTMLFrameSetElement.h:
431         * html/HTMLIFrameElement.h:
432         * html/HTMLInputElement.cpp:
433         (WebCore::HTMLInputElement::isKeyboardFocusable):
434         (WebCore::HTMLInputElement::isTextFormControlKeyboardFocusable):
435         (WebCore::HTMLInputElement::willDispatchEvent):
436         (WebCore::HTMLInputElement::defaultEventHandler):
437         * html/HTMLInputElement.h:
438         * html/HTMLLabelElement.cpp:
439         (WebCore::HTMLLabelElement::defaultEventHandler):
440         * html/HTMLLabelElement.h:
441         * html/HTMLLinkElement.cpp:
442         (WebCore::HTMLLinkElement::defaultEventHandler):
443         * html/HTMLLinkElement.h:
444         * html/HTMLPlugInElement.cpp:
445         (WebCore::HTMLPlugInElement::defaultEventHandler):
446         (WebCore::HTMLPlugInElement::isKeyboardFocusable):
447         * html/HTMLPlugInElement.h:
448         * html/HTMLPlugInImageElement.cpp:
449         (WebCore::HTMLPlugInImageElement::defaultEventHandler):
450         * html/HTMLPlugInImageElement.h:
451         * html/HTMLSelectElement.cpp:
452         (WebCore::HTMLSelectElement::isKeyboardFocusable):
453         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
454         (WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
455         (WebCore::HTMLSelectElement::defaultEventHandler):
456         * html/HTMLSelectElement.h:
457         * html/HTMLSummaryElement.cpp:
458         (WebCore::HTMLSummaryElement::defaultEventHandler):
459         * html/HTMLSummaryElement.h:
460         * html/HTMLTextAreaElement.cpp:
461         (WebCore::HTMLTextAreaElement::isKeyboardFocusable):
462         (WebCore::HTMLTextAreaElement::defaultEventHandler):
463         (WebCore::HTMLTextAreaElement::handleBeforeTextInsertedEvent):
464         * html/HTMLTextAreaElement.h:
465         * html/HTMLTextFormControlElement.cpp:
466         (WebCore::HTMLTextFormControlElement::forwardEvent):
467         * html/HTMLTextFormControlElement.h:
468         * html/ImageInputType.cpp:
469         (WebCore::ImageInputType::handleDOMActivateEvent):
470         * html/ImageInputType.h:
471         * html/InputType.cpp:
472         (WebCore::InputType::handleClickEvent):
473         (WebCore::InputType::handleMouseDownEvent):
474         (WebCore::InputType::handleDOMActivateEvent):
475         (WebCore::InputType::handleKeydownEvent):
476         (WebCore::InputType::handleKeypressEvent):
477         (WebCore::InputType::handleKeyupEvent):
478         (WebCore::InputType::handleBeforeTextInsertedEvent):
479         (WebCore::InputType::handleTouchEvent):
480         (WebCore::InputType::forwardEvent):
481         (WebCore::InputType::shouldSubmitImplicitly):
482         (WebCore::InputType::dispatchSimulatedClickIfActive):
483         (WebCore::InputType::isKeyboardFocusable):
484         * html/InputType.h:
485         * html/MediaDocument.cpp:
486         (WebCore::MediaDocument::defaultEventHandler):
487         * html/MediaDocument.h:
488         * html/NumberInputType.cpp:
489         (WebCore::NumberInputType::handleKeydownEvent):
490         * html/NumberInputType.h:
491         * html/RadioInputType.cpp:
492         (WebCore::RadioInputType::handleClickEvent):
493         (WebCore::RadioInputType::handleKeydownEvent):
494         (WebCore::RadioInputType::handleKeyupEvent):
495         (WebCore::RadioInputType::isKeyboardFocusable):
496         * html/RadioInputType.h:
497         * html/RangeInputType.cpp:
498         (WebCore::RangeInputType::handleMouseDownEvent):
499         (WebCore::RangeInputType::handleTouchEvent):
500         (WebCore::RangeInputType::handleKeydownEvent):
501         * html/RangeInputType.h:
502         * html/ResetInputType.cpp:
503         (WebCore::ResetInputType::handleDOMActivateEvent):
504         * html/ResetInputType.h:
505         * html/SearchInputType.cpp:
506         (WebCore::SearchInputType::handleKeydownEvent):
507         * html/SearchInputType.h:
508         * html/SubmitInputType.cpp:
509         (WebCore::SubmitInputType::handleDOMActivateEvent):
510         * html/SubmitInputType.h:
511         * html/TextFieldInputType.cpp:
512         (WebCore::TextFieldInputType::isKeyboardFocusable):
513         (WebCore::TextFieldInputType::handleKeydownEvent):
514         (WebCore::TextFieldInputType::handleKeydownEventForSpinButton):
515         (WebCore::TextFieldInputType::forwardEvent):
516         (WebCore::TextFieldInputType::shouldSubmitImplicitly):
517         (WebCore::TextFieldInputType::handleBeforeTextInsertedEvent):
518         * html/TextFieldInputType.h:
519         * html/shadow/AutoFillButtonElement.cpp:
520         (WebCore::AutoFillButtonElement::defaultEventHandler):
521         * html/shadow/AutoFillButtonElement.h:
522         * html/shadow/MediaControlElementTypes.cpp:
523         (WebCore::MediaControlMuteButtonElement::defaultEventHandler):
524         (WebCore::MediaControlSeekButtonElement::defaultEventHandler):
525         (WebCore::MediaControlVolumeSliderElement::defaultEventHandler):
526         * html/shadow/MediaControlElementTypes.h:
527         * html/shadow/MediaControlElements.cpp:
528         (WebCore::MediaControlPanelElement::defaultEventHandler):
529         (WebCore::MediaControlVolumeSliderContainerElement::defaultEventHandler):
530         (WebCore::MediaControlPanelMuteButtonElement::defaultEventHandler):
531         (WebCore::MediaControlPlayButtonElement::defaultEventHandler):
532         (WebCore::MediaControlOverlayPlayButtonElement::defaultEventHandler):
533         (WebCore::MediaControlRewindButtonElement::defaultEventHandler):
534         (WebCore::MediaControlReturnToRealtimeButtonElement::defaultEventHandler):
535         (WebCore::MediaControlToggleClosedCaptionsButtonElement::defaultEventHandler):
536         (WebCore::MediaControlClosedCaptionsTrackListElement::defaultEventHandler):
537         (WebCore::MediaControlTimelineElement::defaultEventHandler):
538         (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
539         (WebCore::MediaControlFullscreenVolumeMinButtonElement::defaultEventHandler):
540         (WebCore::MediaControlFullscreenVolumeMaxButtonElement::defaultEventHandler):
541         * html/shadow/MediaControlElements.h:
542         * html/shadow/MediaControls.cpp:
543         (WebCore::MediaControls::defaultEventHandler):
544         (WebCore::MediaControls::containsRelatedTarget):
545         * html/shadow/MediaControls.h:
546         * html/shadow/MediaControlsApple.cpp:
547         (WebCore::MediaControlsApple::defaultEventHandler):
548         (WebCore::MediaControlsApple::handleClickEvent):
549         (WebCore::MediaControlsAppleEventListener::handleEvent):
550         * html/shadow/MediaControlsApple.h:
551         * html/shadow/SliderThumbElement.cpp:
552         (WebCore::SliderThumbElement::defaultEventHandler):
553         (WebCore::SliderThumbElement::handleTouchStart):
554         (WebCore::SliderThumbElement::handleTouchMove):
555         (WebCore::SliderThumbElement::handleTouchEndAndCancel):
556         (WebCore::SliderThumbElement::handleTouchEvent):
557         * html/shadow/SliderThumbElement.h:
558         * html/shadow/SpinButtonElement.cpp:
559         (WebCore::SpinButtonElement::defaultEventHandler):
560         (WebCore::SpinButtonElement::forwardEvent):
561         * html/shadow/SpinButtonElement.h:
562         * html/shadow/TextControlInnerElements.cpp:
563         (WebCore::TextControlInnerTextElement::defaultEventHandler):
564         (WebCore::SearchFieldResultsButtonElement::defaultEventHandler):
565         (WebCore::SearchFieldCancelButtonElement::defaultEventHandler):
566         * html/shadow/TextControlInnerElements.h:
567         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
568         (WebCore::ImageControlsButtonElementMac::defaultEventHandler):
569         * html/shadow/mac/ImageControlsButtonElementMac.h:
570         * loader/FrameLoader.cpp:
571         (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
572         * mathml/MathMLElement.cpp:
573         (WebCore::MathMLElement::defaultEventHandler):
574         (WebCore::MathMLElement::isKeyboardFocusable):
575         * mathml/MathMLElement.h:
576         * mathml/MathMLSelectElement.cpp:
577         (WebCore::MathMLSelectElement::defaultEventHandler):
578         * mathml/MathMLSelectElement.h:
579         * page/EventHandler.cpp:
580         (WebCore::didScrollInScrollableArea):
581         (WebCore::handleWheelEventInAppropriateEnclosingBox):
582         (WebCore::EventHandler::defaultWheelEventHandler):
583         (WebCore::EventHandler::keyEvent):
584         (WebCore::handleKeyboardSelectionMovement):
585         (WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility):
586         (WebCore::EventHandler::defaultKeyboardEventHandler):
587         (WebCore::EventHandler::defaultTextInputEventHandler):
588         (WebCore::EventHandler::defaultSpaceEventHandler):
589         (WebCore::EventHandler::defaultBackspaceEventHandler):
590         (WebCore::EventHandler::defaultArrowEventHandler):
591         (WebCore::EventHandler::defaultTabEventHandler):
592         * page/EventHandler.h:
593         * page/FocusController.cpp:
594         (WebCore::isFocusableElementOrScopeOwner):
595         (WebCore::isNonFocusableScopeOwner):
596         (WebCore::isFocusableScopeOwner):
597         (WebCore::FocusController::advanceFocusInDocumentOrder):
598         (WebCore::FocusController::findFocusCandidateInContainer):
599         * rendering/RenderFrameSet.cpp:
600         (WebCore::RenderFrameSet::userResize):
601         * rendering/RenderFrameSet.h:
602         * svg/SVGAElement.cpp:
603         (WebCore::SVGAElement::defaultEventHandler):
604         (WebCore::SVGAElement::isKeyboardFocusable):
605         * svg/SVGAElement.h:
606
607 2016-08-31  Romain Bellessort  <romain.bellessort@crf.canon.fr>
608
609         [Streams API] Align getReader() with spec
610         https://bugs.webkit.org/show_bug.cgi?id=160508
611
612         Reviewed by Xabier Rodriguez-Calvar.
613
614         Aligned getReader() with spec following replacement of ReadableStreamReader by
615         ReadableStreamDefaultReader.
616
617         Test: streams/readable-stream-getReader.html
618
619         * Modules/streams/ReadableStream.js:
620         (getReader):
621
622 2016-08-31  Brady Eidson  <beidson@apple.com>
623
624         WK2 Gamepad provider on iOS.
625         https://bugs.webkit.org/show_bug.cgi?id=161412
626
627         Reviewed by Tim Horton.
628
629         No new tests (Native framework backends not directly testable)
630
631         * Configurations/FeatureDefines.xcconfig:
632
633 2016-08-31  Antti Koivisto  <antti@apple.com>
634
635         REGRESSION (r201701): Unable to copy from CodeMirror editor version used in Jenkins install website
636         https://bugs.webkit.org/show_bug.cgi?id=161386
637         <rdar://problem/27590077>
638
639         Reviewed by Dan Bernstein.
640
641         This CodeMirror version uses a hidden <textarea> to implement copy/paste. The textarea has width:1px; border-width:1px.
642         Jenkins page has also has a stylesheet that contains * { box-sizing:border-box } and as a result the textarea content
643         width gets computed as 0. With r201701 we use content size instead of box size for clipping and the textarea content is
644         (correctly) considered invisible.
645
646         Add a quirk that allows this to continue working.
647
648         Test: editing/text-iterator/hidden-textarea-selection-quirk.html
649
650         * editing/TextIterator.cpp:
651         (WebCore::fullyClipsContents):
652
653 2016-08-31  Joseph Pecoraro  <pecoraro@apple.com>
654
655         Remove unused member variable in WebCore::File
656         https://bugs.webkit.org/show_bug.cgi?id=161420
657
658         Reviewed by Alex Christensen.
659
660         * fileapi/File.h:
661
662 2016-08-30  Ryosuke Niwa  <rniwa@webkit.org>
663
664         Add "get" to CustomElementsRegistry
665         https://bugs.webkit.org/show_bug.cgi?id=161421
666
667         Reviewed by Yusuke Suzuki.
668
669         Add the support for "get" method on CustomElementsRegistry, which returns the constructor
670         of the custom element with the given name:
671         https://html.spec.whatwg.org/multipage/scripting.html#dom-customelementregistry-get
672
673         Tests: fast/custom-elements/CustomElementRegistry.html
674
675         * dom/CustomElementRegistry.cpp:
676         (WebCore::CustomElementRegistry::get): Added.
677         * dom/CustomElementRegistry.h:
678         * dom/CustomElementRegistry.idl:
679
680 2016-08-30  Yusuke Suzuki  <utatane.tea@gmail.com>
681
682         Make PendingScript as ref-counted
683         https://bugs.webkit.org/show_bug.cgi?id=161350
684
685         Reviewed by Ryosuke Niwa.
686
687         Currently, while PendingScript is copyable, PendingScript is also CachedResourceClient.
688         So when copying this, the client registration is done in PendingScript's operator= etc.
689         However, this copying functionality is not effectively used.
690         In this patch, we change this PendingScript to ref-counted class and make it noncopyable.
691         This change makes things simple (dropping this copying functionality), and drops unnecessary
692         addClient / removeClient calls. And we also simplify PendingScript class. Since we can offer
693         all the members at the construction time, we do not need any setters like setCachedScript,
694         setElement etc. This prevents us from accidentally generating the half-baked pending script.
695
696         Furthermore, by changing PendingScript noncopyable & ref-counted, we easily make it
697         observable. In this patch, we add PendingScriptClient to receive the notification from
698         PendingScript. Previously, we directly used CachedScript in PendingScript to receive the
699         notification. When introducing ScriptModuleGraph and making this PendingScript the container
700         of the both CachedScript and ScriptModuleGraph, hiding the raw CachedScript operations is
701         useful.
702
703         No behavior changes.
704
705         * WebCore.xcodeproj/project.pbxproj:
706         * dom/PendingScript.cpp:
707         (WebCore::PendingScript::create): These factory functions take all the information needed
708         to construct the PendingScript. So the setters of PendingScript are dropped. This is better
709         since we now do not expose any half-baked pending script accidentally.
710         (WebCore::PendingScript::PendingScript):
711         (WebCore::PendingScript::~PendingScript):
712         (WebCore::PendingScript::notifyClientFinished):
713         (WebCore::PendingScript::notifyFinished):
714         (WebCore::PendingScript::isLoaded): When introducing ScriptModuleGraph, this will query to
715         either CachedScript or ScriptModuleGraph. PendingScript will become the container for the
716         both types.
717         (WebCore::PendingScript::setClient):
718         (WebCore::PendingScript::clearClient): PendingScript is now observable by PendingScriptClient.
719         This avoids touching CachedScript in PendingScript directly. That is good when we introduce
720         ScriptModuleGraph and make PendingScript the container of the both CachedScript and ScriptModuleGraph.
721         (WebCore::PendingScript::releaseElementAndClear): Deleted. Previously, PendingScript is not ref-counted.
722         So when we would like to say "this pending script is empty", we used the pending script with
723         `m_element = nullptr`. This releaseElementAndClear cleared this m_element and made the pending
724         script empty. Now, we use RefPtr<PendingScript> and empty one is just represented by the nullptr.
725         This function is no longer necessary. Dropped.
726         (WebCore::PendingScript::setCachedScript): Deleted. The fields are set in the constructor.
727         So this setter is no longer necessary. Dropped.
728         * dom/PendingScript.h:
729         * dom/PendingScriptClient.h: Copied from Source/WebCore/html/parser/HTMLScriptRunnerHost.h.
730         (WebCore::PendingScriptClient::~PendingScriptClient):
731         * dom/ScriptRunner.cpp:
732         (WebCore::ScriptRunner::queueScriptForExecution):
733         (WebCore::ScriptRunner::notifyScriptReady):
734         (WebCore::ScriptRunner::timerFired): We use `std::exchange` to retrieve the RefPtr<PendingScript>
735         and make the original vector element nullptr. Without this, all the PendingScript is held until
736         the iteration finishes. We keep the original semantics here that the pending script can be
737         released per iteration.
738         * dom/ScriptRunner.h:
739         * html/parser/HTMLDocumentParser.cpp:
740         (WebCore::HTMLDocumentParser::watchForLoad):
741         (WebCore::HTMLDocumentParser::stopWatchingForLoad): Use PendingScript instead of touching
742         CachedScript directly.
743         (WebCore::HTMLDocumentParser::notifyFinished):
744         * html/parser/HTMLDocumentParser.h:
745         * html/parser/HTMLScriptRunner.cpp:
746         (WebCore::HTMLScriptRunner::~HTMLScriptRunner):
747         (WebCore::HTMLScriptRunner::sourceFromPendingScript):
748         (WebCore::HTMLScriptRunner::isPendingScriptReady):
749         (WebCore::HTMLScriptRunner::executeParsingBlockingScript):
750         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): As the previous comment describes,
751         we used releaseElementAndClear to make the current pending script empty. Instead of doing so, we now
752         explicitly clear executeParsingBlockingScript (by assigning nullptr to m_parserBlockingScript).
753         (WebCore::HTMLScriptRunner::watchForLoad):
754         (WebCore::HTMLScriptRunner::stopWatchingForLoad): Previously, we used CachedScript::addClient directly
755         in the m_host.watchForLoad. This means that we did not have a quick way to query whether the pending
756         script is watched. In the old implementation, we have the `m_watchingForLoad : bool` flag in PendingScript
757         to hold the watching status for the given pending script. This `pendingScript.setWatchingForLoad(true)`
758         just made this flag `true`. But now, we do not use CachedScript::addClient directly. Instead, we have
759         the PendingScriptClient and PendingScript::{setClient,clearClient}. We can know whether this pending
760         script is watched by checking `m_client != nullptr`. This makes `m_watchingForLoad` unnecessary.
761         So this patch drops `m_watchingForLoad` and `pendingScript.setWatchingForLoad(true)` call.
762         (WebCore::HTMLScriptRunner::hasParserBlockingScript):
763         (WebCore::HTMLScriptRunner::executeParsingBlockingScripts): We clear the m_parserBlockingScript here
764         instead of the middle of the executePendingScriptAndDispatchEvent.
765         (WebCore::HTMLScriptRunner::executeScriptsWaitingForLoad):
766         (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
767         (WebCore::requestPendingScript):
768         (WebCore::HTMLScriptRunner::requestParsingBlockingScript): Setting m_parsingBlockingScript is now done
769         in this caller side.
770         (WebCore::HTMLScriptRunner::requestDeferredScript):
771         (WebCore::HTMLScriptRunner::runScript):
772         (WebCore::HTMLScriptRunner::requestPendingScript): Instead of configuring the passed PendingScript&,
773         we return the pending script and the caller sets it to m_parserBlockingScript or holds it. And we now
774         change this function to static location one and drop the member function. Previously, we always make
775         PendingScript& valid by always calling `setElement(...)`. I think this is the bug since we accidentally
776         exposed the half-baked pending script. But this bug is not shown since `!cachedScript` path is dead code!
777         This requestPendingScript is called from two places, requestDeferredScript and requestParsingBlockingScript.
778         And these functions are called if the script has `willBeParserExecuted` flag. In the case of the script
779         tag having "src" attribute, this flag is only set if `cachedScript` is correctly instantiated. So when
780         these functions are called, we can ensure that `cachedScript` is correctly instantiated for the given script.
781         In the case of the script tag not having "src" attribute, these functions are won't be called. This is
782         because if such a script tag has `willBeParserExecuted` flag, it also has `m_readyToBeParserExecuted`
783         and it does not have `m_willExecuteWhenDocumentFinishedParsing` flag, and in that case the both
784         functions are never called. So we drop that path and insert the assertion to ensure the above conditions.
785         * html/parser/HTMLScriptRunner.h:
786         * html/parser/HTMLScriptRunnerHost.h:
787
788 2016-08-30  Ricky Mondello  <rmondello@apple.com>
789
790         "pluginReplacementEnabled" should be a Setting, not a RuntimeEnabledFeature
791         https://bugs.webkit.org/show_bug.cgi?id=161416
792         <rdar://problem/28050847>
793
794         Reviewed by Simon Fraser.
795
796         Mostly mechanical. Tested by running LayoutTests/plugins/quicktime-plugin-replacement.html and manually toggling
797         defaultPluginReplacementEnabled and observing a behavior change.
798
799         * bindings/generic/RuntimeEnabledFeatures.cpp:
800         (WebCore::RuntimeEnabledFeatures::reset): Purged of the pluginReplacementEnabled setting.
801         * bindings/generic/RuntimeEnabledFeatures.h:
802         (WebCore::RuntimeEnabledFeatures::setPluginReplacementEnabled): Deleted.
803         (WebCore::RuntimeEnabledFeatures::pluginReplacementEnabled): Deleted.
804         * html/HTMLPlugInElement.cpp:
805         (WebCore::HTMLPlugInElement::requestObject): Use the setting.
806         * page/Settings.cpp: Supply different values for iOS and other platforms, matching the RuntimeEnabledFeature values,
807             enabled for iOS and disabled otherwise.
808         * page/Settings.in: Declare the setting.
809         * testing/InternalSettings.cpp:
810         (WebCore::InternalSettings::Backup::Backup): Use the setting.
811         (WebCore::InternalSettings::Backup::restoreTo): Ditto.
812         (WebCore::InternalSettings::setPluginReplacementEnabled): Ditto.
813         * testing/InternalSettings.h: Can now throw an exception, like other Settings-backed members.
814         * testing/InternalSettings.idl: Declare this as possibly throwing an exception.
815
816 2016-08-30  Ricky Mondello  <rmondello@apple.com>
817
818         YouTubePluginReplacementTest's URL transformation logic should have tests
819         https://bugs.webkit.org/show_bug.cgi?id=161406
820         <rdar://problem/28050847>
821
822         Reviewed by Eric Carlson.
823
824         Refactor most of YouTubePluginReplacement::youTubeURL into a static method that can be used by TestWebKitAPI.
825
826         * Modules/plugins/YouTubePluginReplacement.cpp:
827         (WebCore::YouTubePluginReplacement::youTubeURL): Now implemented in terms of youTubeURLFromAbsoluteURL.
828         (WebCore::YouTubePluginReplacement::youTubeURLFromAbsoluteURL): Absorbs most of youTubeURL.
829         * Modules/plugins/YouTubePluginReplacement.h: Declare a public method, for the benefit of testing.
830         * WebCore.xcodeproj/project.pbxproj: Make some heads private for TestWebKitAPI's benefit.
831
832 2016-08-30  Frederic Wang  <fwang@igalia.com>
833
834         Move some code from MathMLElement to MathMLPresentationElement
835         https://bugs.webkit.org/show_bug.cgi?id=161377
836
837         Reviewed by Darin Adler.
838
839         The following code is only used in presentation MathML classes. We then move it from
840         MathMLElement to MathMLPresentationElement:
841         - testing whether a child is a phrasing/flow element.
842         - parsing of length attributes.
843         - parsing of boolean attributes.
844         - parsing of mathvariant attributes.
845
846         No new tests, already covered by existing tests.
847
848         * mathml/MathMLElement.cpp:
849         (WebCore::MathMLElement::isPhrasingContent): Deleted.
850         (WebCore::MathMLElement::isFlowContent): Deleted.
851         (WebCore::MathMLElement::parseNumberAndUnit): Deleted.
852         (WebCore::MathMLElement::parseNamedSpace): Deleted.
853         (WebCore::MathMLElement::parseMathMLLength): Deleted.
854         (WebCore::MathMLElement::cachedMathMLLength): Deleted.
855         (WebCore::MathMLElement::cachedBooleanAttribute): Deleted.
856         (WebCore::MathMLElement::parseMathVariantAttribute): Deleted.
857         (WebCore::MathMLElement::specifiedDisplayStyle): Deleted.
858         (WebCore::MathMLElement::specifiedMathVariant): Deleted.
859         * mathml/MathMLElement.h:
860         (WebCore::MathMLElement::specifiedDisplayStyle):
861         (WebCore::MathMLElement::specifiedMathVariant):
862         (WebCore::MathMLElement::acceptsDisplayStyleAttribute): Deleted.
863         (WebCore::MathMLElement::acceptsMathVariantAttribute): Deleted.
864         (WebCore::MathMLElement::toOptionalBool): Deleted.
865         * mathml/MathMLPresentationElement.cpp:
866         (WebCore::MathMLPresentationElement::isPhrasingContent):
867         (WebCore::MathMLPresentationElement::isFlowContent):
868         (WebCore::MathMLPresentationElement::cachedBooleanAttribute):
869         (WebCore::MathMLPresentationElement::parseNumberAndUnit):
870         (WebCore::MathMLPresentationElement::parseNamedSpace):
871         (WebCore::MathMLPresentationElement::parseMathMLLength):
872         (WebCore::MathMLPresentationElement::cachedMathMLLength):
873         (WebCore::MathMLPresentationElement::specifiedDisplayStyle):
874         (WebCore::MathMLPresentationElement::parseMathVariantAttribute):
875         (WebCore::MathMLPresentationElement::specifiedMathVariant):
876         * mathml/MathMLPresentationElement.h:
877         (WebCore::MathMLPresentationElement::toOptionalBool):
878         (WebCore::MathMLPresentationElement::acceptsMathVariantAttribute):
879
880 2016-08-30  Frederic Wang  <fwang@igalia.com>
881
882         Introduce a MathMLUnknownElement class
883         https://bugs.webkit.org/show_bug.cgi?id=161298
884
885         Reviewed by Darin Adler.
886
887         For consistency with SVG and HTML, we make MathML elements use a
888         fallback MathMLUnknownElement class. Like SVG, we ensure that unknown
889         MathML elements do not create any renderer.
890
891         Test: mathml/mathml-unknown.xhtml
892
893         * mathml/MathMLUnknownElement.h: Added. This is a simple class for
894         unknown MathML elements, preventing the creation of renderers.
895         * mathml/mathtags.in: Map fallbackInterfaceName to MathMLUnknownElement.
896
897 2016-08-30  Chris Dumez  <cdumez@apple.com>
898
899         [[Delete]] should throw for cross-origin Window / Location objects
900         https://bugs.webkit.org/show_bug.cgi?id=161397
901
902         Reviewed by Ryosuke Niwa.
903
904         [[Delete]] should throw for cross-origin Window / Location objects:
905         - https://github.com/whatwg/html/pull/1728
906
907         Firefox and Chrome already throw. Previously, WebKit was merely
908         ignoring the call and logging an error message.
909
910         No new tests, updated existing test.
911
912         * bindings/js/JSDOMWindowCustom.cpp:
913         (WebCore::JSDOMWindow::deleteProperty):
914         (WebCore::JSDOMWindow::deletePropertyByIndex):
915         * bindings/js/JSLocationCustom.cpp:
916         (WebCore::JSLocation::deleteProperty):
917         (WebCore::JSLocation::deletePropertyByIndex):
918
919 2016-08-30  Brady Eidson  <beidson@apple.com>
920
921         GameController.framework backend for gamepad API.
922         https://bugs.webkit.org/show_bug.cgi?id=161086
923
924         Reviewed by Alex Christensen.
925
926         No new tests (Native framework backends not directly testable)
927
928         * WebCore.xcodeproj/project.pbxproj:
929         
930         * platform/gamepad/cocoa/GameControllerGamepad.h: Copied from Source/WebKit2/UIProcess/Gamepad/mac/UIGamepadProviderHID.cpp.
931         * platform/gamepad/cocoa/GameControllerGamepad.mm: Added.
932         (WebCore::GameControllerGamepad::GameControllerGamepad):
933         (WebCore::GameControllerGamepad::setupAsExtendedGamepad):
934         (WebCore::GameControllerGamepad::setupAsGamepad):
935         
936         * platform/gamepad/cocoa/GameControllerGamepadProvider.h: Added.
937         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: Added.
938         (WebCore::GameControllerGamepadProvider::singleton):
939         (WebCore::GameControllerGamepadProvider::GameControllerGamepadProvider):
940         (WebCore::GameControllerGamepadProvider::controllerDidConnect):
941         (WebCore::GameControllerGamepadProvider::controllerDidDisconnect):
942         (WebCore::GameControllerGamepadProvider::startMonitoringGamepads):
943         (WebCore::GameControllerGamepadProvider::stopMonitoringGamepads):
944         (WebCore::GameControllerGamepadProvider::indexForNewlyConnectedDevice):
945         (WebCore::GameControllerGamepadProvider::gamepadHadInput):
946         (WebCore::GameControllerGamepadProvider::makeInvisibileGamepadsVisible):
947         (WebCore::GameControllerGamepadProvider::inputNotificationTimerFired):
948
949 2016-08-30  Mark Lam  <mark.lam@apple.com>
950
951         Introduce the ThrowScope and force every throw site to instantiate a ThrowScope.
952         https://bugs.webkit.org/show_bug.cgi?id=161171
953
954         Reviewed by Filip Pizlo and Geoffrey Garen.
955
956         No new tests because this is only an internal API change. If it builds, it should be good.
957
958         * bindings/js/JSApplePaySessionCustom.cpp:
959         (WebCore::JSApplePaySession::completeShippingMethodSelection):
960         (WebCore::JSApplePaySession::completeShippingContactSelection):
961         (WebCore::JSApplePaySession::completePaymentMethodSelection):
962         * bindings/js/JSBlobCustom.cpp:
963         (WebCore::constructJSBlob):
964         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
965         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
966         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
967         (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
968         (WebCore::createAesCbcParams):
969         (WebCore::createAesKeyGenParams):
970         (WebCore::createHmacParams):
971         (WebCore::createHmacKeyParams):
972         (WebCore::createRsaKeyGenParams):
973         (WebCore::createRsaOaepParams):
974         (WebCore::createRsaSsaParams):
975         * bindings/js/JSCryptoCustom.cpp:
976         (WebCore::JSCrypto::getRandomValues):
977         * bindings/js/JSCryptoKeySerializationJWK.cpp:
978         (WebCore::getJSArrayFromJSON):
979         (WebCore::getStringFromJSON):
980         (WebCore::getBooleanFromJSON):
981         (WebCore::getBigIntegerVectorFromJSON):
982         (WebCore::JSCryptoKeySerializationJWK::JSCryptoKeySerializationJWK):
983         (WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm):
984         (WebCore::tryJWKKeyOpsValue):
985         (WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
986         (WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence):
987         (WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
988         (WebCore::JSCryptoKeySerializationJWK::keyData):
989         (WebCore::addJWKAlgorithmToJSON):
990         (WebCore::JSCryptoKeySerializationJWK::serialize):
991         * bindings/js/JSCryptoOperationData.cpp:
992         (WebCore::cryptoOperationDataFromJSValue):
993         * bindings/js/JSCustomElementInterface.cpp:
994         (WebCore::JSCustomElementInterface::upgradeElement):
995         * bindings/js/JSCustomElementRegistryCustom.cpp:
996         (WebCore::getCustomElementCallback):
997         (WebCore::JSCustomElementRegistry::define):
998         * bindings/js/JSDOMBinding.cpp:
999         (WebCore::setDOMException):
1000         (WebCore::enforceRange):
1001         (WebCore::toSmallerInt):
1002         (WebCore::toSmallerUInt):
1003         (WebCore::canAccessDocument):
1004         (WebCore::throwTypeError):
1005         (WebCore::throwNotSupportedError):
1006         (WebCore::throwInvalidStateError):
1007         (WebCore::throwSecurityError):
1008         (WebCore::throwArgumentMustBeEnumError):
1009         (WebCore::throwArgumentMustBeFunctionError):
1010         (WebCore::throwArgumentTypeError):
1011         (WebCore::throwArrayElementTypeError):
1012         (WebCore::throwAttributeTypeError):
1013         (WebCore::throwConstructorScriptExecutionContextUnavailableError):
1014         (WebCore::throwSequenceTypeError):
1015         (WebCore::throwNonFiniteTypeError):
1016         (WebCore::throwGetterTypeError):
1017         (WebCore::throwSetterTypeError):
1018         (WebCore::throwThisTypeError):
1019         (WebCore::callThrowTypeError):
1020         * bindings/js/JSDOMBinding.h:
1021         (WebCore::toJSSequence):
1022         (WebCore::toRefPtrNativeArray):
1023         (WebCore::toNativeArray):
1024         * bindings/js/JSDOMConstructor.h:
1025         (WebCore::JSDOMConstructorNotConstructable::callThrowTypeError):
1026         (WebCore::JSBuiltinConstructor<JSClass>::callConstructor):
1027         * bindings/js/JSDOMConvert.h:
1028         (WebCore::convertWrapperType):
1029         * bindings/js/JSDOMIterator.h:
1030         (WebCore::iteratorCreate):
1031         (WebCore::iteratorForEach):
1032         (WebCore::JSDOMIteratorPrototype<JSWrapper>::next):
1033         * bindings/js/JSDOMWindowCustom.cpp:
1034         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
1035         (WebCore::JSDOMWindow::put):
1036         (WebCore::JSDOMWindow::showModalDialog):
1037         (WebCore::handlePostMessage):
1038         (WebCore::JSDOMWindow::setTimeout):
1039         (WebCore::JSDOMWindow::setInterval):
1040         * bindings/js/JSDataCueCustom.cpp:
1041         (WebCore::constructJSDataCue):
1042         * bindings/js/JSDictionary.cpp:
1043         (WebCore::JSDictionary::convertValue):
1044         * bindings/js/JSDocumentCustom.cpp:
1045         (WebCore::JSDocument::createTouchList):
1046         (WebCore::JSDocument::getCSSCanvasContext):
1047         * bindings/js/JSFileCustom.cpp:
1048         (WebCore::constructJSFile):
1049         * bindings/js/JSHTMLAllCollectionCustom.cpp:
1050         (WebCore::JSHTMLAllCollection::item):
1051         * bindings/js/JSHTMLCanvasElementCustom.cpp:
1052         (WebCore::JSHTMLCanvasElement::getContext):
1053         (WebCore::JSHTMLCanvasElement::probablySupportsContext):
1054         * bindings/js/JSHTMLDocumentCustom.cpp:
1055         (WebCore::JSHTMLDocument::open):
1056         * bindings/js/JSHTMLElementCustom.cpp:
1057         (WebCore::constructJSHTMLElement):
1058         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
1059         (WebCore::JSHTMLFormControlsCollection::namedItem):
1060         * bindings/js/JSHTMLInputElementCustom.cpp:
1061         (WebCore::JSHTMLInputElement::selectionStart):
1062         (WebCore::JSHTMLInputElement::setSelectionStart):
1063         (WebCore::JSHTMLInputElement::selectionEnd):
1064         (WebCore::JSHTMLInputElement::setSelectionEnd):
1065         (WebCore::JSHTMLInputElement::selectionDirection):
1066         (WebCore::JSHTMLInputElement::setSelectionDirection):
1067         (WebCore::JSHTMLInputElement::setSelectionRange):
1068         * bindings/js/JSHistoryCustom.cpp:
1069         (WebCore::JSHistory::pushState):
1070         (WebCore::JSHistory::replaceState):
1071         * bindings/js/JSIDBDatabaseCustom.cpp:
1072         (WebCore::JSIDBDatabase::createObjectStore):
1073         * bindings/js/JSImageConstructor.cpp:
1074         (WebCore::JSImageConstructor::construct):
1075         * bindings/js/JSLocationCustom.cpp:
1076         (WebCore::JSLocation::getOwnPropertySlotDelegate):
1077         * bindings/js/JSMediaDevicesCustom.cpp:
1078         (WebCore::JSMediaDevices::getUserMedia):
1079         * bindings/js/JSMediaStreamTrackCustom.cpp:
1080         (WebCore::JSMediaStreamTrack::getSettings):
1081         (WebCore::JSMediaStreamTrack::getCapabilities):
1082         * bindings/js/JSMessagePortCustom.cpp:
1083         (WebCore::fillMessagePortArray):
1084         * bindings/js/JSMessagePortCustom.h:
1085         (WebCore::handlePostMessage):
1086         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
1087         (WebCore::JSMockContentFilterSettings::setDecisionPoint):
1088         (WebCore::toDecision):
1089         * bindings/js/JSModuleLoader.cpp:
1090         (WebCore::JSModuleLoader::evaluate):
1091         * bindings/js/JSMutationObserverCustom.cpp:
1092         (WebCore::constructJSMutationObserver):
1093         * bindings/js/JSNodeCustom.cpp:
1094         (WebCore::JSNode::insertBefore):
1095         (WebCore::JSNode::replaceChild):
1096         (WebCore::JSNode::removeChild):
1097         (WebCore::JSNode::appendChild):
1098         * bindings/js/JSNodeFilterCustom.cpp:
1099         (WebCore::JSNodeFilter::acceptNode):
1100         * bindings/js/JSPluginElementFunctions.cpp:
1101         (WebCore::pluginElementPropertyGetter):
1102         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
1103         (WebCore::constructJSReadableStreamDefaultController):
1104         (WebCore::constructJSReadableStreamDefaultReader):
1105         * bindings/js/JSSVGLengthCustom.cpp:
1106         (WebCore::JSSVGLength::setValue):
1107         (WebCore::JSSVGLength::convertToSpecifiedUnits):
1108         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
1109         (WebCore::JSWebGL2RenderingContext::getIndexedParameter):
1110         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
1111         (WebCore::getObjectParameter):
1112         (WebCore::JSWebGLRenderingContextBase::getAttachedShaders):
1113         (WebCore::JSWebGLRenderingContextBase::getExtension):
1114         (WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
1115         (WebCore::JSWebGLRenderingContextBase::getParameter):
1116         (WebCore::JSWebGLRenderingContextBase::getProgramParameter):
1117         (WebCore::JSWebGLRenderingContextBase::getShaderParameter):
1118         (WebCore::JSWebGLRenderingContextBase::getUniform):
1119         (WebCore::dataFunctionf):
1120         (WebCore::dataFunctioni):
1121         (WebCore::dataFunctionMatrix):
1122         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
1123         (WebCore::cryptoKeyFormatFromJSValue):
1124         (WebCore::cryptoKeyUsagesFromJSValue):
1125         (WebCore::JSWebKitSubtleCrypto::encrypt):
1126         (WebCore::JSWebKitSubtleCrypto::decrypt):
1127         (WebCore::JSWebKitSubtleCrypto::sign):
1128         (WebCore::JSWebKitSubtleCrypto::verify):
1129         (WebCore::JSWebKitSubtleCrypto::digest):
1130         (WebCore::JSWebKitSubtleCrypto::generateKey):
1131         (WebCore::importKey):
1132         (WebCore::JSWebKitSubtleCrypto::importKey):
1133         (WebCore::exportKey):
1134         (WebCore::JSWebKitSubtleCrypto::exportKey):
1135         (WebCore::JSWebKitSubtleCrypto::wrapKey):
1136         (WebCore::JSWebKitSubtleCrypto::unwrapKey):
1137         * bindings/js/JSWorkerCustom.cpp:
1138         (WebCore::constructJSWorker):
1139         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
1140         (WebCore::JSWorkerGlobalScope::setTimeout):
1141         (WebCore::JSWorkerGlobalScope::setInterval):
1142         * bindings/js/ReadableStreamDefaultController.cpp:
1143         (WebCore::ReadableStreamDefaultController::invoke):
1144         * bindings/js/SerializedScriptValue.cpp:
1145         (WebCore::CloneBase::throwStackOverflow):
1146         (WebCore::CloneDeserializer::throwValidationError):
1147         (WebCore::SerializedScriptValue::maybeThrowExceptionIfSerializationFailed):
1148         * bindings/js/WorkerScriptController.cpp:
1149         (WebCore::WorkerScriptController::evaluate):
1150         (WebCore::WorkerScriptController::setException):
1151         * bindings/scripts/CodeGeneratorJS.pm:
1152         (GenerateEnumerationImplementationContent):
1153         (GenerateDictionaryImplementationContent):
1154         (GenerateOverloadedFunctionOrConstructor):
1155         (GenerateImplementation):
1156         (GenerateFunctionCastedThis):
1157         (GenerateArgumentsCountCheck):
1158         (GenerateParametersCheck):
1159         (GenerateConstructorDefinition):
1160         * bindings/scripts/test/JS/JSInterfaceName.cpp:
1161         (WebCore::jsInterfaceNameConstructor):
1162         (WebCore::setJSInterfaceNameConstructor):
1163         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1164         (WebCore::jsTestActiveDOMObjectExcitingAttr):
1165         (WebCore::jsTestActiveDOMObjectConstructor):
1166         (WebCore::setJSTestActiveDOMObjectConstructor):
1167         (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
1168         (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
1169         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
1170         (WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
1171         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
1172         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1173         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
1174         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
1175         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1176         (WebCore::jsTestCustomNamedGetterConstructor):
1177         (WebCore::setJSTestCustomNamedGetterConstructor):
1178         (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
1179         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1180         (WebCore::JSTestEventConstructorConstructor::construct):
1181         (WebCore::jsTestEventConstructorAttr1):
1182         (WebCore::jsTestEventConstructorAttr2):
1183         (WebCore::jsTestEventConstructorAttr3):
1184         (WebCore::jsTestEventConstructorConstructor):
1185         (WebCore::setJSTestEventConstructorConstructor):
1186         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1187         (WebCore::jsTestEventTargetConstructor):
1188         (WebCore::setJSTestEventTargetConstructor):
1189         (WebCore::jsTestEventTargetPrototypeFunctionItem):
1190         * bindings/scripts/test/JS/JSTestException.cpp:
1191         (WebCore::jsTestExceptionName):
1192         (WebCore::jsTestExceptionConstructor):
1193         (WebCore::setJSTestExceptionConstructor):
1194         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1195         (WebCore::jsTestGenerateIsReachableConstructor):
1196         (WebCore::setJSTestGenerateIsReachableConstructor):
1197         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
1198         (WebCore::jsTestGlobalObjectRegularAttribute):
1199         (WebCore::jsTestGlobalObjectPublicAndPrivateAttribute):
1200         (WebCore::jsTestGlobalObjectPublicAndPrivateConditionalAttribute):
1201         (WebCore::jsTestGlobalObjectEnabledAtRuntimeAttribute):
1202         (WebCore::jsTestGlobalObjectConstructor):
1203         (WebCore::setJSTestGlobalObjectConstructor):
1204         (WebCore::setJSTestGlobalObjectRegularAttribute):
1205         (WebCore::setJSTestGlobalObjectPublicAndPrivateAttribute):
1206         (WebCore::setJSTestGlobalObjectPublicAndPrivateConditionalAttribute):
1207         (WebCore::setJSTestGlobalObjectEnabledAtRuntimeAttribute):
1208         (WebCore::jsTestGlobalObjectInstanceFunctionRegularOperation):
1209         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1):
1210         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2):
1211         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation):
1212         (WebCore::jsTestGlobalObjectInstanceFunctionTestPrivateFunction):
1213         * bindings/scripts/test/JS/JSTestInterface.cpp:
1214         (WebCore::JSTestInterfaceConstructor::construct):
1215         (WebCore::jsTestInterfaceConstructorImplementsStaticReadOnlyAttr):
1216         (WebCore::jsTestInterfaceConstructorImplementsStaticAttr):
1217         (WebCore::jsTestInterfaceImplementsStr1):
1218         (WebCore::jsTestInterfaceImplementsStr2):
1219         (WebCore::jsTestInterfaceImplementsStr3):
1220         (WebCore::jsTestInterfaceImplementsNode):
1221         (WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr):
1222         (WebCore::jsTestInterfaceConstructorSupplementalStaticAttr):
1223         (WebCore::jsTestInterfaceSupplementalStr1):
1224         (WebCore::jsTestInterfaceSupplementalStr2):
1225         (WebCore::jsTestInterfaceSupplementalStr3):
1226         (WebCore::jsTestInterfaceSupplementalNode):
1227         (WebCore::jsTestInterfaceConstructor):
1228         (WebCore::setJSTestInterfaceConstructor):
1229         (WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
1230         (WebCore::setJSTestInterfaceImplementsStr2):
1231         (WebCore::setJSTestInterfaceImplementsStr3):
1232         (WebCore::setJSTestInterfaceImplementsNode):
1233         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
1234         (WebCore::setJSTestInterfaceSupplementalStr2):
1235         (WebCore::setJSTestInterfaceSupplementalStr3):
1236         (WebCore::setJSTestInterfaceSupplementalNode):
1237         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod1):
1238         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
1239         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod3):
1240         (WebCore::jsTestInterfaceConstructorFunctionImplementsMethod4):
1241         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod1):
1242         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
1243         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod3):
1244         (WebCore::jsTestInterfaceConstructorFunctionSupplementalMethod4):
1245         * bindings/scripts/test/JS/JSTestIterable.cpp:
1246         (WebCore::jsTestIterableConstructor):
1247         (WebCore::setJSTestIterableConstructor):
1248         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
1249         (WebCore::jsTestJSBuiltinConstructorTestAttributeCustom):
1250         (WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustom):
1251         (WebCore::jsTestJSBuiltinConstructorConstructor):
1252         (WebCore::setJSTestJSBuiltinConstructorConstructor):
1253         (WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustom):
1254         (WebCore::jsTestJSBuiltinConstructorPrototypeFunctionTestCustomFunction):
1255         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1256         (WebCore::jsTestMediaQueryListListenerConstructor):
1257         (WebCore::setJSTestMediaQueryListListenerConstructor):
1258         (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
1259         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1260         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
1261         (WebCore::jsTestNamedConstructorConstructor):
1262         (WebCore::setJSTestNamedConstructorConstructor):
1263         * bindings/scripts/test/JS/JSTestNode.cpp:
1264         (WebCore::JSTestNodeConstructor::construct):
1265         (WebCore::jsTestNodeName):
1266         (WebCore::jsTestNodeConstructor):
1267         (WebCore::setJSTestNodeConstructor):
1268         (WebCore::setJSTestNodeName):
1269         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1270         (WebCore::jsTestNondeterministicNondeterministicReadonlyAttr):
1271         (WebCore::jsTestNondeterministicNondeterministicWriteableAttr):
1272         (WebCore::jsTestNondeterministicNondeterministicExceptionAttr):
1273         (WebCore::jsTestNondeterministicNondeterministicGetterExceptionAttr):
1274         (WebCore::jsTestNondeterministicNondeterministicSetterExceptionAttr):
1275         (WebCore::jsTestNondeterministicConstructor):
1276         (WebCore::setJSTestNondeterministicConstructor):
1277         (WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
1278         (WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
1279         (WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
1280         (WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
1281         (WebCore::jsTestNondeterministicPrototypeFunctionNondeterministicZeroArgFunction):
1282         * bindings/scripts/test/JS/JSTestObj.cpp:
1283         (WebCore::convert<TestObj::EnumType>):
1284         (WebCore::convert<TestObj::Optional>):
1285         (WebCore::convert<AlternateEnumName>):
1286         (WebCore::convert<TestObj::EnumA>):
1287         (WebCore::convert<TestObj::EnumB>):
1288         (WebCore::convert<TestObj::EnumC>):
1289         (WebCore::convert<TestObj::Kind>):
1290         (WebCore::convert<TestObj::Size>):
1291         (WebCore::convert<TestObj::Confidence>):
1292         (WebCore::convertDictionary<TestObj::Dictionary>):
1293         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
1294         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
1295         (WebCore::convertDictionary<AlternateDictionaryName>):
1296         (WebCore::JSTestObjConstructor::construct):
1297         (WebCore::jsTestObjReadOnlyLongAttr):
1298         (WebCore::jsTestObjReadOnlyStringAttr):
1299         (WebCore::jsTestObjReadOnlyTestObjAttr):
1300         (WebCore::jsTestObjConstructorStaticReadOnlyLongAttr):
1301         (WebCore::jsTestObjConstructorStaticStringAttr):
1302         (WebCore::jsTestObjConstructorTestSubObj):
1303         (WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
1304         (WebCore::jsTestObjEnumAttr):
1305         (WebCore::jsTestObjByteAttr):
1306         (WebCore::jsTestObjOctetAttr):
1307         (WebCore::jsTestObjShortAttr):
1308         (WebCore::jsTestObjClampedShortAttr):
1309         (WebCore::jsTestObjEnforceRangeShortAttr):
1310         (WebCore::jsTestObjUnsignedShortAttr):
1311         (WebCore::jsTestObjLongAttr):
1312         (WebCore::jsTestObjLongLongAttr):
1313         (WebCore::jsTestObjUnsignedLongLongAttr):
1314         (WebCore::jsTestObjStringAttr):
1315         (WebCore::jsTestObjUsvstringAttr):
1316         (WebCore::jsTestObjTestObjAttr):
1317         (WebCore::jsTestObjTestNullableObjAttr):
1318         (WebCore::jsTestObjLenientTestObjAttr):
1319         (WebCore::jsTestObjUnforgeableAttr):
1320         (WebCore::jsTestObjStringAttrTreatingNullAsEmptyString):
1321         (WebCore::jsTestObjUsvstringAttrTreatingNullAsEmptyString):
1322         (WebCore::jsTestObjImplementationEnumAttr):
1323         (WebCore::jsTestObjXMLObjAttr):
1324         (WebCore::jsTestObjCreate):
1325         (WebCore::jsTestObjReflectedStringAttr):
1326         (WebCore::jsTestObjReflectedUSVStringAttr):
1327         (WebCore::jsTestObjReflectedIntegralAttr):
1328         (WebCore::jsTestObjReflectedUnsignedIntegralAttr):
1329         (WebCore::jsTestObjReflectedBooleanAttr):
1330         (WebCore::jsTestObjReflectedURLAttr):
1331         (WebCore::jsTestObjReflectedUSVURLAttr):
1332         (WebCore::jsTestObjReflectedCustomIntegralAttr):
1333         (WebCore::jsTestObjReflectedCustomBooleanAttr):
1334         (WebCore::jsTestObjReflectedCustomURLAttr):
1335         (WebCore::jsTestObjEnabledAtRuntimeAttribute):
1336         (WebCore::jsTestObjTypedArrayAttr):
1337         (WebCore::jsTestObjAttrWithGetterException):
1338         (WebCore::jsTestObjAttrWithGetterExceptionWithMessage):
1339         (WebCore::jsTestObjAttrWithSetterException):
1340         (WebCore::jsTestObjAttrWithSetterExceptionWithMessage):
1341         (WebCore::jsTestObjStringAttrWithGetterException):
1342         (WebCore::jsTestObjStringAttrWithSetterException):
1343         (WebCore::jsTestObjCustomAttr):
1344         (WebCore::jsTestObjOnfoo):
1345         (WebCore::jsTestObjOnwebkitfoo):
1346         (WebCore::jsTestObjWithScriptStateAttribute):
1347         (WebCore::jsTestObjWithCallWithAndSetterCallWithAttribute):
1348         (WebCore::jsTestObjWithScriptExecutionContextAttribute):
1349         (WebCore::jsTestObjWithScriptStateAttributeRaises):
1350         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
1351         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
1352         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
1353         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
1354         (WebCore::jsTestObjWithScriptArgumentsAndCallStackAttribute):
1355         (WebCore::jsTestObjConditionalAttr1):
1356         (WebCore::jsTestObjConditionalAttr2):
1357         (WebCore::jsTestObjConditionalAttr3):
1358         (WebCore::jsTestObjConditionalAttr4Constructor):
1359         (WebCore::jsTestObjConditionalAttr5Constructor):
1360         (WebCore::jsTestObjConditionalAttr6Constructor):
1361         (WebCore::jsTestObjCachedAttribute1):
1362         (WebCore::jsTestObjCachedAttribute2):
1363         (WebCore::jsTestObjAnyAttribute):
1364         (WebCore::jsTestObjContentDocument):
1365         (WebCore::jsTestObjMutablePoint):
1366         (WebCore::jsTestObjImmutablePoint):
1367         (WebCore::jsTestObjStrawberry):
1368         (WebCore::jsTestObjDescription):
1369         (WebCore::jsTestObjId):
1370         (WebCore::jsTestObjHash):
1371         (WebCore::jsTestObjReplaceableAttribute):
1372         (WebCore::jsTestObjNullableDoubleAttribute):
1373         (WebCore::jsTestObjNullableLongAttribute):
1374         (WebCore::jsTestObjNullableBooleanAttribute):
1375         (WebCore::jsTestObjNullableStringAttribute):
1376         (WebCore::jsTestObjNullableLongSettableAttribute):
1377         (WebCore::jsTestObjNullableStringSettableAttribute):
1378         (WebCore::jsTestObjNullableUSVStringSettableAttribute):
1379         (WebCore::jsTestObjNullableStringValue):
1380         (WebCore::jsTestObjAttribute):
1381         (WebCore::jsTestObjAttributeWithReservedEnumType):
1382         (WebCore::jsTestObjPutForwardsAttribute):
1383         (WebCore::jsTestObjPutForwardsNullableAttribute):
1384         (WebCore::jsTestObjStringifierAttribute):
1385         (WebCore::jsTestObjConstructor):
1386         (WebCore::setJSTestObjConstructor):
1387         (WebCore::setJSTestObjConstructorStaticStringAttr):
1388         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
1389         (WebCore::setJSTestObjEnumAttr):
1390         (WebCore::setJSTestObjByteAttr):
1391         (WebCore::setJSTestObjOctetAttr):
1392         (WebCore::setJSTestObjShortAttr):
1393         (WebCore::setJSTestObjClampedShortAttr):
1394         (WebCore::setJSTestObjEnforceRangeShortAttr):
1395         (WebCore::setJSTestObjUnsignedShortAttr):
1396         (WebCore::setJSTestObjLongAttr):
1397         (WebCore::setJSTestObjLongLongAttr):
1398         (WebCore::setJSTestObjUnsignedLongLongAttr):
1399         (WebCore::setJSTestObjStringAttr):
1400         (WebCore::setJSTestObjUsvstringAttr):
1401         (WebCore::setJSTestObjTestObjAttr):
1402         (WebCore::setJSTestObjTestNullableObjAttr):
1403         (WebCore::setJSTestObjLenientTestObjAttr):
1404         (WebCore::setJSTestObjStringAttrTreatingNullAsEmptyString):
1405         (WebCore::setJSTestObjUsvstringAttrTreatingNullAsEmptyString):
1406         (WebCore::setJSTestObjImplementationEnumAttr):
1407         (WebCore::setJSTestObjXMLObjAttr):
1408         (WebCore::setJSTestObjCreate):
1409         (WebCore::setJSTestObjReflectedStringAttr):
1410         (WebCore::setJSTestObjReflectedUSVStringAttr):
1411         (WebCore::setJSTestObjReflectedIntegralAttr):
1412         (WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
1413         (WebCore::setJSTestObjReflectedBooleanAttr):
1414         (WebCore::setJSTestObjReflectedURLAttr):
1415         (WebCore::setJSTestObjReflectedUSVURLAttr):
1416         (WebCore::setJSTestObjReflectedCustomIntegralAttr):
1417         (WebCore::setJSTestObjReflectedCustomBooleanAttr):
1418         (WebCore::setJSTestObjReflectedCustomURLAttr):
1419         (WebCore::setJSTestObjEnabledAtRuntimeAttribute):
1420         (WebCore::setJSTestObjTypedArrayAttr):
1421         (WebCore::setJSTestObjAttrWithGetterException):
1422         (WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
1423         (WebCore::setJSTestObjAttrWithSetterException):
1424         (WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
1425         (WebCore::setJSTestObjStringAttrWithGetterException):
1426         (WebCore::setJSTestObjStringAttrWithSetterException):
1427         (WebCore::setJSTestObjCustomAttr):
1428         (WebCore::setJSTestObjOnfoo):
1429         (WebCore::setJSTestObjOnwebkitfoo):
1430         (WebCore::setJSTestObjWithScriptStateAttribute):
1431         (WebCore::setJSTestObjWithCallWithAndSetterCallWithAttribute):
1432         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
1433         (WebCore::setJSTestObjWithScriptStateAttributeRaises):
1434         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
1435         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
1436         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
1437         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
1438         (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
1439         (WebCore::setJSTestObjConditionalAttr1):
1440         (WebCore::setJSTestObjConditionalAttr2):
1441         (WebCore::setJSTestObjConditionalAttr3):
1442         (WebCore::setJSTestObjConditionalAttr4Constructor):
1443         (WebCore::setJSTestObjConditionalAttr5Constructor):
1444         (WebCore::setJSTestObjConditionalAttr6Constructor):
1445         (WebCore::setJSTestObjAnyAttribute):
1446         (WebCore::setJSTestObjMutablePoint):
1447         (WebCore::setJSTestObjImmutablePoint):
1448         (WebCore::setJSTestObjStrawberry):
1449         (WebCore::setJSTestObjId):
1450         (WebCore::setJSTestObjReplaceableAttribute):
1451         (WebCore::setJSTestObjNullableLongSettableAttribute):
1452         (WebCore::setJSTestObjNullableStringSettableAttribute):
1453         (WebCore::setJSTestObjNullableUSVStringSettableAttribute):
1454         (WebCore::setJSTestObjNullableStringValue):
1455         (WebCore::setJSTestObjAttributeWithReservedEnumType):
1456         (WebCore::setJSTestObjPutForwardsAttribute):
1457         (WebCore::setJSTestObjPutForwardsNullableAttribute):
1458         (WebCore::setJSTestObjStringifierAttribute):
1459         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1):
1460         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2):
1461         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation):
1462         (WebCore::jsTestObjPrototypeFunctionVoidMethod):
1463         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
1464         (WebCore::jsTestObjPrototypeFunctionByteMethod):
1465         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
1466         (WebCore::jsTestObjPrototypeFunctionOctetMethod):
1467         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
1468         (WebCore::jsTestObjPrototypeFunctionLongMethod):
1469         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
1470         (WebCore::jsTestObjPrototypeFunctionObjMethod):
1471         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
1472         (WebCore::jsTestObjInstanceFunctionUnforgeableMethod):
1473         (WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyString):
1474         (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter):
1475         (WebCore::jsTestObjPrototypeFunctionNullableStringMethod):
1476         (WebCore::jsTestObjConstructorFunctionNullableStringStaticMethod):
1477         (WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethod):
1478         (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArg):
1479         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArg):
1480         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue):
1481         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
1482         (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArg):
1483         (WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArg):
1484         (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyString):
1485         (WebCore::jsTestObjPrototypeFunctionSerializedValue):
1486         (WebCore::jsTestObjPrototypeFunctionOptionsObject):
1487         (WebCore::jsTestObjPrototypeFunctionMethodWithException):
1488         (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionWithMessage):
1489         (WebCore::jsTestObjPrototypeFunctionCustomMethod):
1490         (WebCore::jsTestObjPrototypeFunctionCustomMethodWithArgs):
1491         (WebCore::jsTestObjPrototypeFunctionPrivateMethod):
1492         (WebCore::jsTestObjPrototypeFunctionPublicAndPrivateMethod):
1493         (WebCore::jsTestObjPrototypeFunctionAddEventListener):
1494         (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
1495         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoid):
1496         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObj):
1497         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidException):
1498         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException):
1499         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
1500         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState):
1501         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
1502         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
1503         (WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack):
1504         (WebCore::jsTestObjPrototypeFunctionWithDocumentArgument):
1505         (WebCore::jsTestObjPrototypeFunctionWithCallerDocumentArgument):
1506         (WebCore::jsTestObjPrototypeFunctionWithCallerWindowArgument):
1507         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
1508         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue):
1509         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
1510         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
1511         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
1512         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVString):
1513         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicString):
1514         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue):
1515         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringAndDefaultValue):
1516         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNull):
1517         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
1518         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNull):
1519         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsEmptyString):
1520         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringIsEmptyString):
1521         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyString):
1522         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaN):
1523         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaN):
1524         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLong):
1525         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongIsZero):
1526         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLong):
1527         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongIsZero):
1528         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequence):
1529         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmpty):
1530         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBoolean):
1531         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse):
1532         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAny):
1533         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapper):
1534         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapperIsNull):
1535         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolver):
1536         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
1537         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
1538         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg):
1539         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionArg):
1540         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg):
1541         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionAndOptionalArg):
1542         (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackAndOptionalArg):
1543         (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArg):
1544         (WebCore::jsTestObjPrototypeFunctionConditionalMethod1):
1545         (WebCore::jsTestObjPrototypeFunctionConditionalMethod2):
1546         (WebCore::jsTestObjPrototypeFunctionConditionalMethod3):
1547         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
1548         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
1549         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
1550         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
1551         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5):
1552         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6):
1553         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
1554         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
1555         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
1556         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
1557         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
1558         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12):
1559         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
1560         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
1561         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
1562         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
1563         (WebCore::jsTestObjConstructorFunctionClassMethod):
1564         (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
1565         (WebCore::jsTestObjConstructorFunctionClassMethod2):
1566         (WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
1567         (WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
1568         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1):
1569         (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
1570         (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange):
1571         (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
1572         (WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
1573         (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
1574         (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence):
1575         (WebCore::jsTestObjPrototypeFunctionGetElementById):
1576         (WebCore::jsTestObjPrototypeFunctionGetSVGDocument):
1577         (WebCore::jsTestObjPrototypeFunctionConvert1):
1578         (WebCore::jsTestObjPrototypeFunctionConvert2):
1579         (WebCore::jsTestObjPrototypeFunctionConvert3):
1580         (WebCore::jsTestObjPrototypeFunctionConvert4):
1581         (WebCore::jsTestObjPrototypeFunctionMutablePointFunction):
1582         (WebCore::jsTestObjPrototypeFunctionImmutablePointFunction):
1583         (WebCore::jsTestObjPrototypeFunctionOrange):
1584         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
1585         (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
1586         (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
1587         (WebCore::jsTestObjPrototypeFunctionAny):
1588         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
1589         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
1590         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
1591         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
1592         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
1593         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
1594         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
1595         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
1596         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):
1597         (WebCore::jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack):
1598         (WebCore::jsTestObjPrototypeFunctionConditionalOverload1):
1599         (WebCore::jsTestObjPrototypeFunctionConditionalOverload2):
1600         (WebCore::jsTestObjPrototypeFunctionConditionalOverload):
1601         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1):
1602         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2):
1603         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload):
1604         (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot):
1605         (WebCore::jsTestObjPrototypeFunctionToString):
1606         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1607         (WebCore::constructJSTestOverloadedConstructors1):
1608         (WebCore::constructJSTestOverloadedConstructors2):
1609         (WebCore::constructJSTestOverloadedConstructors3):
1610         (WebCore::constructJSTestOverloadedConstructors4):
1611         (WebCore::constructJSTestOverloadedConstructors5):
1612         (WebCore::JSTestOverloadedConstructorsConstructor::construct):
1613         (WebCore::jsTestOverloadedConstructorsConstructor):
1614         (WebCore::setJSTestOverloadedConstructorsConstructor):
1615         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1616         (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
1617         (WebCore::constructJSTestOverloadedConstructorsWithSequence2):
1618         (WebCore::JSTestOverloadedConstructorsWithSequenceConstructor::construct):
1619         (WebCore::jsTestOverloadedConstructorsWithSequenceConstructor):
1620         (WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):
1621         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1622         (WebCore::jsTestOverrideBuiltinsConstructor):
1623         (WebCore::setJSTestOverrideBuiltinsConstructor):
1624         (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem):
1625         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1626         (WebCore::jsTestSerializedScriptValueInterfaceValue):
1627         (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue):
1628         (WebCore::jsTestSerializedScriptValueInterfaceCachedValue):
1629         (WebCore::jsTestSerializedScriptValueInterfacePorts):
1630         (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue):
1631         (WebCore::jsTestSerializedScriptValueInterfaceConstructor):
1632         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
1633         (WebCore::setJSTestSerializedScriptValueInterfaceValue):
1634         (WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
1635         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1636         (WebCore::JSTestTypedefsConstructor::construct):
1637         (WebCore::jsTestTypedefsUnsignedLongLongAttr):
1638         (WebCore::jsTestTypedefsImmutableSerializedScriptValue):
1639         (WebCore::jsTestTypedefsConstructorTestSubObj):
1640         (WebCore::jsTestTypedefsAttrWithGetterException):
1641         (WebCore::jsTestTypedefsAttrWithSetterException):
1642         (WebCore::jsTestTypedefsStringAttrWithGetterException):
1643         (WebCore::jsTestTypedefsStringAttrWithSetterException):
1644         (WebCore::jsTestTypedefsConstructor):
1645         (WebCore::setJSTestTypedefsConstructor):
1646         (WebCore::setJSTestTypedefsUnsignedLongLongAttr):
1647         (WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
1648         (WebCore::setJSTestTypedefsAttrWithGetterException):
1649         (WebCore::setJSTestTypedefsAttrWithSetterException):
1650         (WebCore::setJSTestTypedefsStringAttrWithGetterException):
1651         (WebCore::setJSTestTypedefsStringAttrWithSetterException):
1652         (WebCore::jsTestTypedefsPrototypeFunctionFunc):
1653         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
1654         (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
1655         (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArg):
1656         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
1657         (WebCore::jsTestTypedefsPrototypeFunctionImmutablePointFunction):
1658         (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction):
1659         (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2):
1660         (WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude):
1661         (WebCore::jsTestTypedefsPrototypeFunctionMethodWithException):
1662         * bindings/scripts/test/JS/JSattribute.cpp:
1663         (WebCore::jsattributeReadonly):
1664         (WebCore::jsattributeConstructor):
1665         (WebCore::setJSattributeConstructor):
1666         * bindings/scripts/test/JS/JSreadonly.cpp:
1667         (WebCore::jsreadonlyConstructor):
1668         (WebCore::setJSreadonlyConstructor):
1669         * bridge/c/c_instance.cpp:
1670         (JSC::Bindings::CInstance::moveGlobalExceptionToExecState):
1671         (JSC::Bindings::CInstance::invokeMethod):
1672         (JSC::Bindings::CInstance::invokeDefaultMethod):
1673         (JSC::Bindings::CInstance::invokeConstruct):
1674         (JSC::Bindings::CInstance::toJSPrimitive):
1675         * bridge/objc/objc_instance.mm:
1676         (ObjcInstance::moveGlobalExceptionToExecState):
1677         (ObjcInstance::invokeMethod):
1678         * bridge/objc/objc_runtime.mm:
1679         (JSC::Bindings::ObjcField::valueFromInstance):
1680         (JSC::Bindings::ObjcField::setValueToInstance):
1681         (JSC::Bindings::ObjcArray::setValueAt):
1682         (JSC::Bindings::ObjcArray::valueAt):
1683         (JSC::Bindings::callObjCFallbackObject):
1684         * bridge/objc/objc_utility.h:
1685         * bridge/objc/objc_utility.mm:
1686         (JSC::Bindings::throwError):
1687         * bridge/runtime_array.cpp:
1688         (JSC::RuntimeArray::lengthGetter):
1689         (JSC::RuntimeArray::put):
1690         (JSC::RuntimeArray::putByIndex):
1691         * bridge/runtime_method.cpp:
1692         (JSC::RuntimeMethod::lengthGetter):
1693         (JSC::callRuntimeMethod):
1694         * bridge/runtime_object.cpp:
1695         (JSC::Bindings::RuntimeObject::fallbackObjectGetter):
1696         (JSC::Bindings::RuntimeObject::fieldGetter):
1697         (JSC::Bindings::RuntimeObject::methodGetter):
1698         (JSC::Bindings::RuntimeObject::getOwnPropertySlot):
1699         (JSC::Bindings::RuntimeObject::put):
1700         (JSC::Bindings::RuntimeObject::defaultValue):
1701         (JSC::Bindings::RuntimeObject::getOwnPropertyNames):
1702         (JSC::Bindings::RuntimeObject::throwInvalidAccessError):
1703         * bridge/runtime_object.h:
1704
1705 2016-08-30  Brent Fulgham  <bfulgham@apple.com>
1706
1707         Use of uninitialised memory in TransformationMatrx::blend4()
1708         https://bugs.webkit.org/show_bug.cgi?id=134621
1709         <rdar://problem/27337539>
1710
1711         Reviewed by Dean Jackson.
1712
1713         Change is based on the Blink change (patch by <alancutter@chromium.org>):
1714         <https://src.chromium.org/viewvc/blink?revision=177453&view=revision>
1715
1716         TransformationMatrix::blend() was attempting to blend between non-invertable
1717         matricies. This resulted in garbage stack variables being used.
1718         This patch ensures that blend() will fall back to a 50% step interpolation
1719         when one of the sides are not invertable.
1720
1721         Tested by new TransformationMatrix test in TestWebKitAPI.
1722
1723         * platform/graphics/transforms/TransformationMatrix.cpp:
1724         (WebCore::TransformationMatrix::blend2): Properly handle failure in the
1725         decompose method calls.
1726         (WebCore::TransformationMatrix::blend4): Ditto.
1727
1728 2016-08-30  Alex Christensen  <achristensen@webkit.org>
1729
1730         URLParser should handle relative URLs that start with //
1731         https://bugs.webkit.org/show_bug.cgi?id=161364
1732
1733         Reviewed by Darin Adler.
1734
1735         Covered by an API test.
1736
1737         * platform/URLParser.cpp:
1738         (WebCore::URLParser::parse):
1739
1740 2016-08-30  Wenson Hsieh  <wenson_hsieh@apple.com>
1741
1742         Fix a typo introduced in r205184.
1743         https://bugs.webkit.org/show_bug.cgi?id=161380
1744
1745         Reviewed by Tim Horton.
1746
1747         Fixes a typo in an accessibility string: "Exit fullscreen" => "Exit Fullscreen"
1748
1749         * platform/LocalizedStrings.cpp:
1750         (WebCore::exitFullScreenButtonAccessibilityTitle):
1751
1752 2016-08-30  Youenn Fablet  <youenn@apple.com>
1753
1754         [Fetch API] Blob not found URL should result in a network error
1755         https://bugs.webkit.org/show_bug.cgi?id=161381
1756
1757         Reviewed by Sam Weinig.
1758
1759         Covered by rebased and updated tests.
1760
1761         Raising a network error if no blob can be found from the URL.
1762         It is no longer notified by a 404 response.
1763
1764         Updated FileReaderLoader to generate the correct exception.
1765
1766         Made some clean-up in the code, in particular adding an enum class for BlobResourceHandle errors.
1767
1768         * fileapi/FileReaderLoader.cpp:
1769         (WebCore::FileReaderLoader::didFail):
1770         (WebCore::FileReaderLoader::toErrorCode):
1771         (WebCore::FileReaderLoader::httpStatusCodeToErrorCode):
1772         * fileapi/FileReaderLoader.h:
1773         * platform/network/BlobResourceHandle.cpp:
1774         (WebCore::BlobResourceHandle::loadResourceSynchronously):
1775         (WebCore::BlobResourceHandle::doStart):
1776         (WebCore::BlobResourceHandle::didGetSize):
1777         (WebCore::BlobResourceHandle::readSync):
1778         (WebCore::BlobResourceHandle::readFileSync):
1779         (WebCore::BlobResourceHandle::readAsync):
1780         (WebCore::BlobResourceHandle::didOpen):
1781         (WebCore::BlobResourceHandle::didRead):
1782         (WebCore::BlobResourceHandle::failed):
1783         (WebCore::BlobResourceHandle::notifyResponse):
1784         (WebCore::BlobResourceHandle::notifyResponseOnError):
1785         (WebCore::BlobResourceHandle::notifyFail):
1786         * platform/network/BlobResourceHandle.h:
1787
1788 2016-08-30  Youenn Fablet  <youenn@apple.com>
1789
1790         [Fetch API] Body mix-in text() should decode data as UTF-8
1791         https://bugs.webkit.org/show_bug.cgi?id=161372
1792
1793         Reviewed by Sam Weinig.
1794
1795         Test: imported/w3c/web-platform-tests/fetch/api/basic/text-utf8.html
1796
1797         UsingTextResourceDecoder to decode data as UTF-8.
1798         Making sure to prepend BOM if there is none, as specified in https://encoding.spec.whatwg.org/#utf-8-decode.
1799
1800         * Modules/fetch/FetchBodyConsumer.cpp:
1801         (WebCore::shouldPrependBOM):
1802         (WebCore::textFromUTF8):
1803         (WebCore::FetchBodyConsumer::resolveWithData):
1804         (WebCore::FetchBodyConsumer::takeAsText):
1805
1806 2016-08-30  Zalan Bujtas  <zalan@apple.com>
1807
1808         ASSERTION FAILED: opportunitiesInRun <= expansionOpportunityCount in WebCore::computeExpansionForJustifiedText
1809         https://bugs.webkit.org/show_bug.cgi?id=139393
1810         <rdar://problem/27704243>
1811
1812         Reviewed by Myles C. Maxfield.
1813
1814         This patch ensures that we always remove a valid 'after expansion' opportunity (even when the last entry
1815         in the opportunities list is 0).
1816
1817         Test: fast/text/assert-on-expansion-opportunity.html
1818
1819         * rendering/RenderBlockLineLayout.cpp:
1820         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
1821
1822 2016-08-30  Wenson Hsieh  <wenson_hsieh@apple.com>
1823
1824         Exit fullscreen button in fullscreen media playback needs an accessibility string
1825         https://bugs.webkit.org/show_bug.cgi?id=161380
1826
1827         Reviewed by Beth Dakin.
1828
1829         Adds an accessibility string for the exit fullscreen button.
1830
1831         * English.lproj/Localizable.strings:
1832         * platform/LocalizedStrings.cpp:
1833         (WebCore::exitFullScreenButtonAccessibilityTitle):
1834         * platform/LocalizedStrings.h:
1835
1836 2016-08-30  Antti Koivisto  <antti@apple.com>
1837
1838         Remove StylePendingImage
1839         https://bugs.webkit.org/show_bug.cgi?id=161245
1840
1841         Reviewed by Andreas Kling.
1842
1843         Instances of this confusing type are used as placeholders during style resolution.
1844         We can get rid of it and make "pending" a state of StyleImage. This simplies the code and
1845         will allow further improvements.
1846
1847         * WebCore.xcodeproj/project.pbxproj:
1848         * css/CSSCrossfadeValue.cpp:
1849         (WebCore::CSSCrossfadeValue::isPending):
1850         (WebCore::CSSCrossfadeValue::blend):
1851         * css/CSSCrossfadeValue.h:
1852         * css/CSSCursorImageValue.cpp:
1853         (WebCore::CSSCursorImageValue::CSSCursorImageValue):
1854         (WebCore::CSSCursorImageValue::~CSSCursorImageValue):
1855
1856             Save the original URL since the underlying CSSImageValue may change.
1857
1858         (WebCore::CSSCursorImageValue::updateCursorElement):
1859         (WebCore::CSSCursorImageValue::cursorElementRemoved):
1860         (WebCore::CSSCursorImageValue::cursorElementChanged):
1861         (WebCore::CSSCursorImageValue::loadImage):
1862         (WebCore::CSSCursorImageValue::styleImage):
1863         (WebCore::CSSCursorImageValue::isSVGCursor):
1864         (WebCore::CSSCursorImageValue::cachedImageURL):
1865         (WebCore::CSSCursorImageValue::updateCachedImage):
1866         (WebCore::CSSCursorImageValue::detachPendingImage): Deleted.
1867         (WebCore::CSSCursorImageValue::cachedImage): Deleted.
1868         (WebCore::CSSCursorImageValue::cachedOrPendingImage): Deleted.
1869         (WebCore::CSSCursorImageValue::clearCachedImage): Deleted.
1870         * css/CSSCursorImageValue.h:
1871         * css/CSSFilterImageValue.cpp:
1872         (WebCore::CSSFilterImageValue::isPending):
1873         * css/CSSFilterImageValue.h:
1874         * css/CSSImageGeneratorValue.cpp:
1875         (WebCore::CSSImageGeneratorValue::isPending):
1876         (WebCore::CSSImageGeneratorValue::subimageIsPending):
1877         (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue):
1878         * css/CSSImageGeneratorValue.h:
1879         * css/CSSImageSetValue.cpp:
1880         (WebCore::CSSImageSetValue::~CSSImageSetValue):
1881         (WebCore::CSSImageSetValue::loadBestFitImage):
1882         (WebCore::CSSImageSetValue::styleImage):
1883         (WebCore::CSSImageSetValue::traverseSubresources):
1884         (WebCore::CSSImageSetValue::detachPendingImage): Deleted.
1885         (WebCore::CSSImageSetValue::bestFitImage): Deleted.
1886         (WebCore::CSSImageSetValue::cachedOrPendingImageSet): Deleted.
1887         * css/CSSImageSetValue.h:
1888         * css/CSSImageValue.cpp:
1889         (WebCore::CSSImageValue::CSSImageValue):
1890         (WebCore::CSSImageValue::~CSSImageValue):
1891         (WebCore::CSSImageValue::isPending):
1892         (WebCore::CSSImageValue::styleImage):
1893         (WebCore::CSSImageValue::loadImage):
1894         (WebCore::CSSImageValue::traverseSubresources):
1895         (WebCore::CSSImageValue::detachPendingImage): Deleted.
1896         (WebCore::CSSImageValue::cachedOrPendingImage): Deleted.
1897         (WebCore::CSSImageValue::cachedImage): Deleted.
1898         * css/CSSImageValue.h:
1899         (WebCore::CSSImageValue::create):
1900         * css/StyleResolver.cpp:
1901         (WebCore::StyleResolver::cachedOrPendingFromValue):
1902         (WebCore::StyleResolver::generatedOrPendingFromValue):
1903         (WebCore::StyleResolver::setOrPendingFromValue):
1904         (WebCore::StyleResolver::cursorOrPendingFromValue):
1905         * page/PageSerializer.cpp:
1906         (WebCore::PageSerializer::retrieveResourcesForProperties):
1907         * page/animation/CSSPropertyAnimation.cpp:
1908         (WebCore::blendFilter):
1909         (WebCore::crossfadeBlend):
1910         * rendering/RenderImageResourceStyleImage.cpp:
1911         (WebCore::RenderImageResourceStyleImage::image):
1912         * rendering/shapes/ShapeOutsideInfo.cpp:
1913         (WebCore::ShapeOutsideInfo::createShapeForImage):
1914         * rendering/style/StyleCachedImage.cpp:
1915         (WebCore::StyleCachedImage::StyleCachedImage):
1916         (WebCore::StyleCachedImage::~StyleCachedImage):
1917         (WebCore::StyleCachedImage::setCachedImage):
1918         (WebCore::StyleCachedImage::cssValue):
1919         (WebCore::StyleCachedImage::canRender):
1920         (WebCore::StyleCachedImage::isPending):
1921         (WebCore::StyleCachedImage::isLoaded):
1922         (WebCore::StyleCachedImage::errorOccurred):
1923         (WebCore::StyleCachedImage::imageSize):
1924         (WebCore::StyleCachedImage::imageHasRelativeWidth):
1925         (WebCore::StyleCachedImage::imageHasRelativeHeight):
1926         (WebCore::StyleCachedImage::computeIntrinsicDimensions):
1927         (WebCore::StyleCachedImage::usesImageContainerSize):
1928         (WebCore::StyleCachedImage::setContainerSizeForRenderer):
1929         (WebCore::StyleCachedImage::addClient):
1930         (WebCore::StyleCachedImage::removeClient):
1931         (WebCore::StyleCachedImage::image):
1932         (WebCore::StyleCachedImage::knownToBeOpaque):
1933         * rendering/style/StyleCachedImage.h:
1934         * rendering/style/StyleGeneratedImage.cpp:
1935         (WebCore::StyleGeneratedImage::isPending):
1936         * rendering/style/StyleGeneratedImage.h:
1937         * rendering/style/StyleImage.h:
1938         (WebCore::StyleImage::isCachedImage):
1939         (WebCore::StyleImage::StyleImage):
1940         (WebCore::StyleImage::canRender): Deleted.
1941         (WebCore::StyleImage::isPendingImage): Deleted.
1942         * rendering/style/StylePendingImage.h: Removed.
1943         * style/StylePendingResources.cpp:
1944         (WebCore::Style::loadPendingImage):
1945         (WebCore::Style::loadPendingImages):
1946
1947 2016-08-30  Philippe Normand  <pnormand@igalia.com>
1948
1949         [GStreamer] bump required version to 1.2.3
1950         https://bugs.webkit.org/show_bug.cgi?id=159667
1951
1952         Reviewed by Xabier Rodriguez Calvar.
1953
1954         GStreamer 1.0.3 was released almost 4 years ago. GStreamer 1.2.3
1955         being the version shipped in the Ubuntu LTS (14.04) it
1956         feels reasonable to bump our requirement. Other major
1957         distributions like Debian Jessie and Fedora ship GStreamer 1.4.x
1958         already.
1959
1960         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1961         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1962         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1963         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Deleted.
1964         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1965         (webkitVideoSinkProposeAllocation): Deleted.
1966         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1967         (webKitWebSrcQueryWithParent): Deleted.
1968
1969 2016-08-29  Alex Christensen  <achristensen@webkit.org>
1970
1971         Fix Windows build after r205161
1972
1973         * bindings/js/JSPerformanceTimingCustom.cpp:
1974
1975 2016-08-29  Chris Dumez  <cdumez@apple.com>
1976
1977         We should throw a SecurityError when denying setting a cross-origin Location property
1978         https://bugs.webkit.org/show_bug.cgi?id=161368
1979
1980         Reviewed by Ryosuke Niwa.
1981
1982         We should throw a SecurityError when denying setting a cross-origin
1983         Location property:
1984         - https://html.spec.whatwg.org/#location-set
1985         - https://html.spec.whatwg.org/#crossoriginset-(-o,-p,-v,-receiver-)
1986         - https://html.spec.whatwg.org/#location-getownproperty
1987
1988         Firefox and Chrome already throw. We currently ignore and log an error
1989         message.
1990
1991         No new tests, updated existing tests.
1992
1993         * bindings/js/JSLocationCustom.cpp:
1994         (WebCore::JSLocation::putDelegate):
1995
1996 2016-08-29  Brent Fulgham  <bfulgham@apple.com>
1997
1998         Avoid holding GlyphData in MathOperator
1999         https://bugs.webkit.org/show_bug.cgi?id=161256
2000         <rdar://problem/28033400>
2001
2002         Reviewed by Myles C. Maxfield.
2003
2004         Do not cache GlyphData in MathOperator elements, because the fonts referenced in the
2005         GlyphData may be purged during low-memory conditions. Instead, we should store either
2006         the relevant CodePoint, or the fallback Glyph (for the current system font).
2007
2008         Added an initialization function for GlyphAssemblyData, since unions containing structs
2009         do not properly call constructors, resulting in garbage font/glyph content.
2010
2011         No new tests. Changes are covered by existing MathML test suite.
2012
2013         * rendering/mathml/MathOperator.cpp:
2014         (WebCore::MathOperator::GlyphAssemblyData::initialize): Added.
2015         (WebCore::MathOperator::MathOperator): Initialize m_assembly/m_variant.
2016         (WebCore::MathOperator::setSizeVariant): Only store the glyph, not the font.
2017         (WebCore::glyphDataForCodePointOrFallbackGlyph): Added helper function.
2018         (WebCore::MathOperator::setGlyphAssembly): Do not rely on stored GlyphData.
2019         (WebCore::MathOperator::calculateGlyphAssemblyFallback): Remove unneeded argument. Check
2020         if a fallback glyph is being used and remember for later.
2021         (WebCore::MathOperator::calculateStretchyData): Do not rely on stored GlyphData.
2022         (WebCore::MathOperator::fillWithVerticalExtensionGlyph): Ditto.
2023         (WebCore::MathOperator::fillWithHorizontalExtensionGlyph): Ditto.
2024         (WebCore::MathOperator::paintVerticalGlyphAssembly): Ditto.
2025         (WebCore::MathOperator::paintHorizontalGlyphAssembly): Ditto.
2026         (WebCore::MathOperator::paint): Ditto.
2027         * rendering/mathml/MathOperator.h:
2028         (WebCore::MathOperator::GlyphAssemblyData::hasExtension): Added.
2029         (WebCore::MathOperator::GlyphAssemblyData::hasMiddle): Added.
2030         (WebCore::MathOperator::MathOperator): Deleted.
2031
2032 2016-08-29  Dean Jackson  <dino@apple.com>
2033
2034         JSON.stringify returns empty when used with performance.timing.
2035         https://bugs.webkit.org/show_bug.cgi?id=151813
2036         <rdar://problem/28066067>
2037
2038         Reviewed by Sam Weinig.
2039
2040         While we are waiting for our bindings generator to handle
2041         "serializer", add a custom toJSON function that allows
2042         performance.timing to be stringified.
2043
2044         Test: fast/dom/webtiming-performance-timing-stringify.html
2045
2046         * CMakeLists.txt: New file added.
2047         * WebCore.xcodeproj/project.pbxproj: New file added.
2048         * bindings/js/JSPerformanceTimingCustom.cpp: Added. Implements toJSON.
2049         (WebCore::JSPerformanceTiming::toJSON):
2050         * page/PerformanceTiming.idl: Add toJSON().
2051
2052 2016-08-29  Chris Dumez  <cdumez@apple.com>
2053
2054         Regression(r204923): It should be possible to set 'Location.href' cross origin
2055         https://bugs.webkit.org/show_bug.cgi?id=161343
2056         <rdar://problem/28063361>
2057
2058         Reviewed by Ryosuke Niwa.
2059
2060         It should be possible to set 'Location.href' cross origin:
2061         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
2062
2063         Firefox and Chrome allow this but we throw a SecurityError.
2064
2065         We already allow setting crossOrigin.window.location which is equivalent.
2066
2067         No new tests, updated existing test.
2068
2069         * bindings/js/JSLocationCustom.cpp:
2070         (WebCore::JSLocation::putDelegate):
2071         Refactor the [Put] delegate so that it does not log a security error
2072         when setting 'href' attribute, given that setting it works as expected.
2073         This fixes a bug in shipping Safari where setting 'href' would work but
2074         log an error message anyway.
2075
2076         * bindings/scripts/CodeGeneratorJS.pm:
2077         (GenerateImplementation):
2078         Add support for [DoNotCheckSecurityOnSetter] IDL extended attribute,
2079         in addition to the already supported [DoNotCheckSecurity] and
2080         [DoNotCheckSecurityOnGetter].
2081
2082         * page/Location.idl:
2083         Use [DoNotCheckSecurityOnSetter] on 'href' attribute as it can be
2084         set cross-origin. This fixes the regression introduced in r204923.
2085
2086 2016-08-29  Chris Dumez  <cdumez@apple.com>
2087
2088         We should throw a SecurityError when denying setting a cross-origin Window property
2089         https://bugs.webkit.org/show_bug.cgi?id=161339
2090
2091         Reviewed by Geoffrey Garen.
2092
2093         We should throw a SecurityError when denying setting a cross-origin Window property:
2094         - https://html.spec.whatwg.org/#crossoriginset-(-o,-p,-v,-receiver-)
2095         - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
2096
2097         e.g. crossOriginWindow.name = "" should throw.
2098
2099         Firefox and Chrome already throw but WebKit merely ignores the call and logs an
2100         error message.
2101
2102         No new tests, updated existing tests.
2103
2104         * bindings/js/JSDOMWindowCustom.cpp:
2105         (WebCore::JSDOMWindow::put):
2106
2107 2016-08-29  Alex Christensen  <achristensen@webkit.org>
2108
2109         URLParser should parse about:blank
2110         https://bugs.webkit.org/show_bug.cgi?id=161324
2111
2112         Reviewed by Brady Eidson.
2113
2114         Covered by new API tests.
2115
2116         * platform/URLParser.cpp:
2117         (WebCore::URLParser::parse):
2118
2119 2016-08-29  Chris Dumez  <cdumez@apple.com>
2120
2121         document.createEvent("popstateevent") should create a PopStateEvent
2122         https://bugs.webkit.org/show_bug.cgi?id=161321
2123
2124         Reviewed by Darin Adler.
2125
2126         document.createEvent("popstateevent") should create a PopStateEvent as per:
2127         - https://dom.spec.whatwg.org/#dom-document-createevent
2128
2129         Firefox and Chrome match the specification but WebKit throws an exception,
2130         which is risky compatibility-wise.
2131
2132         No new tests, rebaselined existing tests.
2133
2134         * dom/Document.cpp:
2135         (WebCore::Document::createEvent):
2136         * dom/PopStateEvent.cpp:
2137         (WebCore::PopStateEvent::createForBindings):
2138         * dom/PopStateEvent.h:
2139
2140 2016-08-29  Chris Dumez  <cdumez@apple.com>
2141
2142         We should throw a SecurityError when denying access to cross-origin Window properties
2143         https://bugs.webkit.org/show_bug.cgi?id=161316
2144
2145         Reviewed by Darin Adler.
2146
2147         We should throw a SecurityError when denying access to cross-origin Window properties:
2148         - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
2149         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
2150
2151         Firefox and Chrome already throw.
2152
2153         No new tests, updated existing tests.
2154
2155         * bindings/js/JSDOMWindowCustom.cpp:
2156         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2157
2158 2016-08-29  Youenn Fablet  <youenn@apple.com>
2159
2160         Image Loader should use FetchOptions::mode according its crossOrigin attribute
2161         https://bugs.webkit.org/show_bug.cgi?id=161309
2162
2163         Reviewed by Darin Adler.
2164
2165         Test: http/tests/security/load-image-after-redirection.html
2166
2167         * loader/ImageLoader.cpp:
2168         (WebCore::ImageLoader::updateFromElement): Using CachedResourceRequest::setAsPotentiallyCrossOrigin to set fetch mode.
2169
2170 2016-08-29  Frederic Wang  <fwang@igalia.com>
2171
2172         Use MathMLPresentationElement for all MathML presentation tags
2173         https://bugs.webkit.org/show_bug.cgi?id=161297
2174
2175         Reviewed by Darin Adler.
2176
2177         Some tabular MathML elements as well as unsupported presentation MathML markup currently
2178         create a generic MathMLElement instance. We make them instead use the
2179         MathMLPresentationElement class since they are presentation MathML elements. This also
2180         allows to make MathMLElement::isPresentationMathML always return false.
2181
2182         No new tests, already covered by existing tests.
2183
2184         * mathml/MathMLElement.cpp:
2185         (WebCore::MathMLElement::isPresentationMathML): Deleted. Moved into the header file.
2186         * mathml/MathMLElement.h:
2187         (WebCore::MathMLElement::isPresentationMathML): Make this always return false now that all
2188         presentation markup are handled by MathMLPresentationElement.
2189         * mathml/MathMLPresentationElement.cpp:
2190         (WebCore::MathMLPresentationElement::createElementRenderer): Make the fallback always call
2191         MathMLElement::createElementRenderer. This preserves the behavior for the new elements
2192         handled here and does not affect the old ones (table is handled above while all the others
2193         are already handled in the derived class).
2194         * mathml/mathtags.in: Use MathMLPresentationElement for all MathML presentation tags.
2195
2196 2016-08-29  Alex Christensen  <achristensen@webkit.org>
2197
2198         API test URLParserTest.ParserFailures failing ASSERT_NOT_REACHED
2199         https://bugs.webkit.org/show_bug.cgi?id=161317
2200
2201         Reviewed by Brady Eidson.
2202
2203         Added an API test.
2204
2205         * platform/URLParser.cpp:
2206         (WebCore::URLParser::parse):
2207         Turns out, this state can be reached.
2208
2209 2016-08-29  Youenn Fablet  <youenn@apple.com>
2210
2211         [Fetch API] Response cloning should structureClone when teeing Response stream
2212         https://bugs.webkit.org/show_bug.cgi?id=161147
2213
2214         Reviewed by Darin Adler.
2215
2216         Covered by updated test.
2217
2218         Implementing structure cloning for ArrayBuffer and ArrayBufferView objects.
2219         Using this structure cloning in ReadableStream to support structureClone in the case of Fetch API.
2220
2221         * CMakeLists.txt: Adding StructureClone.cpp
2222         * Modules/fetch/FetchResponse.js:
2223         (clone): Setting structureClone to true
2224         * Modules/streams/ReadableStreamInternals.js:
2225         (doStructuredClone): Added to clone ArrayBuffer/ArrayBufferView chunks. Throwing exception otherwise.
2226         (teeReadableStreamPullFunction): Using @doStructuredClone
2227         * WebCore.xcodeproj/project.pbxproj: Adding StructureClone.cpp/.h
2228         * bindings/js/JSDOMGlobalObject.cpp:
2229         (WebCore::JSDOMGlobalObject::addBuiltinGlobals): Adding @ArrayBuffer and structuredCloneArrayBuffer and structuredCloneArrayBufferView private properties.
2230         * bindings/js/StructuredClone.cpp: Added.
2231         (WebCore::structuredCloneArrayBuffer): Cloning of ArrayBuffer as per
2232         http://w3c.github.io/html/infrastructure.html#section-structuredclone step 11.
2233        (WebCore::structuredCloneArrayBufferView): Cloning of ArrayBufferView as
2234        perhttp://w3c.github.io/html/infrastructure.html#section-structuredclone, step 12.
2235         * bindings/js/StructuredClone.h: Added.
2236         * bindings/js/WebCoreBuiltinNames.h: 
2237
2238 2016-08-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2239
2240         [GTK] Accelerated compositing does not work in Wayland
2241         https://bugs.webkit.org/show_bug.cgi?id=115803
2242
2243         Reviewed by Michael Catanzaro.
2244
2245         The Wayland implementation in WebKit2 uses a nested display running in the UI process so that GL contexts created
2246         in the web process need to be created in the nested display. We currently have a shared platform display that
2247         should represent the connection to the actual display all applications connect to. This patch refactors the
2248         GLContext API to ensure that GL contexts are always attached to a particular platform display. The create
2249         methods receive an optional PlatformDisplay that will be used as the display of all GL operations of the created
2250         GL context. The sharing GL context should also share the same display, it can't be global to the process, but to
2251         the display, so it's now created on demand by the PlatformDisplay. In addition to the global shared display,
2252         it's now possible to set a shared display for compositing that can be used when creating GL contexts. This makes
2253         it possible to use a different display for compositing, connected to the nested display in wayland, even in non
2254         wayland environments.
2255         The patch also adds support for surfaceless EGL contexts that can be used for offscreen contexts. It also adds
2256         support for offscreen wayland contexts, as a fallback in wayland in case surfaceless is not supported.
2257         Some wayland code that is specific to the WebKit2 implementation has been moved to the WebKit2 layer.
2258
2259         * PlatformGTK.cmake:
2260         * platform/graphics/GLContext.cpp:
2261         (WebCore::initializeOpenGLShimsIfNeeded):
2262         (WebCore::GLContext::createContextForWindow):
2263         (WebCore::GLContext::createOffscreenContext):
2264         (WebCore::GLContext::createSharingContext):
2265         (WebCore::GLContext::GLContext):
2266         (WebCore::GLContext::~GLContext):
2267         (WebCore::GLContext::current):
2268         (WebCore::activeContextList): Deleted.
2269         * platform/graphics/GLContext.h:
2270         (WebCore::GLContext::display):
2271         * platform/graphics/GraphicsContext3DPrivate.cpp:
2272         (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
2273         (WebCore::GraphicsContext3DPrivate::platformContext):
2274         (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
2275         * platform/graphics/PlatformDisplay.cpp:
2276         (WebCore::PlatformDisplay::createPlatformDisplay): Always use the default wayland display created by GTK+ for
2277         the global shared display.
2278         (WebCore::PlatformDisplay::sharedDisplayForCompositing):
2279         (WebCore::PlatformDisplay::setSharedDisplayForCompositing):
2280         (WebCore::PlatformDisplay::sharingGLContext):
2281         (WebCore::eglDisplays): Helper HashSet to keep track of all PlatformDisplays with an EGL display intialized to
2282         properly termimate them at exit.
2283         (WebCore::PlatformDisplay::initializeEGLDisplay): Remove eglBindAPI() from display initialization, since it's
2284         not a display initialization and it's thread specific, so it needs to be called on every thread where EGL is used.
2285         (WebCore::PlatformDisplay::terminateEGLDisplay):
2286         (WebCore::PlatformDisplay::eglDisplay): Deleted.
2287         * platform/graphics/PlatformDisplay.h:
2288         * platform/graphics/cairo/ImageBufferCairo.cpp:
2289         (WebCore::ImageBufferData::~ImageBufferData):
2290         (WebCore::ImageBufferData::createCompositorBuffer):
2291         (WebCore::ImageBufferData::swapBuffersIfNeeded):
2292         (WebCore::ImageBufferData::createCairoGLSurface):
2293         (WebCore::ImageBufferData::paintToTextureMapper):
2294         (WebCore::ImageBuffer::copyToPlatformTexture):
2295         * platform/graphics/egl/GLContextEGL.cpp:
2296         (WebCore::GLContextEGL::getEGLConfig):
2297         (WebCore::GLContextEGL::createWindowContext):
2298         (WebCore::GLContextEGL::createPbufferContext):
2299         (WebCore::GLContextEGL::createSurfacelessContext):
2300         (WebCore::GLContextEGL::createPixmapContext):
2301         (WebCore::GLContextEGL::createWaylandContext):
2302         (WebCore::GLContextEGL::createContext):
2303         (WebCore::GLContextEGL::createSharingContext):
2304         (WebCore::GLContextEGL::GLContextEGL):
2305         (WebCore::GLContextEGL::~GLContextEGL):
2306         (WebCore::GLContextEGL::defaultFrameBufferSize):
2307         (WebCore::GLContextEGL::makeContextCurrent):
2308         (WebCore::GLContextEGL::swapBuffers):
2309         (WebCore::GLContextEGL::cairoDevice):
2310         * platform/graphics/egl/GLContextEGL.h:
2311         * platform/graphics/glx/GLContextGLX.cpp:
2312         (WebCore::GLContextGLX::createWindowContext):
2313         (WebCore::GLContextGLX::createPbufferContext):
2314         (WebCore::GLContextGLX::createPixmapContext):
2315         (WebCore::GLContextGLX::createContext):
2316         (WebCore::GLContextGLX::createSharingContext):
2317         (WebCore::GLContextGLX::GLContextGLX):
2318         (WebCore::GLContextGLX::~GLContextGLX):
2319         (WebCore::GLContextGLX::defaultFrameBufferSize):
2320         (WebCore::GLContextGLX::makeContextCurrent):
2321         (WebCore::GLContextGLX::swapBuffers):
2322         (WebCore::GLContextGLX::cairoDevice):
2323         (WebCore::GLContextGLX::waitNative): Deleted.
2324         * platform/graphics/glx/GLContextGLX.h:
2325         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2326         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
2327         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
2328         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
2329         (WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
2330         (WebCore::PlatformDisplayWayland::~PlatformDisplayWayland):
2331         (WebCore::PlatformDisplayWayland::initialize):
2332         (WebCore::PlatformDisplayWayland::registryGlobal):
2333         (WebCore::PlatformDisplayWayland::createSurface):
2334         * platform/graphics/wayland/PlatformDisplayWayland.h:
2335         (WebCore::PlatformDisplayWayland::native): Deleted.
2336         * platform/graphics/wayland/WaylandEventSource.cpp: Removed.
2337         * platform/graphics/wayland/WaylandSurface.cpp: Removed.
2338         * platform/graphics/wayland/WebKitGtkWaylandClientProtocol.xml: Removed.
2339         * platform/graphics/wayland/WlUniquePtr.h: Make it possible to use std::unique_ptr with Wayland objects.
2340         (WebCore::WlPtrDeleter::operator()):
2341
2342 2016-08-29  Youenn Fablet  <youenn@apple.com>
2343
2344         [Fetch API] Add support for BufferSource bodies
2345         https://bugs.webkit.org/show_bug.cgi?id=161087
2346
2347         Reviewed by Darin Adler.
2348
2349         Covered by updated tests.
2350
2351         Added support for ArrayBuffer, ArrayBufferView and FormData upload.
2352         Added support for consuming ArrayBufferView.
2353
2354         To support FormData upload, FetchBOdy is now storing a FormData computed from the DOMFormData passed to the constructor.
2355         This allows setting the content-type for FormData correctly with the boundary parameter.
2356
2357         * Modules/fetch/FetchBody.cpp:
2358         (WebCore::FetchBody::bodyForInternalRequest): Adding support for FormData upload.
2359         (WebCore::FetchBody::FetchBody): Adding ArrayBuffer and ArrayBufferView constructors.
2360         (WebCore::FetchBody::extract): Extracting in case of BufferSource (i.e. ArrayBuffer or ArrayBufferView) and FormData.
2361         (WebCore::FetchBody::consume): Adding support to consume ArrayBufferView.
2362         (WebCore::FetchBody::consumeAsStream): Adding support to consume ArrayBufferView as a stream.
2363         Cloned the ArrayBuffer before enqueuing it in  the stream.
2364         (WebCore::FetchBody::consumeArrayBuffer): Cleaning m_data after being consumed.
2365         (WebCore::FetchBody::consumeArrayBufferView): Adding support to consume ArrayBufferView.
2366         (WebCore::FetchBody::consumeText): Cleaning m_text after being consumed.
2367         (WebCore::FetchBody::consumeBlob): Ditto for m_blob.
2368         (WebCore::FetchBody::bodyForInternalRequest): Adding support for ArrayBuffer and ArrayBufferView upload.
2369         * Modules/fetch/FetchBody.h:
2370         * Modules/fetch/FetchRequest.cpp:
2371         (WebCore::FetchRequest::internalRequest): Passing ScriptExecutionContext as this is needed for FormData upload.
2372         (WebCore::FetchRequest::setBody): Ditto.
2373         * Modules/fetch/FetchResponse.cpp:
2374         (WebCore::FetchResponse::initializeWith): Ditto.
2375         (WebCore::FetchResponse::fetch): Removing FormData upload rejection check.
2376
2377 2016-08-26  Sergio Villar Senin  <svillar@igalia.com>
2378
2379         [css-grid] Do not recursively call layout during auto repeat computation
2380         https://bugs.webkit.org/show_bug.cgi?id=161234
2381
2382         Reviewed by Manuel Rego Casasnovas.
2383
2384         The computation of auto repeat tracks was incorrectly recursively triggering
2385         a layout in order to compute the available size. That was happening whenever
2386         the width was indefinite. In such cases we should treat the width always as
2387         indefinite without having to run any extra code. During the layout phase
2388         we'll have the actual width available.
2389
2390         This fix also unveiled a few errors in one of the imported mozilla tests which were
2391         incorrectly passing when they should not.
2392
2393         Test: fast/css-grid-layout/grid-indefinite-size-auto-repeat-crash.html
2394
2395         * rendering/RenderGrid.cpp:
2396         (WebCore::RenderGrid::layoutBlock):
2397         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
2398         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
2399         (WebCore::RenderGrid::placeItemsOnGrid):
2400         * rendering/RenderGrid.h:
2401
2402 2016-08-29  Youenn Fablet  <youenn@apple.com>
2403
2404         data:// URL behavior of XHR does not match spec
2405         https://bugs.webkit.org/show_bug.cgi?id=109199
2406
2407         Reviewed by Darin Adler.
2408
2409         Covered by rebased tests.
2410
2411         Making data URLs same origin for XHR and fetch API.
2412         This is the behavior when https://fetch.spec.whatwg.org/#same-origin-data-url-flag is set.
2413         As per the specs, this flag is set for fetch API and XMLHttpRequest.
2414         Introducing this flag in ThreadableLoader options, default value being false.
2415         Setting flag for XHR and fetch API.
2416
2417         Fixing accuracy of data URL loading by setting status code and content-type HTTP header as per fetch specification.
2418
2419         As can be seen from the rebased tests, no constraint is put on the method used as the fetch specification is about to allow all methods for data URLs.
2420
2421         * Modules/fetch/FetchLoader.cpp:
2422         (WebCore::FetchLoader::start): Setting same-origin-data-url-flag to true.
2423         * loader/DocumentThreadableLoader.cpp:
2424         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Making data URLs same origin if flag is set.
2425         * loader/ResourceLoader.cpp:
2426         (WebCore::ResourceLoader::loadDataURL): Setting status code and content-type header according specification.
2427         * loader/ThreadableLoader.cpp:
2428         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Adding same-origin-data-url-flag option.
2429         * loader/ThreadableLoader.h:
2430         * loader/WorkerThreadableLoader.cpp:
2431         (WebCore::LoaderTaskOptions::LoaderTaskOptions): Ensuring flag is preserved when going to the main thread.
2432         * platform/network/DataURLDecoder.cpp:
2433         (WebCore::DataURLDecoder::parseMediaType): Setting mediaType value, used by ResourceLoader to set the content-type header.
2434         * platform/network/DataURLDecoder.h:
2435         * xml/XMLHttpRequest.cpp:
2436         (WebCore::XMLHttpRequest::createRequest): Setting same-origin-data-url-flag to true.
2437
2438 2016-08-25  Frederic Wang  <fwang@igalia.com>
2439
2440         Add support for non-BMP operators U+1EEF0 and U+1EEF1
2441         https://bugs.webkit.org/show_bug.cgi?id=153984
2442
2443         Reviewed by Darin Adler.
2444
2445         Tests: mathml/presentation/non-bmp-operators-spacing.html
2446                mathml/presentation/non-bmp-operators-stretching.html
2447
2448         * mathml/MathMLOperatorDictionary.cpp: We move the definition of operator dictionary Entry
2449         here as it is not used by external code.
2450         We now also accept non-BMP operators and add entries for U+1EEF0 and U+1EEF1.
2451         (WebCore::extractProperty): Helper function to convert from Entry structure to a Property
2452         structure.
2453         (WebCore::MathMLOperatorDictionary::search): This function now accepts a non-BMP parameter
2454         and returns a Property structure.
2455         (WebCore::MathMLOperatorDictionary::isVertical): This function now accepts a non-BMP parameter.
2456         * mathml/MathMLOperatorDictionary.h: Replace the Entry structure with a Property structure
2457         which was used by MathMLOperatorElement. Update the signatures of search and isVertical.
2458         * mathml/MathMLOperatorElement.cpp:
2459         (WebCore::MathMLOperatorElement::parseOperatorChar): Remove the special case that excludes
2460         non-BMP operators.
2461         (WebCore::MathMLOperatorElement::computeDictionaryProperty): Rename the property structure
2462         to use the one moved into MathMLOperatorDictionary.h. We no longer need to convert the result
2463         of the search call.
2464         (WebCore::MathMLOperatorElement::dictionaryProperty): Rename the property structure.
2465         * mathml/MathMLOperatorElement.h: Make OperatorChar accept non-BMP operators.
2466         MathMLOperatorElement::DictionaryProperty is now moved into MathMLOperatorDictionary
2467         and renamed Property.
2468         * rendering/mathml/MathOperator.cpp: Accept non-BMP operators.
2469         * rendering/mathml/MathOperator.h: Ditto.
2470         * rendering/mathml/RenderMathMLFencedOperator.cpp:
2471         (WebCore::RenderMathMLFencedOperator::updateOperatorContent):  Adjust code to use the new
2472         return type of MathMLOperatorDictionary::search.
2473         * rendering/mathml/RenderMathMLFencedOperator.h: Accept non-BMP operators.
2474         * rendering/mathml/RenderMathMLOperator.cpp: Ditto.
2475         * rendering/mathml/RenderMathMLOperator.h: Ditto.
2476
2477 2016-08-28  Youenn Fablet  <youenn@apple.com>
2478
2479         [Fetch API] Ensure response cloning works when data is loading
2480         https://bugs.webkit.org/show_bug.cgi?id=161137
2481
2482         Reviewed by Darin Adler.
2483
2484         Test: http/tests/fetch/clone-after-load-is-finished.html and updated wpt test
2485
2486         FetchBody is only able to clone data when requested by Response in case the data is already there.
2487         If data is loaded from FetchLoader, each received chunk should be given to each cloned response.
2488         The simplest approach is to create a ReadableStream body for the cloned Response and use it for the teeing.
2489
2490         * Modules/fetch/FetchResponse.cpp:
2491         (WebCore::FetchResponse::BodyLoader::didSucceed): Postpone stream closing if there is still data to enqueue in the FetchBody.
2492         * Modules/fetch/FetchResponse.h:
2493         * Modules/fetch/FetchResponse.idl:
2494         * Modules/fetch/FetchResponse.js:
2495         (clone): If response is being loaded, create a ReadableStream body so that loaded data cloning is handled by ReadableStream tee.
2496         * Modules/streams/ReadableStreamInternals.js: Restrict firstReadCallback to the case of a readable ReadableStream.
2497         If stream is errored or closed, FetchResponse will already have disposed of its source.
2498         (readFromReadableStreamDefaultReader):
2499         * bindings/js/WebCoreBuiltinNames.h:
2500
2501 2016-08-28  Andreas Kling  <akling@apple.com>
2502
2503         document.title setter can't throw.
2504         <https://webkit.org/b/161302>
2505
2506         Reviewed by Antti Koivisto.
2507
2508         Remove [SetterRaisesException] from document.title and replace
2509         ExceptionCode propagation with ASSERT_NO_EXCEPTION.
2510
2511         Setting the .textContent of a SVGTitleElement or HTMLTitleElement
2512         will never fail, so there's no exception to propagate.
2513
2514         * dom/Document.cpp:
2515         (WebCore::Document::setTitle):
2516         * dom/Document.h:
2517         * dom/Document.idl:
2518         * html/ImageDocument.cpp:
2519         (WebCore::ImageDocument::finishedParsing):
2520
2521 2016-08-23  Frederic Wang  <fwang@igalia.com>
2522
2523         MathML renderers should use struct to pass long list of LayoutUnits
2524         https://bugs.webkit.org/show_bug.cgi?id=161084
2525
2526         Reviewed by Darin Adler.
2527
2528         RenderMathMLFraction, RenderMathMLMenclose, RenderMathMLScripts and RenderMathMLUnderOver
2529         have helper functions to retrieve a list of LayoutUnit parameters. We gather them in a single
2530         struct instead of using a long list of LayoutUnit& parameters.
2531
2532         No new tests, behavior is unchanged.
2533
2534         * rendering/mathml/RenderMathMLFraction.cpp:
2535         (WebCore::RenderMathMLFraction::getFractionParameters):
2536         (WebCore::RenderMathMLFraction::getStackParameters):
2537         (WebCore::RenderMathMLFraction::layoutBlock):
2538         * rendering/mathml/RenderMathMLFraction.h:
2539         * rendering/mathml/RenderMathMLMenclose.cpp:
2540         (WebCore::RenderMathMLMenclose::getSpaceAroundContent):
2541         (WebCore::RenderMathMLMenclose::computePreferredLogicalWidths):
2542         (WebCore::RenderMathMLMenclose::layoutBlock):
2543         * rendering/mathml/RenderMathMLMenclose.h:
2544         * rendering/mathml/RenderMathMLScripts.cpp:
2545         (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded):
2546         (WebCore::RenderMathMLScripts::layoutBlock):
2547         * rendering/mathml/RenderMathMLScripts.h:
2548         * rendering/mathml/RenderMathMLUnderOver.cpp:
2549         (WebCore::RenderMathMLUnderOver::getVerticalParameters):
2550         (WebCore::RenderMathMLUnderOver::layoutBlock):
2551         * rendering/mathml/RenderMathMLUnderOver.h:
2552
2553 2016-08-28  Andreas Kling  <akling@apple.com>
2554
2555         Clean up some .text attribute setters that don't throw.
2556         <https://webkit.org/b/161292>
2557
2558         Reviewed by Darin Adler.
2559
2560         Remove [SetterRaisesException] for three .text attributes
2561         and replace them with ASSERT_NO_EXCEPTION.
2562
2563         These setters behave like .textContent, which can't throw as
2564         it's always okay to replace an Element's children with a Text.
2565
2566         * html/HTMLAnchorElement.cpp:
2567         (WebCore::HTMLAnchorElement::setText):
2568         * html/HTMLAnchorElement.h:
2569         * html/HTMLAnchorElement.idl:
2570         * html/HTMLOptionElement.cpp:
2571         (WebCore::HTMLOptionElement::setText):
2572         * html/HTMLOptionElement.h:
2573         * html/HTMLOptionElement.idl:
2574         * html/HTMLTitleElement.cpp:
2575         (WebCore::HTMLTitleElement::setText):
2576         * html/HTMLTitleElement.h:
2577         * html/HTMLTitleElement.idl:
2578
2579 2016-08-24  Dave Hyatt  <hyatt@apple.com>
2580
2581         Initial landing of CSS Parser Tokenization (and files to support that). Not used yet.
2582         https://bugs.webkit.org/show_bug.cgi?id=161174
2583
2584         This code is imported from Blink and is their CSS parser (modified to work in WebKit).
2585         It is from commit e4bb90df7f2ed8a63975b5ed27a1b488cb9b146f, Mon Aug 22 2016.
2586
2587         Reviewed by Simon Fraser.
2588
2589         * CMakeLists.txt:
2590         * WebCore.xcodeproj/project.pbxproj:
2591         * css/CSSMarkup.cpp: Added.
2592         (WebCore::isCSSTokenizerIdentifier):
2593         (WebCore::serializeCharacter):
2594         (WebCore::serializeCharacterAsCodePoint):
2595         (WebCore::serializeIdentifier):
2596         (WebCore::serializeString):
2597         (WebCore::serializeURI):
2598         (WebCore::serializeFontFamily):
2599         * css/CSSMarkup.h: Added.
2600         * css/CSSOMUtils.cpp: Removed.
2601         * css/CSSOMUtils.h: Removed.
2602         * css/CSSSelector.cpp:
2603         * css/parser/CSSParserFastPaths.cpp: Added.
2604         * css/parser/CSSParserFastPaths.h: Added.
2605         * css/parser/CSSParserIdioms.h: Added.
2606         (WebCore::isCSSSpace):
2607         (WebCore::isNameStartCodePoint):
2608         (WebCore::isNameCodePoint):
2609         * css/parser/CSSParserObserver.h: Added.
2610         (WebCore::CSSParserObserver::~CSSParserObserver):
2611         * css/parser/CSSParserObserverWrapper.cpp: Added.
2612         (WebCore::CSSParserObserverWrapper::startOffset):
2613         (WebCore::CSSParserObserverWrapper::previousTokenStartOffset):
2614         (WebCore::CSSParserObserverWrapper::endOffset):
2615         (WebCore::CSSParserObserverWrapper::skipCommentsBefore):
2616         (WebCore::CSSParserObserverWrapper::yieldCommentsBefore):
2617         * css/parser/CSSParserObserverWrapper.h: Added.
2618         (WebCore::CSSParserObserverWrapper::CSSParserObserverWrapper):
2619         (WebCore::CSSParserObserverWrapper::observer):
2620         (WebCore::CSSParserObserverWrapper::addComment):
2621         (WebCore::CSSParserObserverWrapper::addToken):
2622         (WebCore::CSSParserObserverWrapper::finalizeConstruction):
2623         * css/parser/CSSParserToken.cpp: Added.
2624         (WebCore::cssPrimitiveValueUnitFromTrie):
2625         (WebCore::stringToUnitType):
2626         (WebCore::CSSParserToken::CSSParserToken):
2627         (WebCore::CSSParserToken::convertToDimensionWithUnit):
2628         (WebCore::CSSParserToken::convertToPercentage):
2629         (WebCore::CSSParserToken::delimiter):
2630         (WebCore::CSSParserToken::numericSign):
2631         (WebCore::CSSParserToken::numericValueType):
2632         (WebCore::CSSParserToken::numericValue):
2633         (WebCore::CSSParserToken::parseAsUnresolvedCSSPropertyID):
2634         (WebCore::CSSParserToken::id):
2635         (WebCore::CSSParserToken::functionId):
2636         (WebCore::CSSParserToken::hasStringBacking):
2637         (WebCore::CSSParserToken::copyWithUpdatedString):
2638         (WebCore::CSSParserToken::valueDataCharRawEqual):
2639         (WebCore::CSSParserToken::operator==):
2640         (WebCore::CSSParserToken::serialize):
2641         * css/parser/CSSParserToken.h: Added.
2642         (WebCore::CSSParserToken::operator!=):
2643         (WebCore::CSSParserToken::type):
2644         (WebCore::CSSParserToken::value):
2645         (WebCore::CSSParserToken::getHashTokenType):
2646         (WebCore::CSSParserToken::getBlockType):
2647         (WebCore::CSSParserToken::unitType):
2648         (WebCore::CSSParserToken::unicodeRangeStart):
2649         (WebCore::CSSParserToken::unicodeRangeEnd):
2650         (WebCore::CSSParserToken::initValueFromStringView):
2651         * css/parser/CSSParserTokenRange.cpp: Added.
2652         (WebCore::CSSParserTokenRange::eofToken):
2653         (WebCore::CSSParserTokenRange::makeSubRange):
2654         (WebCore::CSSParserTokenRange::consumeBlock):
2655         (WebCore::CSSParserTokenRange::consumeComponentValue):
2656         (WebCore::CSSParserTokenRange::serialize):
2657         * css/parser/CSSParserTokenRange.h: Added.
2658         (WebCore::CSSParserTokenRange::CSSParserTokenRange):
2659         (WebCore::CSSParserTokenRange::atEnd):
2660         (WebCore::CSSParserTokenRange::end):
2661         (WebCore::CSSParserTokenRange::peek):
2662         (WebCore::CSSParserTokenRange::consume):
2663         (WebCore::CSSParserTokenRange::consumeIncludingWhitespace):
2664         (WebCore::CSSParserTokenRange::consumeWhitespace):
2665         (WebCore::CSSParserTokenRange::begin):
2666         * css/parser/CSSPropertyParser.cpp: Added.
2667         (WebCore::hasPrefix):
2668         (WebCore::cssPropertyID):
2669         (WebCore::cssPropertyNameIOSAliasing):
2670         (WebCore::isAppleLegacyCssValueKeyword):
2671         (WebCore::cssValueKeywordID):
2672         (WebCore::unresolvedCSSPropertyID):
2673         * css/parser/CSSPropertyParser.h: Added.
2674         (WebCore::CSSPropertyParser::inQuirksMode):
2675         * css/parser/CSSPropertyParserHelpers.cpp: Added.
2676         * css/parser/CSSPropertyParserHelpers.h: Added.
2677         (WebCore::CSSPropertyParserHelpers::identMatches):
2678         (WebCore::CSSPropertyParserHelpers::consumeIdent):
2679         (WebCore::CSSPropertyParserHelpers::isCSSWideKeyword):
2680         * css/parser/CSSTokenizer.cpp: Added.
2681         (WebCore::CSSTokenizer::Scope::Scope):
2682         (WebCore::CSSTokenizer::Scope::tokenRange):
2683         (WebCore::CSSTokenizer::Scope::tokenCount):
2684         (WebCore::isNewLine):
2685         (WebCore::twoCharsAreValidEscape):
2686         (WebCore::CSSTokenizer::CSSTokenizer):
2687         (WebCore::CSSTokenizer::reconsume):
2688         (WebCore::CSSTokenizer::consume):
2689         (WebCore::CSSTokenizer::whiteSpace):
2690         (WebCore::CSSTokenizer::blockStart):
2691         (WebCore::CSSTokenizer::blockEnd):
2692         (WebCore::CSSTokenizer::leftParenthesis):
2693         (WebCore::CSSTokenizer::rightParenthesis):
2694         (WebCore::CSSTokenizer::leftBracket):
2695         (WebCore::CSSTokenizer::rightBracket):
2696         (WebCore::CSSTokenizer::leftBrace):
2697         (WebCore::CSSTokenizer::rightBrace):
2698         (WebCore::CSSTokenizer::plusOrFullStop):
2699         (WebCore::CSSTokenizer::asterisk):
2700         (WebCore::CSSTokenizer::lessThan):
2701         (WebCore::CSSTokenizer::comma):
2702         (WebCore::CSSTokenizer::hyphenMinus):
2703         (WebCore::CSSTokenizer::solidus):
2704         (WebCore::CSSTokenizer::colon):
2705         (WebCore::CSSTokenizer::semiColon):
2706         (WebCore::CSSTokenizer::hash):
2707         (WebCore::CSSTokenizer::circumflexAccent):
2708         (WebCore::CSSTokenizer::dollarSign):
2709         (WebCore::CSSTokenizer::verticalLine):
2710         (WebCore::CSSTokenizer::tilde):
2711         (WebCore::CSSTokenizer::commercialAt):
2712         (WebCore::CSSTokenizer::reverseSolidus):
2713         (WebCore::CSSTokenizer::asciiDigit):
2714         (WebCore::CSSTokenizer::letterU):
2715         (WebCore::CSSTokenizer::nameStart):
2716         (WebCore::CSSTokenizer::stringStart):
2717         (WebCore::CSSTokenizer::endOfFile):
2718         (WebCore::CSSTokenizer::nextToken):
2719         (WebCore::CSSTokenizer::consumeNumber):
2720         (WebCore::CSSTokenizer::consumeNumericToken):
2721         (WebCore::CSSTokenizer::consumeIdentLikeToken):
2722         (WebCore::CSSTokenizer::consumeStringTokenUntil):
2723         (WebCore::CSSTokenizer::consumeUnicodeRange):
2724         (WebCore::isNonPrintableCodePoint):
2725         (WebCore::CSSTokenizer::consumeUrlToken):
2726         (WebCore::CSSTokenizer::consumeBadUrlRemnants):
2727         (WebCore::CSSTokenizer::consumeSingleWhitespaceIfNext):
2728         (WebCore::CSSTokenizer::consumeUntilCommentEndFound):
2729         (WebCore::CSSTokenizer::consumeIfNext):
2730         (WebCore::CSSTokenizer::consumeName):
2731         (WebCore::CSSTokenizer::consumeEscape):
2732         (WebCore::CSSTokenizer::nextTwoCharsAreValidEscape):
2733         (WebCore::CSSTokenizer::nextCharsAreNumber):
2734         (WebCore::CSSTokenizer::nextCharsAreIdentifier):
2735         (WebCore::CSSTokenizer::registerString):
2736         * css/parser/CSSTokenizer.h: Added.
2737         (WebCore::CSSTokenizer::Scope::storeString):
2738         * css/parser/CSSTokenizerInputStream.cpp: Added.
2739         (WebCore::CSSTokenizerInputStream::CSSTokenizerInputStream):
2740         (WebCore::CSSTokenizerInputStream::advanceUntilNonWhitespace):
2741         (WebCore::CSSTokenizerInputStream::getDouble):
2742         * css/parser/CSSTokenizerInputStream.h: Added.
2743         (WebCore::CSSTokenizerInputStream::nextInputChar):
2744         (WebCore::CSSTokenizerInputStream::peekWithoutReplacement):
2745         (WebCore::CSSTokenizerInputStream::advance):
2746         (WebCore::CSSTokenizerInputStream::pushBack):
2747         (WebCore::CSSTokenizerInputStream::skipWhilePredicate):
2748         (WebCore::CSSTokenizerInputStream::length):
2749         (WebCore::CSSTokenizerInputStream::offset):
2750         (WebCore::CSSTokenizerInputStream::rangeAt):
2751         * platform/Length.h:
2752
2753 2016-08-28  Javier Fernandez  <jfernandez@igalia.com>
2754
2755         Should never be reached failure in WebCore::RenderFlexibleBox::alignChildren
2756         https://bugs.webkit.org/show_bug.cgi?id=151591
2757         <rdar://problem/27711829>
2758
2759         Reviewed by Darin Adler.
2760
2761         The align-self and align-items CSS properties were originally defined in the
2762         Flexbible Box specification. The new CSS Box Alignment specification tries
2763         to generalize them so they can be used by other layout models, as it's  the
2764         case of the GridLayout spec.
2765
2766         Since we have implemented the Grid Layout spec behind a runtime flag, we should
2767         do the same with the new syntax of these properties.
2768
2769         Test: css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html
2770
2771         * css/CSSParser.cpp:
2772         (WebCore::isValidKeywordPropertyAndValue):
2773         (WebCore::isKeywordPropertyID):
2774         (WebCore::CSSParser::parseValue):
2775         * rendering/RenderFlexibleBox.cpp:
2776         (WebCore::RenderFlexibleBox::alignChildren):
2777
2778 2016-08-28  Frederic Wang  <fwang@igalia.com>
2779
2780         Improve parsing of the menclose notation attribute value
2781         https://bugs.webkit.org/show_bug.cgi?id=161045
2782
2783         Reviewed by Darin Adler.
2784
2785         We improve the way the list of menclose notations is parsed to avoid allocating a vector and
2786         accept any whitespace as separators.
2787
2788         New test cases in mathml/presentation/menclose-notation-equivalence.html
2789
2790         * mathml/MathMLMencloseElement.cpp: Include HTMLParserIdioms.h to use isHTMLSpace.
2791         (WebCore::MathMLMencloseElement::addNotationFlags): Helper function to perform the relevant
2792         addNotation calls from a notation name.
2793         (WebCore::MathMLMencloseElement::parseNotationAttribute): Use only simple string operations
2794         to determine the list of notations.
2795         * mathml/MathMLMencloseElement.h: Declare the new helper function.
2796
2797 2016-08-28  Frederic Wang  <fwang@igalia.com>
2798
2799         Make MathMLSpaceElement and MathMLTokenElement inherit from MathMLPresentationElement
2800         https://bugs.webkit.org/show_bug.cgi?id=161232
2801
2802         Reviewed by Darin Adler.
2803
2804         The mrow-like features of MathMLPresentationElement are now moved into RenderMathMLRow.
2805         Hence we make MathMLSpaceElement and MathMLTokenElement inherit from the generic class
2806         MathMLPresentationElement for presentation MathML elements.
2807
2808         No new tests, already covered by existing tests.
2809
2810         * mathml/MathMLSpaceElement.cpp:
2811         (WebCore::MathMLSpaceElement::MathMLSpaceElement): Derive from MathMLPresentationElement.
2812         (WebCore::MathMLSpaceElement::parseAttribute): Ditto.
2813         * mathml/MathMLSpaceElement.h: Ditto. Override acceptsDisplayStyleAttribute as a small
2814         optimization. isPresentationMathML is no longer needed.
2815         * mathml/MathMLTokenElement.cpp:
2816         (WebCore::MathMLTokenElement::MathMLTokenElement): Derive from MathMLPresentationElement.
2817         (WebCore::MathMLTokenElement::didAttachRenderers): Ditto.
2818         (WebCore::MathMLTokenElement::childrenChanged): Ditto.
2819         (WebCore::MathMLTokenElement::parseAttribute): Deleted. No need to override this function
2820         any more since it's already implemented in MathMLPresentationElement.
2821         * mathml/MathMLTokenElement.h: Derive from MathMLPresentationElement. Override
2822         acceptsDisplayStyleAttribute as a small optimization. isPresentationMathML is no longer
2823         needed.
2824
2825 2016-08-28  Frederic Wang  <fwang@igalia.com>
2826
2827         RenderMathMLRow::firstLineBaseline does not need to be overridden in RenderMathMLMenclose
2828         https://bugs.webkit.org/show_bug.cgi?id=161127
2829
2830         Reviewed by Darin Adler.
2831
2832         RenderMathMLRow::firstLineBaseline already provides the correct calculation of ascent for
2833         non-empty menclose elements. Empty menclose elements are not used in practice so the
2834         calculated value is irrelevant. Aligning on mrow (i.e. leaving firstLineBaseline to 0)
2835         is fine. This change allows to get rid of the m_ascent member and helps to keep good baseline
2836         alignment when the zoom level changes (bug 161126).
2837
2838         No new tests, already covered by existing tests.
2839
2840         * rendering/mathml/RenderMathMLMenclose.cpp:
2841         (WebCore::RenderMathMLMenclose::RenderMathMLMenclose): Remove initialization of m_ascent.
2842         (WebCore::RenderMathMLMenclose::layoutBlock): No need to calculate m_ascent. The height and
2843         content location can be determined without introducing local variables ascent or descent.
2844         (WebCore::RenderMathMLMenclose::firstLineBaseline): Deleted. We just use the implementation
2845         from RenderMathMLRow.
2846         * rendering/mathml/RenderMathMLMenclose.h: Delete m_ascent and do not override
2847         firstLineBaseline.
2848
2849 2016-08-28  Frederic Wang  <fwang@igalia.com>
2850
2851         More cleanup for the mpadded implementation
2852         https://bugs.webkit.org/show_bug.cgi?id=161136
2853
2854         Reviewed by Darin Adler.
2855
2856         We perform the following cleanup for the mpadded renderer class:
2857         1) We do not store the ascent on the class. This may make update more reliable and will
2858         help for general improvement of MathML ascents (bug 155879).
2859         2) We split resolveWidth/resolveAttributes into smaller functions and improve the coding
2860         style. This helps to calculate firstLineBaseline in 1).
2861         3) We do not override updateFromElement and styleDidChange to perform setNeedsLayout calls.
2862         These calls already seem unnecessary and can be removed even more safely after 1).
2863
2864         We add a test for style change. Change of attributes as well as metrics calcuation of empty
2865         and non-empty mpadded elements are already covered by other tests.
2866
2867         Test: mathml/presentation/mpadded-style-change.html
2868
2869         * rendering/mathml/RenderMathMLPadded.cpp:
2870         (WebCore::RenderMathMLPadded::voffset): New helper function to resolve voffset.
2871         (WebCore::RenderMathMLPadded::lspace): Ditto for lspace.
2872         (WebCore::RenderMathMLPadded::mpaddedWidth): Ditto for width.
2873         (WebCore::RenderMathMLPadded::mpaddedHeight): Ditto for height.
2874         (WebCore::RenderMathMLPadded::mpaddedDepth): Ditto for detph.
2875         (WebCore::RenderMathMLPadded::computePreferredLogicalWidths): Use mpaddedWidth().
2876         (WebCore::RenderMathMLPadded::layoutBlock): Use the new helper functions.
2877         (WebCore::RenderMathMLPadded::firstLineBaseline): Use voffset or mpaddedHeight for baseline
2878         calculation instead of m_padded.
2879         (WebCore::RenderMathMLPadded::resolveWidth): Deleted. Renamed mpaddedWidth.
2880         (WebCore::RenderMathMLPadded::resolveAttributes): Deleted. Split into smaller functions.
2881         (WebCore::RenderMathMLPadded::updateFromElement): Deleted. We do not need to call
2882         setNeedsLayout.
2883         (WebCore::RenderMathMLPadded::styleDidChange): Deleted. Ditto.
2884         * rendering/mathml/RenderMathMLPadded.h: Update function declaration and remove m_ascent.
2885
2886 2016-08-27  Alex Christensen  <achristensen@webkit.org>
2887
2888         URLParser should parse relative URLs
2889         https://bugs.webkit.org/show_bug.cgi?id=161282
2890
2891         Reviewed by Darin Adler.
2892
2893         Partially covered by new API tests, but once the parser is complete enough we can
2894         use the url web platform tests to more fully test this.  It's still a work in
2895         progress only used by tests.
2896
2897         * platform/URLParser.cpp:
2898         (WebCore::URLParser::urlLengthUntilPart):
2899         (WebCore::URLParser::copyURLPartsUntil):
2900         Added some helper functions to reduce redundant code.  When parsing relative URLs,
2901         we often want to copy large parts of the base URL, but the stopping point differs.
2902         (WebCore::URLParser::parse):
2903         The parser now returns a URL instead of an Optional<URL> because a URL has a m_isValid which behaves like Optional.
2904         * platform/URLParser.h:
2905         (WebCore::URLParser::parse):
2906
2907 2016-08-27  Chris Dumez  <cdumez@apple.com>
2908
2909         Update generated bindings to throw a SecurityError when denying cross-origin access to properties
2910         https://bugs.webkit.org/show_bug.cgi?id=161270
2911
2912         Reviewed by Darin Adler.
2913
2914         Update generated bindings to throw a SecurityError when denying cross-origin
2915         access to properties, as per the HTML specification:
2916         - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
2917         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
2918
2919         Firefox and Chrome already throw but Webkit was logging an error message and
2920         returning undefined instead.
2921
2922         No new tests, updated existing tests.
2923
2924         * bindings/js/JSDOMBinding.cpp:
2925         (WebCore::canAccessDocument):
2926         (WebCore::BindingSecurity::shouldAllowAccessToNode):
2927         * bindings/js/JSDOMBinding.h:
2928         * bindings/scripts/CodeGeneratorJS.pm:
2929         (GenerateImplementation):
2930
2931 2016-08-27  Chris Dumez  <cdumez@apple.com>
2932
2933         Follow-up fixes after r205030.
2934         https://bugs.webkit.org/show_bug.cgi?id=161216
2935
2936         Reviewed by Darin Adler.
2937
2938         * html/parser/HTMLParserIdioms.cpp:
2939         (WebCore::isHTMLSpaceOrDelimiter):
2940         (WebCore::isNumberStart):
2941         (WebCore::parseHTMLListOfOfFloatingPointNumberValues):
2942         * html/parser/HTMLParserIdioms.h:
2943
2944 2016-08-27  Rawinder Singh  <rawinder.singh-webkit@cisra.canon.com.au>
2945
2946         Add final keyword to final classes and overriden methods in WebCore/css
2947         https://bugs.webkit.org/show_bug.cgi?id=161182
2948
2949         Reviewed by Darin Adler.
2950
2951         - Mark classes in the WebCore/css directory final as appropriate.
2952         - Update WebCore/css classes so that overriden methods in final classes are marked final.
2953
2954         * css/CSSAnimationTriggerScrollValue.h:
2955         * css/CSSAspectRatioValue.h:
2956         * css/CSSBasicShapes.h:
2957         * css/CSSBorderImageSliceValue.h:
2958         * css/CSSCalculationValue.cpp:
2959         (WebCore::determineCategory):
2960         * css/CSSCalculationValue.h:
2961         * css/CSSCanvasValue.h:
2962         * css/CSSCharsetRule.h:
2963         * css/CSSComputedStyleDeclaration.h:
2964         * css/CSSContentDistributionValue.h:
2965         * css/CSSCrossfadeValue.h:
2966         * css/CSSCursorImageValue.h:
2967         * css/CSSCustomPropertyValue.h:
2968         * css/CSSFilterImageValue.h:
2969         * css/CSSFontFaceLoadEvent.h:
2970         * css/CSSFontFaceSrcValue.h:
2971         * css/CSSFontFeatureValue.h:
2972         * css/CSSFontSelector.h:
2973         * css/CSSFontValue.h:
2974         * css/CSSFunctionValue.h:
2975         * css/CSSGradientValue.h:
2976         * css/CSSGridAutoRepeatValue.h:
2977         * css/CSSGridLineNamesValue.h:
2978         * css/CSSGridTemplateAreasValue.h:
2979         * css/CSSImageSetValue.h:
2980         * css/CSSImageValue.h:
2981         * css/CSSInheritedValue.h:
2982         * css/CSSInitialValue.h:
2983         * css/CSSKeyframeRule.h:
2984         * css/CSSKeyframesRule.h:
2985         * css/CSSLineBoxContainValue.h:
2986         * css/CSSNamedImageValue.h:
2987         * css/CSSPrimitiveValue.h:
2988         * css/CSSReflectValue.h:
2989         * css/CSSRevertValue.h:
2990         * css/CSSRuleList.h:
2991         * css/CSSSegmentedFontFace.h:
2992         * css/CSSShadowValue.h:
2993         * css/CSSStyleSheet.cpp:
2994         * css/CSSStyleSheet.h:
2995         * css/CSSSupportsRule.h:
2996         * css/CSSTimingFunctionValue.h:
2997         * css/CSSUnicodeRangeValue.h:
2998         * css/CSSUnknownRule.h:
2999         * css/CSSUnsetValue.h:
3000         * css/CSSValue.cpp:
3001         * css/CSSVariableDependentValue.h:
3002         * css/CSSVariableValue.h:
3003         * css/Counter.h:
3004         * css/DOMCSSNamespace.h:
3005         * css/DashboardRegion.h:
3006         * css/LengthRepeat.h:
3007         * css/MediaList.h:
3008         * css/MediaQueryList.h:
3009         * css/MediaQueryMatcher.h:
3010         * css/Pair.h:
3011         * css/PropertySetCSSStyleDeclaration.h:
3012         * css/RGBColor.h:
3013         * css/Rect.h:
3014         * css/StyleMedia.h:
3015         * css/StyleProperties.h:
3016         * css/StyleRule.h:
3017         * css/StyleRuleImport.h:
3018         * css/StyleSheetContents.h:
3019         * css/StyleSheetList.h:
3020         * css/ViewportStyleResolver.h:
3021         * css/WebKitCSSFilterValue.h:
3022         * css/WebKitCSSRegionRule.h:
3023         * css/WebKitCSSTransformValue.h:
3024         * css/WebKitCSSViewportRule.h:
3025
3026 2016-08-27  Simon Fraser  <simon.fraser@apple.com>
3027
3028         Add more Editing logging
3029         https://bugs.webkit.org/show_bug.cgi?id=161287
3030
3031         Reviewed by Darin Adler.
3032
3033         Add logging which tracks how key events get from the UI process to the
3034         web process, and down to form fields.
3035
3036         * editing/Editor.cpp:
3037         (WebCore::Editor::handleTextEvent):
3038         (WebCore::Editor::appliedEditing):
3039         * editing/TypingCommand.cpp:
3040         (WebCore::TypingCommand::insertText):
3041         (WebCore::TypingCommand::insertTextAndNotifyAccessibility):
3042         * html/HTMLTextFormControlElement.cpp:
3043         (WebCore::HTMLTextFormControlElement::didEditInnerTextValue):
3044         * page/EventHandler.cpp:
3045         (WebCore::EventHandler::keyEvent):
3046         (WebCore::EventHandler::handleTextInputEvent):
3047
3048 2016-08-27  Sam Weinig  <sam@webkit.org>
3049
3050         Remove more custom JavaScript bindings
3051         https://bugs.webkit.org/show_bug.cgi?id=161293
3052
3053         Reviewed by Darin Adler.
3054
3055         Remove custom bindings for AudioContext, DOMFormData, MediaSession and WebKitPoint.
3056
3057         * Modules/mediasession/MediaSession.cpp:
3058         (WebCore::MediaSession::MediaSession):
3059         * Modules/mediasession/MediaSession.h:
3060         Change to take Document explicitly, since that is what it 
3061         expecting.
3062
3063         * Modules/webaudio/AudioContext.cpp:
3064         (WebCore::AudioContext::create):
3065         * Modules/webaudio/AudioContext.h:
3066         Remove unused ExceptionCode parameter.
3067
3068         * Modules/webaudio/AudioContext.idl:
3069         * html/DOMFormData.idl:
3070         * html/HTMLFormElement.idl:
3071         * page/WebKitPoint.idl:
3072         Switch to use the generated constructor.
3073
3074         * CMakeLists.txt:
3075         * WebCore.xcodeproj/project.pbxproj:
3076         * bindings/js/JSBindingsAllInOne.cpp:
3077         Remove files.
3078         
3079         * bindings/js/JSAudioContextCustom.cpp: Removed.
3080         * bindings/js/JSDOMFormDataCustom.cpp: Removed.
3081         * bindings/js/JSMediaSessionCustom.cpp: Removed.
3082         * bindings/js/JSWebKitPointCustom.cpp: Removed.
3083         Remove in favor of generated variants.
3084
3085         * bindings/js/JSHTMLInputElementCustom.h: Removed.
3086         Remove unused header.
3087
3088         * page/WebKitPoint.h:
3089         (WebCore::WebKitPoint::create):
3090         (WebCore::WebKitPoint::WebKitPoint):
3091         Move NaN replacement into the implementation and out of the bindings.
3092
3093 2016-08-27  Ryosuke Niwa  <rniwa@webkit.org>
3094
3095         Add adopted callback for custom elements
3096         https://bugs.webkit.org/show_bug.cgi?id=161284
3097
3098         Reviewed by Antti Koivisto.
3099
3100         Added the support for adoptedCallback: https://dom.spec.whatwg.org/#concept-node-adopt
3101         For now, we only support this callback on appendChild.
3102
3103         Test: fast/custom-elements/adopted-callback.html
3104
3105         * bindings/js/JSCustomElementInterface.cpp:
3106         (WebCore::JSCustomElementInterface::invokeCallback): Added JSDOMGlobalObject* as an argument to the callback so that
3107         we can invoke toJS on Document in invokeAdoptedCallback.
3108         (WebCore::JSCustomElementInterface::setAdoptedCallback): Added.
3109         (WebCore::JSCustomElementInterface::invokeAdoptedCallback): Added.
3110         (WebCore::JSCustomElementInterface::setAttributeChangedCallback):
3111         * bindings/js/JSCustomElementInterface.h:
3112         (WebCore::JSCustomElementInterface::hasConnectedCallback): Added.
3113         (WebCore::JSCustomElementInterface::hasDisconnectedCallback): Added.
3114         (WebCore::JSCustomElementInterface::hasAdoptedCallback): Added.
3115         * bindings/js/JSCustomElementRegistryCustom.cpp:
3116         (WebCore::JSCustomElementRegistry::define):
3117         * dom/CustomElementReactionQueue.cpp:
3118         (WebCore::CustomElementReactionQueueItem::CustomElementReactionQueueItem): Added a variant that takes two documents.
3119         (WebCore::CustomElementReactionQueueItem::invoke):
3120         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded): Fixed a bug that this function was always
3121         enqueuing a callback even when the interface didn't have connectedCallback. Also, there is no need to check
3122         the nullity of the interface since it should never be null.
3123         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded): Ditto.
3124         (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded): Added.
3125         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded): Assert that the interface is never
3126         null instead of exiting early.
3127         * dom/CustomElementReactionQueue.h:
3128         * dom/Element.cpp:
3129         (WebCore::Element::didMoveToNewDocument): Added a call to enqueueAdoptedCallbackIfNeeded.
3130
3131 2016-08-27  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
3132
3133         Fix the !PLATFORM(WIN) && USE(CURL) build.
3134         https://bugs.webkit.org/show_bug.cgi?id=161281
3135
3136         Reviewed by Alex Christensen.
3137
3138         * platform/network/curl/ResourceHandleCurl.cpp:
3139
3140 2016-08-27  Youenn Fablet  <youenn@apple.com>
3141
3142         [Fetch API] Opaque responses should not have any body
3143         https://bugs.webkit.org/show_bug.cgi?id=161130
3144
3145         Reviewed by Sam Weinig.
3146
3147         Covered by updated test.
3148
3149         Added a new ThreadableLoader option to receive or not opaque response body.
3150         By default, option is set to Receive.
3151         FetchLoader is setting it to DoNotReceive.
3152
3153         * Modules/fetch/FetchLoader.cpp:
3154         (WebCore::FetchLoader::start):
3155         * loader/DocumentThreadableLoader.cpp:
3156         (WebCore::DocumentThreadableLoader::didReceiveResponse): Calling didFinishLoading just after didReceiveResponse in case of Opaque responses.
3157         * loader/ThreadableLoader.cpp:
3158         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions):
3159         * loader/ThreadableLoader.h:
3160         * loader/WorkerThreadableLoader.cpp:
3161         (WebCore::LoaderTaskOptions::LoaderTaskOptions):
3162
3163 2016-08-27  Youenn Fablet  <youenn@apple.com>
3164
3165         [Fetch API] opaqueredirect responses should have their URL set to the original URL
3166         https://bugs.webkit.org/show_bug.cgi?id=161194
3167
3168         Reviewed by Sam Weinig.
3169
3170         Covered by updated tests.
3171
3172         * loader/DocumentThreadableLoader.cpp:
3173         (WebCore::DocumentThreadableLoader::didReceiveResponse):
3174         * loader/SubresourceLoader.cpp: Removing isNull ASSERT since we now set the response URL.
3175         (WebCore::SubresourceLoader::willSendRequestInternal): Setting opaqueredirect response URL to the original URL.
3176
3177 2016-08-27  Andreas Kling  <akling@apple.com>
3178
3179         script.text should behave like script.textContent on setting
3180         <https://webkit.org/b/148852>
3181
3182         Reviewed by Chris Dumez.
3183
3184         HTMLScriptElement.text should behave just like .textContent when setting,
3185         so just forward setText() to setTextContent().
3186
3187         Test: import/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-text.html
3188
3189         * html/HTMLScriptElement.cpp:
3190         (WebCore::HTMLScriptElement::setText):
3191
3192 2016-08-27  Youenn Fablet  <youenn@apple.com>
3193
3194         [Fetch API] Blob type should be set from Response/Request contentType header
3195         https://bugs.webkit.org/show_bug.cgi?id=161228
3196
3197         Reviewed by Alex Christensen.
3198
3199         Covered by updated tests.
3200
3201         Renaming FetchBody::m_mimeType to m_contentType since that better relates to Content-Type header.
3202         Updated FetchRequest and FetchResponse to set m_contentType according request/response headers.
3203         Handled the case of a Request created from JS, a Response created from JS and a Response created internally to
3204         be used as resolve value in the fetch promise.
3205
3206         In case Content-Type is set but is empty, its empty value should be used for blob type.
3207         Updated contentType checks to use isNull in lieu of isEmpty.
3208
3209         * Modules/fetch/FetchBody.cpp:
3210         (WebCore::FetchBody::updateContentType): Routine to synchronize headers with m_contentType.
3211         (WebCore::FetchBody::FetchBody): Renamed m_mimeType to m_contentType.
3212         (WebCore::FetchBody::blob): Ditto.
3213         * Modules/fetch/FetchBody.h: Ditto.
3214         (WebCore::FetchBody::contentType):
3215         (WebCore::FetchBody::setMimeType): Deleted.
3216         (WebCore::FetchBody::mimeType): Deleted.
3217         * Modules/fetch/FetchRequest.cpp:
3218         (WebCore::FetchRequest::setBody): set FetchBody::m_contentType according HTTP headers.
3219         * Modules/fetch/FetchResponse.cpp:
3220         (WebCore::FetchResponse::initializeWith): Ditto.
3221         (WebCore::FetchResponse::BodyLoader::didReceiveResponse): Ditto.
3222
3223 2016-08-26  Alex Christensen  <achristensen@webkit.org>
3224
3225         Fix Windows build after r205065.
3226
3227         * Modules/webaudio/BiquadFilterNode.idl:
3228         * Modules/webaudio/PannerNode.idl:
3229         There's no WEB_AUDIO on Windows.
3230
3231 2016-08-26  Devin Rousso  <dcrousso+webkit@gmail.com>
3232
3233         REGRESSION (r203535): Web Inspector: Inspector overlay node info has disappeared
3234         https://bugs.webkit.org/show_bug.cgi?id=161264
3235
3236         Reviewed by Joseph Pecoraro.
3237
3238         No new tests.  Fixing JavaScript error in Inspector overlay.
3239
3240         * inspector/InspectorOverlay.cpp:
3241         (evaluateCommandInOverlay):
3242         (WebCore::InspectorOverlay::evaluateInOverlay):
3243         Add ASSERT to ensure that errors in the Inspector overlay will cause tests to crash.
3244
3245         * inspector/InspectorOverlayPage.js:
3246         (DOMBuilder.prototype.appendTextNode):
3247         Move textContent value to parameter of document.createTextNode.
3248
3249 2016-08-26  Sam Weinig  <sam@webkit.org>
3250
3251         Remove support for ENABLE_LEGACY_WEB_AUDIO
3252         https://bugs.webkit.org/show_bug.cgi?id=161262
3253
3254         Reviewed by Anders Carlsson.
3255
3256         * Configurations/FeatureDefines.xcconfig:
3257         Remove ENABLE_LEGACY_WEB_AUDIO.
3258
3259         * Modules/webaudio/AudioBufferSourceNode.cpp:
3260         (WebCore::AudioBufferSourceNode::noteGrainOn): Deleted.
3261         * Modules/webaudio/AudioBufferSourceNode.h:
3262         * Modules/webaudio/AudioBufferSourceNode.idl:
3263         (WebCore::AudioScheduledSourceNode::noteOn): Deleted.
3264         (WebCore::AudioScheduledSourceNode::noteOff): Deleted.
3265         * Modules/webaudio/AudioScheduledSourceNode.h:
3266         * Modules/webaudio/AudioScheduledSourceNode.cpp:
3267         Remove the looping attribute, as well as the noteOn, noteOff, and noteGrainOn functions.
3268
3269         * Modules/webaudio/AudioContext.idl:
3270         Remove the createGainNode, createDelayNode and createJavaScriptNode functions.
3271
3272         * Modules/webaudio/AudioParam.idl:
3273         Remove the setTargetValueAtTime function.
3274
3275         * Modules/webaudio/BiquadDSPKernel.cpp:
3276         (WebCore::BiquadDSPKernel::updateCoefficientsIfNecessary):
3277         * Modules/webaudio/BiquadFilterNode.cpp:
3278         (WebCore::BiquadFilterNode::type):
3279         (WebCore::BiquadFilterNode::setType):
3280         (WebCore::BiquadFilterNode::getFrequencyResponse):
3281         * Modules/webaudio/BiquadFilterNode.h:
3282         * Modules/webaudio/BiquadFilterNode.idl:
3283         * Modules/webaudio/BiquadProcessor.cpp:
3284         (WebCore::BiquadProcessor::BiquadProcessor):
3285         (WebCore::BiquadProcessor::setType):
3286         (WebCore::BiquadProcessor::getFrequencyResponse):
3287         * Modules/webaudio/BiquadProcessor.h:
3288         (WebCore::BiquadProcessor::type):
3289         * bindings/js/JSBiquadFilterNodeCustom.cpp: Removed.
3290         Rename BiquadProcessor::FilterType to BiquadFilterType and use it
3291         directly from the IDL. Remove legacy filter constants from the IDL
3292         and the need for a custom binding for the type attribute.
3293
3294         * Modules/webaudio/OscillatorNode.cpp:
3295         (WebCore::OscillatorNode::OscillatorNode):
3296         (WebCore::OscillatorNode::setType):
3297         (WebCore::OscillatorNode::setPeriodicWave):
3298         (WebCore::OscillatorNode::type): Deleted.
3299         * Modules/webaudio/OscillatorNode.h:
3300         (WebCore::OscillatorNode::type):
3301         * Modules/webaudio/OscillatorNode.idl:
3302         * Modules/webaudio/PeriodicWave.cpp:
3303         (WebCore::PeriodicWave::createSine):
3304         (WebCore::PeriodicWave::createSquare):
3305         (WebCore::PeriodicWave::createSawtooth):
3306         (WebCore::PeriodicWave::createTriangle):
3307         (WebCore::PeriodicWave::generateBasicWaveform):
3308         * Modules/webaudio/PeriodicWave.h:
3309         * bindings/js/JSOscillatorNodeCustom.cpp: Removed.
3310         Remove noteOn and noteOff functions and the type integer constants.
3311         Remove the need for a custom binding for the type attribute by renaming
3312         the type enum OscillatorNode::Type and putting the enum in the IDL.
3313
3314         * Modules/webaudio/PannerNode.cpp:
3315         (WebCore::PannerNode::PannerNode):
3316         (WebCore::PannerNode::process):
3317         (WebCore::PannerNode::setPanningModel):
3318         (WebCore::PannerNode::distanceModel):
3319         (WebCore::PannerNode::setDistanceModel):
3320         (WebCore::PannerNode::panningModel): Deleted.
3321         * Modules/webaudio/PannerNode.h:
3322         (WebCore::PannerNode::panningModel):
3323         * Modules/webaudio/PannerNode.idl:
3324         * bindings/js/JSPannerNodeCustom.cpp: Removed.
3325         * platform/audio/Distance.cpp:
3326         (WebCore::DistanceEffect::DistanceEffect):
3327         (WebCore::DistanceEffect::gain):
3328         * platform/audio/Distance.h:
3329         (WebCore::DistanceEffect::model):
3330         (WebCore::DistanceEffect::setModel):
3331         * platform/audio/EqualPowerPanner.cpp:
3332         (WebCore::EqualPowerPanner::EqualPowerPanner):
3333         * platform/audio/HRTFPanner.cpp:
3334         (WebCore::HRTFPanner::HRTFPanner):
3335         * platform/audio/Panner.cpp:
3336         (WebCore::Panner::create):
3337         * platform/audio/Panner.h:
3338         (WebCore::Panner::panningModel):
3339         (WebCore::Panner::Panner):
3340         Replace the panning model and distance model integer constants
3341         with IDL enum support, removing the need for a custom binding.
3342         Rename the supporting C++ enums to work with the bindings.
3343
3344         * bindings/js/JSAudioContextCustom.cpp:
3345         (WebCore::constructJSAudioContext):
3346         Remove deprecated way of creating an offline context.
3347
3348         * WebCore.xcodeproj/project.pbxproj:
3349         Update files.
3350
3351 2016-08-26  Johan K. Jensen  <johan_jensen@apple.com>
3352
3353         Web Inspector: Frontend should have access to Resource Timing information
3354         https://bugs.webkit.org/show_bug.cgi?id=160095
3355
3356         Reviewed by Alex Christensen.
3357
3358         Show correct information with Resource Timing information
3359         from ResourceLoader rather than DocumentLoader.
3360
3361         No new tests, frontend doesn't use the timing data yet.
3362
3363         * inspector/InspectorNetworkAgent.cpp:
3364         (WebCore::InspectorNetworkAgent::buildObjectForTiming):
3365         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
3366         (WebCore::InspectorNetworkAgent::buildObjectForCachedResource):
3367         (WebCore::InspectorNetworkAgent::willSendRequest):
3368         (WebCore::InspectorNetworkAgent::didReceiveResponse):
3369         (WebCore::InspectorNetworkAgent::didLoadResourceFromMemoryCache):
3370         (WebCore::buildObjectForTiming): Deleted.
3371         (WebCore::buildObjectForResourceResponse): Deleted.
3372         (WebCore::buildObjectForCachedResource): Deleted.
3373         Use ResourceLoader instead of DocumentLoader to get Resource Timing information.
3374         Move functions to member functions to access the executionStopWatch.
3375
3376         (WebCore::InspectorNetworkAgent::didFinishLoading):
3377         Use the load timing finishTime and convert to elapsed time