17cc5cb2025002608ec8469034c8cbb75d209910
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-08-31  Romain Bellessort  <romain.bellessort@crf.canon.fr>
2
3         [Streams API] Align getReader() with spec
4         https://bugs.webkit.org/show_bug.cgi?id=160508
5
6         Reviewed by Xabier Rodriguez-Calvar.
7
8         Aligned getReader() with spec following replacement of ReadableStreamReader by
9         ReadableStreamDefaultReader.
10
11         Test: streams/readable-stream-getReader.html
12
13         * Modules/streams/ReadableStream.js:
14         (getReader):
15
16 2016-08-31  Brady Eidson  <beidson@apple.com>
17
18         WK2 Gamepad provider on iOS.
19         https://bugs.webkit.org/show_bug.cgi?id=161412
20
21         Reviewed by Tim Horton.
22
23         No new tests (Native framework backends not directly testable)
24
25         * Configurations/FeatureDefines.xcconfig:
26
27 2016-08-31  Antti Koivisto  <antti@apple.com>
28
29         REGRESSION (r201701): Unable to copy from CodeMirror editor version used in Jenkins install website
30         https://bugs.webkit.org/show_bug.cgi?id=161386
31         <rdar://problem/27590077>
32
33         Reviewed by Dan Bernstein.
34
35         This CodeMirror version uses a hidden <textarea> to implement copy/paste. The textarea has width:1px; border-width:1px.
36         Jenkins page has also has a stylesheet that contains * { box-sizing:border-box } and as a result the textarea content
37         width gets computed as 0. With r201701 we use content size instead of box size for clipping and the textarea content is
38         (correctly) considered invisible.
39
40         Add a quirk that allows this to continue working.
41
42         Test: editing/text-iterator/hidden-textarea-selection-quirk.html
43
44         * editing/TextIterator.cpp:
45         (WebCore::fullyClipsContents):
46
47 2016-08-31  Joseph Pecoraro  <pecoraro@apple.com>
48
49         Remove unused member variable in WebCore::File
50         https://bugs.webkit.org/show_bug.cgi?id=161420
51
52         Reviewed by Alex Christensen.
53
54         * fileapi/File.h:
55
56 2016-08-30  Ryosuke Niwa  <rniwa@webkit.org>
57
58         Add "get" to CustomElementsRegistry
59         https://bugs.webkit.org/show_bug.cgi?id=161421
60
61         Reviewed by Yusuke Suzuki.
62
63         Add the support for "get" method on CustomElementsRegistry, which returns the constructor
64         of the custom element with the given name:
65         https://html.spec.whatwg.org/multipage/scripting.html#dom-customelementregistry-get
66
67         Tests: fast/custom-elements/CustomElementRegistry.html
68
69         * dom/CustomElementRegistry.cpp:
70         (WebCore::CustomElementRegistry::get): Added.
71         * dom/CustomElementRegistry.h:
72         * dom/CustomElementRegistry.idl:
73
74 2016-08-30  Yusuke Suzuki  <utatane.tea@gmail.com>
75
76         Make PendingScript as ref-counted
77         https://bugs.webkit.org/show_bug.cgi?id=161350
78
79         Reviewed by Ryosuke Niwa.
80
81         Currently, while PendingScript is copyable, PendingScript is also CachedResourceClient.
82         So when copying this, the client registration is done in PendingScript's operator= etc.
83         However, this copying functionality is not effectively used.
84         In this patch, we change this PendingScript to ref-counted class and make it noncopyable.
85         This change makes things simple (dropping this copying functionality), and drops unnecessary
86         addClient / removeClient calls. And we also simplify PendingScript class. Since we can offer
87         all the members at the construction time, we do not need any setters like setCachedScript,
88         setElement etc. This prevents us from accidentally generating the half-baked pending script.
89
90         Furthermore, by changing PendingScript noncopyable & ref-counted, we easily make it
91         observable. In this patch, we add PendingScriptClient to receive the notification from
92         PendingScript. Previously, we directly used CachedScript in PendingScript to receive the
93         notification. When introducing ScriptModuleGraph and making this PendingScript the container
94         of the both CachedScript and ScriptModuleGraph, hiding the raw CachedScript operations is
95         useful.
96
97         No behavior changes.
98
99         * WebCore.xcodeproj/project.pbxproj:
100         * dom/PendingScript.cpp:
101         (WebCore::PendingScript::create): These factory functions take all the information needed
102         to construct the PendingScript. So the setters of PendingScript are dropped. This is better
103         since we now do not expose any half-baked pending script accidentally.
104         (WebCore::PendingScript::PendingScript):
105         (WebCore::PendingScript::~PendingScript):
106         (WebCore::PendingScript::notifyClientFinished):
107         (WebCore::PendingScript::notifyFinished):
108         (WebCore::PendingScript::isLoaded): When introducing ScriptModuleGraph, this will query to
109         either CachedScript or ScriptModuleGraph. PendingScript will become the container for the
110         both types.
111         (WebCore::PendingScript::setClient):
112         (WebCore::PendingScript::clearClient): PendingScript is now observable by PendingScriptClient.
113         This avoids touching CachedScript in PendingScript directly. That is good when we introduce
114         ScriptModuleGraph and make PendingScript the container of the both CachedScript and ScriptModuleGraph.
115         (WebCore::PendingScript::releaseElementAndClear): Deleted. Previously, PendingScript is not ref-counted.
116         So when we would like to say "this pending script is empty", we used the pending script with
117         `m_element = nullptr`. This releaseElementAndClear cleared this m_element and made the pending
118         script empty. Now, we use RefPtr<PendingScript> and empty one is just represented by the nullptr.
119         This function is no longer necessary. Dropped.
120         (WebCore::PendingScript::setCachedScript): Deleted. The fields are set in the constructor.
121         So this setter is no longer necessary. Dropped.
122         * dom/PendingScript.h:
123         * dom/PendingScriptClient.h: Copied from Source/WebCore/html/parser/HTMLScriptRunnerHost.h.
124         (WebCore::PendingScriptClient::~PendingScriptClient):
125         * dom/ScriptRunner.cpp:
126         (WebCore::ScriptRunner::queueScriptForExecution):
127         (WebCore::ScriptRunner::notifyScriptReady):
128         (WebCore::ScriptRunner::timerFired): We use `std::exchange` to retrieve the RefPtr<PendingScript>
129         and make the original vector element nullptr. Without this, all the PendingScript is held until
130         the iteration finishes. We keep the original semantics here that the pending script can be
131         released per iteration.
132         * dom/ScriptRunner.h:
133         * html/parser/HTMLDocumentParser.cpp:
134         (WebCore::HTMLDocumentParser::watchForLoad):
135         (WebCore::HTMLDocumentParser::stopWatchingForLoad): Use PendingScript instead of touching
136         CachedScript directly.
137         (WebCore::HTMLDocumentParser::notifyFinished):
138         * html/parser/HTMLDocumentParser.h:
139         * html/parser/HTMLScriptRunner.cpp:
140         (WebCore::HTMLScriptRunner::~HTMLScriptRunner):
141         (WebCore::HTMLScriptRunner::sourceFromPendingScript):
142         (WebCore::HTMLScriptRunner::isPendingScriptReady):
143         (WebCore::HTMLScriptRunner::executeParsingBlockingScript):
144         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): As the previous comment describes,
145         we used releaseElementAndClear to make the current pending script empty. Instead of doing so, we now
146         explicitly clear executeParsingBlockingScript (by assigning nullptr to m_parserBlockingScript).
147         (WebCore::HTMLScriptRunner::watchForLoad):
148         (WebCore::HTMLScriptRunner::stopWatchingForLoad): Previously, we used CachedScript::addClient directly
149         in the m_host.watchForLoad. This means that we did not have a quick way to query whether the pending
150         script is watched. In the old implementation, we have the `m_watchingForLoad : bool` flag in PendingScript
151         to hold the watching status for the given pending script. This `pendingScript.setWatchingForLoad(true)`
152         just made this flag `true`. But now, we do not use CachedScript::addClient directly. Instead, we have
153         the PendingScriptClient and PendingScript::{setClient,clearClient}. We can know whether this pending
154         script is watched by checking `m_client != nullptr`. This makes `m_watchingForLoad` unnecessary.
155         So this patch drops `m_watchingForLoad` and `pendingScript.setWatchingForLoad(true)` call.
156         (WebCore::HTMLScriptRunner::hasParserBlockingScript):
157         (WebCore::HTMLScriptRunner::executeParsingBlockingScripts): We clear the m_parserBlockingScript here
158         instead of the middle of the executePendingScriptAndDispatchEvent.
159         (WebCore::HTMLScriptRunner::executeScriptsWaitingForLoad):
160         (WebCore::HTMLScriptRunner::executeScriptsWaitingForParsing):
161         (WebCore::requestPendingScript):
162         (WebCore::HTMLScriptRunner::requestParsingBlockingScript): Setting m_parsingBlockingScript is now done
163         in this caller side.
164         (WebCore::HTMLScriptRunner::requestDeferredScript):
165         (WebCore::HTMLScriptRunner::runScript):
166         (WebCore::HTMLScriptRunner::requestPendingScript): Instead of configuring the passed PendingScript&,
167         we return the pending script and the caller sets it to m_parserBlockingScript or holds it. And we now
168         change this function to static location one and drop the member function. Previously, we always make
169         PendingScript& valid by always calling `setElement(...)`. I think this is the bug since we accidentally
170         exposed the half-baked pending script. But this bug is not shown since `!cachedScript` path is dead code!
171         This requestPendingScript is called from two places, requestDeferredScript and requestParsingBlockingScript.
172         And these functions are called if the script has `willBeParserExecuted` flag. In the case of the script
173         tag having "src" attribute, this flag is only set if `cachedScript` is correctly instantiated. So when
174         these functions are called, we can ensure that `cachedScript` is correctly instantiated for the given script.
175         In the case of the script tag not having "src" attribute, these functions are won't be called. This is
176         because if such a script tag has `willBeParserExecuted` flag, it also has `m_readyToBeParserExecuted`
177         and it does not have `m_willExecuteWhenDocumentFinishedParsing` flag, and in that case the both
178         functions are never called. So we drop that path and insert the assertion to ensure the above conditions.
179         * html/parser/HTMLScriptRunner.h:
180         * html/parser/HTMLScriptRunnerHost.h:
181
182 2016-08-30  Ricky Mondello  <rmondello@apple.com>
183
184         "pluginReplacementEnabled" should be a Setting, not a RuntimeEnabledFeature
185         https://bugs.webkit.org/show_bug.cgi?id=161416
186         <rdar://problem/28050847>
187
188         Reviewed by Simon Fraser.
189
190         Mostly mechanical. Tested by running LayoutTests/plugins/quicktime-plugin-replacement.html and manually toggling
191         defaultPluginReplacementEnabled and observing a behavior change.
192
193         * bindings/generic/RuntimeEnabledFeatures.cpp:
194         (WebCore::RuntimeEnabledFeatures::reset): Purged of the pluginReplacementEnabled setting.
195         * bindings/generic/RuntimeEnabledFeatures.h:
196         (WebCore::RuntimeEnabledFeatures::setPluginReplacementEnabled): Deleted.
197         (WebCore::RuntimeEnabledFeatures::pluginReplacementEnabled): Deleted.
198         * html/HTMLPlugInElement.cpp:
199         (WebCore::HTMLPlugInElement::requestObject): Use the setting.
200         * page/Settings.cpp: Supply different values for iOS and other platforms, matching the RuntimeEnabledFeature values,
201             enabled for iOS and disabled otherwise.
202         * page/Settings.in: Declare the setting.
203         * testing/InternalSettings.cpp:
204         (WebCore::InternalSettings::Backup::Backup): Use the setting.
205         (WebCore::InternalSettings::Backup::restoreTo): Ditto.
206         (WebCore::InternalSettings::setPluginReplacementEnabled): Ditto.
207         * testing/InternalSettings.h: Can now throw an exception, like other Settings-backed members.
208         * testing/InternalSettings.idl: Declare this as possibly throwing an exception.
209
210 2016-08-30  Ricky Mondello  <rmondello@apple.com>
211
212         YouTubePluginReplacementTest's URL transformation logic should have tests
213         https://bugs.webkit.org/show_bug.cgi?id=161406
214         <rdar://problem/28050847>
215
216         Reviewed by Eric Carlson.
217
218         Refactor most of YouTubePluginReplacement::youTubeURL into a static method that can be used by TestWebKitAPI.
219
220         * Modules/plugins/YouTubePluginReplacement.cpp:
221         (WebCore::YouTubePluginReplacement::youTubeURL): Now implemented in terms of youTubeURLFromAbsoluteURL.
222         (WebCore::YouTubePluginReplacement::youTubeURLFromAbsoluteURL): Absorbs most of youTubeURL.
223         * Modules/plugins/YouTubePluginReplacement.h: Declare a public method, for the benefit of testing.
224         * WebCore.xcodeproj/project.pbxproj: Make some heads private for TestWebKitAPI's benefit.
225
226 2016-08-30  Frederic Wang  <fwang@igalia.com>
227
228         Move some code from MathMLElement to MathMLPresentationElement
229         https://bugs.webkit.org/show_bug.cgi?id=161377
230
231         Reviewed by Darin Adler.
232
233         The following code is only used in presentation MathML classes. We then move it from
234         MathMLElement to MathMLPresentationElement:
235         - testing whether a child is a phrasing/flow element.
236         - parsing of length attributes.
237         - parsing of boolean attributes.
238         - parsing of mathvariant attributes.
239
240         No new tests, already covered by existing tests.
241
242         * mathml/MathMLElement.cpp:
243         (WebCore::MathMLElement::isPhrasingContent): Deleted.
244         (WebCore::MathMLElement::isFlowContent): Deleted.
245         (WebCore::MathMLElement::parseNumberAndUnit): Deleted.
246         (WebCore::MathMLElement::parseNamedSpace): Deleted.
247         (WebCore::MathMLElement::parseMathMLLength): Deleted.
248         (WebCore::MathMLElement::cachedMathMLLength): Deleted.
249         (WebCore::MathMLElement::cachedBooleanAttribute): Deleted.
250         (WebCore::MathMLElement::parseMathVariantAttribute): Deleted.
251         (WebCore::MathMLElement::specifiedDisplayStyle): Deleted.
252         (WebCore::MathMLElement::specifiedMathVariant): Deleted.
253         * mathml/MathMLElement.h:
254         (WebCore::MathMLElement::specifiedDisplayStyle):
255         (WebCore::MathMLElement::specifiedMathVariant):
256         (WebCore::MathMLElement::acceptsDisplayStyleAttribute): Deleted.
257         (WebCore::MathMLElement::acceptsMathVariantAttribute): Deleted.
258         (WebCore::MathMLElement::toOptionalBool): Deleted.
259         * mathml/MathMLPresentationElement.cpp:
260         (WebCore::MathMLPresentationElement::isPhrasingContent):
261         (WebCore::MathMLPresentationElement::isFlowContent):
262         (WebCore::MathMLPresentationElement::cachedBooleanAttribute):
263         (WebCore::MathMLPresentationElement::parseNumberAndUnit):
264         (WebCore::MathMLPresentationElement::parseNamedSpace):
265         (WebCore::MathMLPresentationElement::parseMathMLLength):
266         (WebCore::MathMLPresentationElement::cachedMathMLLength):
267         (WebCore::MathMLPresentationElement::specifiedDisplayStyle):
268         (WebCore::MathMLPresentationElement::parseMathVariantAttribute):
269         (WebCore::MathMLPresentationElement::specifiedMathVariant):
270         * mathml/MathMLPresentationElement.h:
271         (WebCore::MathMLPresentationElement::toOptionalBool):
272         (WebCore::MathMLPresentationElement::acceptsMathVariantAttribute):
273
274 2016-08-30  Frederic Wang  <fwang@igalia.com>
275
276         Introduce a MathMLUnknownElement class
277         https://bugs.webkit.org/show_bug.cgi?id=161298
278
279         Reviewed by Darin Adler.
280
281         For consistency with SVG and HTML, we make MathML elements use a
282         fallback MathMLUnknownElement class. Like SVG, we ensure that unknown
283         MathML elements do not create any renderer.
284
285         Test: mathml/mathml-unknown.xhtml
286
287         * mathml/MathMLUnknownElement.h: Added. This is a simple class for
288         unknown MathML elements, preventing the creation of renderers.
289         * mathml/mathtags.in: Map fallbackInterfaceName to MathMLUnknownElement.
290
291 2016-08-30  Chris Dumez  <cdumez@apple.com>
292
293         [[Delete]] should throw for cross-origin Window / Location objects
294         https://bugs.webkit.org/show_bug.cgi?id=161397
295
296         Reviewed by Ryosuke Niwa.
297
298         [[Delete]] should throw for cross-origin Window / Location objects:
299         - https://github.com/whatwg/html/pull/1728
300
301         Firefox and Chrome already throw. Previously, WebKit was merely
302         ignoring the call and logging an error message.
303
304         No new tests, updated existing test.
305
306         * bindings/js/JSDOMWindowCustom.cpp:
307         (WebCore::JSDOMWindow::deleteProperty):
308         (WebCore::JSDOMWindow::deletePropertyByIndex):
309         * bindings/js/JSLocationCustom.cpp:
310         (WebCore::JSLocation::deleteProperty):
311         (WebCore::JSLocation::deletePropertyByIndex):
312
313 2016-08-30  Brady Eidson  <beidson@apple.com>
314
315         GameController.framework backend for gamepad API.
316         https://bugs.webkit.org/show_bug.cgi?id=161086
317
318         Reviewed by Alex Christensen.
319
320         No new tests (Native framework backends not directly testable)
321
322         * WebCore.xcodeproj/project.pbxproj:
323         
324         * platform/gamepad/cocoa/GameControllerGamepad.h: Copied from Source/WebKit2/UIProcess/Gamepad/mac/UIGamepadProviderHID.cpp.
325         * platform/gamepad/cocoa/GameControllerGamepad.mm: Added.
326         (WebCore::GameControllerGamepad::GameControllerGamepad):
327         (WebCore::GameControllerGamepad::setupAsExtendedGamepad):
328         (WebCore::GameControllerGamepad::setupAsGamepad):
329         
330         * platform/gamepad/cocoa/GameControllerGamepadProvider.h: Added.
331         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: Added.
332         (WebCore::GameControllerGamepadProvider::singleton):
333         (WebCore::GameControllerGamepadProvider::GameControllerGamepadProvider):
334         (WebCore::GameControllerGamepadProvider::controllerDidConnect):
335         (WebCore::GameControllerGamepadProvider::controllerDidDisconnect):
336         (WebCore::GameControllerGamepadProvider::startMonitoringGamepads):
337         (WebCore::GameControllerGamepadProvider::stopMonitoringGamepads):
338         (WebCore::GameControllerGamepadProvider::indexForNewlyConnectedDevice):
339         (WebCore::GameControllerGamepadProvider::gamepadHadInput):
340         (WebCore::GameControllerGamepadProvider::makeInvisibileGamepadsVisible):
341         (WebCore::GameControllerGamepadProvider::inputNotificationTimerFired):
342
343 2016-08-30  Mark Lam  <mark.lam@apple.com>
344
345         Introduce the ThrowScope and force every throw site to instantiate a ThrowScope.
346         https://bugs.webkit.org/show_bug.cgi?id=161171
347
348         Reviewed by Filip Pizlo and Geoffrey Garen.
349
350         No new tests because this is only an internal API change. If it builds, it should be good.
351
352         * bindings/js/JSApplePaySessionCustom.cpp:
353         (WebCore::JSApplePaySession::completeShippingMethodSelection):
354         (WebCore::JSApplePaySession::completeShippingContactSelection):
355         (WebCore::JSApplePaySession::completePaymentMethodSelection):
356         * bindings/js/JSBlobCustom.cpp:
357         (WebCore::constructJSBlob):
358         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
359         (WebCore::JSCSSStyleDeclaration::getPropertyCSSValue):
360         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
361         (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
362         (WebCore::createAesCbcParams):
363         (WebCore::createAesKeyGenParams):
364         (WebCore::createHmacParams):
365         (WebCore::createHmacKeyParams):
366         (WebCore::createRsaKeyGenParams):
367         (WebCore::createRsaOaepParams):
368         (WebCore::createRsaSsaParams):
369         * bindings/js/JSCryptoCustom.cpp:
370         (WebCore::JSCrypto::getRandomValues):
371         * bindings/js/JSCryptoKeySerializationJWK.cpp:
372         (WebCore::getJSArrayFromJSON):
373         (WebCore::getStringFromJSON):
374         (WebCore::getBooleanFromJSON):
375         (WebCore::getBigIntegerVectorFromJSON):
376         (WebCore::JSCryptoKeySerializationJWK::JSCryptoKeySerializationJWK):
377         (WebCore::JSCryptoKeySerializationJWK::reconcileAlgorithm):
378         (WebCore::tryJWKKeyOpsValue):
379         (WebCore::JSCryptoKeySerializationJWK::reconcileUsages):
380         (WebCore::JSCryptoKeySerializationJWK::keyDataOctetSequence):
381         (WebCore::JSCryptoKeySerializationJWK::keyDataRSAComponents):
382         (WebCore::JSCryptoKeySerializationJWK::keyData):
383         (WebCore::addJWKAlgorithmToJSON):
384         (WebCore::JSCryptoKeySerializationJWK::serialize):
385         * bindings/js/JSCryptoOperationData.cpp:
386         (WebCore::cryptoOperationDataFromJSValue):
387         * bindings/js/JSCustomElementInterface.cpp:
388         (WebCore::JSCustomElementInterface::upgradeElement):
389         * bindings/js/JSCustomElementRegistryCustom.cpp:
390         (WebCore::getCustomElementCallback):
391         (WebCore::JSCustomElementRegistry::define):
392         * bindings/js/JSDOMBinding.cpp:
393         (WebCore::setDOMException):
394         (WebCore::enforceRange):
395         (WebCore::toSmallerInt):
396         (WebCore::toSmallerUInt):
397         (WebCore::canAccessDocument):
398         (WebCore::throwTypeError):
399         (WebCore::throwNotSupportedError):
400         (WebCore::throwInvalidStateError):
401         (WebCore::throwSecurityError):
402         (WebCore::throwArgumentMustBeEnumError):
403         (WebCore::throwArgumentMustBeFunctionError):
404         (WebCore::throwArgumentTypeError):
405         (WebCore::throwArrayElementTypeError):
406         (WebCore::throwAttributeTypeError):
407         (WebCore::throwConstructorScriptExecutionContextUnavailableError):
408         (WebCore::throwSequenceTypeError):
409         (WebCore::throwNonFiniteTypeError):
410         (WebCore::throwGetterTypeError):
411         (WebCore::throwSetterTypeError):
412         (WebCore::throwThisTypeError):
413         (WebCore::callThrowTypeError):
414         * bindings/js/JSDOMBinding.h:
415         (WebCore::toJSSequence):
416         (WebCore::toRefPtrNativeArray):
417         (WebCore::toNativeArray):
418         * bindings/js/JSDOMConstructor.h:
419         (WebCore::JSDOMConstructorNotConstructable::callThrowTypeError):
420         (WebCore::JSBuiltinConstructor<JSClass>::callConstructor):
421         * bindings/js/JSDOMConvert.h:
422         (WebCore::convertWrapperType):
423         * bindings/js/JSDOMIterator.h:
424         (WebCore::iteratorCreate):
425         (WebCore::iteratorForEach):
426         (WebCore::JSDOMIteratorPrototype<JSWrapper>::next):
427         * bindings/js/JSDOMWindowCustom.cpp:
428         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
429         (WebCore::JSDOMWindow::put):
430         (WebCore::JSDOMWindow::showModalDialog):
431         (WebCore::handlePostMessage):
432         (WebCore::JSDOMWindow::setTimeout):
433         (WebCore::JSDOMWindow::setInterval):
434         * bindings/js/JSDataCueCustom.cpp:
435         (WebCore::constructJSDataCue):
436         * bindings/js/JSDictionary.cpp:
437         (WebCore::JSDictionary::convertValue):
438         * bindings/js/JSDocumentCustom.cpp:
439         (WebCore::JSDocument::createTouchList):
440         (WebCore::JSDocument::getCSSCanvasContext):
441         * bindings/js/JSFileCustom.cpp:
442         (WebCore::constructJSFile):
443         * bindings/js/JSHTMLAllCollectionCustom.cpp:
444         (WebCore::JSHTMLAllCollection::item):
445         * bindings/js/JSHTMLCanvasElementCustom.cpp:
446         (WebCore::JSHTMLCanvasElement::getContext):
447         (WebCore::JSHTMLCanvasElement::probablySupportsContext):
448         * bindings/js/JSHTMLDocumentCustom.cpp:
449         (WebCore::JSHTMLDocument::open):
450         * bindings/js/JSHTMLElementCustom.cpp:
451         (WebCore::constructJSHTMLElement):
452         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
453         (WebCore::JSHTMLFormControlsCollection::namedItem):
454         * bindings/js/JSHTMLInputElementCustom.cpp:
455         (WebCore::JSHTMLInputElement::selectionStart):
456         (WebCore::JSHTMLInputElement::setSelectionStart):
457         (WebCore::JSHTMLInputElement::selectionEnd):
458         (WebCore::JSHTMLInputElement::setSelectionEnd):
459         (WebCore::JSHTMLInputElement::selectionDirection):
460         (WebCore::JSHTMLInputElement::setSelectionDirection):
461         (WebCore::JSHTMLInputElement::setSelectionRange):
462         * bindings/js/JSHistoryCustom.cpp:
463         (WebCore::JSHistory::pushState):
464         (WebCore::JSHistory::replaceState):
465         * bindings/js/JSIDBDatabaseCustom.cpp:
466         (WebCore::JSIDBDatabase::createObjectStore):
467         * bindings/js/JSImageConstructor.cpp:
468         (WebCore::JSImageConstructor::construct):
469         * bindings/js/JSLocationCustom.cpp:
470         (WebCore::JSLocation::getOwnPropertySlotDelegate):
471         * bindings/js/JSMediaDevicesCustom.cpp:
472         (WebCore::JSMediaDevices::getUserMedia):
473         * bindings/js/JSMediaStreamTrackCustom.cpp:
474         (WebCore::JSMediaStreamTrack::getSettings):
475         (WebCore::JSMediaStreamTrack::getCapabilities):
476         * bindings/js/JSMessagePortCustom.cpp:
477         (WebCore::fillMessagePortArray):
478         * bindings/js/JSMessagePortCustom.h:
479         (WebCore::handlePostMessage):
480         * bindings/js/JSMockContentFilterSettingsCustom.cpp:
481         (WebCore::JSMockContentFilterSettings::setDecisionPoint):
482         (WebCore::toDecision):
483         * bindings/js/JSModuleLoader.cpp:
484         (WebCore::JSModuleLoader::evaluate):
485         * bindings/js/JSMutationObserverCustom.cpp:
486         (WebCore::constructJSMutationObserver):
487         * bindings/js/JSNodeCustom.cpp:
488         (WebCore::JSNode::insertBefore):
489         (WebCore::JSNode::replaceChild):
490         (WebCore::JSNode::removeChild):
491         (WebCore::JSNode::appendChild):
492         * bindings/js/JSNodeFilterCustom.cpp:
493         (WebCore::JSNodeFilter::acceptNode):
494         * bindings/js/JSPluginElementFunctions.cpp:
495         (WebCore::pluginElementPropertyGetter):
496         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
497         (WebCore::constructJSReadableStreamDefaultController):
498         (WebCore::constructJSReadableStreamDefaultReader):
499         * bindings/js/JSSVGLengthCustom.cpp:
500         (WebCore::JSSVGLength::setValue):
501         (WebCore::JSSVGLength::convertToSpecifiedUnits):
502         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
503         (WebCore::JSWebGL2RenderingContext::getIndexedParameter):
504         * bindings/js/JSWebGLRenderingContextBaseCustom.cpp:
505         (WebCore::getObjectParameter):
506         (WebCore::JSWebGLRenderingContextBase::getAttachedShaders):
507         (WebCore::JSWebGLRenderingContextBase::getExtension):
508         (WebCore::JSWebGLRenderingContextBase::getFramebufferAttachmentParameter):
509         (WebCore::JSWebGLRenderingContextBase::getParameter):
510         (WebCore::JSWebGLRenderingContextBase::getProgramParameter):
511         (WebCore::JSWebGLRenderingContextBase::getShaderParameter):
512         (WebCore::JSWebGLRenderingContextBase::getUniform):
513         (WebCore::dataFunctionf):
514         (WebCore::dataFunctioni):
515         (WebCore::dataFunctionMatrix):
516         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
517         (WebCore::cryptoKeyFormatFromJSValue):
518         (WebCore::cryptoKeyUsagesFromJSValue):
519         (WebCore::JSWebKitSubtleCrypto::encrypt):
520         (WebCore::JSWebKitSubtleCrypto::decrypt):
521         (WebCore::JSWebKitSubtleCrypto::sign):
522         (WebCore::JSWebKitSubtleCrypto::verify):
523         (WebCore::JSWebKitSubtleCrypto::digest):
524         (WebCore::JSWebKitSubtleCrypto::generateKey):
525         (WebCore::importKey):
526         (WebCore::JSWebKitSubtleCrypto::importKey):
527         (WebCore::exportKey):
528         (WebCore::JSWebKitSubtleCrypto::exportKey):
529         (WebCore::JSWebKitSubtleCrypto::wrapKey):
530         (WebCore::JSWebKitSubtleCrypto::unwrapKey):
531         * bindings/js/JSWorkerCustom.cpp:
532         (WebCore::constructJSWorker):
533         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
534         (WebCore::JSWorkerGlobalScope::setTimeout):
535         (WebCore::JSWorkerGlobalScope::setInterval):
536         * bindings/js/ReadableStreamDefaultController.cpp:
537         (WebCore::ReadableStreamDefaultController::invoke):
538         * bindings/js/SerializedScriptValue.cpp:
539         (WebCore::CloneBase::throwStackOverflow):
540         (WebCore::CloneDeserializer::throwValidationError):
541         (WebCore::SerializedScriptValue::maybeThrowExceptionIfSerializationFailed):
542         * bindings/js/WorkerScriptController.cpp:
543         (WebCore::WorkerScriptController::evaluate):
544         (WebCore::WorkerScriptController::setException):
545         * bindings/scripts/CodeGeneratorJS.pm:
546         (GenerateEnumerationImplementationContent):
547         (GenerateDictionaryImplementationContent):
548         (GenerateOverloadedFunctionOrConstructor):
549         (GenerateImplementation):
550         (GenerateFunctionCastedThis):
551         (GenerateArgumentsCountCheck):
552         (GenerateParametersCheck):
553         (GenerateConstructorDefinition):
554         * bindings/scripts/test/JS/JSInterfaceName.cpp:
555         (WebCore::jsInterfaceNameConstructor):
556         (WebCore::setJSInterfaceNameConstructor):
557         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
558         (WebCore::jsTestActiveDOMObjectExcitingAttr):
559         (WebCore::jsTestActiveDOMObjectConstructor):
560         (WebCore::setJSTestActiveDOMObjectConstructor):
561         (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
562         (WebCore::jsTestActiveDOMObjectPrototypeFunctionPostMessage):
563         * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
564         (WebCore::jsTestClassWithJSBuiltinConstructorConstructor):
565         (WebCore::setJSTestClassWithJSBuiltinConstructorConstructor):
566         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
567         (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
568         (WebCore::setJSTestCustomConstructorWithNoInterfaceObjectConstructor):
569         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
570         (WebCore::jsTestCustomNamedGetterConstructor):
571         (WebCore::setJSTestCustomNamedGetterConstructor):
572         (WebCore::jsTestCustomNamedGetterPrototypeFunctionAnotherFunction):
573         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
574         (WebCore::JSTestEventConstructorConstructor::construct):
575         (WebCore::jsTestEventConstructorAttr1):
576         (WebCore::jsTestEventConstructorAttr2):
577         (WebCore::jsTestEventConstructorAttr3):
578         (WebCore::jsTestEventConstructorConstructor):
579         (WebCore::setJSTestEventConstructorConstructor):
580         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
581         (WebCore::jsTestEventTargetConstructor):
582         (WebCore::setJSTestEventTargetConstructor):
583         (WebCore::jsTestEventTargetPrototypeFunctionItem):
584         * bindings/scripts/test/JS/JSTestException.cpp:
585         (WebCore::jsTestExceptionName):
586         (WebCore::jsTestExceptionConstructor):
587         (WebCore::setJSTestExceptionConstructor):
588         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
589         (WebCore::jsTestGenerateIsReachableConstructor):
590         (WebCore::setJSTestGenerateIsReachableConstructor):
591         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
592         (WebCore::jsTestGlobalObjectRegularAttribute):
593         (WebCore::jsTestGlobalObjectPublicAndPrivateAttribute):
594         (WebCore::jsTestGlobalObjectPublicAndPrivateConditionalAttribute):
595         (WebCore::jsTestGlobalObjectEnabledAtRuntimeAttribute):
596         (WebCore::jsTestGlobalObjectConstructor):
597         (WebCore::setJSTestGlobalObjectConstructor):
598         (WebCore::setJSTestGlobalObjectRegularAttribute):
599         (WebCore::setJSTestGlobalObjectPublicAndPrivateAttribute):
600         (WebCore::setJSTestGlobalObjectPublicAndPrivateConditionalAttribute):
601         (WebCore::setJSTestGlobalObjectEnabledAtRuntimeAttribute):
602         (WebCore::jsTestGlobalObjectInstanceFunctionRegularOperation):
603         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation1):
604         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation2):
605         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation):
606         (WebCore::jsTestGlobalObjectInstanceFunctionTestPrivateFunction):
607         * bindings/scripts/test/JS/JSTestInterface.cpp:
608         (WebCore::JSTestInterfaceConstructor::construct):
609         (WebCore::jsTestInterfaceConstructorImplementsStaticReadOnlyAttr):
610         (WebCore::jsTestInterfaceConstructorImplementsStaticAttr):
611         (WebCore::jsTestInterfaceImplementsStr1):
612         (WebCore::jsTestInterfaceImplementsStr2):
613         (WebCore::jsTestInterfaceImplementsStr3):
614         (WebCore::jsTestInterfaceImplementsNode):
615         (WebCore::jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr):
616         (WebCore::jsTestInterfaceConstructorSupplementalStaticAttr):
617         (WebCore::jsTestInterfaceSupplementalStr1):
618         (WebCore::jsTestInterfaceSupplementalStr2):
619         (WebCore::jsTestInterfaceSupplementalStr3):
620         (WebCore::jsTestInterfaceSupplementalNode):
621         (WebCore::jsTestInterfaceConstructor):
622         (WebCore::setJSTestInterfaceConstructor):
623         (WebCore::setJSTestInterfaceConstructorImplementsStaticAttr):
624         (WebCore::setJSTestInterfaceImplementsStr2):
625         (WebCore::setJSTestInterfaceImplementsStr3):
626         (WebCore::setJSTestInterfaceImplementsNode):
627         (WebCore::setJSTestInterfaceConstructorSupplementalStaticAttr):
628         (WebCore::setJSTestInterfaceSupplementalStr2):
629         (WebCore::setJSTestInterfaceSupplementalStr3):
630         (WebCore::setJSTestInterfaceSupplementalNode):
631         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod1):
632         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
633         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod3):
634         (WebCore::jsTestInterfaceConstructorFunctionImplementsMethod4):
635         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod1):
636         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
637         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod3):
638         (WebCore::jsTestInterfaceConstructorFunctionSupplementalMethod4):
639         * bindings/scripts/test/JS/JSTestIterable.cpp:
640         (WebCore::jsTestIterableConstructor):
641         (WebCore::setJSTestIterableConstructor):
642         * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
643         (WebCore::jsTestJSBuiltinConstructorTestAttributeCustom):
644         (WebCore::jsTestJSBuiltinConstructorTestAttributeRWCustom):
645         (WebCore::jsTestJSBuiltinConstructorConstructor):
646         (WebCore::setJSTestJSBuiltinConstructorConstructor):
647         (WebCore::setJSTestJSBuiltinConstructorTestAttributeRWCustom):
648         (WebCore::jsTestJSBuiltinConstructorPrototypeFunctionTestCustomFunction):
649         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
650         (WebCore::jsTestMediaQueryListListenerConstructor):
651         (WebCore::setJSTestMediaQueryListListenerConstructor):
652         (WebCore::jsTestMediaQueryListListenerPrototypeFunctionMethod):
653         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
654         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
655         (WebCore::jsTestNamedConstructorConstructor):
656         (WebCore::setJSTestNamedConstructorConstructor):
657         * bindings/scripts/test/JS/JSTestNode.cpp:
658         (WebCore::JSTestNodeConstructor::construct):
659         (WebCore::jsTestNodeName):
660         (WebCore::jsTestNodeConstructor):
661         (WebCore::setJSTestNodeConstructor):
662         (WebCore::setJSTestNodeName):
663         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
664         (WebCore::jsTestNondeterministicNondeterministicReadonlyAttr):
665         (WebCore::jsTestNondeterministicNondeterministicWriteableAttr):
666         (WebCore::jsTestNondeterministicNondeterministicExceptionAttr):
667         (WebCore::jsTestNondeterministicNondeterministicGetterExceptionAttr):
668         (WebCore::jsTestNondeterministicNondeterministicSetterExceptionAttr):
669         (WebCore::jsTestNondeterministicConstructor):
670         (WebCore::setJSTestNondeterministicConstructor):
671         (WebCore::setJSTestNondeterministicNondeterministicWriteableAttr):
672         (WebCore::setJSTestNondeterministicNondeterministicExceptionAttr):
673         (WebCore::setJSTestNondeterministicNondeterministicGetterExceptionAttr):
674         (WebCore::setJSTestNondeterministicNondeterministicSetterExceptionAttr):
675         (WebCore::jsTestNondeterministicPrototypeFunctionNondeterministicZeroArgFunction):
676         * bindings/scripts/test/JS/JSTestObj.cpp:
677         (WebCore::convert<TestObj::EnumType>):
678         (WebCore::convert<TestObj::Optional>):
679         (WebCore::convert<AlternateEnumName>):
680         (WebCore::convert<TestObj::EnumA>):
681         (WebCore::convert<TestObj::EnumB>):
682         (WebCore::convert<TestObj::EnumC>):
683         (WebCore::convert<TestObj::Kind>):
684         (WebCore::convert<TestObj::Size>):
685         (WebCore::convert<TestObj::Confidence>):
686         (WebCore::convertDictionary<TestObj::Dictionary>):
687         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
688         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
689         (WebCore::convertDictionary<AlternateDictionaryName>):
690         (WebCore::JSTestObjConstructor::construct):
691         (WebCore::jsTestObjReadOnlyLongAttr):
692         (WebCore::jsTestObjReadOnlyStringAttr):
693         (WebCore::jsTestObjReadOnlyTestObjAttr):
694         (WebCore::jsTestObjConstructorStaticReadOnlyLongAttr):
695         (WebCore::jsTestObjConstructorStaticStringAttr):
696         (WebCore::jsTestObjConstructorTestSubObj):
697         (WebCore::jsTestObjTestSubObjEnabledBySettingConstructor):
698         (WebCore::jsTestObjEnumAttr):
699         (WebCore::jsTestObjByteAttr):
700         (WebCore::jsTestObjOctetAttr):
701         (WebCore::jsTestObjShortAttr):
702         (WebCore::jsTestObjClampedShortAttr):
703         (WebCore::jsTestObjEnforceRangeShortAttr):
704         (WebCore::jsTestObjUnsignedShortAttr):
705         (WebCore::jsTestObjLongAttr):
706         (WebCore::jsTestObjLongLongAttr):
707         (WebCore::jsTestObjUnsignedLongLongAttr):
708         (WebCore::jsTestObjStringAttr):
709         (WebCore::jsTestObjUsvstringAttr):
710         (WebCore::jsTestObjTestObjAttr):
711         (WebCore::jsTestObjTestNullableObjAttr):
712         (WebCore::jsTestObjLenientTestObjAttr):
713         (WebCore::jsTestObjUnforgeableAttr):
714         (WebCore::jsTestObjStringAttrTreatingNullAsEmptyString):
715         (WebCore::jsTestObjUsvstringAttrTreatingNullAsEmptyString):
716         (WebCore::jsTestObjImplementationEnumAttr):
717         (WebCore::jsTestObjXMLObjAttr):
718         (WebCore::jsTestObjCreate):
719         (WebCore::jsTestObjReflectedStringAttr):
720         (WebCore::jsTestObjReflectedUSVStringAttr):
721         (WebCore::jsTestObjReflectedIntegralAttr):
722         (WebCore::jsTestObjReflectedUnsignedIntegralAttr):
723         (WebCore::jsTestObjReflectedBooleanAttr):
724         (WebCore::jsTestObjReflectedURLAttr):
725         (WebCore::jsTestObjReflectedUSVURLAttr):
726         (WebCore::jsTestObjReflectedCustomIntegralAttr):
727         (WebCore::jsTestObjReflectedCustomBooleanAttr):
728         (WebCore::jsTestObjReflectedCustomURLAttr):
729         (WebCore::jsTestObjEnabledAtRuntimeAttribute):
730         (WebCore::jsTestObjTypedArrayAttr):
731         (WebCore::jsTestObjAttrWithGetterException):
732         (WebCore::jsTestObjAttrWithGetterExceptionWithMessage):
733         (WebCore::jsTestObjAttrWithSetterException):
734         (WebCore::jsTestObjAttrWithSetterExceptionWithMessage):
735         (WebCore::jsTestObjStringAttrWithGetterException):
736         (WebCore::jsTestObjStringAttrWithSetterException):
737         (WebCore::jsTestObjCustomAttr):
738         (WebCore::jsTestObjOnfoo):
739         (WebCore::jsTestObjOnwebkitfoo):
740         (WebCore::jsTestObjWithScriptStateAttribute):
741         (WebCore::jsTestObjWithCallWithAndSetterCallWithAttribute):
742         (WebCore::jsTestObjWithScriptExecutionContextAttribute):
743         (WebCore::jsTestObjWithScriptStateAttributeRaises):
744         (WebCore::jsTestObjWithScriptExecutionContextAttributeRaises):
745         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute):
746         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
747         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
748         (WebCore::jsTestObjWithScriptArgumentsAndCallStackAttribute):
749         (WebCore::jsTestObjConditionalAttr1):
750         (WebCore::jsTestObjConditionalAttr2):
751         (WebCore::jsTestObjConditionalAttr3):
752         (WebCore::jsTestObjConditionalAttr4Constructor):
753         (WebCore::jsTestObjConditionalAttr5Constructor):
754         (WebCore::jsTestObjConditionalAttr6Constructor):
755         (WebCore::jsTestObjCachedAttribute1):
756         (WebCore::jsTestObjCachedAttribute2):
757         (WebCore::jsTestObjAnyAttribute):
758         (WebCore::jsTestObjContentDocument):
759         (WebCore::jsTestObjMutablePoint):
760         (WebCore::jsTestObjImmutablePoint):
761         (WebCore::jsTestObjStrawberry):
762         (WebCore::jsTestObjDescription):
763         (WebCore::jsTestObjId):
764         (WebCore::jsTestObjHash):
765         (WebCore::jsTestObjReplaceableAttribute):
766         (WebCore::jsTestObjNullableDoubleAttribute):
767         (WebCore::jsTestObjNullableLongAttribute):
768         (WebCore::jsTestObjNullableBooleanAttribute):
769         (WebCore::jsTestObjNullableStringAttribute):
770         (WebCore::jsTestObjNullableLongSettableAttribute):
771         (WebCore::jsTestObjNullableStringSettableAttribute):
772         (WebCore::jsTestObjNullableUSVStringSettableAttribute):
773         (WebCore::jsTestObjNullableStringValue):
774         (WebCore::jsTestObjAttribute):
775         (WebCore::jsTestObjAttributeWithReservedEnumType):
776         (WebCore::jsTestObjPutForwardsAttribute):
777         (WebCore::jsTestObjPutForwardsNullableAttribute):
778         (WebCore::jsTestObjStringifierAttribute):
779         (WebCore::jsTestObjConstructor):
780         (WebCore::setJSTestObjConstructor):
781         (WebCore::setJSTestObjConstructorStaticStringAttr):
782         (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
783         (WebCore::setJSTestObjEnumAttr):
784         (WebCore::setJSTestObjByteAttr):
785         (WebCore::setJSTestObjOctetAttr):
786         (WebCore::setJSTestObjShortAttr):
787         (WebCore::setJSTestObjClampedShortAttr):
788         (WebCore::setJSTestObjEnforceRangeShortAttr):
789         (WebCore::setJSTestObjUnsignedShortAttr):
790         (WebCore::setJSTestObjLongAttr):
791         (WebCore::setJSTestObjLongLongAttr):
792         (WebCore::setJSTestObjUnsignedLongLongAttr):
793         (WebCore::setJSTestObjStringAttr):
794         (WebCore::setJSTestObjUsvstringAttr):
795         (WebCore::setJSTestObjTestObjAttr):
796         (WebCore::setJSTestObjTestNullableObjAttr):
797         (WebCore::setJSTestObjLenientTestObjAttr):
798         (WebCore::setJSTestObjStringAttrTreatingNullAsEmptyString):
799         (WebCore::setJSTestObjUsvstringAttrTreatingNullAsEmptyString):
800         (WebCore::setJSTestObjImplementationEnumAttr):
801         (WebCore::setJSTestObjXMLObjAttr):
802         (WebCore::setJSTestObjCreate):
803         (WebCore::setJSTestObjReflectedStringAttr):
804         (WebCore::setJSTestObjReflectedUSVStringAttr):
805         (WebCore::setJSTestObjReflectedIntegralAttr):
806         (WebCore::setJSTestObjReflectedUnsignedIntegralAttr):
807         (WebCore::setJSTestObjReflectedBooleanAttr):
808         (WebCore::setJSTestObjReflectedURLAttr):
809         (WebCore::setJSTestObjReflectedUSVURLAttr):
810         (WebCore::setJSTestObjReflectedCustomIntegralAttr):
811         (WebCore::setJSTestObjReflectedCustomBooleanAttr):
812         (WebCore::setJSTestObjReflectedCustomURLAttr):
813         (WebCore::setJSTestObjEnabledAtRuntimeAttribute):
814         (WebCore::setJSTestObjTypedArrayAttr):
815         (WebCore::setJSTestObjAttrWithGetterException):
816         (WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
817         (WebCore::setJSTestObjAttrWithSetterException):
818         (WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
819         (WebCore::setJSTestObjStringAttrWithGetterException):
820         (WebCore::setJSTestObjStringAttrWithSetterException):
821         (WebCore::setJSTestObjCustomAttr):
822         (WebCore::setJSTestObjOnfoo):
823         (WebCore::setJSTestObjOnwebkitfoo):
824         (WebCore::setJSTestObjWithScriptStateAttribute):
825         (WebCore::setJSTestObjWithCallWithAndSetterCallWithAttribute):
826         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
827         (WebCore::setJSTestObjWithScriptStateAttributeRaises):
828         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
829         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
830         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
831         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
832         (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
833         (WebCore::setJSTestObjConditionalAttr1):
834         (WebCore::setJSTestObjConditionalAttr2):
835         (WebCore::setJSTestObjConditionalAttr3):
836         (WebCore::setJSTestObjConditionalAttr4Constructor):
837         (WebCore::setJSTestObjConditionalAttr5Constructor):
838         (WebCore::setJSTestObjConditionalAttr6Constructor):
839         (WebCore::setJSTestObjAnyAttribute):
840         (WebCore::setJSTestObjMutablePoint):
841         (WebCore::setJSTestObjImmutablePoint):
842         (WebCore::setJSTestObjStrawberry):
843         (WebCore::setJSTestObjId):
844         (WebCore::setJSTestObjReplaceableAttribute):
845         (WebCore::setJSTestObjNullableLongSettableAttribute):
846         (WebCore::setJSTestObjNullableStringSettableAttribute):
847         (WebCore::setJSTestObjNullableUSVStringSettableAttribute):
848         (WebCore::setJSTestObjNullableStringValue):
849         (WebCore::setJSTestObjAttributeWithReservedEnumType):
850         (WebCore::setJSTestObjPutForwardsAttribute):
851         (WebCore::setJSTestObjPutForwardsNullableAttribute):
852         (WebCore::setJSTestObjStringifierAttribute):
853         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1):
854         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2):
855         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation):
856         (WebCore::jsTestObjPrototypeFunctionVoidMethod):
857         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
858         (WebCore::jsTestObjPrototypeFunctionByteMethod):
859         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
860         (WebCore::jsTestObjPrototypeFunctionOctetMethod):
861         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
862         (WebCore::jsTestObjPrototypeFunctionLongMethod):
863         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
864         (WebCore::jsTestObjPrototypeFunctionObjMethod):
865         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
866         (WebCore::jsTestObjInstanceFunctionUnforgeableMethod):
867         (WebCore::jsTestObjPrototypeFunctionMethodWithArgTreatingNullAsEmptyString):
868         (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter):
869         (WebCore::jsTestObjPrototypeFunctionNullableStringMethod):
870         (WebCore::jsTestObjConstructorFunctionNullableStringStaticMethod):
871         (WebCore::jsTestObjPrototypeFunctionNullableStringSpecialMethod):
872         (WebCore::jsTestObjPrototypeFunctionMethodWithEnumArg):
873         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArg):
874         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalEnumArgAndDefaultValue):
875         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
876         (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArg):
877         (WebCore::jsTestObjPrototypeFunctionMethodWithNullableUSVStringArg):
878         (WebCore::jsTestObjPrototypeFunctionMethodWithUSVStringArgTreatingNullAsEmptyString):
879         (WebCore::jsTestObjPrototypeFunctionSerializedValue):
880         (WebCore::jsTestObjPrototypeFunctionOptionsObject):
881         (WebCore::jsTestObjPrototypeFunctionMethodWithException):
882         (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionWithMessage):
883         (WebCore::jsTestObjPrototypeFunctionCustomMethod):
884         (WebCore::jsTestObjPrototypeFunctionCustomMethodWithArgs):
885         (WebCore::jsTestObjPrototypeFunctionPrivateMethod):
886         (WebCore::jsTestObjPrototypeFunctionPublicAndPrivateMethod):
887         (WebCore::jsTestObjPrototypeFunctionAddEventListener):
888         (WebCore::jsTestObjPrototypeFunctionRemoveEventListener):
889         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoid):
890         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObj):
891         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidException):
892         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException):
893         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContext):
894         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState):
895         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException):
896         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces):
897         (WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStack):
898         (WebCore::jsTestObjPrototypeFunctionWithDocumentArgument):
899         (WebCore::jsTestObjPrototypeFunctionWithCallerDocumentArgument):
900         (WebCore::jsTestObjPrototypeFunctionWithCallerWindowArgument):
901         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArg):
902         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue):
903         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndOptionalArg):
904         (WebCore::jsTestObjPrototypeFunctionMethodWithNonOptionalArgAndTwoOptionalArgs):
905         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalString):
906         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVString):
907         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicString):
908         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue):
909         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringAndDefaultValue):
910         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNull):
911         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsUndefined):
912         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNull):
913         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsEmptyString):
914         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUSVStringIsEmptyString):
915         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyString):
916         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaN):
917         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaN):
918         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLong):
919         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalLongLongIsZero):
920         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLong):
921         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalUnsignedLongLongIsZero):
922         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequence):
923         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalSequenceIsEmpty):
924         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBoolean):
925         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalBooleanIsFalse):
926         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAny):
927         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapper):
928         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalNullableWrapperIsNull):
929         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalXPathNSResolver):
930         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackArg):
931         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackArg):
932         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackAndOptionalArg):
933         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionArg):
934         (WebCore::jsTestObjPrototypeFunctionMethodWithNonCallbackArgAndCallbackFunctionArg):
935         (WebCore::jsTestObjPrototypeFunctionMethodWithCallbackFunctionAndOptionalArg):
936         (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackAndOptionalArg):
937         (WebCore::jsTestObjConstructorFunctionStaticMethodWithCallbackArg):
938         (WebCore::jsTestObjPrototypeFunctionConditionalMethod1):
939         (WebCore::jsTestObjPrototypeFunctionConditionalMethod2):
940         (WebCore::jsTestObjPrototypeFunctionConditionalMethod3):
941         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
942         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
943         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
944         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
945         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod5):
946         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod6):
947         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
948         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
949         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
950         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
951         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
952         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12):
953         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod):
954         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
955         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
956         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter):
957         (WebCore::jsTestObjConstructorFunctionClassMethod):
958         (WebCore::jsTestObjConstructorFunctionClassMethodWithOptional):
959         (WebCore::jsTestObjConstructorFunctionClassMethod2):
960         (WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
961         (WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
962         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1):
963         (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
964         (WebCore::jsTestObjPrototypeFunctionClassMethodWithEnforceRange):
965         (WebCore::jsTestObjPrototypeFunctionMethodWithUnsignedLongSequence):
966         (WebCore::jsTestObjPrototypeFunctionStringArrayFunction):
967         (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
968         (WebCore::jsTestObjPrototypeFunctionMethodWithAndWithoutNullableSequence):
969         (WebCore::jsTestObjPrototypeFunctionGetElementById):
970         (WebCore::jsTestObjPrototypeFunctionGetSVGDocument):
971         (WebCore::jsTestObjPrototypeFunctionConvert1):
972         (WebCore::jsTestObjPrototypeFunctionConvert2):
973         (WebCore::jsTestObjPrototypeFunctionConvert3):
974         (WebCore::jsTestObjPrototypeFunctionConvert4):
975         (WebCore::jsTestObjPrototypeFunctionMutablePointFunction):
976         (WebCore::jsTestObjPrototypeFunctionImmutablePointFunction):
977         (WebCore::jsTestObjPrototypeFunctionOrange):
978         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
979         (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
980         (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
981         (WebCore::jsTestObjPrototypeFunctionAny):
982         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
983         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
984         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
985         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
986         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
987         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
988         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
989         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
990         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):
991         (WebCore::jsTestObjPrototypeFunctionMethodWithNeedsCustomElementReactionStack):
992         (WebCore::jsTestObjPrototypeFunctionConditionalOverload1):
993         (WebCore::jsTestObjPrototypeFunctionConditionalOverload2):
994         (WebCore::jsTestObjPrototypeFunctionConditionalOverload):
995         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1):
996         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2):
997         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload):
998         (WebCore::jsTestObjPrototypeFunctionAttachShadowRoot):
999         (WebCore::jsTestObjPrototypeFunctionToString):
1000         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1001         (WebCore::constructJSTestOverloadedConstructors1):
1002         (WebCore::constructJSTestOverloadedConstructors2):
1003         (WebCore::constructJSTestOverloadedConstructors3):
1004         (WebCore::constructJSTestOverloadedConstructors4):
1005         (WebCore::constructJSTestOverloadedConstructors5):
1006         (WebCore::JSTestOverloadedConstructorsConstructor::construct):
1007         (WebCore::jsTestOverloadedConstructorsConstructor):
1008         (WebCore::setJSTestOverloadedConstructorsConstructor):
1009         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
1010         (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
1011         (WebCore::constructJSTestOverloadedConstructorsWithSequence2):
1012         (WebCore::JSTestOverloadedConstructorsWithSequenceConstructor::construct):
1013         (WebCore::jsTestOverloadedConstructorsWithSequenceConstructor):
1014         (WebCore::setJSTestOverloadedConstructorsWithSequenceConstructor):
1015         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1016         (WebCore::jsTestOverrideBuiltinsConstructor):
1017         (WebCore::setJSTestOverrideBuiltinsConstructor):
1018         (WebCore::jsTestOverrideBuiltinsPrototypeFunctionNamedItem):
1019         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1020         (WebCore::jsTestSerializedScriptValueInterfaceValue):
1021         (WebCore::jsTestSerializedScriptValueInterfaceReadonlyValue):
1022         (WebCore::jsTestSerializedScriptValueInterfaceCachedValue):
1023         (WebCore::jsTestSerializedScriptValueInterfacePorts):
1024         (WebCore::jsTestSerializedScriptValueInterfaceCachedReadonlyValue):
1025         (WebCore::jsTestSerializedScriptValueInterfaceConstructor):
1026         (WebCore::setJSTestSerializedScriptValueInterfaceConstructor):
1027         (WebCore::setJSTestSerializedScriptValueInterfaceValue):
1028         (WebCore::setJSTestSerializedScriptValueInterfaceCachedValue):
1029         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1030         (WebCore::JSTestTypedefsConstructor::construct):
1031         (WebCore::jsTestTypedefsUnsignedLongLongAttr):
1032         (WebCore::jsTestTypedefsImmutableSerializedScriptValue):
1033         (WebCore::jsTestTypedefsConstructorTestSubObj):
1034         (WebCore::jsTestTypedefsAttrWithGetterException):
1035         (WebCore::jsTestTypedefsAttrWithSetterException):
1036         (WebCore::jsTestTypedefsStringAttrWithGetterException):
1037         (WebCore::jsTestTypedefsStringAttrWithSetterException):
1038         (WebCore::jsTestTypedefsConstructor):
1039         (WebCore::setJSTestTypedefsConstructor):
1040         (WebCore::setJSTestTypedefsUnsignedLongLongAttr):
1041         (WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
1042         (WebCore::setJSTestTypedefsAttrWithGetterException):
1043         (WebCore::setJSTestTypedefsAttrWithSetterException):
1044         (WebCore::setJSTestTypedefsStringAttrWithGetterException):
1045         (WebCore::setJSTestTypedefsStringAttrWithSetterException):
1046         (WebCore::jsTestTypedefsPrototypeFunctionFunc):
1047         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
1048         (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
1049         (WebCore::jsTestTypedefsPrototypeFunctionNullableSequenceArg):
1050         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
1051         (WebCore::jsTestTypedefsPrototypeFunctionImmutablePointFunction):
1052         (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction):
1053         (WebCore::jsTestTypedefsPrototypeFunctionStringSequenceFunction2):
1054         (WebCore::jsTestTypedefsPrototypeFunctionCallWithSequenceThatRequiresInclude):
1055         (WebCore::jsTestTypedefsPrototypeFunctionMethodWithException):
1056         * bindings/scripts/test/JS/JSattribute.cpp:
1057         (WebCore::jsattributeReadonly):
1058         (WebCore::jsattributeConstructor):
1059         (WebCore::setJSattributeConstructor):
1060         * bindings/scripts/test/JS/JSreadonly.cpp:
1061         (WebCore::jsreadonlyConstructor):
1062         (WebCore::setJSreadonlyConstructor):
1063         * bridge/c/c_instance.cpp:
1064         (JSC::Bindings::CInstance::moveGlobalExceptionToExecState):
1065         (JSC::Bindings::CInstance::invokeMethod):
1066         (JSC::Bindings::CInstance::invokeDefaultMethod):
1067         (JSC::Bindings::CInstance::invokeConstruct):
1068         (JSC::Bindings::CInstance::toJSPrimitive):
1069         * bridge/objc/objc_instance.mm:
1070         (ObjcInstance::moveGlobalExceptionToExecState):
1071         (ObjcInstance::invokeMethod):
1072         * bridge/objc/objc_runtime.mm:
1073         (JSC::Bindings::ObjcField::valueFromInstance):
1074         (JSC::Bindings::ObjcField::setValueToInstance):
1075         (JSC::Bindings::ObjcArray::setValueAt):
1076         (JSC::Bindings::ObjcArray::valueAt):
1077         (JSC::Bindings::callObjCFallbackObject):
1078         * bridge/objc/objc_utility.h:
1079         * bridge/objc/objc_utility.mm:
1080         (JSC::Bindings::throwError):
1081         * bridge/runtime_array.cpp:
1082         (JSC::RuntimeArray::lengthGetter):
1083         (JSC::RuntimeArray::put):
1084         (JSC::RuntimeArray::putByIndex):
1085         * bridge/runtime_method.cpp:
1086         (JSC::RuntimeMethod::lengthGetter):
1087         (JSC::callRuntimeMethod):
1088         * bridge/runtime_object.cpp:
1089         (JSC::Bindings::RuntimeObject::fallbackObjectGetter):
1090         (JSC::Bindings::RuntimeObject::fieldGetter):
1091         (JSC::Bindings::RuntimeObject::methodGetter):
1092         (JSC::Bindings::RuntimeObject::getOwnPropertySlot):
1093         (JSC::Bindings::RuntimeObject::put):
1094         (JSC::Bindings::RuntimeObject::defaultValue):
1095         (JSC::Bindings::RuntimeObject::getOwnPropertyNames):
1096         (JSC::Bindings::RuntimeObject::throwInvalidAccessError):
1097         * bridge/runtime_object.h:
1098
1099 2016-08-30  Brent Fulgham  <bfulgham@apple.com>
1100
1101         Use of uninitialised memory in TransformationMatrx::blend4()
1102         https://bugs.webkit.org/show_bug.cgi?id=134621
1103         <rdar://problem/27337539>
1104
1105         Reviewed by Dean Jackson.
1106
1107         Change is based on the Blink change (patch by <alancutter@chromium.org>):
1108         <https://src.chromium.org/viewvc/blink?revision=177453&view=revision>
1109
1110         TransformationMatrix::blend() was attempting to blend between non-invertable
1111         matricies. This resulted in garbage stack variables being used.
1112         This patch ensures that blend() will fall back to a 50% step interpolation
1113         when one of the sides are not invertable.
1114
1115         Tested by new TransformationMatrix test in TestWebKitAPI.
1116
1117         * platform/graphics/transforms/TransformationMatrix.cpp:
1118         (WebCore::TransformationMatrix::blend2): Properly handle failure in the
1119         decompose method calls.
1120         (WebCore::TransformationMatrix::blend4): Ditto.
1121
1122 2016-08-30  Alex Christensen  <achristensen@webkit.org>
1123
1124         URLParser should handle relative URLs that start with //
1125         https://bugs.webkit.org/show_bug.cgi?id=161364
1126
1127         Reviewed by Darin Adler.
1128
1129         Covered by an API test.
1130
1131         * platform/URLParser.cpp:
1132         (WebCore::URLParser::parse):
1133
1134 2016-08-30  Wenson Hsieh  <wenson_hsieh@apple.com>
1135
1136         Fix a typo introduced in r205184.
1137         https://bugs.webkit.org/show_bug.cgi?id=161380
1138
1139         Reviewed by Tim Horton.
1140
1141         Fixes a typo in an accessibility string: "Exit fullscreen" => "Exit Fullscreen"
1142
1143         * platform/LocalizedStrings.cpp:
1144         (WebCore::exitFullScreenButtonAccessibilityTitle):
1145
1146 2016-08-30  Youenn Fablet  <youenn@apple.com>
1147
1148         [Fetch API] Blob not found URL should result in a network error
1149         https://bugs.webkit.org/show_bug.cgi?id=161381
1150
1151         Reviewed by Sam Weinig.
1152
1153         Covered by rebased and updated tests.
1154
1155         Raising a network error if no blob can be found from the URL.
1156         It is no longer notified by a 404 response.
1157
1158         Updated FileReaderLoader to generate the correct exception.
1159
1160         Made some clean-up in the code, in particular adding an enum class for BlobResourceHandle errors.
1161
1162         * fileapi/FileReaderLoader.cpp:
1163         (WebCore::FileReaderLoader::didFail):
1164         (WebCore::FileReaderLoader::toErrorCode):
1165         (WebCore::FileReaderLoader::httpStatusCodeToErrorCode):
1166         * fileapi/FileReaderLoader.h:
1167         * platform/network/BlobResourceHandle.cpp:
1168         (WebCore::BlobResourceHandle::loadResourceSynchronously):
1169         (WebCore::BlobResourceHandle::doStart):
1170         (WebCore::BlobResourceHandle::didGetSize):
1171         (WebCore::BlobResourceHandle::readSync):
1172         (WebCore::BlobResourceHandle::readFileSync):
1173         (WebCore::BlobResourceHandle::readAsync):
1174         (WebCore::BlobResourceHandle::didOpen):
1175         (WebCore::BlobResourceHandle::didRead):
1176         (WebCore::BlobResourceHandle::failed):
1177         (WebCore::BlobResourceHandle::notifyResponse):
1178         (WebCore::BlobResourceHandle::notifyResponseOnError):
1179         (WebCore::BlobResourceHandle::notifyFail):
1180         * platform/network/BlobResourceHandle.h:
1181
1182 2016-08-30  Youenn Fablet  <youenn@apple.com>
1183
1184         [Fetch API] Body mix-in text() should decode data as UTF-8
1185         https://bugs.webkit.org/show_bug.cgi?id=161372
1186
1187         Reviewed by Sam Weinig.
1188
1189         Test: imported/w3c/web-platform-tests/fetch/api/basic/text-utf8.html
1190
1191         UsingTextResourceDecoder to decode data as UTF-8.
1192         Making sure to prepend BOM if there is none, as specified in https://encoding.spec.whatwg.org/#utf-8-decode.
1193
1194         * Modules/fetch/FetchBodyConsumer.cpp:
1195         (WebCore::shouldPrependBOM):
1196         (WebCore::textFromUTF8):
1197         (WebCore::FetchBodyConsumer::resolveWithData):
1198         (WebCore::FetchBodyConsumer::takeAsText):
1199
1200 2016-08-30  Zalan Bujtas  <zalan@apple.com>
1201
1202         ASSERTION FAILED: opportunitiesInRun <= expansionOpportunityCount in WebCore::computeExpansionForJustifiedText
1203         https://bugs.webkit.org/show_bug.cgi?id=139393
1204         <rdar://problem/27704243>
1205
1206         Reviewed by Myles C. Maxfield.
1207
1208         This patch ensures that we always remove a valid 'after expansion' opportunity (even when the last entry
1209         in the opportunities list is 0).
1210
1211         Test: fast/text/assert-on-expansion-opportunity.html
1212
1213         * rendering/RenderBlockLineLayout.cpp:
1214         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
1215
1216 2016-08-30  Wenson Hsieh  <wenson_hsieh@apple.com>
1217
1218         Exit fullscreen button in fullscreen media playback needs an accessibility string
1219         https://bugs.webkit.org/show_bug.cgi?id=161380
1220
1221         Reviewed by Beth Dakin.
1222
1223         Adds an accessibility string for the exit fullscreen button.
1224
1225         * English.lproj/Localizable.strings:
1226         * platform/LocalizedStrings.cpp:
1227         (WebCore::exitFullScreenButtonAccessibilityTitle):
1228         * platform/LocalizedStrings.h:
1229
1230 2016-08-30  Antti Koivisto  <antti@apple.com>
1231
1232         Remove StylePendingImage
1233         https://bugs.webkit.org/show_bug.cgi?id=161245
1234
1235         Reviewed by Andreas Kling.
1236
1237         Instances of this confusing type are used as placeholders during style resolution.
1238         We can get rid of it and make "pending" a state of StyleImage. This simplies the code and
1239         will allow further improvements.
1240
1241         * WebCore.xcodeproj/project.pbxproj:
1242         * css/CSSCrossfadeValue.cpp:
1243         (WebCore::CSSCrossfadeValue::isPending):
1244         (WebCore::CSSCrossfadeValue::blend):
1245         * css/CSSCrossfadeValue.h:
1246         * css/CSSCursorImageValue.cpp:
1247         (WebCore::CSSCursorImageValue::CSSCursorImageValue):
1248         (WebCore::CSSCursorImageValue::~CSSCursorImageValue):
1249
1250             Save the original URL since the underlying CSSImageValue may change.
1251
1252         (WebCore::CSSCursorImageValue::updateCursorElement):
1253         (WebCore::CSSCursorImageValue::cursorElementRemoved):
1254         (WebCore::CSSCursorImageValue::cursorElementChanged):
1255         (WebCore::CSSCursorImageValue::loadImage):
1256         (WebCore::CSSCursorImageValue::styleImage):
1257         (WebCore::CSSCursorImageValue::isSVGCursor):
1258         (WebCore::CSSCursorImageValue::cachedImageURL):
1259         (WebCore::CSSCursorImageValue::updateCachedImage):
1260         (WebCore::CSSCursorImageValue::detachPendingImage): Deleted.
1261         (WebCore::CSSCursorImageValue::cachedImage): Deleted.
1262         (WebCore::CSSCursorImageValue::cachedOrPendingImage): Deleted.
1263         (WebCore::CSSCursorImageValue::clearCachedImage): Deleted.
1264         * css/CSSCursorImageValue.h:
1265         * css/CSSFilterImageValue.cpp:
1266         (WebCore::CSSFilterImageValue::isPending):
1267         * css/CSSFilterImageValue.h:
1268         * css/CSSImageGeneratorValue.cpp:
1269         (WebCore::CSSImageGeneratorValue::isPending):
1270         (WebCore::CSSImageGeneratorValue::subimageIsPending):
1271         (WebCore::CSSImageGeneratorValue::cachedImageForCSSValue):
1272         * css/CSSImageGeneratorValue.h:
1273         * css/CSSImageSetValue.cpp:
1274         (WebCore::CSSImageSetValue::~CSSImageSetValue):
1275         (WebCore::CSSImageSetValue::loadBestFitImage):
1276         (WebCore::CSSImageSetValue::styleImage):
1277         (WebCore::CSSImageSetValue::traverseSubresources):
1278         (WebCore::CSSImageSetValue::detachPendingImage): Deleted.
1279         (WebCore::CSSImageSetValue::bestFitImage): Deleted.
1280         (WebCore::CSSImageSetValue::cachedOrPendingImageSet): Deleted.
1281         * css/CSSImageSetValue.h:
1282         * css/CSSImageValue.cpp:
1283         (WebCore::CSSImageValue::CSSImageValue):
1284         (WebCore::CSSImageValue::~CSSImageValue):
1285         (WebCore::CSSImageValue::isPending):
1286         (WebCore::CSSImageValue::styleImage):
1287         (WebCore::CSSImageValue::loadImage):
1288         (WebCore::CSSImageValue::traverseSubresources):
1289         (WebCore::CSSImageValue::detachPendingImage): Deleted.
1290         (WebCore::CSSImageValue::cachedOrPendingImage): Deleted.
1291         (WebCore::CSSImageValue::cachedImage): Deleted.
1292         * css/CSSImageValue.h:
1293         (WebCore::CSSImageValue::create):
1294         * css/StyleResolver.cpp:
1295         (WebCore::StyleResolver::cachedOrPendingFromValue):
1296         (WebCore::StyleResolver::generatedOrPendingFromValue):
1297         (WebCore::StyleResolver::setOrPendingFromValue):
1298         (WebCore::StyleResolver::cursorOrPendingFromValue):
1299         * page/PageSerializer.cpp:
1300         (WebCore::PageSerializer::retrieveResourcesForProperties):
1301         * page/animation/CSSPropertyAnimation.cpp:
1302         (WebCore::blendFilter):
1303         (WebCore::crossfadeBlend):
1304         * rendering/RenderImageResourceStyleImage.cpp:
1305         (WebCore::RenderImageResourceStyleImage::image):
1306         * rendering/shapes/ShapeOutsideInfo.cpp:
1307         (WebCore::ShapeOutsideInfo::createShapeForImage):
1308         * rendering/style/StyleCachedImage.cpp:
1309         (WebCore::StyleCachedImage::StyleCachedImage):
1310         (WebCore::StyleCachedImage::~StyleCachedImage):
1311         (WebCore::StyleCachedImage::setCachedImage):
1312         (WebCore::StyleCachedImage::cssValue):
1313         (WebCore::StyleCachedImage::canRender):
1314         (WebCore::StyleCachedImage::isPending):
1315         (WebCore::StyleCachedImage::isLoaded):
1316         (WebCore::StyleCachedImage::errorOccurred):
1317         (WebCore::StyleCachedImage::imageSize):
1318         (WebCore::StyleCachedImage::imageHasRelativeWidth):
1319         (WebCore::StyleCachedImage::imageHasRelativeHeight):
1320         (WebCore::StyleCachedImage::computeIntrinsicDimensions):
1321         (WebCore::StyleCachedImage::usesImageContainerSize):
1322         (WebCore::StyleCachedImage::setContainerSizeForRenderer):
1323         (WebCore::StyleCachedImage::addClient):
1324         (WebCore::StyleCachedImage::removeClient):
1325         (WebCore::StyleCachedImage::image):
1326         (WebCore::StyleCachedImage::knownToBeOpaque):
1327         * rendering/style/StyleCachedImage.h:
1328         * rendering/style/StyleGeneratedImage.cpp:
1329         (WebCore::StyleGeneratedImage::isPending):
1330         * rendering/style/StyleGeneratedImage.h:
1331         * rendering/style/StyleImage.h:
1332         (WebCore::StyleImage::isCachedImage):
1333         (WebCore::StyleImage::StyleImage):
1334         (WebCore::StyleImage::canRender): Deleted.
1335         (WebCore::StyleImage::isPendingImage): Deleted.
1336         * rendering/style/StylePendingImage.h: Removed.
1337         * style/StylePendingResources.cpp:
1338         (WebCore::Style::loadPendingImage):
1339         (WebCore::Style::loadPendingImages):
1340
1341 2016-08-30  Philippe Normand  <pnormand@igalia.com>
1342
1343         [GStreamer] bump required version to 1.2.3
1344         https://bugs.webkit.org/show_bug.cgi?id=159667
1345
1346         Reviewed by Xabier Rodriguez Calvar.
1347
1348         GStreamer 1.0.3 was released almost 4 years ago. GStreamer 1.2.3
1349         being the version shipped in the Ubuntu LTS (14.04) it
1350         feels reasonable to bump our requirement. Other major
1351         distributions like Debian Jessie and Fedora ship GStreamer 1.4.x
1352         already.
1353
1354         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1355         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
1356         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1357         (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Deleted.
1358         * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1359         (webkitVideoSinkProposeAllocation): Deleted.
1360         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1361         (webKitWebSrcQueryWithParent): Deleted.
1362
1363 2016-08-29  Alex Christensen  <achristensen@webkit.org>
1364
1365         Fix Windows build after r205161
1366
1367         * bindings/js/JSPerformanceTimingCustom.cpp:
1368
1369 2016-08-29  Chris Dumez  <cdumez@apple.com>
1370
1371         We should throw a SecurityError when denying setting a cross-origin Location property
1372         https://bugs.webkit.org/show_bug.cgi?id=161368
1373
1374         Reviewed by Ryosuke Niwa.
1375
1376         We should throw a SecurityError when denying setting a cross-origin
1377         Location property:
1378         - https://html.spec.whatwg.org/#location-set
1379         - https://html.spec.whatwg.org/#crossoriginset-(-o,-p,-v,-receiver-)
1380         - https://html.spec.whatwg.org/#location-getownproperty
1381
1382         Firefox and Chrome already throw. We currently ignore and log an error
1383         message.
1384
1385         No new tests, updated existing tests.
1386
1387         * bindings/js/JSLocationCustom.cpp:
1388         (WebCore::JSLocation::putDelegate):
1389
1390 2016-08-29  Brent Fulgham  <bfulgham@apple.com>
1391
1392         Avoid holding GlyphData in MathOperator
1393         https://bugs.webkit.org/show_bug.cgi?id=161256
1394         <rdar://problem/28033400>
1395
1396         Reviewed by Myles C. Maxfield.
1397
1398         Do not cache GlyphData in MathOperator elements, because the fonts referenced in the
1399         GlyphData may be purged during low-memory conditions. Instead, we should store either
1400         the relevant CodePoint, or the fallback Glyph (for the current system font).
1401
1402         Added an initialization function for GlyphAssemblyData, since unions containing structs
1403         do not properly call constructors, resulting in garbage font/glyph content.
1404
1405         No new tests. Changes are covered by existing MathML test suite.
1406
1407         * rendering/mathml/MathOperator.cpp:
1408         (WebCore::MathOperator::GlyphAssemblyData::initialize): Added.
1409         (WebCore::MathOperator::MathOperator): Initialize m_assembly/m_variant.
1410         (WebCore::MathOperator::setSizeVariant): Only store the glyph, not the font.
1411         (WebCore::glyphDataForCodePointOrFallbackGlyph): Added helper function.
1412         (WebCore::MathOperator::setGlyphAssembly): Do not rely on stored GlyphData.
1413         (WebCore::MathOperator::calculateGlyphAssemblyFallback): Remove unneeded argument. Check
1414         if a fallback glyph is being used and remember for later.
1415         (WebCore::MathOperator::calculateStretchyData): Do not rely on stored GlyphData.
1416         (WebCore::MathOperator::fillWithVerticalExtensionGlyph): Ditto.
1417         (WebCore::MathOperator::fillWithHorizontalExtensionGlyph): Ditto.
1418         (WebCore::MathOperator::paintVerticalGlyphAssembly): Ditto.
1419         (WebCore::MathOperator::paintHorizontalGlyphAssembly): Ditto.
1420         (WebCore::MathOperator::paint): Ditto.
1421         * rendering/mathml/MathOperator.h:
1422         (WebCore::MathOperator::GlyphAssemblyData::hasExtension): Added.
1423         (WebCore::MathOperator::GlyphAssemblyData::hasMiddle): Added.
1424         (WebCore::MathOperator::MathOperator): Deleted.
1425
1426 2016-08-29  Dean Jackson  <dino@apple.com>
1427
1428         JSON.stringify returns empty when used with performance.timing.
1429         https://bugs.webkit.org/show_bug.cgi?id=151813
1430         <rdar://problem/28066067>
1431
1432         Reviewed by Sam Weinig.
1433
1434         While we are waiting for our bindings generator to handle
1435         "serializer", add a custom toJSON function that allows
1436         performance.timing to be stringified.
1437
1438         Test: fast/dom/webtiming-performance-timing-stringify.html
1439
1440         * CMakeLists.txt: New file added.
1441         * WebCore.xcodeproj/project.pbxproj: New file added.
1442         * bindings/js/JSPerformanceTimingCustom.cpp: Added. Implements toJSON.
1443         (WebCore::JSPerformanceTiming::toJSON):
1444         * page/PerformanceTiming.idl: Add toJSON().
1445
1446 2016-08-29  Chris Dumez  <cdumez@apple.com>
1447
1448         Regression(r204923): It should be possible to set 'Location.href' cross origin
1449         https://bugs.webkit.org/show_bug.cgi?id=161343
1450         <rdar://problem/28063361>
1451
1452         Reviewed by Ryosuke Niwa.
1453
1454         It should be possible to set 'Location.href' cross origin:
1455         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
1456
1457         Firefox and Chrome allow this but we throw a SecurityError.
1458
1459         We already allow setting crossOrigin.window.location which is equivalent.
1460
1461         No new tests, updated existing test.
1462
1463         * bindings/js/JSLocationCustom.cpp:
1464         (WebCore::JSLocation::putDelegate):
1465         Refactor the [Put] delegate so that it does not log a security error
1466         when setting 'href' attribute, given that setting it works as expected.
1467         This fixes a bug in shipping Safari where setting 'href' would work but
1468         log an error message anyway.
1469
1470         * bindings/scripts/CodeGeneratorJS.pm:
1471         (GenerateImplementation):
1472         Add support for [DoNotCheckSecurityOnSetter] IDL extended attribute,
1473         in addition to the already supported [DoNotCheckSecurity] and
1474         [DoNotCheckSecurityOnGetter].
1475
1476         * page/Location.idl:
1477         Use [DoNotCheckSecurityOnSetter] on 'href' attribute as it can be
1478         set cross-origin. This fixes the regression introduced in r204923.
1479
1480 2016-08-29  Chris Dumez  <cdumez@apple.com>
1481
1482         We should throw a SecurityError when denying setting a cross-origin Window property
1483         https://bugs.webkit.org/show_bug.cgi?id=161339
1484
1485         Reviewed by Geoffrey Garen.
1486
1487         We should throw a SecurityError when denying setting a cross-origin Window property:
1488         - https://html.spec.whatwg.org/#crossoriginset-(-o,-p,-v,-receiver-)
1489         - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
1490
1491         e.g. crossOriginWindow.name = "" should throw.
1492
1493         Firefox and Chrome already throw but WebKit merely ignores the call and logs an
1494         error message.
1495
1496         No new tests, updated existing tests.
1497
1498         * bindings/js/JSDOMWindowCustom.cpp:
1499         (WebCore::JSDOMWindow::put):
1500
1501 2016-08-29  Alex Christensen  <achristensen@webkit.org>
1502
1503         URLParser should parse about:blank
1504         https://bugs.webkit.org/show_bug.cgi?id=161324
1505
1506         Reviewed by Brady Eidson.
1507
1508         Covered by new API tests.
1509
1510         * platform/URLParser.cpp:
1511         (WebCore::URLParser::parse):
1512
1513 2016-08-29  Chris Dumez  <cdumez@apple.com>
1514
1515         document.createEvent("popstateevent") should create a PopStateEvent
1516         https://bugs.webkit.org/show_bug.cgi?id=161321
1517
1518         Reviewed by Darin Adler.
1519
1520         document.createEvent("popstateevent") should create a PopStateEvent as per:
1521         - https://dom.spec.whatwg.org/#dom-document-createevent
1522
1523         Firefox and Chrome match the specification but WebKit throws an exception,
1524         which is risky compatibility-wise.
1525
1526         No new tests, rebaselined existing tests.
1527
1528         * dom/Document.cpp:
1529         (WebCore::Document::createEvent):
1530         * dom/PopStateEvent.cpp:
1531         (WebCore::PopStateEvent::createForBindings):
1532         * dom/PopStateEvent.h:
1533
1534 2016-08-29  Chris Dumez  <cdumez@apple.com>
1535
1536         We should throw a SecurityError when denying access to cross-origin Window properties
1537         https://bugs.webkit.org/show_bug.cgi?id=161316
1538
1539         Reviewed by Darin Adler.
1540
1541         We should throw a SecurityError when denying access to cross-origin Window properties:
1542         - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
1543         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
1544
1545         Firefox and Chrome already throw.
1546
1547         No new tests, updated existing tests.
1548
1549         * bindings/js/JSDOMWindowCustom.cpp:
1550         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
1551
1552 2016-08-29  Youenn Fablet  <youenn@apple.com>
1553
1554         Image Loader should use FetchOptions::mode according its crossOrigin attribute
1555         https://bugs.webkit.org/show_bug.cgi?id=161309
1556
1557         Reviewed by Darin Adler.
1558
1559         Test: http/tests/security/load-image-after-redirection.html
1560
1561         * loader/ImageLoader.cpp:
1562         (WebCore::ImageLoader::updateFromElement): Using CachedResourceRequest::setAsPotentiallyCrossOrigin to set fetch mode.
1563
1564 2016-08-29  Frederic Wang  <fwang@igalia.com>
1565
1566         Use MathMLPresentationElement for all MathML presentation tags
1567         https://bugs.webkit.org/show_bug.cgi?id=161297
1568
1569         Reviewed by Darin Adler.
1570
1571         Some tabular MathML elements as well as unsupported presentation MathML markup currently
1572         create a generic MathMLElement instance. We make them instead use the
1573         MathMLPresentationElement class since they are presentation MathML elements. This also
1574         allows to make MathMLElement::isPresentationMathML always return false.
1575
1576         No new tests, already covered by existing tests.
1577
1578         * mathml/MathMLElement.cpp:
1579         (WebCore::MathMLElement::isPresentationMathML): Deleted. Moved into the header file.
1580         * mathml/MathMLElement.h:
1581         (WebCore::MathMLElement::isPresentationMathML): Make this always return false now that all
1582         presentation markup are handled by MathMLPresentationElement.
1583         * mathml/MathMLPresentationElement.cpp:
1584         (WebCore::MathMLPresentationElement::createElementRenderer): Make the fallback always call
1585         MathMLElement::createElementRenderer. This preserves the behavior for the new elements
1586         handled here and does not affect the old ones (table is handled above while all the others
1587         are already handled in the derived class).
1588         * mathml/mathtags.in: Use MathMLPresentationElement for all MathML presentation tags.
1589
1590 2016-08-29  Alex Christensen  <achristensen@webkit.org>
1591
1592         API test URLParserTest.ParserFailures failing ASSERT_NOT_REACHED
1593         https://bugs.webkit.org/show_bug.cgi?id=161317
1594
1595         Reviewed by Brady Eidson.
1596
1597         Added an API test.
1598
1599         * platform/URLParser.cpp:
1600         (WebCore::URLParser::parse):
1601         Turns out, this state can be reached.
1602
1603 2016-08-29  Youenn Fablet  <youenn@apple.com>
1604
1605         [Fetch API] Response cloning should structureClone when teeing Response stream
1606         https://bugs.webkit.org/show_bug.cgi?id=161147
1607
1608         Reviewed by Darin Adler.
1609
1610         Covered by updated test.
1611
1612         Implementing structure cloning for ArrayBuffer and ArrayBufferView objects.
1613         Using this structure cloning in ReadableStream to support structureClone in the case of Fetch API.
1614
1615         * CMakeLists.txt: Adding StructureClone.cpp
1616         * Modules/fetch/FetchResponse.js:
1617         (clone): Setting structureClone to true
1618         * Modules/streams/ReadableStreamInternals.js:
1619         (doStructuredClone): Added to clone ArrayBuffer/ArrayBufferView chunks. Throwing exception otherwise.
1620         (teeReadableStreamPullFunction): Using @doStructuredClone
1621         * WebCore.xcodeproj/project.pbxproj: Adding StructureClone.cpp/.h
1622         * bindings/js/JSDOMGlobalObject.cpp:
1623         (WebCore::JSDOMGlobalObject::addBuiltinGlobals): Adding @ArrayBuffer and structuredCloneArrayBuffer and structuredCloneArrayBufferView private properties.
1624         * bindings/js/StructuredClone.cpp: Added.
1625         (WebCore::structuredCloneArrayBuffer): Cloning of ArrayBuffer as per
1626         http://w3c.github.io/html/infrastructure.html#section-structuredclone step 11.
1627        (WebCore::structuredCloneArrayBufferView): Cloning of ArrayBufferView as
1628        perhttp://w3c.github.io/html/infrastructure.html#section-structuredclone, step 12.
1629         * bindings/js/StructuredClone.h: Added.
1630         * bindings/js/WebCoreBuiltinNames.h: 
1631
1632 2016-08-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1633
1634         [GTK] Accelerated compositing does not work in Wayland
1635         https://bugs.webkit.org/show_bug.cgi?id=115803
1636
1637         Reviewed by Michael Catanzaro.
1638
1639         The Wayland implementation in WebKit2 uses a nested display running in the UI process so that GL contexts created
1640         in the web process need to be created in the nested display. We currently have a shared platform display that
1641         should represent the connection to the actual display all applications connect to. This patch refactors the
1642         GLContext API to ensure that GL contexts are always attached to a particular platform display. The create
1643         methods receive an optional PlatformDisplay that will be used as the display of all GL operations of the created
1644         GL context. The sharing GL context should also share the same display, it can't be global to the process, but to
1645         the display, so it's now created on demand by the PlatformDisplay. In addition to the global shared display,
1646         it's now possible to set a shared display for compositing that can be used when creating GL contexts. This makes
1647         it possible to use a different display for compositing, connected to the nested display in wayland, even in non
1648         wayland environments.
1649         The patch also adds support for surfaceless EGL contexts that can be used for offscreen contexts. It also adds
1650         support for offscreen wayland contexts, as a fallback in wayland in case surfaceless is not supported.
1651         Some wayland code that is specific to the WebKit2 implementation has been moved to the WebKit2 layer.
1652
1653         * PlatformGTK.cmake:
1654         * platform/graphics/GLContext.cpp:
1655         (WebCore::initializeOpenGLShimsIfNeeded):
1656         (WebCore::GLContext::createContextForWindow):
1657         (WebCore::GLContext::createOffscreenContext):
1658         (WebCore::GLContext::createSharingContext):
1659         (WebCore::GLContext::GLContext):
1660         (WebCore::GLContext::~GLContext):
1661         (WebCore::GLContext::current):
1662         (WebCore::activeContextList): Deleted.
1663         * platform/graphics/GLContext.h:
1664         (WebCore::GLContext::display):
1665         * platform/graphics/GraphicsContext3DPrivate.cpp:
1666         (WebCore::GraphicsContext3DPrivate::GraphicsContext3DPrivate):
1667         (WebCore::GraphicsContext3DPrivate::platformContext):
1668         (WebCore::GraphicsContext3DPrivate::paintToTextureMapper):
1669         * platform/graphics/PlatformDisplay.cpp:
1670         (WebCore::PlatformDisplay::createPlatformDisplay): Always use the default wayland display created by GTK+ for
1671         the global shared display.
1672         (WebCore::PlatformDisplay::sharedDisplayForCompositing):
1673         (WebCore::PlatformDisplay::setSharedDisplayForCompositing):
1674         (WebCore::PlatformDisplay::sharingGLContext):
1675         (WebCore::eglDisplays): Helper HashSet to keep track of all PlatformDisplays with an EGL display intialized to
1676         properly termimate them at exit.
1677         (WebCore::PlatformDisplay::initializeEGLDisplay): Remove eglBindAPI() from display initialization, since it's
1678         not a display initialization and it's thread specific, so it needs to be called on every thread where EGL is used.
1679         (WebCore::PlatformDisplay::terminateEGLDisplay):
1680         (WebCore::PlatformDisplay::eglDisplay): Deleted.
1681         * platform/graphics/PlatformDisplay.h:
1682         * platform/graphics/cairo/ImageBufferCairo.cpp:
1683         (WebCore::ImageBufferData::~ImageBufferData):
1684         (WebCore::ImageBufferData::createCompositorBuffer):
1685         (WebCore::ImageBufferData::swapBuffersIfNeeded):
1686         (WebCore::ImageBufferData::createCairoGLSurface):
1687         (WebCore::ImageBufferData::paintToTextureMapper):
1688         (WebCore::ImageBuffer::copyToPlatformTexture):
1689         * platform/graphics/egl/GLContextEGL.cpp:
1690         (WebCore::GLContextEGL::getEGLConfig):
1691         (WebCore::GLContextEGL::createWindowContext):
1692         (WebCore::GLContextEGL::createPbufferContext):
1693         (WebCore::GLContextEGL::createSurfacelessContext):
1694         (WebCore::GLContextEGL::createPixmapContext):
1695         (WebCore::GLContextEGL::createWaylandContext):
1696         (WebCore::GLContextEGL::createContext):
1697         (WebCore::GLContextEGL::createSharingContext):
1698         (WebCore::GLContextEGL::GLContextEGL):
1699         (WebCore::GLContextEGL::~GLContextEGL):
1700         (WebCore::GLContextEGL::defaultFrameBufferSize):
1701         (WebCore::GLContextEGL::makeContextCurrent):
1702         (WebCore::GLContextEGL::swapBuffers):
1703         (WebCore::GLContextEGL::cairoDevice):
1704         * platform/graphics/egl/GLContextEGL.h:
1705         * platform/graphics/glx/GLContextGLX.cpp:
1706         (WebCore::GLContextGLX::createWindowContext):
1707         (WebCore::GLContextGLX::createPbufferContext):
1708         (WebCore::GLContextGLX::createPixmapContext):
1709         (WebCore::GLContextGLX::createContext):
1710         (WebCore::GLContextGLX::createSharingContext):
1711         (WebCore::GLContextGLX::GLContextGLX):
1712         (WebCore::GLContextGLX::~GLContextGLX):
1713         (WebCore::GLContextGLX::defaultFrameBufferSize):
1714         (WebCore::GLContextGLX::makeContextCurrent):
1715         (WebCore::GLContextGLX::swapBuffers):
1716         (WebCore::GLContextGLX::cairoDevice):
1717         (WebCore::GLContextGLX::waitNative): Deleted.
1718         * platform/graphics/glx/GLContextGLX.h:
1719         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1720         (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
1721         (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):
1722         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
1723         (WebCore::PlatformDisplayWayland::PlatformDisplayWayland):
1724         (WebCore::PlatformDisplayWayland::~PlatformDisplayWayland):
1725         (WebCore::PlatformDisplayWayland::initialize):
1726         (WebCore::PlatformDisplayWayland::registryGlobal):
1727         (WebCore::PlatformDisplayWayland::createSurface):
1728         * platform/graphics/wayland/PlatformDisplayWayland.h:
1729         (WebCore::PlatformDisplayWayland::native): Deleted.
1730         * platform/graphics/wayland/WaylandEventSource.cpp: Removed.
1731         * platform/graphics/wayland/WaylandSurface.cpp: Removed.
1732         * platform/graphics/wayland/WebKitGtkWaylandClientProtocol.xml: Removed.
1733         * platform/graphics/wayland/WlUniquePtr.h: Make it possible to use std::unique_ptr with Wayland objects.
1734         (WebCore::WlPtrDeleter::operator()):
1735
1736 2016-08-29  Youenn Fablet  <youenn@apple.com>
1737
1738         [Fetch API] Add support for BufferSource bodies
1739         https://bugs.webkit.org/show_bug.cgi?id=161087
1740
1741         Reviewed by Darin Adler.
1742
1743         Covered by updated tests.
1744
1745         Added support for ArrayBuffer, ArrayBufferView and FormData upload.
1746         Added support for consuming ArrayBufferView.
1747
1748         To support FormData upload, FetchBOdy is now storing a FormData computed from the DOMFormData passed to the constructor.
1749         This allows setting the content-type for FormData correctly with the boundary parameter.
1750
1751         * Modules/fetch/FetchBody.cpp:
1752         (WebCore::FetchBody::bodyForInternalRequest): Adding support for FormData upload.
1753         (WebCore::FetchBody::FetchBody): Adding ArrayBuffer and ArrayBufferView constructors.
1754         (WebCore::FetchBody::extract): Extracting in case of BufferSource (i.e. ArrayBuffer or ArrayBufferView) and FormData.
1755         (WebCore::FetchBody::consume): Adding support to consume ArrayBufferView.
1756         (WebCore::FetchBody::consumeAsStream): Adding support to consume ArrayBufferView as a stream.
1757         Cloned the ArrayBuffer before enqueuing it in  the stream.
1758         (WebCore::FetchBody::consumeArrayBuffer): Cleaning m_data after being consumed.
1759         (WebCore::FetchBody::consumeArrayBufferView): Adding support to consume ArrayBufferView.
1760         (WebCore::FetchBody::consumeText): Cleaning m_text after being consumed.
1761         (WebCore::FetchBody::consumeBlob): Ditto for m_blob.
1762         (WebCore::FetchBody::bodyForInternalRequest): Adding support for ArrayBuffer and ArrayBufferView upload.
1763         * Modules/fetch/FetchBody.h:
1764         * Modules/fetch/FetchRequest.cpp:
1765         (WebCore::FetchRequest::internalRequest): Passing ScriptExecutionContext as this is needed for FormData upload.
1766         (WebCore::FetchRequest::setBody): Ditto.
1767         * Modules/fetch/FetchResponse.cpp:
1768         (WebCore::FetchResponse::initializeWith): Ditto.
1769         (WebCore::FetchResponse::fetch): Removing FormData upload rejection check.
1770
1771 2016-08-26  Sergio Villar Senin  <svillar@igalia.com>
1772
1773         [css-grid] Do not recursively call layout during auto repeat computation
1774         https://bugs.webkit.org/show_bug.cgi?id=161234
1775
1776         Reviewed by Manuel Rego Casasnovas.
1777
1778         The computation of auto repeat tracks was incorrectly recursively triggering
1779         a layout in order to compute the available size. That was happening whenever
1780         the width was indefinite. In such cases we should treat the width always as
1781         indefinite without having to run any extra code. During the layout phase
1782         we'll have the actual width available.
1783
1784         This fix also unveiled a few errors in one of the imported mozilla tests which were
1785         incorrectly passing when they should not.
1786
1787         Test: fast/css-grid-layout/grid-indefinite-size-auto-repeat-crash.html
1788
1789         * rendering/RenderGrid.cpp:
1790         (WebCore::RenderGrid::layoutBlock):
1791         (WebCore::RenderGrid::computeIntrinsicLogicalWidths):
1792         (WebCore::RenderGrid::computeAutoRepeatTracksCount):
1793         (WebCore::RenderGrid::placeItemsOnGrid):
1794         * rendering/RenderGrid.h:
1795
1796 2016-08-29  Youenn Fablet  <youenn@apple.com>
1797
1798         data:// URL behavior of XHR does not match spec
1799         https://bugs.webkit.org/show_bug.cgi?id=109199
1800
1801         Reviewed by Darin Adler.
1802
1803         Covered by rebased tests.
1804
1805         Making data URLs same origin for XHR and fetch API.
1806         This is the behavior when https://fetch.spec.whatwg.org/#same-origin-data-url-flag is set.
1807         As per the specs, this flag is set for fetch API and XMLHttpRequest.
1808         Introducing this flag in ThreadableLoader options, default value being false.
1809         Setting flag for XHR and fetch API.
1810
1811         Fixing accuracy of data URL loading by setting status code and content-type HTTP header as per fetch specification.
1812
1813         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.
1814
1815         * Modules/fetch/FetchLoader.cpp:
1816         (WebCore::FetchLoader::start): Setting same-origin-data-url-flag to true.
1817         * loader/DocumentThreadableLoader.cpp:
1818         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Making data URLs same origin if flag is set.
1819         * loader/ResourceLoader.cpp:
1820         (WebCore::ResourceLoader::loadDataURL): Setting status code and content-type header according specification.
1821         * loader/ThreadableLoader.cpp:
1822         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions): Adding same-origin-data-url-flag option.
1823         * loader/ThreadableLoader.h:
1824         * loader/WorkerThreadableLoader.cpp:
1825         (WebCore::LoaderTaskOptions::LoaderTaskOptions): Ensuring flag is preserved when going to the main thread.
1826         * platform/network/DataURLDecoder.cpp:
1827         (WebCore::DataURLDecoder::parseMediaType): Setting mediaType value, used by ResourceLoader to set the content-type header.
1828         * platform/network/DataURLDecoder.h:
1829         * xml/XMLHttpRequest.cpp:
1830         (WebCore::XMLHttpRequest::createRequest): Setting same-origin-data-url-flag to true.
1831
1832 2016-08-25  Frederic Wang  <fwang@igalia.com>
1833
1834         Add support for non-BMP operators U+1EEF0 and U+1EEF1
1835         https://bugs.webkit.org/show_bug.cgi?id=153984
1836
1837         Reviewed by Darin Adler.
1838
1839         Tests: mathml/presentation/non-bmp-operators-spacing.html
1840                mathml/presentation/non-bmp-operators-stretching.html
1841
1842         * mathml/MathMLOperatorDictionary.cpp: We move the definition of operator dictionary Entry
1843         here as it is not used by external code.
1844         We now also accept non-BMP operators and add entries for U+1EEF0 and U+1EEF1.
1845         (WebCore::extractProperty): Helper function to convert from Entry structure to a Property
1846         structure.
1847         (WebCore::MathMLOperatorDictionary::search): This function now accepts a non-BMP parameter
1848         and returns a Property structure.
1849         (WebCore::MathMLOperatorDictionary::isVertical): This function now accepts a non-BMP parameter.
1850         * mathml/MathMLOperatorDictionary.h: Replace the Entry structure with a Property structure
1851         which was used by MathMLOperatorElement. Update the signatures of search and isVertical.
1852         * mathml/MathMLOperatorElement.cpp:
1853         (WebCore::MathMLOperatorElement::parseOperatorChar): Remove the special case that excludes
1854         non-BMP operators.
1855         (WebCore::MathMLOperatorElement::computeDictionaryProperty): Rename the property structure
1856         to use the one moved into MathMLOperatorDictionary.h. We no longer need to convert the result
1857         of the search call.
1858         (WebCore::MathMLOperatorElement::dictionaryProperty): Rename the property structure.
1859         * mathml/MathMLOperatorElement.h: Make OperatorChar accept non-BMP operators.
1860         MathMLOperatorElement::DictionaryProperty is now moved into MathMLOperatorDictionary
1861         and renamed Property.
1862         * rendering/mathml/MathOperator.cpp: Accept non-BMP operators.
1863         * rendering/mathml/MathOperator.h: Ditto.
1864         * rendering/mathml/RenderMathMLFencedOperator.cpp:
1865         (WebCore::RenderMathMLFencedOperator::updateOperatorContent):  Adjust code to use the new
1866         return type of MathMLOperatorDictionary::search.
1867         * rendering/mathml/RenderMathMLFencedOperator.h: Accept non-BMP operators.
1868         * rendering/mathml/RenderMathMLOperator.cpp: Ditto.
1869         * rendering/mathml/RenderMathMLOperator.h: Ditto.
1870
1871 2016-08-28  Youenn Fablet  <youenn@apple.com>
1872
1873         [Fetch API] Ensure response cloning works when data is loading
1874         https://bugs.webkit.org/show_bug.cgi?id=161137
1875
1876         Reviewed by Darin Adler.
1877
1878         Test: http/tests/fetch/clone-after-load-is-finished.html and updated wpt test
1879
1880         FetchBody is only able to clone data when requested by Response in case the data is already there.
1881         If data is loaded from FetchLoader, each received chunk should be given to each cloned response.
1882         The simplest approach is to create a ReadableStream body for the cloned Response and use it for the teeing.
1883
1884         * Modules/fetch/FetchResponse.cpp:
1885         (WebCore::FetchResponse::BodyLoader::didSucceed): Postpone stream closing if there is still data to enqueue in the FetchBody.
1886         * Modules/fetch/FetchResponse.h:
1887         * Modules/fetch/FetchResponse.idl:
1888         * Modules/fetch/FetchResponse.js:
1889         (clone): If response is being loaded, create a ReadableStream body so that loaded data cloning is handled by ReadableStream tee.
1890         * Modules/streams/ReadableStreamInternals.js: Restrict firstReadCallback to the case of a readable ReadableStream.
1891         If stream is errored or closed, FetchResponse will already have disposed of its source.
1892         (readFromReadableStreamDefaultReader):
1893         * bindings/js/WebCoreBuiltinNames.h:
1894
1895 2016-08-28  Andreas Kling  <akling@apple.com>
1896
1897         document.title setter can't throw.
1898         <https://webkit.org/b/161302>
1899
1900         Reviewed by Antti Koivisto.
1901
1902         Remove [SetterRaisesException] from document.title and replace
1903         ExceptionCode propagation with ASSERT_NO_EXCEPTION.
1904
1905         Setting the .textContent of a SVGTitleElement or HTMLTitleElement
1906         will never fail, so there's no exception to propagate.
1907
1908         * dom/Document.cpp:
1909         (WebCore::Document::setTitle):
1910         * dom/Document.h:
1911         * dom/Document.idl:
1912         * html/ImageDocument.cpp:
1913         (WebCore::ImageDocument::finishedParsing):
1914
1915 2016-08-23  Frederic Wang  <fwang@igalia.com>
1916
1917         MathML renderers should use struct to pass long list of LayoutUnits
1918         https://bugs.webkit.org/show_bug.cgi?id=161084
1919
1920         Reviewed by Darin Adler.
1921
1922         RenderMathMLFraction, RenderMathMLMenclose, RenderMathMLScripts and RenderMathMLUnderOver
1923         have helper functions to retrieve a list of LayoutUnit parameters. We gather them in a single
1924         struct instead of using a long list of LayoutUnit& parameters.
1925
1926         No new tests, behavior is unchanged.
1927
1928         * rendering/mathml/RenderMathMLFraction.cpp:
1929         (WebCore::RenderMathMLFraction::getFractionParameters):
1930         (WebCore::RenderMathMLFraction::getStackParameters):
1931         (WebCore::RenderMathMLFraction::layoutBlock):
1932         * rendering/mathml/RenderMathMLFraction.h:
1933         * rendering/mathml/RenderMathMLMenclose.cpp:
1934         (WebCore::RenderMathMLMenclose::getSpaceAroundContent):
1935         (WebCore::RenderMathMLMenclose::computePreferredLogicalWidths):
1936         (WebCore::RenderMathMLMenclose::layoutBlock):
1937         * rendering/mathml/RenderMathMLMenclose.h:
1938         * rendering/mathml/RenderMathMLScripts.cpp:
1939         (WebCore::RenderMathMLScripts::getScriptMetricsAndLayoutIfNeeded):
1940         (WebCore::RenderMathMLScripts::layoutBlock):
1941         * rendering/mathml/RenderMathMLScripts.h:
1942         * rendering/mathml/RenderMathMLUnderOver.cpp:
1943         (WebCore::RenderMathMLUnderOver::getVerticalParameters):
1944         (WebCore::RenderMathMLUnderOver::layoutBlock):
1945         * rendering/mathml/RenderMathMLUnderOver.h:
1946
1947 2016-08-28  Andreas Kling  <akling@apple.com>
1948
1949         Clean up some .text attribute setters that don't throw.
1950         <https://webkit.org/b/161292>
1951
1952         Reviewed by Darin Adler.
1953
1954         Remove [SetterRaisesException] for three .text attributes
1955         and replace them with ASSERT_NO_EXCEPTION.
1956
1957         These setters behave like .textContent, which can't throw as
1958         it's always okay to replace an Element's children with a Text.
1959
1960         * html/HTMLAnchorElement.cpp:
1961         (WebCore::HTMLAnchorElement::setText):
1962         * html/HTMLAnchorElement.h:
1963         * html/HTMLAnchorElement.idl:
1964         * html/HTMLOptionElement.cpp:
1965         (WebCore::HTMLOptionElement::setText):
1966         * html/HTMLOptionElement.h:
1967         * html/HTMLOptionElement.idl:
1968         * html/HTMLTitleElement.cpp:
1969         (WebCore::HTMLTitleElement::setText):
1970         * html/HTMLTitleElement.h:
1971         * html/HTMLTitleElement.idl:
1972
1973 2016-08-24  Dave Hyatt  <hyatt@apple.com>
1974
1975         Initial landing of CSS Parser Tokenization (and files to support that). Not used yet.
1976         https://bugs.webkit.org/show_bug.cgi?id=161174
1977
1978         This code is imported from Blink and is their CSS parser (modified to work in WebKit).
1979         It is from commit e4bb90df7f2ed8a63975b5ed27a1b488cb9b146f, Mon Aug 22 2016.
1980
1981         Reviewed by Simon Fraser.
1982
1983         * CMakeLists.txt:
1984         * WebCore.xcodeproj/project.pbxproj:
1985         * css/CSSMarkup.cpp: Added.
1986         (WebCore::isCSSTokenizerIdentifier):
1987         (WebCore::serializeCharacter):
1988         (WebCore::serializeCharacterAsCodePoint):
1989         (WebCore::serializeIdentifier):
1990         (WebCore::serializeString):
1991         (WebCore::serializeURI):
1992         (WebCore::serializeFontFamily):
1993         * css/CSSMarkup.h: Added.
1994         * css/CSSOMUtils.cpp: Removed.
1995         * css/CSSOMUtils.h: Removed.
1996         * css/CSSSelector.cpp:
1997         * css/parser/CSSParserFastPaths.cpp: Added.
1998         * css/parser/CSSParserFastPaths.h: Added.
1999         * css/parser/CSSParserIdioms.h: Added.
2000         (WebCore::isCSSSpace):
2001         (WebCore::isNameStartCodePoint):
2002         (WebCore::isNameCodePoint):
2003         * css/parser/CSSParserObserver.h: Added.
2004         (WebCore::CSSParserObserver::~CSSParserObserver):
2005         * css/parser/CSSParserObserverWrapper.cpp: Added.
2006         (WebCore::CSSParserObserverWrapper::startOffset):
2007         (WebCore::CSSParserObserverWrapper::previousTokenStartOffset):
2008         (WebCore::CSSParserObserverWrapper::endOffset):
2009         (WebCore::CSSParserObserverWrapper::skipCommentsBefore):
2010         (WebCore::CSSParserObserverWrapper::yieldCommentsBefore):
2011         * css/parser/CSSParserObserverWrapper.h: Added.
2012         (WebCore::CSSParserObserverWrapper::CSSParserObserverWrapper):
2013         (WebCore::CSSParserObserverWrapper::observer):
2014         (WebCore::CSSParserObserverWrapper::addComment):
2015         (WebCore::CSSParserObserverWrapper::addToken):
2016         (WebCore::CSSParserObserverWrapper::finalizeConstruction):
2017         * css/parser/CSSParserToken.cpp: Added.
2018         (WebCore::cssPrimitiveValueUnitFromTrie):
2019         (WebCore::stringToUnitType):
2020         (WebCore::CSSParserToken::CSSParserToken):
2021         (WebCore::CSSParserToken::convertToDimensionWithUnit):
2022         (WebCore::CSSParserToken::convertToPercentage):
2023         (WebCore::CSSParserToken::delimiter):
2024         (WebCore::CSSParserToken::numericSign):
2025         (WebCore::CSSParserToken::numericValueType):
2026         (WebCore::CSSParserToken::numericValue):
2027         (WebCore::CSSParserToken::parseAsUnresolvedCSSPropertyID):
2028         (WebCore::CSSParserToken::id):
2029         (WebCore::CSSParserToken::functionId):
2030         (WebCore::CSSParserToken::hasStringBacking):
2031         (WebCore::CSSParserToken::copyWithUpdatedString):
2032         (WebCore::CSSParserToken::valueDataCharRawEqual):
2033         (WebCore::CSSParserToken::operator==):
2034         (WebCore::CSSParserToken::serialize):
2035         * css/parser/CSSParserToken.h: Added.
2036         (WebCore::CSSParserToken::operator!=):
2037         (WebCore::CSSParserToken::type):
2038         (WebCore::CSSParserToken::value):
2039         (WebCore::CSSParserToken::getHashTokenType):
2040         (WebCore::CSSParserToken::getBlockType):
2041         (WebCore::CSSParserToken::unitType):
2042         (WebCore::CSSParserToken::unicodeRangeStart):
2043         (WebCore::CSSParserToken::unicodeRangeEnd):
2044         (WebCore::CSSParserToken::initValueFromStringView):
2045         * css/parser/CSSParserTokenRange.cpp: Added.
2046         (WebCore::CSSParserTokenRange::eofToken):
2047         (WebCore::CSSParserTokenRange::makeSubRange):
2048         (WebCore::CSSParserTokenRange::consumeBlock):
2049         (WebCore::CSSParserTokenRange::consumeComponentValue):
2050         (WebCore::CSSParserTokenRange::serialize):
2051         * css/parser/CSSParserTokenRange.h: Added.
2052         (WebCore::CSSParserTokenRange::CSSParserTokenRange):
2053         (WebCore::CSSParserTokenRange::atEnd):
2054         (WebCore::CSSParserTokenRange::end):
2055         (WebCore::CSSParserTokenRange::peek):
2056         (WebCore::CSSParserTokenRange::consume):
2057         (WebCore::CSSParserTokenRange::consumeIncludingWhitespace):
2058         (WebCore::CSSParserTokenRange::consumeWhitespace):
2059         (WebCore::CSSParserTokenRange::begin):
2060         * css/parser/CSSPropertyParser.cpp: Added.
2061         (WebCore::hasPrefix):
2062         (WebCore::cssPropertyID):
2063         (WebCore::cssPropertyNameIOSAliasing):
2064         (WebCore::isAppleLegacyCssValueKeyword):
2065         (WebCore::cssValueKeywordID):
2066         (WebCore::unresolvedCSSPropertyID):
2067         * css/parser/CSSPropertyParser.h: Added.
2068         (WebCore::CSSPropertyParser::inQuirksMode):
2069         * css/parser/CSSPropertyParserHelpers.cpp: Added.
2070         * css/parser/CSSPropertyParserHelpers.h: Added.
2071         (WebCore::CSSPropertyParserHelpers::identMatches):
2072         (WebCore::CSSPropertyParserHelpers::consumeIdent):
2073         (WebCore::CSSPropertyParserHelpers::isCSSWideKeyword):
2074         * css/parser/CSSTokenizer.cpp: Added.
2075         (WebCore::CSSTokenizer::Scope::Scope):
2076         (WebCore::CSSTokenizer::Scope::tokenRange):
2077         (WebCore::CSSTokenizer::Scope::tokenCount):
2078         (WebCore::isNewLine):
2079         (WebCore::twoCharsAreValidEscape):
2080         (WebCore::CSSTokenizer::CSSTokenizer):
2081         (WebCore::CSSTokenizer::reconsume):
2082         (WebCore::CSSTokenizer::consume):
2083         (WebCore::CSSTokenizer::whiteSpace):
2084         (WebCore::CSSTokenizer::blockStart):
2085         (WebCore::CSSTokenizer::blockEnd):
2086         (WebCore::CSSTokenizer::leftParenthesis):
2087         (WebCore::CSSTokenizer::rightParenthesis):
2088         (WebCore::CSSTokenizer::leftBracket):
2089         (WebCore::CSSTokenizer::rightBracket):
2090         (WebCore::CSSTokenizer::leftBrace):
2091         (WebCore::CSSTokenizer::rightBrace):
2092         (WebCore::CSSTokenizer::plusOrFullStop):
2093         (WebCore::CSSTokenizer::asterisk):
2094         (WebCore::CSSTokenizer::lessThan):
2095         (WebCore::CSSTokenizer::comma):
2096         (WebCore::CSSTokenizer::hyphenMinus):
2097         (WebCore::CSSTokenizer::solidus):
2098         (WebCore::CSSTokenizer::colon):
2099         (WebCore::CSSTokenizer::semiColon):
2100         (WebCore::CSSTokenizer::hash):
2101         (WebCore::CSSTokenizer::circumflexAccent):
2102         (WebCore::CSSTokenizer::dollarSign):
2103         (WebCore::CSSTokenizer::verticalLine):
2104         (WebCore::CSSTokenizer::tilde):
2105         (WebCore::CSSTokenizer::commercialAt):
2106         (WebCore::CSSTokenizer::reverseSolidus):
2107         (WebCore::CSSTokenizer::asciiDigit):
2108         (WebCore::CSSTokenizer::letterU):
2109         (WebCore::CSSTokenizer::nameStart):
2110         (WebCore::CSSTokenizer::stringStart):
2111         (WebCore::CSSTokenizer::endOfFile):
2112         (WebCore::CSSTokenizer::nextToken):
2113         (WebCore::CSSTokenizer::consumeNumber):
2114         (WebCore::CSSTokenizer::consumeNumericToken):
2115         (WebCore::CSSTokenizer::consumeIdentLikeToken):
2116         (WebCore::CSSTokenizer::consumeStringTokenUntil):
2117         (WebCore::CSSTokenizer::consumeUnicodeRange):
2118         (WebCore::isNonPrintableCodePoint):
2119         (WebCore::CSSTokenizer::consumeUrlToken):
2120         (WebCore::CSSTokenizer::consumeBadUrlRemnants):
2121         (WebCore::CSSTokenizer::consumeSingleWhitespaceIfNext):
2122         (WebCore::CSSTokenizer::consumeUntilCommentEndFound):
2123         (WebCore::CSSTokenizer::consumeIfNext):
2124         (WebCore::CSSTokenizer::consumeName):
2125         (WebCore::CSSTokenizer::consumeEscape):
2126         (WebCore::CSSTokenizer::nextTwoCharsAreValidEscape):
2127         (WebCore::CSSTokenizer::nextCharsAreNumber):
2128         (WebCore::CSSTokenizer::nextCharsAreIdentifier):
2129         (WebCore::CSSTokenizer::registerString):
2130         * css/parser/CSSTokenizer.h: Added.
2131         (WebCore::CSSTokenizer::Scope::storeString):
2132         * css/parser/CSSTokenizerInputStream.cpp: Added.
2133         (WebCore::CSSTokenizerInputStream::CSSTokenizerInputStream):
2134         (WebCore::CSSTokenizerInputStream::advanceUntilNonWhitespace):
2135         (WebCore::CSSTokenizerInputStream::getDouble):
2136         * css/parser/CSSTokenizerInputStream.h: Added.
2137         (WebCore::CSSTokenizerInputStream::nextInputChar):
2138         (WebCore::CSSTokenizerInputStream::peekWithoutReplacement):
2139         (WebCore::CSSTokenizerInputStream::advance):
2140         (WebCore::CSSTokenizerInputStream::pushBack):
2141         (WebCore::CSSTokenizerInputStream::skipWhilePredicate):
2142         (WebCore::CSSTokenizerInputStream::length):
2143         (WebCore::CSSTokenizerInputStream::offset):
2144         (WebCore::CSSTokenizerInputStream::rangeAt):
2145         * platform/Length.h:
2146
2147 2016-08-28  Javier Fernandez  <jfernandez@igalia.com>
2148
2149         Should never be reached failure in WebCore::RenderFlexibleBox::alignChildren
2150         https://bugs.webkit.org/show_bug.cgi?id=151591
2151         <rdar://problem/27711829>
2152
2153         Reviewed by Darin Adler.
2154
2155         The align-self and align-items CSS properties were originally defined in the
2156         Flexbible Box specification. The new CSS Box Alignment specification tries
2157         to generalize them so they can be used by other layout models, as it's  the
2158         case of the GridLayout spec.
2159
2160         Since we have implemented the Grid Layout spec behind a runtime flag, we should
2161         do the same with the new syntax of these properties.
2162
2163         Test: css3/flexbox/new-alignment-values-invalid-if-grid-not-enabled.html
2164
2165         * css/CSSParser.cpp:
2166         (WebCore::isValidKeywordPropertyAndValue):
2167         (WebCore::isKeywordPropertyID):
2168         (WebCore::CSSParser::parseValue):
2169         * rendering/RenderFlexibleBox.cpp:
2170         (WebCore::RenderFlexibleBox::alignChildren):
2171
2172 2016-08-28  Frederic Wang  <fwang@igalia.com>
2173
2174         Improve parsing of the menclose notation attribute value
2175         https://bugs.webkit.org/show_bug.cgi?id=161045
2176
2177         Reviewed by Darin Adler.
2178
2179         We improve the way the list of menclose notations is parsed to avoid allocating a vector and
2180         accept any whitespace as separators.
2181
2182         New test cases in mathml/presentation/menclose-notation-equivalence.html
2183
2184         * mathml/MathMLMencloseElement.cpp: Include HTMLParserIdioms.h to use isHTMLSpace.
2185         (WebCore::MathMLMencloseElement::addNotationFlags): Helper function to perform the relevant
2186         addNotation calls from a notation name.
2187         (WebCore::MathMLMencloseElement::parseNotationAttribute): Use only simple string operations
2188         to determine the list of notations.
2189         * mathml/MathMLMencloseElement.h: Declare the new helper function.
2190
2191 2016-08-28  Frederic Wang  <fwang@igalia.com>
2192
2193         Make MathMLSpaceElement and MathMLTokenElement inherit from MathMLPresentationElement
2194         https://bugs.webkit.org/show_bug.cgi?id=161232
2195
2196         Reviewed by Darin Adler.
2197
2198         The mrow-like features of MathMLPresentationElement are now moved into RenderMathMLRow.
2199         Hence we make MathMLSpaceElement and MathMLTokenElement inherit from the generic class
2200         MathMLPresentationElement for presentation MathML elements.
2201
2202         No new tests, already covered by existing tests.
2203
2204         * mathml/MathMLSpaceElement.cpp:
2205         (WebCore::MathMLSpaceElement::MathMLSpaceElement): Derive from MathMLPresentationElement.
2206         (WebCore::MathMLSpaceElement::parseAttribute): Ditto.
2207         * mathml/MathMLSpaceElement.h: Ditto. Override acceptsDisplayStyleAttribute as a small
2208         optimization. isPresentationMathML is no longer needed.
2209         * mathml/MathMLTokenElement.cpp:
2210         (WebCore::MathMLTokenElement::MathMLTokenElement): Derive from MathMLPresentationElement.
2211         (WebCore::MathMLTokenElement::didAttachRenderers): Ditto.
2212         (WebCore::MathMLTokenElement::childrenChanged): Ditto.
2213         (WebCore::MathMLTokenElement::parseAttribute): Deleted. No need to override this function
2214         any more since it's already implemented in MathMLPresentationElement.
2215         * mathml/MathMLTokenElement.h: Derive from MathMLPresentationElement. Override
2216         acceptsDisplayStyleAttribute as a small optimization. isPresentationMathML is no longer
2217         needed.
2218
2219 2016-08-28  Frederic Wang  <fwang@igalia.com>
2220
2221         RenderMathMLRow::firstLineBaseline does not need to be overridden in RenderMathMLMenclose
2222         https://bugs.webkit.org/show_bug.cgi?id=161127
2223
2224         Reviewed by Darin Adler.
2225
2226         RenderMathMLRow::firstLineBaseline already provides the correct calculation of ascent for
2227         non-empty menclose elements. Empty menclose elements are not used in practice so the
2228         calculated value is irrelevant. Aligning on mrow (i.e. leaving firstLineBaseline to 0)
2229         is fine. This change allows to get rid of the m_ascent member and helps to keep good baseline
2230         alignment when the zoom level changes (bug 161126).
2231
2232         No new tests, already covered by existing tests.
2233
2234         * rendering/mathml/RenderMathMLMenclose.cpp:
2235         (WebCore::RenderMathMLMenclose::RenderMathMLMenclose): Remove initialization of m_ascent.
2236         (WebCore::RenderMathMLMenclose::layoutBlock): No need to calculate m_ascent. The height and
2237         content location can be determined without introducing local variables ascent or descent.
2238         (WebCore::RenderMathMLMenclose::firstLineBaseline): Deleted. We just use the implementation
2239         from RenderMathMLRow.
2240         * rendering/mathml/RenderMathMLMenclose.h: Delete m_ascent and do not override
2241         firstLineBaseline.
2242
2243 2016-08-28  Frederic Wang  <fwang@igalia.com>
2244
2245         More cleanup for the mpadded implementation
2246         https://bugs.webkit.org/show_bug.cgi?id=161136
2247
2248         Reviewed by Darin Adler.
2249
2250         We perform the following cleanup for the mpadded renderer class:
2251         1) We do not store the ascent on the class. This may make update more reliable and will
2252         help for general improvement of MathML ascents (bug 155879).
2253         2) We split resolveWidth/resolveAttributes into smaller functions and improve the coding
2254         style. This helps to calculate firstLineBaseline in 1).
2255         3) We do not override updateFromElement and styleDidChange to perform setNeedsLayout calls.
2256         These calls already seem unnecessary and can be removed even more safely after 1).
2257
2258         We add a test for style change. Change of attributes as well as metrics calcuation of empty
2259         and non-empty mpadded elements are already covered by other tests.
2260
2261         Test: mathml/presentation/mpadded-style-change.html
2262
2263         * rendering/mathml/RenderMathMLPadded.cpp:
2264         (WebCore::RenderMathMLPadded::voffset): New helper function to resolve voffset.
2265         (WebCore::RenderMathMLPadded::lspace): Ditto for lspace.
2266         (WebCore::RenderMathMLPadded::mpaddedWidth): Ditto for width.
2267         (WebCore::RenderMathMLPadded::mpaddedHeight): Ditto for height.
2268         (WebCore::RenderMathMLPadded::mpaddedDepth): Ditto for detph.
2269         (WebCore::RenderMathMLPadded::computePreferredLogicalWidths): Use mpaddedWidth().
2270         (WebCore::RenderMathMLPadded::layoutBlock): Use the new helper functions.
2271         (WebCore::RenderMathMLPadded::firstLineBaseline): Use voffset or mpaddedHeight for baseline
2272         calculation instead of m_padded.
2273         (WebCore::RenderMathMLPadded::resolveWidth): Deleted. Renamed mpaddedWidth.
2274         (WebCore::RenderMathMLPadded::resolveAttributes): Deleted. Split into smaller functions.
2275         (WebCore::RenderMathMLPadded::updateFromElement): Deleted. We do not need to call
2276         setNeedsLayout.
2277         (WebCore::RenderMathMLPadded::styleDidChange): Deleted. Ditto.
2278         * rendering/mathml/RenderMathMLPadded.h: Update function declaration and remove m_ascent.
2279
2280 2016-08-27  Alex Christensen  <achristensen@webkit.org>
2281
2282         URLParser should parse relative URLs
2283         https://bugs.webkit.org/show_bug.cgi?id=161282
2284
2285         Reviewed by Darin Adler.
2286
2287         Partially covered by new API tests, but once the parser is complete enough we can
2288         use the url web platform tests to more fully test this.  It's still a work in
2289         progress only used by tests.
2290
2291         * platform/URLParser.cpp:
2292         (WebCore::URLParser::urlLengthUntilPart):
2293         (WebCore::URLParser::copyURLPartsUntil):
2294         Added some helper functions to reduce redundant code.  When parsing relative URLs,
2295         we often want to copy large parts of the base URL, but the stopping point differs.
2296         (WebCore::URLParser::parse):
2297         The parser now returns a URL instead of an Optional<URL> because a URL has a m_isValid which behaves like Optional.
2298         * platform/URLParser.h:
2299         (WebCore::URLParser::parse):
2300
2301 2016-08-27  Chris Dumez  <cdumez@apple.com>
2302
2303         Update generated bindings to throw a SecurityError when denying cross-origin access to properties
2304         https://bugs.webkit.org/show_bug.cgi?id=161270
2305
2306         Reviewed by Darin Adler.
2307
2308         Update generated bindings to throw a SecurityError when denying cross-origin
2309         access to properties, as per the HTML specification:
2310         - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
2311         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
2312
2313         Firefox and Chrome already throw but Webkit was logging an error message and
2314         returning undefined instead.
2315
2316         No new tests, updated existing tests.
2317
2318         * bindings/js/JSDOMBinding.cpp:
2319         (WebCore::canAccessDocument):
2320         (WebCore::BindingSecurity::shouldAllowAccessToNode):
2321         * bindings/js/JSDOMBinding.h:
2322         * bindings/scripts/CodeGeneratorJS.pm:
2323         (GenerateImplementation):
2324
2325 2016-08-27  Chris Dumez  <cdumez@apple.com>
2326
2327         Follow-up fixes after r205030.
2328         https://bugs.webkit.org/show_bug.cgi?id=161216
2329
2330         Reviewed by Darin Adler.
2331
2332         * html/parser/HTMLParserIdioms.cpp:
2333         (WebCore::isHTMLSpaceOrDelimiter):
2334         (WebCore::isNumberStart):
2335         (WebCore::parseHTMLListOfOfFloatingPointNumberValues):
2336         * html/parser/HTMLParserIdioms.h:
2337
2338 2016-08-27  Rawinder Singh  <rawinder.singh-webkit@cisra.canon.com.au>
2339
2340         Add final keyword to final classes and overriden methods in WebCore/css
2341         https://bugs.webkit.org/show_bug.cgi?id=161182
2342
2343         Reviewed by Darin Adler.
2344
2345         - Mark classes in the WebCore/css directory final as appropriate.
2346         - Update WebCore/css classes so that overriden methods in final classes are marked final.
2347
2348         * css/CSSAnimationTriggerScrollValue.h:
2349         * css/CSSAspectRatioValue.h:
2350         * css/CSSBasicShapes.h:
2351         * css/CSSBorderImageSliceValue.h:
2352         * css/CSSCalculationValue.cpp:
2353         (WebCore::determineCategory):
2354         * css/CSSCalculationValue.h:
2355         * css/CSSCanvasValue.h:
2356         * css/CSSCharsetRule.h:
2357         * css/CSSComputedStyleDeclaration.h:
2358         * css/CSSContentDistributionValue.h:
2359         * css/CSSCrossfadeValue.h:
2360         * css/CSSCursorImageValue.h:
2361         * css/CSSCustomPropertyValue.h:
2362         * css/CSSFilterImageValue.h:
2363         * css/CSSFontFaceLoadEvent.h:
2364         * css/CSSFontFaceSrcValue.h:
2365         * css/CSSFontFeatureValue.h:
2366         * css/CSSFontSelector.h:
2367         * css/CSSFontValue.h:
2368         * css/CSSFunctionValue.h:
2369         * css/CSSGradientValue.h:
2370         * css/CSSGridAutoRepeatValue.h:
2371         * css/CSSGridLineNamesValue.h:
2372         * css/CSSGridTemplateAreasValue.h:
2373         * css/CSSImageSetValue.h:
2374         * css/CSSImageValue.h:
2375         * css/CSSInheritedValue.h:
2376         * css/CSSInitialValue.h:
2377         * css/CSSKeyframeRule.h:
2378         * css/CSSKeyframesRule.h:
2379         * css/CSSLineBoxContainValue.h:
2380         * css/CSSNamedImageValue.h:
2381         * css/CSSPrimitiveValue.h:
2382         * css/CSSReflectValue.h:
2383         * css/CSSRevertValue.h:
2384         * css/CSSRuleList.h:
2385         * css/CSSSegmentedFontFace.h:
2386         * css/CSSShadowValue.h:
2387         * css/CSSStyleSheet.cpp:
2388         * css/CSSStyleSheet.h:
2389         * css/CSSSupportsRule.h:
2390         * css/CSSTimingFunctionValue.h:
2391         * css/CSSUnicodeRangeValue.h:
2392         * css/CSSUnknownRule.h:
2393         * css/CSSUnsetValue.h:
2394         * css/CSSValue.cpp:
2395         * css/CSSVariableDependentValue.h:
2396         * css/CSSVariableValue.h:
2397         * css/Counter.h:
2398         * css/DOMCSSNamespace.h:
2399         * css/DashboardRegion.h:
2400         * css/LengthRepeat.h:
2401         * css/MediaList.h:
2402         * css/MediaQueryList.h:
2403         * css/MediaQueryMatcher.h:
2404         * css/Pair.h:
2405         * css/PropertySetCSSStyleDeclaration.h:
2406         * css/RGBColor.h:
2407         * css/Rect.h:
2408         * css/StyleMedia.h:
2409         * css/StyleProperties.h:
2410         * css/StyleRule.h:
2411         * css/StyleRuleImport.h:
2412         * css/StyleSheetContents.h:
2413         * css/StyleSheetList.h:
2414         * css/ViewportStyleResolver.h:
2415         * css/WebKitCSSFilterValue.h:
2416         * css/WebKitCSSRegionRule.h:
2417         * css/WebKitCSSTransformValue.h:
2418         * css/WebKitCSSViewportRule.h:
2419
2420 2016-08-27  Simon Fraser  <simon.fraser@apple.com>
2421
2422         Add more Editing logging
2423         https://bugs.webkit.org/show_bug.cgi?id=161287
2424
2425         Reviewed by Darin Adler.
2426
2427         Add logging which tracks how key events get from the UI process to the
2428         web process, and down to form fields.
2429
2430         * editing/Editor.cpp:
2431         (WebCore::Editor::handleTextEvent):
2432         (WebCore::Editor::appliedEditing):
2433         * editing/TypingCommand.cpp:
2434         (WebCore::TypingCommand::insertText):
2435         (WebCore::TypingCommand::insertTextAndNotifyAccessibility):
2436         * html/HTMLTextFormControlElement.cpp:
2437         (WebCore::HTMLTextFormControlElement::didEditInnerTextValue):
2438         * page/EventHandler.cpp:
2439         (WebCore::EventHandler::keyEvent):
2440         (WebCore::EventHandler::handleTextInputEvent):
2441
2442 2016-08-27  Sam Weinig  <sam@webkit.org>
2443
2444         Remove more custom JavaScript bindings
2445         https://bugs.webkit.org/show_bug.cgi?id=161293
2446
2447         Reviewed by Darin Adler.
2448
2449         Remove custom bindings for AudioContext, DOMFormData, MediaSession and WebKitPoint.
2450
2451         * Modules/mediasession/MediaSession.cpp:
2452         (WebCore::MediaSession::MediaSession):
2453         * Modules/mediasession/MediaSession.h:
2454         Change to take Document explicitly, since that is what it 
2455         expecting.
2456
2457         * Modules/webaudio/AudioContext.cpp:
2458         (WebCore::AudioContext::create):
2459         * Modules/webaudio/AudioContext.h:
2460         Remove unused ExceptionCode parameter.
2461
2462         * Modules/webaudio/AudioContext.idl:
2463         * html/DOMFormData.idl:
2464         * html/HTMLFormElement.idl:
2465         * page/WebKitPoint.idl:
2466         Switch to use the generated constructor.
2467
2468         * CMakeLists.txt:
2469         * WebCore.xcodeproj/project.pbxproj:
2470         * bindings/js/JSBindingsAllInOne.cpp:
2471         Remove files.
2472         
2473         * bindings/js/JSAudioContextCustom.cpp: Removed.
2474         * bindings/js/JSDOMFormDataCustom.cpp: Removed.
2475         * bindings/js/JSMediaSessionCustom.cpp: Removed.
2476         * bindings/js/JSWebKitPointCustom.cpp: Removed.
2477         Remove in favor of generated variants.
2478
2479         * bindings/js/JSHTMLInputElementCustom.h: Removed.
2480         Remove unused header.
2481
2482         * page/WebKitPoint.h:
2483         (WebCore::WebKitPoint::create):
2484         (WebCore::WebKitPoint::WebKitPoint):
2485         Move NaN replacement into the implementation and out of the bindings.
2486
2487 2016-08-27  Ryosuke Niwa  <rniwa@webkit.org>
2488
2489         Add adopted callback for custom elements
2490         https://bugs.webkit.org/show_bug.cgi?id=161284
2491
2492         Reviewed by Antti Koivisto.
2493
2494         Added the support for adoptedCallback: https://dom.spec.whatwg.org/#concept-node-adopt
2495         For now, we only support this callback on appendChild.
2496
2497         Test: fast/custom-elements/adopted-callback.html
2498
2499         * bindings/js/JSCustomElementInterface.cpp:
2500         (WebCore::JSCustomElementInterface::invokeCallback): Added JSDOMGlobalObject* as an argument to the callback so that
2501         we can invoke toJS on Document in invokeAdoptedCallback.
2502         (WebCore::JSCustomElementInterface::setAdoptedCallback): Added.
2503         (WebCore::JSCustomElementInterface::invokeAdoptedCallback): Added.
2504         (WebCore::JSCustomElementInterface::setAttributeChangedCallback):
2505         * bindings/js/JSCustomElementInterface.h:
2506         (WebCore::JSCustomElementInterface::hasConnectedCallback): Added.
2507         (WebCore::JSCustomElementInterface::hasDisconnectedCallback): Added.
2508         (WebCore::JSCustomElementInterface::hasAdoptedCallback): Added.
2509         * bindings/js/JSCustomElementRegistryCustom.cpp:
2510         (WebCore::JSCustomElementRegistry::define):
2511         * dom/CustomElementReactionQueue.cpp:
2512         (WebCore::CustomElementReactionQueueItem::CustomElementReactionQueueItem): Added a variant that takes two documents.
2513         (WebCore::CustomElementReactionQueueItem::invoke):
2514         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded): Fixed a bug that this function was always
2515         enqueuing a callback even when the interface didn't have connectedCallback. Also, there is no need to check
2516         the nullity of the interface since it should never be null.
2517         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded): Ditto.
2518         (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded): Added.
2519         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded): Assert that the interface is never
2520         null instead of exiting early.
2521         * dom/CustomElementReactionQueue.h:
2522         * dom/Element.cpp:
2523         (WebCore::Element::didMoveToNewDocument): Added a call to enqueueAdoptedCallbackIfNeeded.
2524
2525 2016-08-27  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
2526
2527         Fix the !PLATFORM(WIN) && USE(CURL) build.
2528         https://bugs.webkit.org/show_bug.cgi?id=161281
2529
2530         Reviewed by Alex Christensen.
2531
2532         * platform/network/curl/ResourceHandleCurl.cpp:
2533
2534 2016-08-27  Youenn Fablet  <youenn@apple.com>
2535
2536         [Fetch API] Opaque responses should not have any body
2537         https://bugs.webkit.org/show_bug.cgi?id=161130
2538
2539         Reviewed by Sam Weinig.
2540
2541         Covered by updated test.
2542
2543         Added a new ThreadableLoader option to receive or not opaque response body.
2544         By default, option is set to Receive.
2545         FetchLoader is setting it to DoNotReceive.
2546
2547         * Modules/fetch/FetchLoader.cpp:
2548         (WebCore::FetchLoader::start):
2549         * loader/DocumentThreadableLoader.cpp:
2550         (WebCore::DocumentThreadableLoader::didReceiveResponse): Calling didFinishLoading just after didReceiveResponse in case of Opaque responses.
2551         * loader/ThreadableLoader.cpp:
2552         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions):
2553         * loader/ThreadableLoader.h:
2554         * loader/WorkerThreadableLoader.cpp:
2555         (WebCore::LoaderTaskOptions::LoaderTaskOptions):
2556
2557 2016-08-27  Youenn Fablet  <youenn@apple.com>
2558
2559         [Fetch API] opaqueredirect responses should have their URL set to the original URL
2560         https://bugs.webkit.org/show_bug.cgi?id=161194
2561
2562         Reviewed by Sam Weinig.
2563
2564         Covered by updated tests.
2565
2566         * loader/DocumentThreadableLoader.cpp:
2567         (WebCore::DocumentThreadableLoader::didReceiveResponse):
2568         * loader/SubresourceLoader.cpp: Removing isNull ASSERT since we now set the response URL.
2569         (WebCore::SubresourceLoader::willSendRequestInternal): Setting opaqueredirect response URL to the original URL.
2570
2571 2016-08-27  Andreas Kling  <akling@apple.com>
2572
2573         script.text should behave like script.textContent on setting
2574         <https://webkit.org/b/148852>
2575
2576         Reviewed by Chris Dumez.
2577
2578         HTMLScriptElement.text should behave just like .textContent when setting,
2579         so just forward setText() to setTextContent().
2580
2581         Test: import/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/script-text.html
2582
2583         * html/HTMLScriptElement.cpp:
2584         (WebCore::HTMLScriptElement::setText):
2585
2586 2016-08-27  Youenn Fablet  <youenn@apple.com>
2587
2588         [Fetch API] Blob type should be set from Response/Request contentType header
2589         https://bugs.webkit.org/show_bug.cgi?id=161228
2590
2591         Reviewed by Alex Christensen.
2592
2593         Covered by updated tests.
2594
2595         Renaming FetchBody::m_mimeType to m_contentType since that better relates to Content-Type header.
2596         Updated FetchRequest and FetchResponse to set m_contentType according request/response headers.
2597         Handled the case of a Request created from JS, a Response created from JS and a Response created internally to
2598         be used as resolve value in the fetch promise.
2599
2600         In case Content-Type is set but is empty, its empty value should be used for blob type.
2601         Updated contentType checks to use isNull in lieu of isEmpty.
2602
2603         * Modules/fetch/FetchBody.cpp:
2604         (WebCore::FetchBody::updateContentType): Routine to synchronize headers with m_contentType.
2605         (WebCore::FetchBody::FetchBody): Renamed m_mimeType to m_contentType.
2606         (WebCore::FetchBody::blob): Ditto.
2607         * Modules/fetch/FetchBody.h: Ditto.
2608         (WebCore::FetchBody::contentType):
2609         (WebCore::FetchBody::setMimeType): Deleted.
2610         (WebCore::FetchBody::mimeType): Deleted.
2611         * Modules/fetch/FetchRequest.cpp:
2612         (WebCore::FetchRequest::setBody): set FetchBody::m_contentType according HTTP headers.
2613         * Modules/fetch/FetchResponse.cpp:
2614         (WebCore::FetchResponse::initializeWith): Ditto.
2615         (WebCore::FetchResponse::BodyLoader::didReceiveResponse): Ditto.
2616
2617 2016-08-26  Alex Christensen  <achristensen@webkit.org>
2618
2619         Fix Windows build after r205065.
2620
2621         * Modules/webaudio/BiquadFilterNode.idl:
2622         * Modules/webaudio/PannerNode.idl:
2623         There's no WEB_AUDIO on Windows.
2624
2625 2016-08-26  Devin Rousso  <dcrousso+webkit@gmail.com>
2626
2627         REGRESSION (r203535): Web Inspector: Inspector overlay node info has disappeared
2628         https://bugs.webkit.org/show_bug.cgi?id=161264
2629
2630         Reviewed by Joseph Pecoraro.
2631
2632         No new tests.  Fixing JavaScript error in Inspector overlay.
2633
2634         * inspector/InspectorOverlay.cpp:
2635         (evaluateCommandInOverlay):
2636         (WebCore::InspectorOverlay::evaluateInOverlay):
2637         Add ASSERT to ensure that errors in the Inspector overlay will cause tests to crash.
2638
2639         * inspector/InspectorOverlayPage.js:
2640         (DOMBuilder.prototype.appendTextNode):
2641         Move textContent value to parameter of document.createTextNode.
2642
2643 2016-08-26  Sam Weinig  <sam@webkit.org>
2644
2645         Remove support for ENABLE_LEGACY_WEB_AUDIO
2646         https://bugs.webkit.org/show_bug.cgi?id=161262
2647
2648         Reviewed by Anders Carlsson.
2649
2650         * Configurations/FeatureDefines.xcconfig:
2651         Remove ENABLE_LEGACY_WEB_AUDIO.
2652
2653         * Modules/webaudio/AudioBufferSourceNode.cpp:
2654         (WebCore::AudioBufferSourceNode::noteGrainOn): Deleted.
2655         * Modules/webaudio/AudioBufferSourceNode.h:
2656         * Modules/webaudio/AudioBufferSourceNode.idl:
2657         (WebCore::AudioScheduledSourceNode::noteOn): Deleted.
2658         (WebCore::AudioScheduledSourceNode::noteOff): Deleted.
2659         * Modules/webaudio/AudioScheduledSourceNode.h:
2660         * Modules/webaudio/AudioScheduledSourceNode.cpp:
2661         Remove the looping attribute, as well as the noteOn, noteOff, and noteGrainOn functions.
2662
2663         * Modules/webaudio/AudioContext.idl:
2664         Remove the createGainNode, createDelayNode and createJavaScriptNode functions.
2665
2666         * Modules/webaudio/AudioParam.idl:
2667         Remove the setTargetValueAtTime function.
2668
2669         * Modules/webaudio/BiquadDSPKernel.cpp:
2670         (WebCore::BiquadDSPKernel::updateCoefficientsIfNecessary):
2671         * Modules/webaudio/BiquadFilterNode.cpp:
2672         (WebCore::BiquadFilterNode::type):
2673         (WebCore::BiquadFilterNode::setType):
2674         (WebCore::BiquadFilterNode::getFrequencyResponse):
2675         * Modules/webaudio/BiquadFilterNode.h:
2676         * Modules/webaudio/BiquadFilterNode.idl:
2677         * Modules/webaudio/BiquadProcessor.cpp:
2678         (WebCore::BiquadProcessor::BiquadProcessor):
2679         (WebCore::BiquadProcessor::setType):
2680         (WebCore::BiquadProcessor::getFrequencyResponse):
2681         * Modules/webaudio/BiquadProcessor.h:
2682         (WebCore::BiquadProcessor::type):
2683         * bindings/js/JSBiquadFilterNodeCustom.cpp: Removed.
2684         Rename BiquadProcessor::FilterType to BiquadFilterType and use it
2685         directly from the IDL. Remove legacy filter constants from the IDL
2686         and the need for a custom binding for the type attribute.
2687
2688         * Modules/webaudio/OscillatorNode.cpp:
2689         (WebCore::OscillatorNode::OscillatorNode):
2690         (WebCore::OscillatorNode::setType):
2691         (WebCore::OscillatorNode::setPeriodicWave):
2692         (WebCore::OscillatorNode::type): Deleted.
2693         * Modules/webaudio/OscillatorNode.h:
2694         (WebCore::OscillatorNode::type):
2695         * Modules/webaudio/OscillatorNode.idl:
2696         * Modules/webaudio/PeriodicWave.cpp:
2697         (WebCore::PeriodicWave::createSine):
2698         (WebCore::PeriodicWave::createSquare):
2699         (WebCore::PeriodicWave::createSawtooth):
2700         (WebCore::PeriodicWave::createTriangle):
2701         (WebCore::PeriodicWave::generateBasicWaveform):
2702         * Modules/webaudio/PeriodicWave.h:
2703         * bindings/js/JSOscillatorNodeCustom.cpp: Removed.
2704         Remove noteOn and noteOff functions and the type integer constants.
2705         Remove the need for a custom binding for the type attribute by renaming
2706         the type enum OscillatorNode::Type and putting the enum in the IDL.
2707
2708         * Modules/webaudio/PannerNode.cpp:
2709         (WebCore::PannerNode::PannerNode):
2710         (WebCore::PannerNode::process):
2711         (WebCore::PannerNode::setPanningModel):
2712         (WebCore::PannerNode::distanceModel):
2713         (WebCore::PannerNode::setDistanceModel):
2714         (WebCore::PannerNode::panningModel): Deleted.
2715         * Modules/webaudio/PannerNode.h:
2716         (WebCore::PannerNode::panningModel):
2717         * Modules/webaudio/PannerNode.idl:
2718         * bindings/js/JSPannerNodeCustom.cpp: Removed.
2719         * platform/audio/Distance.cpp:
2720         (WebCore::DistanceEffect::DistanceEffect):
2721         (WebCore::DistanceEffect::gain):
2722         * platform/audio/Distance.h:
2723         (WebCore::DistanceEffect::model):
2724         (WebCore::DistanceEffect::setModel):
2725         * platform/audio/EqualPowerPanner.cpp:
2726         (WebCore::EqualPowerPanner::EqualPowerPanner):
2727         * platform/audio/HRTFPanner.cpp:
2728         (WebCore::HRTFPanner::HRTFPanner):
2729         * platform/audio/Panner.cpp:
2730         (WebCore::Panner::create):
2731         * platform/audio/Panner.h:
2732         (WebCore::Panner::panningModel):
2733         (WebCore::Panner::Panner):
2734         Replace the panning model and distance model integer constants
2735         with IDL enum support, removing the need for a custom binding.
2736         Rename the supporting C++ enums to work with the bindings.
2737
2738         * bindings/js/JSAudioContextCustom.cpp:
2739         (WebCore::constructJSAudioContext):
2740         Remove deprecated way of creating an offline context.
2741
2742         * WebCore.xcodeproj/project.pbxproj:
2743         Update files.
2744
2745 2016-08-26  Johan K. Jensen  <johan_jensen@apple.com>
2746
2747         Web Inspector: Frontend should have access to Resource Timing information
2748         https://bugs.webkit.org/show_bug.cgi?id=160095
2749
2750         Reviewed by Alex Christensen.
2751
2752         Show correct information with Resource Timing information
2753         from ResourceLoader rather than DocumentLoader.
2754
2755         No new tests, frontend doesn't use the timing data yet.
2756
2757         * inspector/InspectorNetworkAgent.cpp:
2758         (WebCore::InspectorNetworkAgent::buildObjectForTiming):
2759         (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse):
2760         (WebCore::InspectorNetworkAgent::buildObjectForCachedResource):
2761         (WebCore::InspectorNetworkAgent::willSendRequest):
2762         (WebCore::InspectorNetworkAgent::didReceiveResponse):
2763         (WebCore::InspectorNetworkAgent::didLoadResourceFromMemoryCache):
2764         (WebCore::buildObjectForTiming): Deleted.
2765         (WebCore::buildObjectForResourceResponse): Deleted.
2766         (WebCore::buildObjectForCachedResource): Deleted.
2767         Use ResourceLoader instead of DocumentLoader to get Resource Timing information.
2768         Move functions to member functions to access the executionStopWatch.
2769
2770         (WebCore::InspectorNetworkAgent::didFinishLoading):
2771         Use the load timing finishTime and convert to elapsed time for frontend.
2772
2773         * inspector/InspectorNetworkAgent.h:
2774         * loader/SubresourceLoader.cpp:
2775         (WebCore::SubresourceLoader::didFinishLoading):
2776         Pass the web process load timing on to the inspector.
2777
2778 2016-08-26  Chris Dumez  <cdumez@apple.com>
2779
2780         Unreviewed, fix Windows build after r205048.
2781
2782         * bindings/scripts/CodeGeneratorJS.pm:
2783         (getConditionalForFunctionConsideringOverloads):
2784         * bindings/scripts/test/JS/JSTestObj.cpp:
2785         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload1):
2786         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload2):
2787         (WebCore::jsTestObjPrototypeFunctionSingleConditionalOverload):
2788         * bindings/scripts/test/TestObj.idl:
2789
2790 2016-08-23  Ryosuke Niwa  <rniwa@webkit.org>
2791
2792         Adopted custom element's callbacks should continue to work
2793         https://bugs.webkit.org/show_bug.cgi?id=161065
2794
2795         Reviewed by Andreas Kling.
2796
2797         When a custom element is adopted into another document, its reaction callbacks need to continue to work.
2798         Because a different document may have its own global object, each custom element needs to remember its
2799         original global object or JSCustomElementInterface. This patch adds the latter to the element rare data.
2800
2801         Tests: fast/custom-elements/connected-callbacks.html
2802                fast/custom-elements/disconnected-callbacks.html
2803
2804         * bindings/js/JSCustomElementInterface.cpp:
2805         (WebCore::JSCustomElementInterface::constructElement):
2806         (WebCore::JSCustomElementInterface::upgradeElement):
2807         * dom/CustomElementReactionQueue.cpp:
2808         (WebCore::findInterfaceForCustomElement): Deleted.
2809         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
2810         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
2811         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
2812         * dom/Element.cpp:
2813         (WebCore::Element::insertedInto): Invoke callbacks even when the current document is not a HTML document.
2814         (WebCore::Element::removedFrom): Ditto.
2815         (WebCore::Element::setCustomElementIsResolved): Moved from Node. Add the element interface to the rare data.
2816         (WebCore::Element::customElementInterface): Added.
2817         * dom/Element.h:
2818         * dom/ElementRareData.cpp:
2819         * dom/ElementRareData.h:
2820         (WebCore::ElementRareData::customElementInterface): Added.
2821         (WebCore::ElementRareData::setCustomElementInterface): Added.
2822         * dom/Node.h:
2823         ((WebCore::Node::setCustomElementIsResolved): Deleted.
2824
2825 2016-08-26  Zalan Bujtas  <zalan@apple.com>
2826
2827         ASSERT_NOT_REACHED() is touched in WebCore::minimumValueForLength
2828         https://bugs.webkit.org/show_bug.cgi?id=125781
2829         <rdar://problem/27684457>
2830
2831         Reviewed by Simon Fraser.
2832
2833         RenderTableSection::calcRowLogicalHeight misused minimumValueForLength to fallback to 0 for non-fixed values.
2834         While this patch fixes the assertion, the table section code needs works to support calc values. See webkit.org/b/161273.   
2835
2836         Test: fast/table/assert-on-min-max-content-values.html
2837
2838         * rendering/RenderTableSection.cpp:
2839         (WebCore::RenderTableSection::calcRowLogicalHeight):
2840
2841 2016-08-26  Andreas Kling  <akling@apple.com>
2842
2843         REGRESSION (r204987): fast/canvas-composite-* tests are now flaky assertion failures
2844         <https://webkit.org/b/161259>
2845
2846         Reviewed by Joseph Pecoraro.
2847
2848         Fix a blunder where HTMLCanvasElement::memoryCost() wasn't forwarding the inquiry
2849         to ImageBuffer but HTMLCanvasElement::externalMemoryCost() was.
2850
2851         This fixes flaky "externalMemorySize() <= extraMemorySize()" assertions on debug bots.
2852
2853         * html/HTMLCanvasElement.cpp:
2854         (WebCore::HTMLCanvasElement::memoryCost):
2855
2856 2016-08-26  Andreas Kling  <akling@apple.com>
2857
2858         The :enabled/:disabled selectors should only match elements that can be disabled.
2859         <https://webkit.org/b/161255>
2860
2861         Reviewed by Chris Dumez.
2862
2863         Per the HTML spec, only the following elements can be actually disabled:
2864
2865             button, input, select, textarea, optgroup, option, menuitem, fieldset
2866
2867         Since HTMLOutputElement inherits from HTMLFormControlElement, it had some
2868         misguided ideas about being disableable. This was causing it to get matched
2869         by :enabled and :disabled selectors.
2870
2871         Test: imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/disabled.html
2872
2873         * css/SelectorChecker.cpp:
2874         (WebCore::SelectorChecker::checkOne):
2875         * cssjit/SelectorCompiler.cpp:
2876         (WebCore::SelectorCompiler::addPseudoClassType):
2877         * css/SelectorCheckerTestFunctions.h:
2878         (WebCore::matchesDisabledPseudoClass):
2879         (WebCore::matchesEnabledPseudoClass): Renamed from isEnabled/isDisabled. Now only allows
2880         :enabled and :disabled selectors to match elements that are actually disableable.
2881
2882         * html/HTMLElement.h:
2883         * html/HTMLElement.cpp:
2884         (WebCore::HTMLElement::canBeActuallyDisabled):
2885         (WebCore::HTMLElement::isActuallyDisabled): Added supporting functions for the aforementioned selectors.
2886
2887         * html/HTMLFormControlElement.cpp:
2888         (WebCore::HTMLFormControlElement::parseAttribute): Don't care about disabled state
2889         changes in elements that are not disableable in the first place.
2890
2891 2016-08-26  Chris Dumez  <cdumez@apple.com>
2892
2893         REGRESSION(r204028): Fix unused-but-set-variable warning in generated JSNavigator.cpp
2894         https://bugs.webkit.org/show_bug.cgi?id=161252
2895
2896         Reviewed by Ryosuke Niwa.
2897
2898         Improve support for [Conditional] with overloaded operations in the IDL.
2899
2900         No new tests, updated bindings tests.
2901
2902         * bindings/scripts/CodeGeneratorJS.pm:
2903         (GenerateHeader):
2904         (GeneratePropertiesHashTable):
2905         (getConditionalForFunctionConsideringOverloads):
2906         (GenerateOverloadedFunctionOrConstructor):
2907         (GenerateImplementation):
2908         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2909         (WebCore::jsTestGlobalObjectInstanceFunctionEnabledAtRuntimeOperation): Deleted.
2910         * bindings/scripts/test/JS/JSTestObj.cpp:
2911         (WebCore::jsTestObjPrototypeFunctionConditionalOverload1):
2912         (WebCore::jsTestObjPrototypeFunctionConditionalOverload2):
2913         (WebCore::jsTestObjPrototypeFunctionConditionalOverload):
2914         (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation): Deleted.
2915         (WebCore::jsTestObjConstructorFunctionOverloadedMethod1): Deleted.
2916         * bindings/scripts/test/TestObj.idl:
2917
2918 2016-08-26  Beth Dakin  <bdakin@apple.com>
2919
2920         charactersAroundPosition can be wrong because it crosses editing boundaries
2921         https://bugs.webkit.org/show_bug.cgi?id=161215
2922         -and corresponding-
2923         rdar://problem/27933564
2924
2925         Reviewed by Ryosuke Niwa.
2926
2927         charactersAroundPosition() should not cross editing boundaries. This patch fixes 
2928         that by making nextCharacterBoundaryInDirection() take an 
2929         EditingBoundaryCrossingRule parameter to pass onto VisiblePosition::next() and 
2930         VisiblePosition::previous().
2931
2932         * editing/VisibleUnits.cpp:
2933         (WebCore::nextCharacterBoundaryInDirection):
2934         (WebCore::positionOfNextBoundaryOfGranularity):
2935         (WebCore::charactersAroundPosition):
2936
2937 2016-08-26  Joseph Pecoraro  <pecoraro@apple.com>
2938
2939         Web Inspector: Test and address issues in IndexedDB.requestData
2940         https://bugs.webkit.org/show_bug.cgi?id=161178
2941         <rdar://problem/28002467>
2942
2943         Reviewed by Brian Burg.
2944
2945         Test: inspector/indexeddb/requestData.html
2946
2947         * inspector/InspectorIndexedDBAgent.cpp:
2948         (idbKeyRangeFromKeyRange):
2949         Parsing was too strict. "lower" and "upper" keys are optional.
2950
2951         (WebCore::DataLoader::execute):
2952         Ensure the skip count is passed forward.
2953
2954 2016-08-25  Joseph Pecoraro  <pecoraro@apple.com>
2955
2956         Web Inspector: Provide a way to clear an IndexedDB object store
2957         https://bugs.webkit.org/show_bug.cgi?id=161167
2958         <rdar://problem/27996932>
2959
2960         Reviewed by Brian Burg.
2961
2962         Test: inspector/indexeddb/clearObjectStore.html
2963
2964         * inspector/InspectorIndexedDBAgent.cpp:
2965         Make the transaction for clearing an object store readwrite
2966         instead of readonly, and activate it.
2967
2968 2016-08-26  Chris Dumez  <cdumez@apple.com>
2969
2970         Calling crossOriginWindow.toString() should not be allowed
2971         https://bugs.webkit.org/show_bug.cgi?id=161225
2972
2973         Reviewed by Andreas Kling.
2974
2975         Calling crossOriginWindow.toString() should not be allowed:
2976         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
2977
2978         In WebKit, we were printing a security error in the console but
2979         returning "[object Window]" anyway.
2980
2981         In Firefox and Chrome, it throws an exception.
2982
2983         No new tests, updated existing test.
2984
2985         * bindings/js/JSDOMWindowCustom.cpp:
2986         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
2987
2988 2016-08-26  Devin Rousso  <dcrousso+webkit@gmail.com>
2989
2990         Web Inspector: Some CSS selectors in the UI aren't escaped
2991         https://bugs.webkit.org/show_bug.cgi?id=151378
2992
2993         Reviewed by Joseph Pecoraro.
2994
2995         No new tests, but logic and results of existing tests updated:
2996         * inspector/dom/content-node-region-info.html:
2997         * inspector/dom/content-node-region-info-expected.txt:
2998         * inspector/dom/highlightNode-expected.txt:
2999         * inspector/dom/highlightSelector.html:
3000         * inspector/dom/highlightSelector-expected.txt:
3001
3002         * inspector/InspectorOverlay.cpp:
3003         (WebCore::buildObjectForElementData):
3004
3005         * inspector/InspectorOverlayPage.css:
3006         (.pseudo-type):
3007         (.tag-name): Deleted.
3008
3009         * inspector/InspectorOverlayPage.js:
3010         (_createElementTitle):
3011
3012 2016-08-25  Brent Fulgham  <bfulgham@apple.com>
3013
3014         Crash when getting font bounding rect
3015         https://bugs.webkit.org/show_bug.cgi?id=161202
3016         <rdar://problem/27986981>
3017
3018         Reviewed by Myles C. Maxfield.
3019
3020         We should never store GlyphData objects for later use, because they contain raw pointers to Font elements
3021         contained in caches, and those font caches get periodically purged.
3022
3023         Instead, we should hold onto the ‘key’ representing the GlyphData, and simply ask the system for the
3024         GlyphData the next time it is needed.
3025
3026         Tested by existing MathML tests under ASAN and GuardMalloc.
3027
3028         * rendering/mathml/RenderMathMLToken.cpp:
3029         (WebCore::RenderMathMLToken::RenderMathMLToken): Clean up constructors.
3030         (WebCore::RenderMathMLToken::computePreferredLogicalWidths): Use keys to get correct GlyphData when needed.
3031         (WebCore::RenderMathMLToken::updateMathVariantGlyph): Ditto.
3032         (WebCore::RenderMathMLToken::firstLineBaseline): Ditto.
3033         (WebCore::RenderMathMLToken::layoutBlock): Ditto.
3034         (WebCore::RenderMathMLToken::paint): Ditto.
3035         (WebCore::RenderMathMLToken::paintChildren): Ditto.
3036         * rendering/mathml/RenderMathMLToken.h:
3037
3038 2016-08-26  Chris Dumez  <cdumez@apple.com>
3039
3040         HTMLAreaElement's coords attributes parsing does not comply with the HTML specification
3041         https://bugs.webkit.org/show_bug.cgi?id=161216
3042
3043         Reviewed by Andreas Kling.
3044
3045         HTMLAreaElement's coords attributes parsing does not comply with the HTML specification:
3046         - https://html.spec.whatwg.org/#attr-area-coords
3047
3048         This patch aligns our parsing of this attribute with the specification and Chrome.
3049
3050         No new tests, rebaselined existing test.
3051
3052         * html/HTMLAreaElement.cpp:
3053         (WebCore::HTMLAreaElement::HTMLAreaElement):
3054         (WebCore::HTMLAreaElement::parseAttribute):
3055         (WebCore::HTMLAreaElement::getRegion):
3056         * html/HTMLAreaElement.h:
3057         * html/parser/HTMLParserIdioms.cpp:
3058         (WebCore::isHTMLSpaceOrDelimiter):
3059         (WebCore::isNumberStart):
3060         (WebCore::parseHTMLListOfOfFloatingPointNumberValuesInternal):
3061         (WebCore::parseHTMLListOfOfFloatingPointNumberValues):
3062         (WebCore::parseHTMLNonNegativeInteger): Deleted.
3063         * html/parser/HTMLParserIdioms.h:
3064
3065 2016-08-26  Csaba Osztrogonác  <ossy@webkit.org>
3066
3067         Fix the !ENABLE(WEB_SOCKETS) build
3068         https://bugs.webkit.org/show_bug.cgi?id=161251
3069
3070         Reviewed by Alex Christensen.
3071
3072         * page/SocketProvider.h:
3073
3074 2016-08-26  Csaba Osztrogonác  <ossy@webkit.org>
3075
3076         Fix the !ENABLE(WEB_TIMING) build
3077         https://bugs.webkit.org/show_bug.cgi?id=161250
3078
3079         Reviewed by Alex Christensen.
3080
3081         * loader/SubresourceLoader.cpp:
3082         (WebCore::SubresourceLoader::didFinishLoading):
3083         * loader/cache/CachedResourceLoader.h:
3084         (WebCore::CachedResourceLoader::resourceTimingInformation):
3085
3086 2016-08-26  Chris Dumez  <cdumez@apple.com>
3087
3088         Trying to access cross-origin Location properties should throw a SecurityError
3089         https://bugs.webkit.org/show_bug.cgi?id=161248
3090
3091         Reviewed by Alex Christensen.
3092
3093         Trying to access cross-origin Location properties should throw a SecurityError:
3094         - https://html.spec.whatwg.org/#crossorigingetownpropertyhelper-(-o,-p-)
3095         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
3096
3097         Firefox and Chrome already throw. However, WebKit was logging an error message
3098         and returning undefined.
3099
3100         No new tests, updated existing tests.
3101
3102         * bindings/js/JSDOMBinding.cpp:
3103         (WebCore::throwSecurityError):
3104         * bindings/js/JSDOMBinding.h:
3105         * bindings/js/JSLocationCustom.cpp:
3106         (WebCore::JSLocation::getOwnPropertySlotDelegate):
3107
3108 2016-08-26  Per Arne Vollan  <pvollan@apple.com>
3109
3110         [Win] Warning fixes.
3111         https://bugs.webkit.org/show_bug.cgi?id=161241
3112
3113         Reviewed by Brent Fulgham.
3114
3115         MSVC warns about potential use of uninitialized variables.
3116
3117         * accessibility/AXObjectCache.cpp:
3118         * css/parser/CSSParserValues.cpp:
3119
3120 2016-08-26  Eric Carlson  <eric.carlson@apple.com>
3121
3122         [MediaStream] Add support for OverConstrainedErrorEvent
3123         https://bugs.webkit.org/show_bug.cgi?id=161199
3124         <rdar://problem/28011819>
3125
3126         Reviewed by Jer Noble.
3127
3128         Test: fast/events/constructors/overconstrained-error-event-constructor.html
3129
3130         * CMakeLists.txt:
3131         * DerivedSources.make:
3132         * Modules/mediastream/OverconstrainedErrorEvent.h: Added.
3133         (WebCore::OverconstrainedErrorEvent::~OverconstrainedErrorEvent):
3134         (WebCore::OverconstrainedErrorEvent::create):
3135         (WebCore::OverconstrainedErrorEvent::createForBindings):
3136         (WebCore::OverconstrainedErrorEvent::error):
3137         (WebCore::OverconstrainedErrorEvent::eventInterface):
3138         (WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent):
3139         * Modules/mediastream/OverconstrainedErrorEvent.idl: Added.
3140
3141         * WebCore.xcodeproj/project.pbxproj: Add new files.
3142
3143         * bindings/js/JSDictionary.cpp:
3144         (WebCore::JSDictionary::convertValue): Add OverconstrainedErrorEvent converter.
3145         * bindings/js/JSDictionary.h:
3146
3147         * dom/EventNames.in: Add OverconstrainedErrorEvent.
3148
3149 2016-08-26  Frederic Wang  <fwang@igalia.com>
3150
3151         The annotation-xml element does not need to be behave as an mrow
3152         https://bugs.webkit.org/show_bug.cgi?id=161230
3153
3154         Reviewed by Manuel Rego Casasnovas.
3155
3156         In r204779, MathMLAnnotationElement was made a MathMLRowElement just because the
3157         annotation-xml element is generating a RenderMathMLRow. This later point is actually not
3158         needed since annotation-xml is just a wrapper for foreign elements and so does not need to
3159         handle special MathML features like operator spacing or stretching. We can thus move back
3160         MathMLAnnotationElement to a generic MathMLPresentationElement and instead make the
3161         annotation-xml element generate a generic RenderMathMLBlock renderer.
3162
3163         No new tests, semantics annotations already covered by existing tests.
3164
3165         * mathml/MathMLAnnotationElement.cpp: Replace RenderMathMLRow.h with RenderMathMLBlock.h
3166         (WebCore::MathMLAnnotationElement::MathMLAnnotationElement): Inherit from
3167         MathMLPresentationElement instead of MathMLRowElement.
3168         (WebCore::MathMLAnnotationElement::createElementRenderer): Make annotation-xml create a
3169         RenderMathMLBlock instead of a RenderMathMLRow.
3170         (WebCore::MathMLAnnotationElement::attributeChanged): Inherit from MathMLPresentationElement
3171         instead of MathMLRowElement.
3172         * mathml/MathMLAnnotationElement.h: Ditto.
3173
3174 2016-08-26  Csaba Osztrogonác  <ossy@webkit.org>
3175
3176         Typo fix after r56209
3177         https://bugs.webkit.org/show_bug.cgi?id=161246
3178
3179         Reviewed by Gyuyoung Kim.
3180
3181         * page/FrameView.cpp:
3182         (WebCore::FrameView::adjustMediaTypeForPrinting):
3183
3184 2016-08-26  Per Arne Vollan  <pvollan@apple.com>
3185
3186         [Win] Warning fixes.
3187         https://bugs.webkit.org/show_bug.cgi?id=161077
3188
3189         Reviewed by Brent Fulgham.
3190
3191         * css/CSSGrammar.y.includes:
3192         * css/RuleFeature.cpp:
3193         (WebCore::makeAttributeSelectorKey):
3194         * editing/TextIterator.cpp:
3195         (WebCore::SearchBuffer::SearchBuffer):
3196         * html/HTMLElement.cpp:
3197         (WebCore::HTMLElement::textToFragment):
3198         * html/MediaElementSession.h:
3199         * platform/URL.cpp:
3200         * platform/graphics/ca/GraphicsLayerCA.cpp:
3201         * platform/network/HTTPParsers.cpp:
3202         (WebCore::parseHTTPHeader):
3203         * rendering/InlineIterator.h:
3204         (WebCore::InlineIterator::clear):
3205         * rendering/RenderDeprecatedFlexibleBox.cpp:
3206         (WebCore::FlexBoxIterator::reset):
3207         * rendering/RenderText.cpp:
3208         (WebCore::RenderText::secureText):
3209         * rendering/mathml/RenderMathMLToken.cpp:
3210         (WebCore::mathVariant):
3211         * style/InlineTextBoxStyle.cpp:
3212         (WebCore::visualOverflowForDecorations):
3213         * xml/XPathGrammar.y:
3214
3215 2016-08-26  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
3216
3217         Make custom constructors consistent with generated bindings code
3218         https://bugs.webkit.org/show_bug.cgi?id=159550
3219
3220         Reviewed by Youenn Fablet.
3221
3222         Add assertion to check DOMConstructorObject* passed in ExecState is not null.
3223         Rename throwConstructorDocumentUnavailableError to throwConstructorScriptExecutionContextUnavailableError since
3224         ScriptExecutionContext is not necessarily a Document.
3225         Modify error message in case of argument error to be consistent with generated binding code: replace calls to
3226         throwVMError with calls to throwConstructorScriptExecutionContextUnavailableError and throwArgumentTypeError.
3227
3228         No new test required. Modify tests and tests expectations to align with new error messages.
3229
3230         * bindings/js/JSAudioContextCustom.cpp:
3231         (WebCore::constructJSAudioContext):
3232         * bindings/js/JSBlobCustom.cpp:
3233         (WebCore::constructJSBlob):
3234         * bindings/js/JSDOMBinding.cpp:
3235         (WebCore::throwConstructorScriptExecutionContextUnavailableError):
3236         * bindings/js/JSDOMBinding.h:
3237         * bindings/js/JSDOMConstructor.h:
3238         (WebCore::JSBuiltinConstructor<JSClass>::callConstructor):
3239         * bindings/js/JSDOMFormDataCustom.cpp:
3240         (WebCore::constructJSDOMFormData):
3241         * bindings/js/JSDataCueCustom.cpp:
3242         (WebCore::constructJSDataCue):
3243         * bindings/js/JSFileCustom.cpp:
3244         (WebCore::constructJSFile):
3245         * bindings/js/JSHTMLElementCustom.cpp:
3246         (WebCore::constructJSHTMLElement):
3247         * bindings/js/JSMediaSessionCustom.cpp:
3248         (WebCore::constructJSMediaSession):
3249         * bindings/js/JSMutationObserverCustom.cpp:
3250         (WebCore::constructJSMutationObserver):
3251         * bindings/js/JSReadableStreamPrivateConstructors.cpp:
3252         (WebCore::constructJSReadableStreamDefaultReader):
3253         * bindings/js/JSWorkerCustom.cpp:
3254         (WebCore::constructJSWorker):
3255         * bindings/scripts/CodeGeneratorJS.pm:
3256         (GenerateCallbackImplementation):
3257         (NativeToJSValue):
3258         (GenerateHashTableValueArray):
3259         (GenerateConstructorDefinition):
3260         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3261         (WebCore::JSTestEventConstructorConstructor::construct):
3262         * bindings/scripts/test/JS/JSTestInterface.cpp:
3263         (WebCore::JSTestInterfaceConstructor::construct):
3264         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3265         (WebCore::JSTestNamedConstructorNamedConstructor::construct):
3266         * bindings/scripts/test/JS/JSTestNode.cpp:
3267         (WebCore::JSTestNodeConstructor::construct):
3268         * bindings/scripts/test/JS/JSTestObj.cpp:
3269         (WebCore::JSTestObjConstructor::construct):
3270         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3271         (WebCore::constructJSTestOverloadedConstructors1):
3272         (WebCore::constructJSTestOverloadedConstructors2):
3273         (WebCore::constructJSTestOverloadedConstructors3):
3274         (WebCore::constructJSTestOverloadedConstructors4):
3275         (WebCore::constructJSTestOverloadedConstructors5):
3276         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
3277         (WebCore::constructJSTestOverloadedConstructorsWithSequence1):
3278         (WebCore::constructJSTestOverloadedConstructorsWithSequence2):
3279         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3280         (WebCore::JSTestTypedefsConstructor::construct):
3281
3282 2016-08-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3283
3284         Unreviewed. Fix GTK+ build after r204986 and r204996.
3285
3286         * page/DOMWindow.idl:
3287
3288 2016-08-25  Wenson Hsieh  <wenson_hsieh@apple.com>
3289
3290         Dragging against the end of the inline media scrubber causes the media scrubber to hide
3291         https://bugs.webkit.org/show_bug.cgi?id=161207
3292
3293         Reviewed by Eric Carlson.
3294
3295         Previously, we would re-enable behavior restrictions when firing an ended event. However, if the ended event is
3296         caused by the user seeking to the end of the video, the media controls would be taken away from under the user.
3297         To prevent this, we don't add the relevant behavior restrictions upon media ended if media was seeking before
3298         firing the event.
3299
3300         Tweaked an existing WebKit API test to cover this change.
3301
3302         * html/HTMLMediaElement.cpp:
3303         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
3304         (WebCore::HTMLMediaElement::addBehaviorRestrictionsOnEndIfNecessary):
3305         * html/HTMLMediaElement.h:
3306         * html/MediaElementSession.cpp:
3307         (WebCore::MediaElementSession::canControlControlsManager):
3308
3309 2016-08-25  Andreas Kling  <akling@apple.com>
3310
3311         REGRESSION: RELEASE_ASSERT in ResourceUsageThread::platformThreadBody when ASan is enabled
3312         <https://webkit.org/b/161203>
3313         <rdar://problem/28011251>
3314
3315         Reviewed by Joseph Pecoraro.
3316
3317         * page/cocoa/ResourceUsageThreadCocoa.mm:
3318         (WebCore::ResourceUsageThread::platformThreadBody): Remove overly optimistic assertions about
3319         "GC owned" memory never being higher than total malloc memory usage. This accounting is not
3320         really exact and pretending otherwise will just lead to crashes.
3321
3322         * html/HTMLCanvasElement.cpp:
3323         (WebCore::HTMLCanvasElement::externalMemoryCost): Hook up HTMLCanvasElement to the ImageBuffer
3324         helper for reporting external memory cost. This makes accounting slightly more correct.
3325
3326 2016-08-25  Chris Dumez  <cdumez@apple.com>
3327
3328         Regression(r203623): Breaks App Store application
3329         https://bugs.webkit.org/show_bug.cgi?id=161206
3330         <rdar://problem/28015060>
3331
3332         Reviewed by Ryosuke Niwa.
3333
3334         Add quirks for the App Store application so that we log an error message
3335         when passing a Document node to Window.getComputedStyle() instead of
3336         throwing an exception.
3337
3338         * page/DOMWindow.cpp:
3339         (WebCore::DOMWindow::getComputedStyle):
3340         * page/DOMWindow.h:
3341         * page/DOMWindow.idl:
3342         * platform/RuntimeApplicationChecks.h:
3343         * platform/RuntimeApplicationChecks.mm:
3344         (WebCore::MacApplication::isAppStore):
3345
3346 2016-08-25  Said Abou-Hallawa  <sabouhallawa@apple.com>
3347
3348         REGRESSION (r203378): [iOS] The PDF image is rendered stretched if a sub image of it is cached first
3349         https://bugs.webkit.org/show_bug.cgi?id=160617
3350
3351         Reviewed by Tim Horton.
3352
3353         When caching only a sub-image of the PDF ensure the source rectangle starts
3354         at the top-left of the cached sub-image rectangle. When drawing the cached 
3355         sub-image to the destination context ensure the destination rectangle is the
3356         sub-image rectangle so no stretching or shrinking happens.
3357
3358         Test: fast/images/cached-clipped-pdf.html
3359
3360         * page/Settings.cpp:
3361         (WebCore::Settings::Settings):
3362         (WebCore::Settings::setCachedPDFImageEnabled): Deleted.
3363         * page/Settings.h:
3364         (WebCore::Settings::isCachedPDFImageEnabled): Deleted.
3365         * page/Settings.in:
3366         Change the boolean setting CachedPDFImageEnabled to be enum property and
3367         rename it PDFImageCachingPolicy. Allow the "PDFImageCachingBelowMemoryLimit"
3368         option to be available on a;; platforms. The "PDFImageCachingClipBoundsOnly"
3369         option is added for testing purpose. If forces recaching the PDF with each
3370         draw and it sets the cached image rectangle to the clipping rectangle.
3371         
3372         * platform/graphics/cg/PDFDocumentImage.cpp:
3373         (WebCore::PDFDocumentImage::setPdfImageCachingPolicy): Take an enum instead of boolean.
3374         (WebCore::cachedImageRect): 
3375         (WebCore::PDFDocumentImage::decodedSizeChanged): Enable PDFImageCachingBelowMemoryLimit
3376         on all platforms.
3377         (WebCore::PDFDocumentImage::updateCachedImageIfNeeded): Fix the source rectangle
3378         when caching a sub-image of the PDF.
3379         (WebCore::PDFDocumentImage::draw): Fix the destination rectangle when drawing
3380         a sub-image to the destination context.
3381         (WebCore::PDFDocumentImage::setCachedPDFImageEnabled): Deleted.
3382         * platform/graphics/cg/PDFDocumentImage.h:
3383         
3384         * rendering/RenderImage.cpp:
3385         (WebCore::RenderImage::paintIntoRect):
3386         
3387         * testing/InternalSettings.cpp:
3388         (WebCore::InternalSettings::Backup::Backup):
3389         (WebCore::InternalSettings::Backup::restoreTo):
3390         (WebCore::InternalSettings::setPDFImageCachingPolicy):
3391         (WebCore::InternalSettings::setCachedPDFImageEnabled): Deleted.
3392         * testing/InternalSettings.h:
3393         * testing/InternalSettings.idl:
3394         Change the internal setting CachedPDFImageEnabled to PDFImageCachingPolicy.
3395
3396 2016-08-25  Zalan Bujtas  <zalan@apple.com>
3397
3398         Infinite recursion crash in WebCore::RenderBlockFlow::layoutBlock
3399         https://bugs.webkit.org/show_bug.cgi?id=139474
3400         <rdar://problem/27705190>
3401
3402         Reviewed by David Hyatt.
3403
3404         We should just give up trying to avoid widow when the page is too small to break line.
3405
3406         Test: fast/multicol/assert-on-small-page-height-with-widow.html
3407
3408         * rendering/RenderBlockFlow.cpp:
3409         (WebCore::RenderBlockFlow::clearShouldBreakAtLineToAvoidWidowIfNeeded):
3410         (WebCore::RenderBlockFlow::adjustLinePositionForPagination):
3411         * rendering/RenderBlockFlow.h:
3412
3413 2016-08-24  Sam Weinig  <sam@webkit.org>
3414
3415         Add the ability to override the implementation name of IDL enums and dictionaries
3416         https://bugs.webkit.org/show_bug.cgi?id=161185
3417
3418         Reviewed by Anders Carlsson.
3419
3420         * bindings/scripts/CodeGenerator.pm:
3421         (ProcessDocument):
3422         Build a dictionary of IDL name -> implementation name overrides
3423         for enums and dictionaries up front based on ImplementedAs extended
3424         attribute.
3425
3426         (HasEnumImplementationNameOverride):
3427         (GetEnumImplementationNameOverride):
3428         (HasDictionaryImplementationNameOverride):
3429         (GetDictionaryImplementationNameOverride):
3430         Expose predicate and getter for name overrides.
3431
3432         * bindings/scripts/CodeGeneratorJS.pm:
3433         (GetEnumerationClassName):
3434         (GetDictionaryClassName):
3435         Use the override names as necessary.
3436
3437         * bindings/scripts/test/TestObj.idl:
3438         Add tests for enums and dictionaries with ImplementedAs extended
3439         attributes.
3440
3441 2016-08-25  Johan K. Jensen  <johan_jensen@apple.com>
3442
3443         Don't store networkLoadTiming in the disk cache
3444         https://bugs.webkit.org/show_bug.cgi?id=161161
3445
3446         Reviewed by Antti Koivisto.
3447
3448         No functionality changed. So, no new tests.
3449
3450         * platform/network/ResourceResponseBase.h:
3451         (WebCore::ResourceResponseBase::encode):
3452         (WebCore::ResourceResponseBase::decode):
3453
3454 2016-08-25  Johan K. Jensen  <johan_jensen@apple.com>
3455
3456         Update the Resource Timing implementation
3457         https://bugs.webkit.org/show_bug.cgi?id=161068
3458
3459         Reviewed by Alex Christensen.
3460
3461         Tests: imported/w3c/web-platform-tests/resource-timing/resource-timing.html
3462                imported/w3c/web-platform-tests/resource-timing/test_resource_timing.html
3463
3464         Update the Resource Timing implementation for better compatibility with the Resource Timing API spec.
3465         Use LoadTiming for general timing information about a resources load timeline.
3466         Mark timestamps for newly loaded resources as well as cached resources.
3467
3468         * loader/DocumentLoader.cpp:
3469         (WebCore::DocumentLoader::startLoadingMainResource):
3470         StartTime and fetchStart should be equal initially.
3471
3472         * loader/LoadTiming.cpp:
3473         (WebCore::LoadTiming::LoadTiming): Moved member initialization out. Removed constructor.
3474         * loader/LoadTiming.h:
3475         (WebCore::LoadTiming::markStartTimeAndFetchStart):
3476         Mark startTime and fetchStart simultaneously.
3477
3478         * loader/ResourceLoader.cpp:
3479         (WebCore::ResourceLoader::init):
3480         Mark the start time of resources.
3481
3482         * loader/ResourceLoader.h:
3483         (WebCore::ResourceLoader::loadTiming):
3484         Add LoadTiming info to handle a resources load timing.
3485
3486         * loader/ResourceTimingInformation.cpp:
3487         (WebCore::ResourceTimingInformation::addResourceTiming):
3488         * loader/ResourceTimingInformation.h:
3489         Only pass in the URL from the ResourceRequest.
3490         Pass LoadTiming instead of timestamps.
3491
3492         * loader/SubresourceLoader.cpp:
3493         (WebCore::SubresourceLoader::willSendRequestInternal):
3494         Mark redirects.
3495
3496         (WebCore::SubresourceLoader::didFinishLoading):
3497         Mark the responseEnd timestamp.
3498         Add the ResourceEntry to the timeline before notifyDone is called.
3499
3500         * loader/cache/CachedResourceLoader.cpp:
3501         (WebCore::CachedResourceLoader::requestResource):
3502         (WebCore::CachedResourceLoader::revalidateResource):
3503         (WebCore::CachedResourceLoader::loadDone):
3504         Mark timestamps for cached resources and use them instead of a cached LoadTiming.
3505
3506         * loader/cache/CachedResourceLoader.h:
3507         (WebCore::CachedResourceLoader::resourceTimingInformation):
3508         Add ResourceTimingInformation getter so SubresourceLoader.cpp can add entries before callbacks.
3509
3510         * page/Performance.cpp:
3511         (WebCore::Performance::addResourceTiming):
3512         * page/Performance.h:
3513         Update signature: URLs and LoadTiming instead of timestamps.
3514
3515         * page/PerformanceResourceTiming.cpp:
3516         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
3517         (WebCore::PerformanceResourceTiming::redirectStart):
3518         (WebCore::PerformanceResourceTiming::redirectEnd):
3519         (WebCore::PerformanceResourceTiming::fetchStart):
3520         (WebCore::PerformanceResourceTiming::domainLookupStart):
3521         (WebCore::PerformanceResourceTiming::domainLookupEnd):
3522         (WebCore::PerformanceResourceTiming::connectStart):
3523         (WebCore::PerformanceResourceTiming::connectEnd):
3524         (WebCore::PerformanceResourceTiming::requestStart):
3525         (WebCore::PerformanceResourceTiming::responseStart):
3526         (WebCore::PerformanceResourceTiming::responseEnd):
3527         (WebCore::PerformanceResourceTiming::resourceTimeToDocumentMilliseconds):
3528         * page/PerformanceResourceTiming.h:
3529         Update signatures and properties to use LoadTiming.
3530         Use LoadTiming’s redirectStart/End, fetchStart, responseStart/End.
3531         Make sure dns and connection timestamps are in increasing order, even when cached.
3532
3533         * page/PerformanceResourceTiming.idl:
3534         Add responseStart.
3535
3536 2016-08-24  Anders Carlsson  <andersca@apple.com>
3537
3538         Simplify createMouseEvent in DragController
3539         https://bugs.webkit.org/show_bug.cgi?id=161168
3540
3541         Reviewed by Dan Bernstein.
3542
3543         * page/DragController.cpp:
3544         (WebCore::createMouseEvent):
3545         * platform/DragData.cpp:
3546         (WebCore::DragData::modifierKeyState): Deleted.
3547         * platform/DragData.h:
3548
3549 2016-08-25  Chris Dumez  <cdumez@apple.com>
3550
3551         DOMTokenList.value should be a stringifier attribute
3552         https://bugs.webkit.org/show_bug.cgi?id=161195
3553
3554         Reviewed by Darin Adler.
3555
3556         DOMTokenList.value should be a stringifier attribute:
3557         - https://dom.spec.whatwg.org/#domtokenlist
3558
3559         No new tests, this change is not observable from the Web.
3560
3561         * html/DOMTokenList.h:
3562         (WebCore::DOMTokenList::toString): Deleted.
3563         * html/DOMTokenList.idl:
3564         * html/HTMLLinkElement.cpp:
3565         (WebCore::HTMLLinkElement::iconSizes): Deleted.
3566         * html/HTMLLinkElement.h:
3567
3568 2016-08-25  Csaba Osztrogonác  <ossy@webkit.org>
3569
3570         [Mac][cmake] Unreviewed speculative buildfix after r204852, just for fun.
3571
3572         * PlatformMac.cmake:
3573
3574 2016-08-24  Frederic Wang  <fwang@igalia.com>
3575
3576         Do not store layout parameters on the RenderMathMLRoot class
3577         https://bugs.webkit.org/show_bug.cgi?id=161132
3578
3579         Reviewed by Darin Adler.
3580
3581         Storing layout parameters on the RenderMathMLRoot class is not really needed since reading
3582         the parameters from the MATH table is not too expensive and updateStyle() is currently always
3583         called in layoutBlock() and computePreferredLogicalWidths(). Most of these parameters are
3584         actually only used in layoutBlock(). We separate horizontal and vertical parameters since
3585         the latter are not needed for preferred width calculations. This removes the need for calling
3586         an updateStyle functions and may also fix update issues when zooming in or out.
3587
3588         No new tests, already covered by existing tests.
3589
3590         * rendering/mathml/MathMLStyle.cpp:
3591         (WebCore::MathMLStyle::updateStyleIfNeeded): No need to update layout parameters for the
3592         RenderMathMLRoot class.
3593         * rendering/mathml/RenderMathMLRoot.cpp:
3594         (WebCore::RenderMathMLRoot::styleDidChange): No need to update layout parameters.
3595         (WebCore::RenderMathMLRoot::horizontalParameters): Move code from updateStyle to retrieve the
3596         horizontal parameters.
3597         (WebCore::RenderMathMLRoot::verticalParameters): Ditto for vertical parameters.
3598         (WebCore::RenderMathMLRoot::computePreferredLogicalWidths): Call horizontalParameters() to
3599         get the kernings of the index instead of calling updateStyle().
3600         (WebCore::RenderMathMLRoot::layoutBlock): Call horizontalParameters() and
3601         verticalParameters() to get the layout parameters instead of calling updateStyle().
3602         (WebCore::RenderMathMLRoot::paint): Call horizontalParameters() and verticalParameters()
3603         to get the layout parameters.
3604         (WebCore::RenderMathMLRoot::updateFromElement): Deleted. No need to call updateStyle().
3605         (WebCore::RenderMathMLRoot::updateStyle): Deleted.
3606         * rendering/mathml/RenderMathMLRoot.h: Do not override updateFromElement(). Replace some
3607         layout parameters stored on the class with struct and helper functions to manipulate them.
3608
3609 2016-08-24  Chris Dumez  <cdumez@apple.com>
3610
3611         WorkerLocation.prototype.toString() should be enumerable
3612         https://bugs.webkit.org/show_bug.cgi?id=161183
3613
3614         Reviewed by Ryosuke Niwa.
3615
3616         WorkerLocation.prototype.toString() should be enumerable:
3617         - https://html.spec.whatwg.org/#workerlocation
3618         - http://heycam.github.io/webidl/#es-stringifier
3619
3620         No new tests, updated existing test.
3621
3622         * workers/WorkerLocation.h:
3623         (WebCore::WorkerLocation::toString): Deleted.
3624         * workers/WorkerLocation.idl:
3625         Also use USVString string type instead of DOMString to match the
3626         specification. There is no behavior change because those attributes
3627         are readonly.
3628
3629 2016-08-24  Chris Dumez  <cdumez@apple.com>
3630
3631         Location.toString() should be enumerable
3632         https://bugs.webkit.org/show_bug.cgi?id=161179
3633
3634         Reviewed by Geoffrey Garen.
3635
3636         Location.toString() should be enumerable as per:
3637         - https://html.spec.whatwg.org/#location
3638         - http://heycam.github.io/webidl/#es-stringifier
3639
3640         This patch stops hard-coding the toString() operation on the Location
3641         interface and makes the 'href' attribute a stringifier attribute instead,
3642         as per the specification. The generated toString() has the same behavior
3643         as it used to but it is now enumerable, as it should.
3644
3645         No new tests, updated existing test.
3646
3647         * bindings/js/JSLocationCustom.cpp:
3648         (WebCore::JSLocation::toStringFunction): Deleted.
3649         * page/Location.idl:
3650
3651 2016-08-24  Joseph Pecoraro  <pecoraro@apple.com>
3652
3653         Implement `CSS.escape` as per CSSOM
3654         https://bugs.webkit.org/show_bug.cgi?id=126337
3655
3656         Reviewed by Dean Jackson.
3657
3658         Test: css3/escape-dom-api.html
3659
3660         * css/CSSOMUtils.cpp:
3661         (WebCore::serializeIdentifier):
3662         Update serialization to match the latest version of the spec:
3663         <https://drafts.csswg.org/cssom/#serialize-an-identifier>
3664         New handling for 0x0, 0x7f, just "-", and "--" is now allowed.
3665
3666         * css/DOMCSSNamespace.cpp:
3667         (WebCore::DOMCSSNamespace::escape):
3668         * css/DOMCSSNamespace.h:
3669         * css/DOMCSSNamespace.idl:
3670         New CSS.escape method.
3671
3672 2016-08-24  Zalan Bujtas  <zalan@apple.com>
3673
3674         ASSERTION FAILED: contentSize >= 0 in WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax
3675         https://bugs.webkit.org/show_bug.cgi?id=155700
3676         <rdar://problem/27720727>
3677
3678         Reviewed by David Hyatt.
3679
3680         RenderBox::m_minPreferredLogicalWidth/m_maxPreferredLogicalWidth don't need special initial value since
3681         preferredLogicalWidthsDirty flag guards them. -1 as initial value can cause problems for renderers that don't
3682         override RenderBox::computePreferredLogicalWidths().    
3683
3684         Test: fast/ruby/assert-when-content-size-is-negative.html
3685
3686         * rendering/RenderBox.cpp:
3687         (WebCore::RenderBox::RenderBox):
3688         (WebCore::RenderBox::dirtyLineBoxes):
3689         (WebCore::RenderBox::deleteLineBoxWrapper):
3690         * rendering/RenderBox.h:
3691
3692 2016-08-24  Alex Christensen  <achristensen@webkit.org>
3693
3694         Import w3c URL tests
3695         https://bugs.webkit.org/show_bug.cgi?id=161177
3696
3697         Reviewed by Tim Horton.
3698
3699         Tests: imported/w3c/web-platform-tests/url/a-element-xhtml.xhtml
3700                imported/w3c/web-platform-tests/url/a-element.html
3701                imported/w3c/web-platform-tests/url/historical.html
3702                imported/w3c/web-platform-tests/url/interfaces.html
3703                imported/w3c/web-platform-tests/url/url-constructor.html
3704                imported/w3c/web-platform-tests/url/url-domainToUnicode.html
3705                imported/w3c/web-platform-tests/url/url-setters.html
3706                imported/w3c/web-platform-tests/url/urlsearchparams-append.html
3707                imported/w3c/web-platform-tests/url/urlsearchparams-constructor.html
3708                imported/w3c/web-platform-tests/url/urlsearchparams-delete.html
3709                imported/w3c/web-platform-tests/url/urlsearchparams-get.html
3710                imported/w3c/web-platform-tests/url/urlsearchparams-getall.html
3711                imported/w3c/web-platform-tests/url/urlsearchparams-has.html
3712                imported/w3c/web-platform-tests/url/urlsearchparams-set.html
3713                imported/w3c/web-platform-tests/url/urlsearchparams-stringifier.html
3714
3715         * platform/URL.cpp:
3716         (WebCore::URL::setQuery):
3717
3718 2016-08-24  Ryan Haddad  <ryanhaddad@apple.com>
3719
3720         Rebaseline bindings tests after r204923.
3721
3722         Unreviewed test gardening.
3723
3724         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3725         (WebCore::jsTestActiveDOMObjectExcitingAttr):
3726         (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
3727
3728 2016-08-24  Jonathan Bedard  <jbedard@apple.com>
3729
3730         FocusController multiple dereferenced NULL pointers
3731         https://bugs.webkit.org/show_bug.cgi?id=160808
3732
3733         Reviewed by Darin Adler.
3734
3735         No new tests needed, fix does not change functionality.
3736
3737         This change fixes a number of NULL pointer dereferences which occur in FocusController.
3738
3739         * page/FocusController.cpp:
3740         (WebCore::isFocusableElementOrScopeOwner): Changed KeyboardEvent reference to pointer.
3741         (WebCore::isNonFocusableScopeOwner): Ditto.
3742         (WebCore::isFocusableScopeOwner): Ditto.
3743         (WebCore::shadowAdjustedTabIndex): Ditto.
3744
3745         (WebCore::FocusController::findFocusableElementAcrossFocusScope): Pass pointer instead of reference to KeyboardEvent.
3746         (WebCore::FocusController::nextFocusableElementWithinScope): Ditto.
3747         (WebCore::FocusController::previousFocusableElementWithinScope): Ditto.
3748         (WebCore::FocusController::findElementWithExactTabIndex): Ditto.
3749         (WebCore::nextElementWithGreaterTabIndex): Ditto.
3750         (WebCore::previousElementWithLowerTabIndex): Ditto.
3751         (WebCore::FocusController::nextFocusableElementOrScopeOwner): Ditto.
3752         (WebCore::FocusController::previousFocusableElementOrScopeOwner): Ditto.
3753         (WebCore::relinquishesEditingFocus): Ditto.
3754
3755 2016-08-24  Nan Wang  <n_wang@apple.com>
3756
3757         AX: VoiceOver on iOS ignores aria-checked on menuitemradio and menuitemcheckbox
3758         https://bugs.webkit.org/show_bug.cgi?id=161118
3759
3760         Reviewed by Chris Fleizach.
3761
3762         Added checkboxOrRadioValue and toggle trait to menuitemradio and menuitemcheckbox.
3763
3764         Test: accessibility/ios-simulator/menuitem-checked.html
3765
3766         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3767         (-[WebAccessibilityObjectWrapper accessibilityTraits]):
3768         (-[WebAccessibilityObjectWrapper accessibilityValue]):
3769
3770 2016-08-24  Chris Dumez  <cdumez@apple.com>
3771
3772         Assertion hit: ASSERT(!m_parserScheduler) in ~HTMLDocumentParser()
3773         https://bugs.webkit.org/show_bug.cgi?id=161083
3774         <rdar://problem/27986937>
3775
3776         Reviewed by Darin Adler.
3777
3778         Call cancelParsing() right before re-creating the new parser in
3779         Document::implicitOpen(). We would previously call removeChildren()
3780         in between which is was an issue because it can cause JS to be
3781         executed and therefore the parser to be re-created after we have
3782         cancelled parsing.
3783
3784         No new tests, unskipped html/browsers/browsing-the-web/unloading-documents/004.html
3785         which was consistently crashing.
3786
3787         * dom/Document.cpp:
3788         (WebCore::Document::implicitOpen):
3789
3790 2016-08-24  Eric Carlson  <eric.carlson@apple.com>
3791
3792         [MediaStream] Add support for OverConstrained Error
3793         https://bugs.webkit.org/show_bug.cgi?id=160790
3794         <rdar://problem/27815715>
3795
3796         Reviewed by Jer Noble.
3797
3798         Existing tests updated.
3799
3800         * DerivedSources.make:
3801         * Modules/mediastream/OverconstrainedError.h: Added.
3802         (WebCore::OverconstrainedError::create):
3803         (WebCore::OverconstrainedError::constraint):
3804         (WebCore::OverconstrainedError::message):
3805         (WebCore::OverconstrainedError::OverconstrainedError):
3806         * Modules/mediastream/OverconstrainedError.idl: Added.
3807         * WebCore.xcodeproj/project.pbxproj:
3808
3809 2016-08-24  Anders Carlsson  <andersca@apple.com>
3810
3811         Build the platform name dynamically for the phony WebKitLegacy framework
3812         https://bugs.webkit.org/show_bug.cgi?id=161163
3813
3814         Reviewed by Dan Bernstein.
3815
3816         * Configurations/WebKitLegacyStub.iOS.tbd:
3817         * WebCore.xcodeproj/project.pbxproj:
3818
3819 2016-08-24  Chris Dumez  <cdumez@apple.com>
3820
3821         It should not be possible to access Location attributes cross origin
3822         https://bugs.webkit.org/show_bug.cgi?id=161125
3823         <rdar://problem/27982472>
3824
3825         Reviewed by Brent Fulgham.
3826
3827         It should not be possible to access Location attributes cross origin:
3828         - https://html.spec.whatwg.org/#crossoriginproperties-(-o-)
3829
3830         We allow access to replace() as per the specification and consistently
3831         with Firefox. The specification seems to indicate we should allow access
3832         to 'href' but Firefox does not and we previously did not so I am not
3833         allowing it in this patch.
3834
3835         Test: http/tests/security/location-cross-origin.html
3836
3837         * bindings/scripts/CodeGeneratorJS.pm:
3838         (GenerateImplementation):
3839         * page/Location.idl:
3840
3841 2016-08-24  Joseph Pecoraro  <pecoraro@apple.com>
3842
3843         Add User Timing to the feature status page
3844         https://bugs.webkit.org/show_bug.cgi?id=161154
3845
3846         Reviewed by Darin Adler.
3847
3848         * features.json:
3849
3850 2016-08-24  Andreas Kling  <akling@apple.com>
3851
3852         Leaks bot hits an assertion in ResourceUsageThread::platformThreadBody
3853         <https://webkit.org/b/160534>
3854
3855         Reviewed by Joseph Pecoraro.
3856
3857         Use the correct malloc bucket when bmalloc is disabled (which is the case on leaks bots.)
3858
3859         * page/cocoa/ResourceUsageThreadCocoa.mm:
3860         (WebCore::ResourceUsageThread::platformThreadBody):
3861
3862 2016-08-24  Filip Pizlo  <fpizlo@apple.com>
3863
3864         Unreviewed, roll out r204901, r204897, r204866, r204856, r204854.
3865
3866         * ForwardingHeaders/heap/HeapInlines.h: Removed.
3867         * ForwardingHeaders/interpreter/Interpreter.h: Added.
3868         * ForwardingHeaders/runtime/AuxiliaryBarrierInlines.h: Removed.
3869         * Modules/indexeddb/IDBCursorWithValue.cpp:
3870         * Modules/indexeddb/client/TransactionOperation.cpp:
3871         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
3872         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3873         * bindings/js/JSApplePayPaymentAuthorizedEventCustom.cpp:
3874         * bindings/js/JSApplePayPaymentMethodSelectedEventCustom.cpp:
3875         * bindings/js/JSApplePayShippingContactSelectedEventCustom.cpp:
3876         * bindings/js/JSApplePayShippingMethodSelectedEventCustom.cpp:
3877         * bindings/js/JSClientRectCustom.cpp:
3878         * bindings/js/JSDOMBinding.cpp:
3879         * bindings/js/JSDOMBinding.h:
3880         * bindings/js/JSDeviceMotionEventCustom.cpp:
3881         * bindings/js/JSDeviceOrientationEventCustom.cpp:
3882         * bindings/js/JSErrorEventCustom.cpp:
3883         * bindings/js/JSIDBCursorWithValueCustom.cpp:
3884         * bindings/js/JSIDBIndexCustom.cpp:
3885         * bindings/js/JSPopStateEventCustom.cpp:
3886         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
3887         * bindings/js/JSWorkerGlobalScopeCustom.cpp:
3888         * bindings/js/WorkerScriptController.cpp:
3889         * contentextensions/ContentExtensionParser.cpp:
3890         * dom/ErrorEvent.cpp:
3891         * html/HTMLCanvasElement.cpp:
3892         * html/MediaDocument.cpp:
3893         * inspector/CommandLineAPIModule.cpp:
3894         * loader/EmptyClients.cpp:
3895         * page/CaptionUserPreferences.cpp:
3896         * page/Frame.cpp:
3897         * page/PageGroup.cpp:
3898         * page/UserContentController.cpp:
3899         * platform/mock/mediasource/MockBox.cpp:
3900         * testing/GCObservation.cpp:
3901
3902 2016-08-24  Zalan Bujtas  <zalan@apple.com>
3903
3904         ASSERTION FAILED: childrenInline() in WebCore::RenderBlockFlow::hasLines
3905         https://bugs.webkit.org/show_bug.cgi?id=139396
3906         <rdar://problem/27704339>
3907
3908         Reviewed by David Hyatt.
3909
3910         RenderBlockFlow::hasLines() should be able to handle the block-children case.
3911
3912         Test: fast/ruby/assert-with-block-rt-child-and-emphasis.html
3913
3914         * rendering/RenderBlock.h:
3915         (WebCore::RenderBlock::hasLines): Deleted.
3916         * rendering/RenderBlockFlow.cpp:
3917         (WebCore::RenderBlockFlow::hasLines):
3918         * rendering/RenderBlockFlow.h:
3919
3920 2016-08-24  Carlos Garcia Campos  <cgarcia@igalia.com>
3921
3922         Unreviewed. Fix GObject DOM bindings API break after r204624 and r204648.
3923
3924         prefix, namespaceURI and localName attributes were moved from Node to Attr/Element in r204624 and prefix was
3925         also made readonly in r204648.
3926
3927         * bindings/gobject/WebKitDOMDeprecated.cpp:
3928         (webkit_dom_node_get_namespace_uri):
3929         (webkit_dom_node_get_prefix):
3930         (webkit_dom_node_set_prefix):
3931         (webkit_dom_node_get_local_name):
3932         * bindings/gobject/WebKitDOMDeprecated.h:
3933         * bindings/gobject/WebKitDOMDeprecated.symbols:
3934         * bindings/gobject/webkitdom.symbols:
3935
3936 2016-08-23  Simon Fraser  <simon.fraser@apple.com>
3937
3938         Add some logging for WKSelectionDrawingInfo
3939         https://bugs.webkit.org/show_bug.cgi?id=161055
3940
3941         Reviewed by Tim Horton.
3942
3943         Add TextStream dumping for SelectionRect.
3944
3945         * platform/ios/SelectionRect.cpp:
3946         (WebCore::operator<<):
3947         * platform/ios/SelectionRect.h:
3948
3949 2016-08-23  Frederic Wang  <fwang@igalia.com>
3950
3951         More consistent header inclusions in the MathML module
3952         https://bugs.webkit.org/show_bug.cgi?id=161080
3953
3954         Reviewed by Darin Adler.
3955
3956         We adjust header inclusion in the MathML module so that:
3957         - implementation file's own header is outside the #if ENABLE(MATHML)
3958         - There is always a blank line after the #if ENABLE(MATHML)
3959
3960         No new tests, behavior is unchanged.
3961
3962         * mathml/MathMLAnnotationElement.cpp:
3963         * mathml/MathMLAnnotationElement.h:
3964         * mathml/MathMLElement.cpp:
3965         * mathml/MathMLFractionElement.cpp:
3966         * mathml/MathMLFractionElement.h:
3967         * mathml/MathMLMathElement.cpp:
3968         * mathml/MathMLMathElement.h:
3969         * mathml/MathMLMencloseElement.cpp:
3970         * mathml/MathMLMencloseElement.h:
3971         * mathml/MathMLOperatorDictionary.cpp:
3972         * mathml/MathMLOperatorElement.cpp:
3973         * mathml/MathMLOperatorElement.h:
3974         * mathml/MathMLPaddedElement.cpp:
3975         * mathml/MathMLPaddedElement.h:
3976         * mathml/MathMLPresentationElement.cpp:
3977         * mathml/MathMLPresentationElement.h:
3978         * mathml/MathMLRowElement.cpp:
3979         * mathml/MathMLRowElement.h:
3980         * mathml/MathMLScriptsElement.cpp:
3981         * mathml/MathMLScriptsElement.h:
3982         * mathml/MathMLSelectElement.h:
3983         * mathml/MathMLSpaceElement.cpp:
3984         * mathml/MathMLSpaceElement.h:
3985         * mathml/MathMLTokenElement.cpp:
3986         * mathml/MathMLUnderOverElement.cpp:
3987         * mathml/MathMLUnderOverElement.h:
3988         * rendering/mathml/MathMLStyle.cpp:
3989         * rendering/mathml/MathOperator.cpp:
3990         * rendering/mathml/MathOperator.h:
3991         * rendering/mathml/RenderMathMLBlock.cpp:
3992         * rendering/mathml/RenderMathMLFenced.cpp:
3993         * rendering/mathml/RenderMathMLFencedOperator.cpp:
3994         * rendering/mathml/RenderMathMLFraction.cpp:
3995         * rendering/mathml/RenderMathMLMath.cpp:
3996         * rendering/mathml/RenderMathMLMenclose.cpp:
3997         * rendering/mathml/RenderMathMLMenclose.h:
3998         * rendering/mathml/RenderMathMLOperator.cpp: