Add more tests for SubtleCrypto::importKey and SubtleCrypto::exportKey
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-11-16  Jiewen Tan  <jiewen_tan@apple.com>
2
3         Add more tests for SubtleCrypto::importKey and SubtleCrypto::exportKey
4         https://bugs.webkit.org/show_bug.cgi?id=164815
5         <rdar://problem/29281660>
6
7         Reviewed by Brent Fulgham.
8
9         Tests: crypto/subtle/aes-import-jwk-key-export-jwk-key.html
10                crypto/subtle/aes-import-jwk-key-export-raw-key.html
11                crypto/subtle/aes-import-raw-key-export-jwk-key.html
12                crypto/subtle/aes-import-raw-key-export-raw-key.html
13                crypto/subtle/hmac-import-jwk-key-export-jwk-key.html
14                crypto/subtle/hmac-import-jwk-key-export-raw-key.html
15                crypto/subtle/hmac-import-raw-key-export-jwk-key.html
16                crypto/subtle/hmac-import-raw-key-export-raw-key.html
17                crypto/subtle/rsa-import-jwk-key-export-jwk-key-private.html
18                crypto/subtle/rsa-import-jwk-key-export-jwk-key-public.html
19
20         * crypto/mac/CryptoKeyRSAMac.cpp:
21         (WebCore::CryptoKeyRSA::create):
22         Add a comment.
23
24 2016-11-16  Antti Koivisto  <antti@apple.com>
25
26         Remove getMutableCachedPseudoStyle
27         https://bugs.webkit.org/show_bug.cgi?id=164819
28
29         Reviewed by Zalan Bujtas.
30
31         It is only used by styleForFirstLetter.
32
33         * rendering/RenderBlock.cpp:
34         (WebCore::styleForFirstLetter):
35
36             Clone the original style before mutations.
37
38         (WebCore::RenderBlock::updateFirstLetterStyle):
39         (WebCore::RenderBlock::createFirstLetterRenderer):
40
41             Since we have a clone already just move it in place.
42
43         * rendering/RenderElement.cpp:
44         (WebCore::RenderElement::getMutableCachedPseudoStyle): Deleted.
45         * rendering/RenderElement.h:
46
47 2016-11-16  Romain Bellessort  <romain.bellessort@crf.canon.fr>
48
49         [Readable Streams API] Implement ReadableByteStreamController close()
50         https://bugs.webkit.org/show_bug.cgi?id=164413
51
52         Reviewed by Darin Adler.
53
54         Implemented close() method of ReadableByteStreamController.
55
56         Updated test expectations for close() tests and added tests
57         to ensure errors are thrown in various cases defined by spec.
58
59         * Modules/streams/ReadableByteStreamController.js:
60         (close): Added.
61         * Modules/streams/ReadableByteStreamInternals.js:
62         (readableByteStreamControllerClose): Added.
63         * bindings/js/WebCoreBuiltinNames.h: Added bytesFilled.
64
65 2016-11-16  Philippe Normand  <pnormand@igalia.com>
66
67         [GStreamer][GL] build broken when using gst-plugins-bad from git
68         https://bugs.webkit.org/show_bug.cgi?id=164776
69
70         Reviewed by Xabier Rodriguez-Calvar.
71
72         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
73         (WebCore::MediaPlayerPrivateGStreamerBase::requestGLContext): The
74         GStreamer GL context GType was renamed, add an ifdef taking this
75         into account.
76
77 2016-11-16  Yusuke Suzuki  <utatane.tea@gmail.com>
78
79         [ES6] Integrate ES6 Modules into WebCore
80         https://bugs.webkit.org/show_bug.cgi?id=148897
81
82         Reviewed by Ryosuke Niwa.
83
84         This patch introduces ES6 Modules into WebCore. We integrate JSC's JSModuleLoader into WebCore.
85         JSC constructs the module loader pipeline by the chains of the promises. To handle this,
86         the following components are added.
87
88             1. CachedModuleScript
89
90                 CachedModuleScript wraps the promise based JSModuleLoader pipeline and offers
91                 similar APIs to CachedScript. ScriptElement and PendingScript interact with
92                 CachedModuleScript when the script tag is the module tag instead of CachedScript.
93                 ScriptElement and PendingScript will receive the notification from
94                 CachedModuleScript by implementing CachedModuleScriptClient.
95
96             2. ScriptModuleLoader
97
98                 This is the module loader instantiated per document. It manages fetching and
99                 offers the callbacks for the JSC's JSModuleLoader implementation. ScriptModuleLoader
100                 will fetch the resource by creating CachedModuleScriptLoader per resource. ScriptModuleLoader
101                 will receive the notification by implementing CachedModuleScriptLoaderClient. When the
102                 resource is fetched, the module loader will drive the promise resolve/reject chain.
103
104             3. CachedModuleScriptLoader
105
106                 This fetches the resource by using CachedScript. Using CachedScript means that it
107                 automatically reports the resource to the inspector. CachedModuleScriptLoader notify to
108                 ScriptModuleLoader when the resource is fetched.
109
110         One tricky point is that the fetch requests issued from one module-graph should share the same
111         nonce, crossorigin attributes etc.
112
113             Here, we wrote the module graph like `A -> B (A depends on B)`.
114
115             <script tag> -> A -> B -> C -> D
116
117         When fetching A, B, C, and D modules, we need to set the same nonce, crossorigin etc. configuration
118         derived from the original script tag. So per module-graph information should be shared throughout
119         the module loader pipeline. To do so, JSC's module loader implementation can take the value called
120         `initiator`. Since the loader will propagate & share this `initiator` throughout the pipeline,
121         we can transfer and share some metadata. Currently, we pass the JSWrapper of the script tag as the
122         initiator. Each fetch request is created by using this initiator script element.
123
124         More integration into the inspector should be done in the subsequent patch.
125
126         * CMakeLists.txt:
127         * WebCore.xcodeproj/project.pbxproj:
128         * bindings/js/CachedModuleScript.cpp: Added.
129         CachedModuleScript offers similar interface to CachedScript to make ScriptElement things easier. It encapsulates the
130         detail of the JSC JSModuleLoader that this module loader is driven by the chain of the promises. CachedModuleScript's
131         callbacks are called from the promise's handlers configured in ScriptController::loadModuleScript.
132         (WebCore::CachedModuleScript::create):
133         (WebCore::CachedModuleScript::CachedModuleScript):
134         (WebCore::CachedModuleScript::load):
135         (WebCore::CachedModuleScript::notifyLoadCompleted):
136         (WebCore::CachedModuleScript::notifyLoadFailed):
137         (WebCore::CachedModuleScript::notifyLoadWasCanceled):
138         (WebCore::CachedModuleScript::notifyClientFinished):
139         (WebCore::CachedModuleScript::addClient):
140         (WebCore::CachedModuleScript::removeClient):
141         * bindings/js/CachedModuleScript.h: Added.
142         (WebCore::CachedModuleScript::moduleKey):
143         (WebCore::CachedModuleScript::error):
144         (WebCore::CachedModuleScript::wasCanceled):
145         (WebCore::CachedModuleScript::isLoaded):
146         (WebCore::CachedModuleScript::nonce):
147         (WebCore::CachedModuleScript::crossOriginMode):
148         Save nonce and crossorigin attributes when we start ScriptElement::prepareScript.
149         * bindings/js/CachedModuleScriptClient.h: Copied from Source/WebCore/dom/LoadableScript.h.
150         (WebCore::CachedModuleScriptClient::~CachedModuleScriptClient):
151         * bindings/js/CachedModuleScriptLoader.cpp: Added.
152         CachedModuleScriptLoader is responsible to fetching the resource for the module script. It uses propagated `initiator`
153         to create the request. This initiator is the JS wrapper of the script element issuing this fetching request. The name
154         `initiator` is derived from the request.setInitiator(). Once the resource is fetched, the fetcher will notify to the
155         client. Currently, ScriptModuleLoader implements this client interface.
156         (WebCore::CachedModuleScriptLoader::create):
157         (WebCore::CachedModuleScriptLoader::CachedModuleScriptLoader):
158         (WebCore::CachedModuleScriptLoader::~CachedModuleScriptLoader):
159         (WebCore::CachedModuleScriptLoader::load):
160         Create the request. We call ScriptElement::requestCachedScript to initiate a new fetching request. At that time,
161         nonce and crossorigin (and charset) attributes of this element are applied to the new request.
162         (WebCore::CachedModuleScriptLoader::notifyFinished):
163         * bindings/js/CachedModuleScriptLoader.h: Copied from Source/WebCore/bindings/js/ScriptModuleLoader.h.
164         * bindings/js/CachedModuleScriptLoaderClient.h: Copied from Source/WebCore/dom/LoadableScript.h.
165         (WebCore::CachedModuleScriptLoaderClient::~CachedModuleScriptLoaderClient):
166         * bindings/js/CachedScriptSourceProvider.h:
167         (WebCore::CachedScriptSourceProvider::create):
168         (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
169         (WebCore::makeSource):
170         * bindings/js/JSBindingsAllInOne.cpp:
171         * bindings/js/JSDOMBinding.cpp:
172         (WebCore::retrieveErrorMessage):
173         (WebCore::reportException):
174         * bindings/js/JSDOMBinding.h:
175         * bindings/js/JSMainThreadExecState.h:
176         (WebCore::JSMainThreadExecState::loadModule):
177         (WebCore::JSMainThreadExecState::linkAndEvaluateModule):
178         * bindings/js/ScriptController.cpp:
179         (WebCore::ScriptController::evaluateInWorld):
180         (WebCore::ScriptController::loadModuleScriptInWorld):
181         (WebCore::ScriptController::loadModuleScript):
182         This just performs loading and not executing the module graph. Once the module graph is loaded, it is notified to
183         the given CachedModuleScript.
184         (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
185         (WebCore::ScriptController::linkAndEvaluateModuleScript):
186         This executes the linking and evaluation of the already instantiated module graph. After loading the module graph,
187         we call this function for the module to evaluate it. This is called from ScriptElement::executeModuleScript.
188         (WebCore::ScriptController::evaluateModule):
189         Every time we evaluate the module, the ScriptModuleLoader::evaluate hook is called. So the loader calls this function
190         to actually evaluate the module.
191         (WebCore::jsValueToModuleKey):
192         (WebCore::ScriptController::setupModuleScriptHandlers):
193         The JSC's module loader is driven by the chain of the promise. So here, we convert this to CachedModuleScript /
194         CachedModuleScriptClient style and encapsulate the details. This encapsulation makes CachedModuleScript similar
195         to CachedScript and it makes things simple in the rest of WebCore. If the propagated error is already reported
196         to the inspector, we receive moduleLoaderAlreadyReportedErrorSymbol as the error value. So at that case, we
197         don't report it twice. If the rejection is caused due to the canceled fetching, moduleLoaderFetchingIsCanceledSymbol
198         appears as the error value. In that case, we will call CachedModuleScript::notifyLoadWasCanceled.
199         (WebCore::ScriptController::executeScript):
200         * bindings/js/ScriptController.h:
201         (WebCore::ScriptController::moduleLoaderAlreadyReportedErrorSymbol):
202         (WebCore::ScriptController::moduleLoaderFetchingIsCanceledSymbol):
203         * bindings/js/ScriptModuleLoader.cpp:
204         We use DeferredWrapper to resolve promises used for the module pipeline. Thus, once the active DOM objects are
205         suspended, the module loader propagation stops.
206         (WebCore::ScriptModuleLoader::~ScriptModuleLoader):
207         Clear the clients of the fetchers issued from this loader.
208         (WebCore::isRootModule):
209         (WebCore::ScriptModuleLoader::resolve):
210         Resolve the module specifier (that is written in `import from "XXX"`) to the unique module key. We use URL
211         string as module key. The edge case is that the module is inlined one. In that case, we don't have any URL
212         for that. Instead of URL, we use symbol at that time.
213         (WebCore::ScriptModuleLoader::fetch):
214         Start fetching for the requested module. It returns the promise that is resolved when the fetching is done.
215         The loader creates the fetcher, and the fetcher start loading the resource. Once the fetcher loads the resource,
216         it notify to the loader through CachedModuleScriptLoaderClient interface. Since we pass the original script
217         element as the `initiator` here, the fetcher can use this initiator to create the request. While the result of
218         CachedResource has 3 variations (loaded, canceled, error occurred), Promise only tells us whether it is resolved
219         or rejected. When CachedModuleScript gets the result from the promise chain, it needs to know which the result is.
220         To transfer the canceled information, we reject the promise with the special symbol `moduleLoaderAlreadyReportedErrorSymbol`.
221         This offers the way to distinguish the canceled error from the other errors.
222         (WebCore::ScriptModuleLoader::evaluate):
223         This is the hook function that is called when JSC's JSModuleLoader attempts to execute each module.
224         (WebCore::ScriptModuleLoader::notifyFinished):
225         This function is called when the fetcher completes. We will resolve the promise with the result of the fetching.
226         The module loader pipeline is constructed as a chain of promises.
227         Rejecting a promise when some error occurs is important because the execution flow of
228         the promise chain is driven by "rejected" or "fulfilled" events.
229         If the promise is not rejected while error occurs, reject handler won't be executed
230         and all the subsequent promise chain will wait the result forever.
231         As a result, even if the error is already reported to the inspector elsewhere,
232         it should be propagated in the pipeline. For example, the error of loading
233         CachedResource is already reported to the inspector by the loader. But we still need
234         to reject the promise to propagate this error to the script element.
235         At that time, we don't want to report the same error twice. When we propagate the error
236         that is already reported to the inspector, we throw moduleLoaderAlreadyReportedErrorSymbol
237         symbol instead. By comparing the thrown error with this symbol, we can distinguish errors raised
238         when checking syntax of a module script from errors reported already.
239         In the reject handler of the promise, we only report a error that is not this symbol.
240         And mime type checking is done here since the module script always require this check.
241         * bindings/js/ScriptModuleLoader.h:
242         (WebCore::ScriptModuleLoader::document): Deleted.
243         * bindings/js/ScriptSourceCode.h:
244         (WebCore::ScriptSourceCode::ScriptSourceCode):
245         * dom/CurrentScriptIncrementer.h:
246         (WebCore::CurrentScriptIncrementer::CurrentScriptIncrementer):
247         * dom/LoadableClassicScript.cpp:
248         (WebCore::LoadableClassicScript::error):
249         (WebCore::LoadableClassicScript::execute):
250         (WebCore::LoadableClassicScript::wasErrored): Deleted.
251         * dom/LoadableClassicScript.h:
252         * dom/LoadableModuleScript.cpp: Copied from Source/WebCore/dom/LoadableScript.h.
253         This is the derived class from LoadableScript. It is used for the script module graphs.
254         (WebCore::LoadableModuleScript::create):
255         (WebCore::LoadableModuleScript::LoadableModuleScript):
256         (WebCore::LoadableModuleScript::~LoadableModuleScript):
257         (WebCore::LoadableModuleScript::isLoaded):
258         (WebCore::LoadableModuleScript::error):
259         (WebCore::LoadableModuleScript::wasCanceled):
260         (WebCore::LoadableModuleScript::notifyFinished):
261         (WebCore::LoadableModuleScript::execute):
262         * dom/LoadableModuleScript.h: Copied from Source/WebCore/dom/LoadableScript.h.
263         (isType):
264         * dom/LoadableScript.h:
265         (WebCore::LoadableScript::isModuleScript):
266         (WebCore::LoadableScript::isModuleGraph): Deleted.
267         * dom/PendingScript.cpp:
268         (WebCore::PendingScript::error):
269         (WebCore::PendingScript::wasErrored): Deleted.
270         * dom/PendingScript.h:
271         * dom/ScriptElement.cpp:
272         (WebCore::ScriptElement::ScriptElement):
273         (WebCore::ScriptElement::determineScriptType):
274         (WebCore::ScriptElement::prepareScript):
275         prepareScript is aligned to whatwg spec: the last sequence to setup flags has one-on-one correspondence to
276         the spec now. And prepareScript recognizes the type="module" case and call the requestModuleScript to setup
277         the CachedModuleScript.
278         (WebCore::ScriptElement::requestClassicScript):
279         (WebCore::ScriptElement::requestModuleScript):
280         We use the nonce and crossorigin attributes at the time of preparing the script tag. To do so, we store the
281         above values in CachedModuleScript.
282         Since inlined module scripts does not have "src" attribute, it is also affected by Content Security Policy's
283         inline script rules.
284         (WebCore::ScriptElement::requestScriptWithCacheForModuleScript):
285         The module loader will construct the fetching request by calling this function. This should be here since we
286         would like to set this Element to the initiator of the request. And nonce and crossorigin attributes of this
287         script tag will be used.
288         (WebCore::ScriptElement::requestScriptWithCache):
289         (WebCore::ScriptElement::executeScript):
290         (WebCore::ScriptElement::executeModuleScript):
291         The entry point to execute the module graph. Since the module graph is beyond the multiple CachedScript code,
292         we have the different entry point from ScriptElement::executeScript.
293         (WebCore::ScriptElement::executeScriptAndDispatchEvent):
294         (WebCore::ScriptElement::executeScriptForScriptRunner):
295         * dom/ScriptElement.h:
296         (WebCore::ScriptElement::scriptType):
297         * html/parser/CSSPreloadScanner.cpp:
298         (WebCore::CSSPreloadScanner::emitRule):
299         * html/parser/HTMLPreloadScanner.cpp:
300         (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest):
301         According to the spec, the module tag ignores the "charset" attribute as the same to the worker's
302         importScript. But WebKit supports the "charset" for importScript intentionally. So to be consistent,
303         even for the module tags, we handle the "charset" attribute. We explicitly note about it in the preloader.
304         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
305         * html/parser/HTMLResourcePreloader.cpp:
306         (WebCore::PreloadRequest::resourceRequest):
307         * html/parser/HTMLResourcePreloader.h:
308         (WebCore::PreloadRequest::PreloadRequest):
309         * html/parser/HTMLScriptRunner.h:
310         * loader/cache/CachedResourceRequest.cpp:
311         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
312         * xml/parser/XMLDocumentParser.cpp:
313         (WebCore::XMLDocumentParser::notifyFinished):
314
315 2016-11-15  Alejandro G. Castro  <alex@igalia.com>
316
317         Warning added in r208542
318         https://bugs.webkit.org/show_bug.cgi?id=164636
319
320         Reviewed by Eric Carlson.
321
322         Deleted the copy constructor, we now explicitly copy the object in
323         the clone method.
324
325         * platform/mediastream/MediaStreamTrackPrivate.cpp: Delete the
326         copy constructor.
327         (WebCore::MediaStreamTrackPrivate::clone): Copy the relevant
328         information for the clone operation in the API.
329         * platform/mediastream/MediaStreamTrackPrivate.h: Delete the copy
330         constructor.
331
332 2016-11-15  Ryosuke Niwa  <rniwa@webkit.org>
333
334         Add more assertions to ElementQueue diagnose a bug
335         https://bugs.webkit.org/show_bug.cgi?id=164814
336
337         Reviewed by Yusuke Suzuki.
338
339         Add more assertions to check the sanity of the element queue.
340         Also made them all release assertions so that we can catch them better.
341
342         * dom/CustomElementReactionQueue.cpp:
343         (WebCore::CustomElementReactionStack::ElementQueue::add):
344         (WebCore::CustomElementReactionStack::ElementQueue::invokeAll):
345
346 2016-11-15  Chris Dumez  <cdumez@apple.com>
347
348         Simplify Element::stripScriptingAttributes()
349         https://bugs.webkit.org/show_bug.cgi?id=164785
350
351         Reviewed by Ryosuke Niwa.
352
353         Simplify Element::stripScriptingAttributes() by leveraging
354         Vector::removeAllMatching().
355
356         No new tests, no Web-exposed behavior change.
357
358         * dom/Element.cpp:
359         (WebCore::Element::stripScriptingAttributes):
360
361 2016-11-15  Jon Lee  <jonlee@apple.com>
362
363         Report active video and audio capture devices separately
364         https://bugs.webkit.org/show_bug.cgi?id=164769
365
366         Reviewed by Eric Carlson.
367
368         For UI purposes, separate the notion of any active capture device to
369         an active audio and video capture device.
370
371         * page/MediaProducer.h: Replace HasActiveMediaCaptureDevice with
372         HasActiveAudioCaptureDevice and HasActiveVideoCaptureDevice.
373
374         * Modules/mediastream/MediaStream.cpp:
375         (WebCore::MediaStream::mediaState): Update the logic for mediaState().
376         Since it is possible to arbitrarily add tracks from various sources,
377         check specifically for a local AV source (meaning a capture device) that
378         is producing data.
379         * platform/mediastream/MediaStreamPrivate.cpp:
380         (WebCore::MediaStreamPrivate::hasLocalVideoSource): Iterate over the tracks
381         and look for video sources that are not remote.
382         (WebCore::MediaStreamPrivate::hasLocalAudioSource): Ditto for audio.
383         * platform/mediastream/MediaStreamPrivate.h:
384         * testing/Internals.cpp:
385         (WebCore::Internals::pageMediaState): Update internals reporting.
386
387 2016-11-15  Chris Dumez  <cdumez@apple.com>
388
389         Avoid copying vector of attributes as much as possible in the HTML parser
390         https://bugs.webkit.org/show_bug.cgi?id=164778
391
392         Reviewed by Ryosuke Niwa.
393
394         Avoid copying vector of attributes as much as possible in the HTML parser by moving
395         AtomicHTMLToken around and making it obvious it is safe to move its attributes
396         vector as well.
397
398         No new tests, no Web-exposed behavior change.
399
400         * html/parser/AtomicHTMLToken.h:
401         (WebCore::AtomicHTMLToken::AtomicHTMLToken):
402         (WebCore::findAttribute):
403         * html/parser/HTMLConstructionSite.cpp:
404         (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagBeforeHTML):
405         (WebCore::HTMLConstructionSite::mergeAttributesFromTokenIntoElement):
406         (WebCore::HTMLConstructionSite::insertHTMLHtmlStartTagInBody):
407         (WebCore::HTMLConstructionSite::insertHTMLBodyStartTagInBody):
408         (WebCore::HTMLConstructionSite::insertDoctype):
409         (WebCore::HTMLConstructionSite::insertComment):
410         (WebCore::HTMLConstructionSite::insertCommentOnDocument):
411         (WebCore::HTMLConstructionSite::insertCommentOnHTMLHtmlElement):
412         (WebCore::HTMLConstructionSite::insertHTMLHeadElement):
413         (WebCore::HTMLConstructionSite::insertHTMLBodyElement):
414         (WebCore::HTMLConstructionSite::insertHTMLFormElement):
415         (WebCore::HTMLConstructionSite::insertHTMLElement):
416         (WebCore::HTMLConstructionSite::insertHTMLElementOrFindCustomElementInterface):
417         (WebCore::HTMLConstructionSite::insertSelfClosingHTMLElement):
418         (WebCore::HTMLConstructionSite::insertFormattingElement):
419         (WebCore::HTMLConstructionSite::insertScriptElement):
420         (WebCore::HTMLConstructionSite::insertForeignElement):
421         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
422         (WebCore::HTMLConstructionSite::createElementFromSavedToken):
423         * html/parser/HTMLConstructionSite.h:
424         * html/parser/HTMLDocumentParser.cpp:
425         (WebCore::HTMLDocumentParser::constructTreeFromHTMLToken):
426         * html/parser/HTMLStackItem.h:
427         (WebCore::HTMLStackItem::HTMLStackItem):
428         (WebCore::HTMLStackItem::create):
429         * html/parser/HTMLTreeBuilder.cpp:
430         (WebCore::CustomElementConstructionData::CustomElementConstructionData):
431         (WebCore::HTMLTreeBuilder::constructTree):
432         (WebCore::HTMLTreeBuilder::processToken):
433         (WebCore::HTMLTreeBuilder::processDoctypeToken):
434         (WebCore::HTMLTreeBuilder::processFakeStartTag):
435         (WebCore::HTMLTreeBuilder::processFakeEndTag):
436         (WebCore::HTMLTreeBuilder::processFakePEndTagIfPInButtonScope):
437         (WebCore::HTMLTreeBuilder::processCloseWhenNestedTag):
438         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
439         (WebCore::HTMLTreeBuilder::insertGenericHTMLElement):
440         (WebCore::HTMLTreeBuilder::processTemplateStartTag):
441         (WebCore::HTMLTreeBuilder::processTemplateEndTag):
442         (WebCore::HTMLTreeBuilder::processEndOfFileForInTemplateContents):
443         (WebCore::HTMLTreeBuilder::processStartTagForInTable):
444         (WebCore::HTMLTreeBuilder::processStartTag):
445         (WebCore::HTMLTreeBuilder::processHtmlStartTagForInBody):
446         (WebCore::HTMLTreeBuilder::processBodyEndTagForInBody):
447         (WebCore::HTMLTreeBuilder::processAnyOtherEndTagForInBody):
448         (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
449         (WebCore::HTMLTreeBuilder::processEndTagForInTableBody):
450         (WebCore::HTMLTreeBuilder::processEndTagForInRow):
451         (WebCore::HTMLTreeBuilder::processEndTagForInCell):
452         (WebCore::HTMLTreeBuilder::processEndTagForInBody):
453         (WebCore::HTMLTreeBuilder::processEndTagForInTable):
454         (WebCore::HTMLTreeBuilder::processEndTag):
455         (WebCore::HTMLTreeBuilder::processComment):
456         (WebCore::HTMLTreeBuilder::processCharacter):
457         (WebCore::HTMLTreeBuilder::processEndOfFile):
458         (WebCore::HTMLTreeBuilder::defaultForBeforeHTML):
459         (WebCore::HTMLTreeBuilder::defaultForBeforeHead):
460         (WebCore::HTMLTreeBuilder::defaultForInHead):
461         (WebCore::HTMLTreeBuilder::defaultForInHeadNoscript):
462         (WebCore::HTMLTreeBuilder::defaultForAfterHead):
463         (WebCore::HTMLTreeBuilder::processStartTagForInHead):
464         (WebCore::HTMLTreeBuilder::processGenericRCDATAStartTag):
465         (WebCore::HTMLTreeBuilder::processGenericRawTextStartTag):
466         (WebCore::HTMLTreeBuilder::processScriptStartTag):
467         (WebCore::HTMLTreeBuilder::shouldProcessTokenInForeignContent):
468         (WebCore::hasAttribute):
469         (WebCore::HTMLTreeBuilder::processTokenInForeignContent):
470         (WebCore::HTMLTreeBuilder::parseError):
471         * html/parser/HTMLTreeBuilder.h:
472         * html/parser/TextDocumentParser.cpp:
473         (WebCore::TextDocumentParser::insertFakePreElement):
474
475 2016-11-15  Alex Christensen  <achristensen@webkit.org>
476
477         Fix iOS API test assertion after r208534
478         https://bugs.webkit.org/show_bug.cgi?id=164751
479
480         Reviewed by Geoffrey Garen.
481
482         This removes a firing assertion in the WebKit1.AudioSessionCategoryIOS API test on the iOS simulator.
483
484         * platform/MemoryPressureHandler.h:
485         (WebCore::MemoryPressureHandler::setLowMemoryHandler):
486         This assertion is no longer valid because we are using m_installed to determine if m_lowMemoryHandler xor m_releaseMemoryBlock is set,
487         and we should be setting both right now on iOS and they are both useful in freeing memory. These should be united.
488
489 2016-11-15  Brady Eidson  <beidson@apple.com>
490
491         IndexedDB 2.0: Key collation during SQLite lookups is insanely slow.
492         https://bugs.webkit.org/show_bug.cgi?id=164754
493
494         Reviewed by Alex Christensen.
495
496         No new tests (Covered by *all* existing tests, and unskips a previously-too-slow test)
497
498         The new serialization format is straight forward enough to get back with minimal documentation
499         in a comment with the code itself being the rest of the documentation.
500         
501         It handles all current IDB key types and leaves room for future key types.
502
503         * Modules/indexeddb/IDBKeyData.cpp:
504         (WebCore::IDBKeyData::setBinaryValue):
505         * Modules/indexeddb/IDBKeyData.h:
506         (WebCore::IDBKeyData::binary):
507         
508         * Modules/indexeddb/server/IDBSerialization.cpp:
509         (WebCore::serializedTypeForKeyType):
510         (WebCore::writeLittleEndian):
511         (WebCore::readLittleEndian):
512         (WebCore::writeDouble):
513         (WebCore::readDouble):
514         (WebCore::encodeKey):
515         (WebCore::serializeIDBKeyData):
516         (WebCore::decodeKey):
517         (WebCore::deserializeIDBKeyData):
518         * Modules/indexeddb/server/IDBSerialization.h:
519         
520         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
521         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey): Verify that Type == Invalid 
522           keys don't get into the database. This was happening before and the previous serialization
523           supported it, but there's clearly no point in supporting it with the new serialization.
524
525 2016-11-15  Brent Fulgham  <bfulgham@apple.com>
526
527         Ensure sufficient buffer for worst-case URL encoding
528         https://bugs.webkit.org/show_bug.cgi?id=164794
529         <rdar://problem/5905510>
530
531         Reviewed by David Kilzer.
532
533         Slightly increase the default allocation size for URL parsing to account for
534         the worst-case parsing case. Under these assumptions, we might need three times
535         the byte length of the URL, plus nine bytes for fix-up characters.
536
537         In short, increase the default buffer size by 9 bytes.
538
539         No new tests. No change in behavior.
540
541         * platform/URL.cpp:
542         (WebCore::URL::parse): Slightly increase the default buffer size.
543
544 2016-11-15  Joseph Pecoraro  <pecoraro@apple.com>
545
546         Web Inspector: Remove unused and untested Page.setTouchEmulationEnabled command
547         https://bugs.webkit.org/show_bug.cgi?id=164793
548
549         Reviewed by Matt Baker.
550
551         * inspector/InspectorPageAgent.cpp:
552         (WebCore::InspectorPageAgent::willDestroyFrontendAndBackend):
553         (WebCore::InspectorPageAgent::updateTouchEventEmulationInPage): Deleted.
554         (WebCore::InspectorPageAgent::setTouchEmulationEnabled): Deleted.
555         * inspector/InspectorPageAgent.h:
556
557 2016-11-15  Jiewen Tan  <jiewen_tan@apple.com>
558
559         Unreviewed, quick fix for r208751
560
561         * bindings/js/JSSubtleCryptoCustom.cpp:
562         (WebCore::jsSubtleCryptoFunctionExportKeyPromise):
563
564 2016-11-15  Chris Dumez  <cdumez@apple.com>
565
566         Unreviewed, fix build after r208710.
567
568         Inline functions should not be marked as WEBCORE_EXPORT.
569
570         * dom/QualifiedName.h:
571
572 2016-11-15  Brent Fulgham  <bfulgham@apple.com>
573
574         strncpy may leave unterminated string in WebCore::URL::init
575         https://bugs.webkit.org/show_bug.cgi?id=74473
576         <rdar://problem/10576626>
577
578         Reviewed by David Kilzer.
579
580         Reviving an old patch by David Kilzer! This should have been integrated years ago.
581
582         No new tests. No change in behavior.
583
584         * platform/URL.cpp:
585         (WebCore::URL::init): Make sure we always enter 'parse' with a
586         null-terminated string.
587
588 2016-11-15  Jiewen Tan  <jiewen_tan@apple.com>
589
590         Followup patch for r208737
591
592         Reviewed by Yusuke Suzuki.
593
594         * bindings/js/JSSubtleCryptoCustom.cpp:
595         (WebCore::jsSubtleCryptoFunctionExportKeyPromise):
596
597 2016-11-14  Simon Fraser  <simon.fraser@apple.com>
598
599         [iOS WK2] Implement support for visual viewports
600         https://bugs.webkit.org/show_bug.cgi?id=164765
601
602         Reviewed by Tim Horton.
603
604         Adopt the visual viewport scrolling model in iOS WK2.
605
606         This is more complex than the Mac implementation for two primary reasons. First,
607         WKWebView needs to to able to control the rectangle used for fixed position layout
608         to get the correct behavior when zooming all the way out, and because iOS displays
609         pages scaled down, exposing document overflow such that the layout viewport rectangle
610         has to get larger than the initial containing block size (which does not happen on Mac).
611
612         This is achieved by pushing a "layoutViewportOverrideRect" down onto FrameView, in
613         a similar way to the customFixedPositionRect that's used now. We share that name
614         for now in code that is agnostic to its use (e.g. VisibleContentRectUpdateInfo).
615
616         I tried so hard to write tests, but ran into various problems (webkit.org/b/164762,
617         webkit.org/b/164764). Will add tests via webkit.org/b/164764.
618
619         * page/FrameView.cpp:
620         (WebCore::FrameView::fixedScrollableAreaBoundsInflatedForScrolling): layoutViewportOrigin()
621         was removed.
622         (WebCore::FrameView::setBaseLayoutViewportOrigin): Rename with "base" to make it clearer that
623         it can be overridden.
624         (WebCore::FrameView::setLayoutViewportOverrideRect):
625         (WebCore::FrameView::baseLayoutViewportSize): Renamed.
626         (WebCore::FrameView::updateLayoutViewport): Logging.
627         (WebCore::FrameView::layoutViewportRect):
628         (WebCore::FrameView::scrollPositionForFixedPosition):
629         (WebCore::FrameView::unscaledMaximumScrollPosition): During page transitions on iOS, it
630         was possible for unscaledDocumentRect to be empty, but visibleSize() to be non-empty, leading
631         to odd negative max scroll offsets, so clamp to 0,0.
632         (WebCore::FrameView::setLayoutViewportOrigin): Deleted.
633         * page/FrameView.h:
634         * page/scrolling/AsyncScrollingCoordinator.cpp:
635         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState): scrollPositionForFixedPosition() already does the
636         visualViewportEnabled() check.
637         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
638         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
639         * platform/graphics/FloatSize.cpp:
640         (WebCore::FloatSize::constrainedBetween): Added for consistency with the other geometry types.
641         * platform/graphics/FloatSize.h:
642         * platform/graphics/LayoutSize.cpp:
643         (WebCore::LayoutSize::constrainedBetween): Ditto.
644         * platform/graphics/LayoutSize.h:
645         * rendering/RenderView.cpp:
646         (WebCore::RenderView::clientLogicalWidthForFixedPosition): If we have an override layout viewport, its size might be different
647         from the RenderView's size (the initial containing block), so we need to use the layoutViewportRect here.
648         (WebCore::RenderView::clientLogicalHeightForFixedPosition):
649
650 2016-11-15  Myles C. Maxfield  <mmaxfield@apple.com>
651
652         [WebGL] Remove unused Chromium-specific OpenGL extensions
653         https://bugs.webkit.org/show_bug.cgi?id=164782
654
655         Reviewed by Dean Jackson.
656
657         No new tests because there is no behavior change.
658
659         * html/canvas/WebGL2RenderingContext.cpp:
660         (WebCore::WebGL2RenderingContext::copyBufferSubData):
661         (WebCore::WebGL2RenderingContext::clear):
662         (WebCore::WebGL2RenderingContext::getExtension):
663         * html/canvas/WebGLCompressedTextureS3TC.cpp:
664         (WebCore::WebGLCompressedTextureS3TC::supported):
665         * html/canvas/WebGLDepthTexture.cpp:
666         (WebCore::WebGLDepthTexture::supported):
667         * html/canvas/WebGLDrawBuffers.cpp:
668         (WebCore::WebGLDrawBuffers::satisfiesWebGLRequirements):
669         * html/canvas/WebGLFramebuffer.cpp:
670         (WebCore::WebGLFramebuffer::onAccess):
671         * html/canvas/WebGLFramebuffer.h:
672         * html/canvas/WebGLRenderingContext.cpp:
673         (WebCore::WebGLRenderingContext::getExtension):
674         (WebCore::WebGLRenderingContext::clear):
675         * html/canvas/WebGLRenderingContextBase.cpp:
676         (WebCore::WebGLRenderingContextBase::setupFlags):
677         (WebCore::WebGLRenderingContextBase::bufferData):
678         (WebCore::WebGLRenderingContextBase::bufferSubData):
679         (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
680         (WebCore::WebGLRenderingContextBase::validateDrawArrays):
681         (WebCore::WebGLRenderingContextBase::validateDrawElements):
682         (WebCore::WebGLRenderingContextBase::readPixels):
683         (WebCore::WebGLRenderingContextBase::texImage2DBase):
684         (WebCore::WebGLRenderingContextBase::copyTexImage2D):
685         * html/canvas/WebGLRenderingContextBase.h:
686         (WebCore::WebGLRenderingContextBase::isGLES2NPOTStrict):
687         (WebCore::WebGLRenderingContextBase::isErrorGeneratedOnOutOfBoundsAccesses): Deleted.
688         (WebCore::WebGLRenderingContextBase::isResourceSafe): Deleted.
689         * platform/graphics/GraphicsContext3D.cpp:
690         (WebCore::GraphicsContext3D::texImage2DResourceSafe):
691         * platform/graphics/GraphicsContext3D.h:
692         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
693         (WebCore::GraphicsContext3D::isResourceSafe): Deleted.
694
695 2016-11-14  Brent Fulgham  <bfulgham@apple.com>
696
697         Correct handling of changing input type
698         https://bugs.webkit.org/show_bug.cgi?id=164759
699         <rdar://problem/29211174>
700
701         Reviewed by Darin Adler.
702
703         Test: fast/forms/search-cancel-button-change-input.html
704
705         It is possible for JavaScript to change the type property of an input field. WebKit
706         needs to gracefully handle this case.
707
708         Add a type traits specialization so we can properly downcast InputType elements.
709         Use this to only call search functions on actual search input types.
710
711         * html/HTMLInputElement.cpp:
712         (WebCore::HTMLInputElement::onSearch): Only perform search functions if the
713         input type is actually a search field.
714         * html/InputType.h: Add type traits specialization for 'downcast' template.
715         * html/SearchInputType.h: Ditto.
716
717 2016-11-15  Zalan Bujtas  <zalan@apple.com>
718
719         CounterNode::insertAfter and ::removeChild should take references.
720         https://bugs.webkit.org/show_bug.cgi?id=164780
721
722         Reviewed by Simon Fraser.
723
724         No change in functionality.
725
726         * rendering/CounterNode.cpp:
727         (WebCore::CounterNode::insertAfter):
728         (WebCore::CounterNode::removeChild):
729         * rendering/CounterNode.h:
730         * rendering/RenderCounter.cpp:
731         (WebCore::makeCounterNode):
732         (WebCore::destroyCounterNodeWithoutMapRemoval):
733         (WebCore::updateCounters):
734
735 2016-11-15  Antti Koivisto  <antti@apple.com>
736
737         slot doesn't work as a flex container
738         https://bugs.webkit.org/show_bug.cgi?id=160740
739         <rdar://problem/28605080>
740
741         Reviewed by Ryosuke Niwa.
742
743         Test: fast/shadow-dom/css-scoping-slot-flex.html
744
745         The style adjustment for flex children needs to be based on their parent box style rather
746         than the composed tree parent. This can be different when display:contents is involved.
747
748         * css/MediaQueryMatcher.cpp:
749         (WebCore::MediaQueryMatcher::documentElementUserAgentStyle):
750         * css/StyleMedia.cpp:
751         (WebCore::StyleMedia::matchMedium):
752         * css/StyleResolver.cpp:
753         (WebCore::StyleResolver::StyleResolver):
754         (WebCore::StyleResolver::styleForElement):
755
756             Optionally provide parent box style so we can do adjustments based on it when computing style for rendering.
757
758         (WebCore::StyleResolver::styleForKeyframe):
759         (WebCore::StyleResolver::pseudoStyleForElement):
760         (WebCore::equivalentBlockDisplay):
761
762             Avoid boolean parameters.
763
764         (WebCore::StyleResolver::adjustRenderStyle):
765
766             Do the display:contents adjustment first and treat 'content' like 'none' later'. We never want to override
767             'contents' with adjustments.
768             Use parent box style for flex/grid adjustments instead of the DOM parent style.
769
770         * css/StyleResolver.h:
771         * rendering/RenderNamedFlowFragment.cpp:
772         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
773         * style/StyleTreeResolver.cpp:
774         (WebCore::Style::TreeResolver::styleForElement):
775
776             Call with parent box style.
777
778         (WebCore::Style::TreeResolver::parentBoxStyle):
779
780             Find the parent box style if any.
781
782         * style/StyleTreeResolver.h:
783         * svg/SVGElementRareData.h:
784         (WebCore::SVGElementRareData::overrideComputedStyle):
785
786 2016-11-15  Joseph Pecoraro  <pecoraro@apple.com>
787
788         Misc Inspector backend cleanup
789         https://bugs.webkit.org/show_bug.cgi?id=164768
790
791         Reviewed by Brian Burg.
792
793         * inspector/DOMPatchSupport.cpp:
794         * inspector/InspectorApplicationCacheAgent.cpp:
795         * inspector/InspectorApplicationCacheAgent.h:
796         * inspector/InspectorCSSAgent.cpp:
797         * inspector/InspectorCSSAgent.h:
798         * inspector/InspectorDOMAgent.cpp:
799         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
800         * inspector/InspectorDOMAgent.h:
801         * inspector/InspectorDOMDebuggerAgent.h:
802         * inspector/InspectorDOMStorageAgent.cpp:
803         * inspector/InspectorDOMStorageAgent.h:
804         * inspector/InspectorDatabaseAgent.cpp:
805         * inspector/InspectorDatabaseAgent.h:
806         * inspector/InspectorFrontendClientLocal.cpp:
807         (WebCore::InspectorFrontendClientLocal::frontendLoaded):
808         * inspector/InspectorIndexedDBAgent.cpp:
809         (WebCore::ClearObjectStoreListener::create): Deleted.
810         (WebCore::ClearObjectStoreListener::~ClearObjectStoreListener): Deleted.
811         (WebCore::ClearObjectStoreListener::ClearObjectStoreListener): Deleted.
812         (WebCore::ClearObjectStore::create): Deleted.
813         (WebCore::ClearObjectStore::ClearObjectStore): Deleted.
814         * inspector/InspectorLayerTreeAgent.cpp:
815         * inspector/InspectorLayerTreeAgent.h:
816         * inspector/InspectorNetworkAgent.h:
817         * inspector/InspectorPageAgent.cpp:
818         * inspector/InspectorPageAgent.h:
819         * inspector/InspectorReplayAgent.cpp:
820         * inspector/InspectorReplayAgent.h:
821         * inspector/InspectorTimelineAgent.cpp:
822         (WebCore::InspectorTimelineAgent::stopFromConsole):
823         * inspector/InspectorTimelineAgent.h:
824         * inspector/PageRuntimeAgent.h:
825
826 2016-11-14  Myles C. Maxfield  <mmaxfield@apple.com>
827
828         [WebGL] Migrate construction functions from pointers to references
829         https://bugs.webkit.org/show_bug.cgi?id=164749
830
831         Reviewed by Zalan Bujtas.
832
833         Mechanical find/replace.
834
835         No new tests because there is no behavior change.
836
837         * html/canvas/ANGLEInstancedArrays.cpp:
838         (WebCore::ANGLEInstancedArrays::ANGLEInstancedArrays):
839         (WebCore::ANGLEInstancedArrays::supported):
840         (WebCore::ANGLEInstancedArrays::drawArraysInstancedANGLE):
841         (WebCore::ANGLEInstancedArrays::drawElementsInstancedANGLE):
842         (WebCore::ANGLEInstancedArrays::vertexAttribDivisorANGLE):
843         * html/canvas/ANGLEInstancedArrays.h:
844         * html/canvas/EXTBlendMinMax.cpp:
845         (WebCore::EXTBlendMinMax::EXTBlendMinMax):
846         * html/canvas/EXTBlendMinMax.h:
847         * html/canvas/EXTFragDepth.cpp:
848         (WebCore::EXTFragDepth::EXTFragDepth):
849         * html/canvas/EXTFragDepth.h:
850         * html/canvas/EXTShaderTextureLOD.cpp:
851         (WebCore::EXTShaderTextureLOD::EXTShaderTextureLOD):
852         * html/canvas/EXTShaderTextureLOD.h:
853         * html/canvas/EXTTextureFilterAnisotropic.cpp:
854         (WebCore::EXTTextureFilterAnisotropic::EXTTextureFilterAnisotropic):
855         * html/canvas/EXTTextureFilterAnisotropic.h:
856         * html/canvas/EXTsRGB.cpp:
857         (WebCore::EXTsRGB::EXTsRGB):
858         * html/canvas/EXTsRGB.h:
859         * html/canvas/OESElementIndexUint.cpp:
860         (WebCore::OESElementIndexUint::OESElementIndexUint):
861         * html/canvas/OESElementIndexUint.h:
862         * html/canvas/OESStandardDerivatives.cpp:
863         (WebCore::OESStandardDerivatives::OESStandardDerivatives):
864         * html/canvas/OESStandardDerivatives.h:
865         * html/canvas/OESTextureFloat.cpp:
866         (WebCore::OESTextureFloat::OESTextureFloat):
867         * html/canvas/OESTextureFloat.h:
868         * html/canvas/OESTextureFloatLinear.cpp:
869         (WebCore::OESTextureFloatLinear::OESTextureFloatLinear):
870         * html/canvas/OESTextureFloatLinear.h:
871         * html/canvas/OESTextureHalfFloat.cpp:
872         (WebCore::OESTextureHalfFloat::OESTextureHalfFloat):
873         * html/canvas/OESTextureHalfFloat.h:
874         * html/canvas/OESTextureHalfFloatLinear.cpp:
875         (WebCore::OESTextureHalfFloatLinear::OESTextureHalfFloatLinear):
876         * html/canvas/OESTextureHalfFloatLinear.h:
877         * html/canvas/OESVertexArrayObject.cpp:
878         (WebCore::OESVertexArrayObject::OESVertexArrayObject):
879         (WebCore::OESVertexArrayObject::createVertexArrayOES):
880         (WebCore::OESVertexArrayObject::deleteVertexArrayOES):
881         (WebCore::OESVertexArrayObject::isVertexArrayOES):
882         (WebCore::OESVertexArrayObject::bindVertexArrayOES):
883         * html/canvas/WebGL2RenderingContext.cpp:
884         (WebCore::WebGL2RenderingContext::initializeVertexArrayObjects):
885         (WebCore::WebGL2RenderingContext::initializeShaderExtensions):
886         (WebCore::WebGL2RenderingContext::drawBuffers):
887         (WebCore::WebGL2RenderingContext::createVertexArray):
888         (WebCore::WebGL2RenderingContext::isVertexArray):
889         (WebCore::WebGL2RenderingContext::bindVertexArray):
890         (WebCore::WebGL2RenderingContext::getExtension):
891         (WebCore::WebGL2RenderingContext::getSupportedExtensions):
892         * html/canvas/WebGLBuffer.cpp:
893         (WebCore::WebGLBuffer::create):
894         (WebCore::WebGLBuffer::WebGLBuffer):
895         * html/canvas/WebGLBuffer.h:
896         * html/canvas/WebGLCompressedTextureATC.cpp:
897         (WebCore::WebGLCompressedTextureATC::WebGLCompressedTextureATC):
898         (WebCore::WebGLCompressedTextureATC::supported):
899         * html/canvas/WebGLCompressedTextureATC.h:
900         * html/canvas/WebGLCompressedTexturePVRTC.cpp:
901         (WebCore::WebGLCompressedTexturePVRTC::WebGLCompressedTexturePVRTC):
902         (WebCore::WebGLCompressedTexturePVRTC::supported):
903         * html/canvas/WebGLCompressedTexturePVRTC.h:
904         * html/canvas/WebGLCompressedTextureS3TC.cpp:
905         (WebCore::WebGLCompressedTextureS3TC::WebGLCompressedTextureS3TC):
906         (WebCore::WebGLCompressedTextureS3TC::supported):
907         * html/canvas/WebGLCompressedTextureS3TC.h:
908         * html/canvas/WebGLContextObject.cpp:
909         (WebCore::WebGLContextObject::WebGLContextObject):
910         * html/canvas/WebGLContextObject.h:
911         * html/canvas/WebGLDebugRendererInfo.cpp:
912         (WebCore::WebGLDebugRendererInfo::WebGLDebugRendererInfo):
913         * html/canvas/WebGLDebugRendererInfo.h:
914         * html/canvas/WebGLDebugShaders.cpp:
915         (WebCore::WebGLDebugShaders::WebGLDebugShaders):
916         (WebCore::WebGLDebugShaders::getTranslatedShaderSource):
917         * html/canvas/WebGLDebugShaders.h:
918         * html/canvas/WebGLDepthTexture.cpp:
919         (WebCore::WebGLDepthTexture::WebGLDepthTexture):
920         (WebCore::WebGLDepthTexture::supported):
921         * html/canvas/WebGLDepthTexture.h:
922         * html/canvas/WebGLDrawBuffers.cpp:
923         (WebCore::WebGLDrawBuffers::WebGLDrawBuffers):
924         (WebCore::WebGLDrawBuffers::supported):
925         (WebCore::WebGLDrawBuffers::drawBuffersWEBGL):
926         (WebCore::WebGLDrawBuffers::satisfiesWebGLRequirements):
927         * html/canvas/WebGLDrawBuffers.h:
928         * html/canvas/WebGLExtension.cpp:
929         (WebCore::WebGLExtension::WebGLExtension):
930         * html/canvas/WebGLExtension.h:
931         (WebCore::WebGLExtension::ref):
932         (WebCore::WebGLExtension::deref):
933         (WebCore::WebGLExtension::context):
934         * html/canvas/WebGLFramebuffer.cpp:
935         (WebCore::WebGLFramebuffer::create):
936         (WebCore::WebGLFramebuffer::WebGLFramebuffer):
937         (WebCore::WebGLFramebuffer::drawBuffersIfNecessary):
938         * html/canvas/WebGLFramebuffer.h:
939         * html/canvas/WebGLLoseContext.cpp:
940         (WebCore::WebGLLoseContext::WebGLLoseContext):
941         (WebCore::WebGLLoseContext::loseContext):
942         (WebCore::WebGLLoseContext::restoreContext):
943         * html/canvas/WebGLLoseContext.h:
944         * html/canvas/WebGLObject.cpp:
945         (WebCore::WebGLObject::WebGLObject):
946         * html/canvas/WebGLObject.h:
947         * html/canvas/WebGLProgram.cpp:
948         (WebCore::WebGLProgram::create):
949         (WebCore::WebGLProgram::WebGLProgram):
950         * html/canvas/WebGLProgram.h:
951         * html/canvas/WebGLQuery.cpp:
952         (WebCore::WebGLQuery::create):
953         (WebCore::WebGLQuery::WebGLQuery):
954         * html/canvas/WebGLQuery.h:
955         * html/canvas/WebGLRenderbuffer.cpp:
956         (WebCore::WebGLRenderbuffer::create):
957         (WebCore::WebGLRenderbuffer::WebGLRenderbuffer):
958         * html/canvas/WebGLRenderbuffer.h:
959         * html/canvas/WebGLRenderingContext.cpp:
960         (WebCore::WebGLRenderingContext::initializeVertexArrayObjects):
961         (WebCore::WebGLRenderingContext::getExtension):
962         (WebCore::WebGLRenderingContext::getSupportedExtensions):
963         * html/canvas/WebGLRenderingContextBase.cpp:
964         (WebCore::WebGLRenderingContextBase::create):
965         (WebCore::WebGLRenderingContextBase::setupFlags):
966         (WebCore::WebGLRenderingContextBase::checkObjectToBeBound):
967         (WebCore::WebGLRenderingContextBase::createBuffer):
968         (WebCore::WebGLRenderingContextBase::createFramebuffer):
969         (WebCore::WebGLRenderingContextBase::createTexture):
970         (WebCore::WebGLRenderingContextBase::createProgram):
971         (WebCore::WebGLRenderingContextBase::createRenderbuffer):
972         (WebCore::WebGLRenderingContextBase::createShader):
973         (WebCore::WebGLRenderingContextBase::deleteObject):
974         (WebCore::WebGLRenderingContextBase::validateWebGLObject):
975         (WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
976         (WebCore::WebGLRenderingContextBase::framebufferTexture2D):
977         (WebCore::WebGLRenderingContextBase::getUniform):
978         (WebCore::WebGLRenderingContextBase::readPixels):
979         (WebCore::WebGLRenderingContextBase::loseContextImpl):
980         (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
981         (WebCore::WebGLRenderingContextBase::supportsDrawBuffers):
982         * html/canvas/WebGLSampler.cpp:
983         (WebCore::WebGLSampler::create):
984         (WebCore::WebGLSampler::WebGLSampler):
985         * html/canvas/WebGLSampler.h:
986         * html/canvas/WebGLShader.cpp:
987         (WebCore::WebGLShader::create):
988         (WebCore::WebGLShader::WebGLShader):
989         * html/canvas/WebGLShader.h:
990         * html/canvas/WebGLSharedObject.cpp:
991         (WebCore::WebGLSharedObject::WebGLSharedObject):
992         * html/canvas/WebGLSharedObject.h:
993         * html/canvas/WebGLSync.cpp:
994         (WebCore::WebGLSync::create):
995         (WebCore::WebGLSync::WebGLSync):
996         * html/canvas/WebGLSync.h:
997         * html/canvas/WebGLTexture.cpp:
998         (WebCore::WebGLTexture::create):
999         (WebCore::WebGLTexture::WebGLTexture):
1000         * html/canvas/WebGLTexture.h:
1001         * html/canvas/WebGLTransformFeedback.cpp:
1002         (WebCore::WebGLTransformFeedback::create):
1003         (WebCore::WebGLTransformFeedback::WebGLTransformFeedback):
1004         * html/canvas/WebGLTransformFeedback.h:
1005         * html/canvas/WebGLVertexArrayObject.cpp:
1006         (WebCore::WebGLVertexArrayObject::create):
1007         (WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject):
1008         * html/canvas/WebGLVertexArrayObject.h:
1009         * html/canvas/WebGLVertexArrayObjectBase.cpp:
1010         (WebCore::WebGLVertexArrayObjectBase::WebGLVertexArrayObjectBase):
1011         * html/canvas/WebGLVertexArrayObjectBase.h:
1012         * html/canvas/WebGLVertexArrayObjectOES.cpp:
1013         (WebCore::WebGLVertexArrayObjectOES::create):
1014         (WebCore::WebGLVertexArrayObjectOES::WebGLVertexArrayObjectOES):
1015         (WebCore::WebGLVertexArrayObjectOES::deleteObjectImpl):
1016         * html/canvas/WebGLVertexArrayObjectOES.h:
1017         * platform/graphics/GraphicsContext3D.h:
1018         * platform/graphics/gpu/Texture.cpp:
1019         (WebCore::convertFormat):
1020         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
1021         (WebCore::GraphicsContext3D::readPixelsAndConvertToBGRAIfNecessary):
1022         (WebCore::GraphicsContext3D::reshapeFBOs):
1023         (WebCore::GraphicsContext3D::getIntegerv):
1024         (WebCore::GraphicsContext3D::getExtensions):
1025         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1026         (WebCore::GraphicsContext3D::validateDepthStencil):
1027         (WebCore::GraphicsContext3D::drawArraysInstanced):
1028         (WebCore::GraphicsContext3D::drawElementsInstanced):
1029         (WebCore::GraphicsContext3D::vertexAttribDivisor):
1030
1031 2016-11-15  Joanmarie Diggs  <jdiggs@igalia.com>
1032
1033         AX: Need to update implicit/default values for aria-valuemin, aria-valuenow, and aria-valuemax
1034         https://bugs.webkit.org/show_bug.cgi?id=164773
1035
1036         Reviewed by Chris Fleizach.
1037
1038         Return the values stated in the ARIA 1.1 spec, namely:
1039         - aria-valuemin is 0 for roles other than spinbutton
1040         - aria-valuemax is 100 for roles other than spinbutton
1041         - aria-valuenow is half way between aria-valuemax and aria-valuemin
1042           for roles other than spinbutton, and 0 for spinbutton
1043
1044         For spinbutton, the spec states that "there is no minimum/maximum value."
1045         But at least in the case of ATK/AT-SPI2, the accessible value interface
1046         is expected to provide a number. Therefore, expose the values we use to
1047         constrain input type="number": -std::numeric_limits<float>::max() and
1048         std::numeric_limits<float>::max().
1049
1050         Test: accessibility/spinbutton-implicit-values.html
1051
1052         * accessibility/AccessibilityNodeObject.cpp:
1053         (WebCore::AccessibilityNodeObject::valueForRange):
1054         (WebCore::AccessibilityNodeObject::maxValueForRange):
1055         (WebCore::AccessibilityNodeObject::minValueForRange):
1056
1057 2016-11-14  Jiewen Tan  <jiewen_tan@apple.com>
1058
1059         Update SubtleCrypto::exportKey to match the latest spec
1060         https://bugs.webkit.org/show_bug.cgi?id=164722
1061         <rdar://problem/29251740>
1062
1063         Reviewed by Brent Fulgham.
1064
1065         This patch does following few things:
1066         1. It updates the SubtleCrypto::exportKey method to match the latest spec:
1067            https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-exportKey.
1068            It also refers to the latest Editor's Draft to a certain degree:
1069            https://w3c.github.io/webcrypto/Overview.html#SubtleCrypto-method-exportKey.
1070         2. It implements exportKey operations of the following algorithms: AES-CBC, AES-KW,
1071            HMAC, RSAES-PKCS1-V1_5, RSASSA-PKCS1-V1_5, and RSA-OAEP.
1072         3. It also fixes the following bugs:
1073            https://bugs.webkit.org/show_bug.cgi?id=156114,
1074            <rdar://problem/21773066>.
1075         Note: We currently only support Raw and Jwk key format.
1076
1077         Tests: crypto/subtle/aes-cbc-generate-export-key-jwk-length-128.html
1078                crypto/subtle/aes-cbc-generate-export-key-jwk-length-192.html
1079                crypto/subtle/aes-cbc-generate-export-key-jwk-length-256.html
1080                crypto/subtle/aes-cbc-generate-export-key-raw.html
1081                crypto/subtle/aes-export-key-malformed-parameters.html
1082                crypto/subtle/aes-kw-generate-export-key-jwk-length-128.html
1083                crypto/subtle/aes-kw-generate-export-key-jwk-length-192.html
1084                crypto/subtle/aes-kw-generate-export-key-jwk-length-256.html
1085                crypto/subtle/aes-kw-generate-export-raw-key.html
1086                crypto/subtle/export-key-malformed-parameters.html
1087                crypto/subtle/hmac-export-key-malformed-parameters.html
1088                crypto/subtle/hmac-generate-export-key-jwk-sha1.html
1089                crypto/subtle/hmac-generate-export-key-jwk-sha224.html
1090                crypto/subtle/hmac-generate-export-key-jwk-sha256.html
1091                crypto/subtle/hmac-generate-export-key-jwk-sha384.html
1092                crypto/subtle/hmac-generate-export-key-jwk-sha512.html
1093                crypto/subtle/hmac-generate-export-raw-key.html
1094                crypto/subtle/hmac-import-key-malformed-parameters.html
1095                crypto/subtle/rsa-export-key-malformed-parameters.html
1096                crypto/subtle/rsa-oaep-generate-export-key-jwk-sha1.html
1097                crypto/subtle/rsa-oaep-generate-export-key-jwk-sha224.html
1098                crypto/subtle/rsa-oaep-generate-export-key-jwk-sha256.html
1099                crypto/subtle/rsa-oaep-generate-export-key-jwk-sha384.html
1100                crypto/subtle/rsa-oaep-generate-export-key-jwk-sha512.html
1101                crypto/subtle/rsaes-pkcs1-v1_5-generate-export-key-jwk.html
1102                crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-jwk-sha1.html
1103                crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-jwk-sha224.html
1104                crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-jwk-sha256.html
1105                crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-jwk-sha384.html
1106                crypto/subtle/rsassa-pkcs1-v1_5-generate-export-key-jwk-sha512.html
1107                crypto/workers/subtle/aes-generate-export-key-jwk.html
1108                crypto/workers/subtle/aes-generate-export-key-raw.html
1109                crypto/workers/subtle/hmac-generate-export-key-jwk.html
1110                crypto/workers/subtle/hmac-generate-export-key-raw.html
1111                crypto/workers/subtle/rsa-generate-export-key-jwk.html
1112
1113         * bindings/js/JSSubtleCryptoCustom.cpp:
1114         (WebCore::toJSValueFromJsonWebKey):
1115         (WebCore::jsSubtleCryptoFunctionExportKeyPromise):
1116         (WebCore::JSSubtleCrypto::exportKey):
1117         * crypto/CryptoAlgorithm.cpp:
1118         (WebCore::CryptoAlgorithm::exportKey):
1119         * crypto/CryptoAlgorithm.h:
1120         * crypto/SubtleCrypto.idl:
1121         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
1122         (WebCore::CryptoAlgorithmAES_CBC::importKey):
1123         (WebCore::CryptoAlgorithmAES_CBC::exportKey):
1124         * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
1125         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
1126         (WebCore::CryptoAlgorithmAES_KW::importKey):
1127         (WebCore::CryptoAlgorithmAES_KW::exportKey):
1128         * crypto/algorithms/CryptoAlgorithmAES_KW.h:
1129         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
1130         (WebCore::CryptoAlgorithmHMAC::importKey):
1131         (WebCore::CryptoAlgorithmHMAC::exportKey):
1132         * crypto/algorithms/CryptoAlgorithmHMAC.h:
1133         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
1134         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
1135         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey):
1136         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
1137         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
1138         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
1139         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey):
1140         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
1141         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
1142         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
1143         (WebCore::CryptoAlgorithmRSA_OAEP::exportKey):
1144         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
1145         * crypto/keys/CryptoKeyAES.cpp:
1146         (WebCore::CryptoKeyAES::exportJwk):
1147         * crypto/keys/CryptoKeyAES.h:
1148         * crypto/keys/CryptoKeyHMAC.cpp:
1149         (WebCore::CryptoKeyHMAC::exportJwk):
1150         * crypto/keys/CryptoKeyHMAC.h:
1151         * crypto/keys/CryptoKeyRSA.cpp:
1152         (WebCore::CryptoKeyRSA::exportJwk):
1153         * crypto/keys/CryptoKeyRSA.h:
1154
1155 2016-11-15  Jon Lee  <jonlee@apple.com>
1156
1157         Remove HasMediaCaptureDevice
1158         https://bugs.webkit.org/show_bug.cgi?id=164767
1159         <rdar://problem/29263696>
1160
1161         Reviewed by Eric Carlson.
1162
1163         * Modules/mediastream/MediaStream.cpp:
1164         (WebCore::MediaStream::mediaState): Remove HasMediaCaptureDevice in state.
1165         * page/MediaProducer.h:
1166         * testing/Internals.cpp:
1167         (WebCore::Internals::pageMediaState): Remove it in the media string.
1168
1169 2016-11-14  Dave Hyatt  <hyatt@apple.com>
1170
1171         [CSS Parser] Fix font-synthesis and text-decoration-skip parsing
1172         https://bugs.webkit.org/show_bug.cgi?id=164736
1173
1174         Reviewed by Dean Jackson.
1175
1176         Fix the properties to not allow duplicate values, to reject when
1177         garbage values are included, to require that none be a singleton,
1178         and to preserve the declaration order of the properties.
1179
1180         * css/StyleBuilderConverter.h:
1181         (WebCore::StyleBuilderConverter::convertTextDecorationSkip):
1182         * css/parser/CSSParser.cpp:
1183         (WebCore::CSSParser::parseFontSynthesis):
1184         (WebCore::CSSParser::parseTextDecorationSkip):
1185         * css/parser/CSSPropertyParser.cpp:
1186         (WebCore::consumeFontSynthesis):
1187         (WebCore::consumeTextDecorationSkip):
1188         (WebCore::CSSPropertyParser::parseSingleValue):
1189
1190 2016-11-15  Daniel Bates  <dabates@apple.com>
1191
1192         Disallow loads using HTTP 0.9 at the ResourceHandle/NetworkDataTask level
1193         https://bugs.webkit.org/show_bug.cgi?id=164662
1194         <rdar://problem/29268514>
1195
1196         Reviewed by Reviewed by Alex Christensen and Brady Eidson.
1197
1198         Currently we disallow non-default HTTP 0.9 loads at the ResourceLoader level and disallow
1199         subresource loads using HTTP 0.9 on a default port when the embedding page loads using a
1200         different HTTP version. However loads can still be initiated from other loaders (e.g. FrameLoader)
1201         with regards to the first issue. The latter issue does not afford much protection and
1202         increases code complexity. Instead we should simplify our policy and move our code to the
1203         lowest networking abstraction level, ResourceHandle/NetworkDataTask, so that we disallow
1204         all non-default port loads using HTTP 0.9 regardless of the loader used.
1205
1206         Tests: http/tests/security/http-0.9/image-default-port-allowed.html
1207                http/tests/security/http-0.9/xhr-blocked.html
1208
1209         * loader/DocumentLoader.cpp:
1210         (WebCore::DocumentLoader::responseReceived): Remove logic to cancel an HTTP 0.9 load from here.
1211         We will cancel the HTTP 0.9 load at the ResourceHandle/NetworkDataTask level.
1212         * loader/ResourceLoader.cpp:
1213         (WebCore::ResourceLoader::didReceiveResponse): Ditto.
1214         * platform/URL.h: Export stringCenterEllipsizedToLength() so that we can use it in WebKit2.
1215         * platform/network/BlobResourceHandle.cpp:
1216         (WebCore::BlobResourceHandle::notifyResponseOnSuccess): Modified to call ResourceHandle::didReceiveResponse().
1217         (WebCore::BlobResourceHandle::notifyResponseOnError): Ditto.
1218         * platform/network/ResourceHandle.cpp:
1219         (WebCore::ResourceHandle::didReceiveResponse): Added. Fail the load if it is using HTTP 0.9.
1220         Otherwise notify the client that we received a response.
1221         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse): Added. Perform any
1222         additional platform-specific logic after notifying the resource handle client of the received
1223         response. Only the libsoup backend overwrites this member function to do something meaningful.
1224         * platform/network/ResourceHandle.h:
1225         * platform/network/ResourceResponseBase.h:
1226         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
1227         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse): Modified to
1228         call ResourceHandle::didReceiveResponse().
1229         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
1230         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]): Ditto.
1231         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1232         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]): Ditto.
1233         * platform/network/soup/ResourceHandleSoup.cpp:
1234         (WebCore::nextMultipartResponsePartCallback): Ditto.
1235         (WebCore::sendRequestCallback): Ditto.
1236         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse): Added. Turns around and
1237         calls continueAfterDidReceiveResponse().
1238
1239 2016-11-15  Zalan Bujtas  <zalan@apple.com>
1240
1241         [MultiCol] Render tree should be all clean by the end of FrameView::layout().
1242         https://bugs.webkit.org/show_bug.cgi?id=162833
1243
1244         Reviewed by Simon Fraser.
1245
1246         This is a temporary workaround until after we addressed render tree mutation during layout (webkit.org/b/163849).
1247
1248         Test: fast/inline/out-of-flow-quotation-text-with-multicolumn.html
1249
1250         * page/FrameView.cpp:
1251         (WebCore::FrameView::layout):
1252         * rendering/RenderMultiColumnFlowThread.cpp:
1253         (WebCore::RenderMultiColumnFlowThread::populate):
1254         (WebCore::RenderMultiColumnFlowThread::evacuateAndDestroy):
1255         * rendering/RenderQuote.cpp:
1256         (WebCore::RenderQuote::attachQuote): Populating/evacuating the flow should not trigger quotation text changes.
1257         (WebCore::RenderQuote::detachQuote):
1258         * rendering/RenderView.h:
1259         (WebCore::RenderTreeInternalMutationScope::RenderTreeInternalMutationScope):
1260         (WebCore::RenderTreeInternalMutationScope::~RenderTreeInternalMutationScope):
1261
1262 2016-11-15  Eric Carlson  <eric.carlson@apple.com>
1263
1264         REGRESSION (r208606?): LayoutTest fast/mediastream/enumerating-crash.html is a flaky crash
1265         https://bugs.webkit.org/show_bug.cgi?id=164715
1266
1267         Reviewed by Jon Lee.
1268
1269         No new tests, fixes a crash in an existing test.
1270
1271         * Modules/mediastream/UserMediaRequest.cpp:
1272         (WebCore::UserMediaRequest::document): Return nullptr when the script execution context has
1273           been cleared.
1274         * Modules/mediastream/UserMediaRequest.h:
1275         (WebCore::UserMediaRequest::document): Deleted.
1276
1277 2016-11-15  Alejandro G. Castro  <alex@igalia.com>
1278
1279         WebRTC: update MediaStream-MediaElement-srcObject.html test and unskip it
1280         https://bugs.webkit.org/show_bug.cgi?id=159343
1281
1282         Reviewed by Philippe Normand.
1283
1284         Test updated.
1285
1286         We can not initialize the srcObject attribute when creating the mediaplayer
1287         or we would be removing the srcObject we are going to use.
1288
1289         * html/HTMLMediaElement.cpp:
1290         (WebCore::HTMLMediaElement::createMediaPlayer):
1291
1292 2016-11-14  Alex Christensen  <achristensen@webkit.org>
1293
1294         Move SecurityOrigin::createFromDatabaseIdentifier to SecurityOriginData
1295         https://bugs.webkit.org/show_bug.cgi?id=164720
1296
1297         Reviewed by Brady Eidson.
1298
1299         This is adding to r208558 where we moved databaseIdentifier to SecurityOriginData so we
1300         don't have to use SecurityOrigin in the DatabaseProcess.  This is a step towards only using 
1301         SecurityOrigin (and the SchemeRegistry) in the WebProcess. SecurityOriginData is for other 
1302         processes and IPC. There should be no change in behaviour.
1303
1304         * Modules/webdatabase/Database.cpp:
1305         (WebCore::Database::Database):
1306         (WebCore::Database::securityOrigin):
1307         * Modules/webdatabase/Database.h:
1308         * Modules/webdatabase/DatabaseContext.cpp:
1309         (WebCore::DatabaseContext::securityOrigin):
1310         * Modules/webdatabase/DatabaseContext.h:
1311         * Modules/webdatabase/DatabaseManager.cpp:
1312         (WebCore::DatabaseManager::tryToOpenDatabaseBackend):
1313         (WebCore::DatabaseManager::fullPathForDatabase):
1314         (WebCore::DatabaseManager::detailsForNameAndOrigin):
1315         * Modules/webdatabase/DatabaseManager.h:
1316         * Modules/webdatabase/DatabaseManagerClient.h:
1317         (WebCore::DatabaseManagerClient::dispatchDidAddNewOrigin):
1318         * Modules/webdatabase/DatabaseTracker.cpp:
1319         (WebCore::DatabaseTracker::hasAdequateQuotaForOrigin):
1320         (WebCore::DatabaseTracker::canEstablishDatabase):
1321         (WebCore::DatabaseTracker::retryCanEstablishDatabase):
1322         (WebCore::DatabaseTracker::hasEntryForOriginNoLock):
1323         (WebCore::DatabaseTracker::hasEntryForDatabase):
1324         (WebCore::DatabaseTracker::maximumSize):
1325         (WebCore::DatabaseTracker::originPath):
1326         (WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
1327         (WebCore::DatabaseTracker::fullPathForDatabase):
1328         (WebCore::DatabaseTracker::origins):
1329         (WebCore::DatabaseTracker::databaseNamesNoLock):
1330         (WebCore::DatabaseTracker::databaseNames):
1331         (WebCore::DatabaseTracker::detailsForNameAndOrigin):
1332         (WebCore::DatabaseTracker::setDatabaseDetails):
1333         (WebCore::DatabaseTracker::addOpenDatabase):
1334         (WebCore::DatabaseTracker::removeOpenDatabase):
1335         (WebCore::DatabaseTracker::originLockFor):
1336         (WebCore::DatabaseTracker::deleteOriginLockFor):
1337         (WebCore::DatabaseTracker::usage):
1338         (WebCore::DatabaseTracker::quotaNoLock):
1339         (WebCore::DatabaseTracker::quota):
1340         (WebCore::DatabaseTracker::setQuota):
1341         (WebCore::DatabaseTracker::addDatabase):
1342         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
1343         (WebCore::DatabaseTracker::deleteOrigin):
1344         (WebCore::DatabaseTracker::isDeletingDatabaseOrOriginFor):
1345         (WebCore::DatabaseTracker::recordCreatingDatabase):
1346         (WebCore::DatabaseTracker::doneCreatingDatabase):
1347         (WebCore::DatabaseTracker::creatingDatabase):
1348         (WebCore::DatabaseTracker::canDeleteDatabase):
1349         (WebCore::DatabaseTracker::recordDeletingDatabase):
1350         (WebCore::DatabaseTracker::doneDeletingDatabase):
1351         (WebCore::DatabaseTracker::isDeletingDatabase):
1352         (WebCore::DatabaseTracker::canDeleteOrigin):
1353         (WebCore::DatabaseTracker::isDeletingOrigin):
1354         (WebCore::DatabaseTracker::recordDeletingOrigin):
1355         (WebCore::DatabaseTracker::doneDeletingOrigin):
1356         (WebCore::DatabaseTracker::deleteDatabase):
1357         (WebCore::DatabaseTracker::deleteDatabaseFile):
1358         (WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
1359         (WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged):
1360         * Modules/webdatabase/DatabaseTracker.h:
1361         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
1362         (WebCore::getDatabaseIdentifier):
1363         * inspector/InspectorDOMStorageAgent.cpp:
1364         (WebCore::InspectorDOMStorageAgent::findStorageArea):
1365         * loader/EmptyClients.cpp:
1366         * page/DOMWindow.cpp:
1367         (WebCore::DOMWindow::sessionStorage):
1368         * page/SecurityOrigin.cpp:
1369         (WebCore::SecurityOrigin::maybeCreateFromDatabaseIdentifier): Deleted.
1370         (WebCore::SecurityOrigin::createFromDatabaseIdentifier): Deleted.
1371         * page/SecurityOrigin.h:
1372         * page/SecurityOriginData.cpp:
1373         (WebCore::SecurityOriginData::fromDatabaseIdentifier):
1374         * page/SecurityOriginData.h:
1375         (WebCore::SecurityOriginData::SecurityOriginData):
1376         * storage/StorageArea.h:
1377         * storage/StorageEventDispatcher.cpp:
1378         (WebCore::StorageEventDispatcher::dispatchSessionStorageEvents):
1379         (WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
1380         (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
1381         (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
1382         * storage/StorageEventDispatcher.h:
1383         * storage/StorageNamespace.h:
1384         * storage/StorageNamespaceProvider.cpp:
1385         (WebCore::StorageNamespaceProvider::localStorageArea):
1386
1387 2016-11-14  Joseph Pecoraro  <pecoraro@apple.com>
1388
1389         Web Inspector: Worker debugging should pause all targets and view call frames in all targets
1390         https://bugs.webkit.org/show_bug.cgi?id=164305
1391         <rdar://problem/29056192>
1392
1393         Reviewed by Timothy Hatcher.
1394
1395         Tests: inspector/debugger/continueUntilNextRunLoop
1396                inspector/worker/debugger-multiple-targets-pause
1397
1398         * workers/WorkerMessagingProxy.cpp:
1399         (WebCore::WorkerMessagingProxy::postMessageToPageInspector):
1400         Switch from postTask (callOnMainThread) to RunLoop::main().dispatch so
1401         that a paused Worker can send Inspector protocol messages responses
1402         back through the Main Page's InspectorWorkerAgent even if the Page
1403         itself is paused and MainThread callbacks are paused.
1404
1405         * workers/WorkerRunLoop.h:
1406         (WebCore::WorkerRunLoop::isNested):
1407         * workers/WorkerRunLoop.cpp:
1408         (WebCore::WorkerRunLoop::runInMode):
1409         When running a nested WorkerRunLoop, running inspector debugger
1410         commands, we should not fire timers on the Worker. Timers would
1411         then be happening out of order and would not be debuggable.
1412
1413         * dom/EventTarget.cpp:
1414         (WebCore::EventTarget::fireEventListeners):
1415         * inspector/InspectorDOMDebuggerAgent.cpp:
1416         (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
1417         (WebCore::InspectorDOMDebuggerAgent::clear):
1418         (WebCore::InspectorDOMDebuggerAgent::didPause): Deleted.
1419         * inspector/InspectorDOMDebuggerAgent.h:
1420         * inspector/InspectorInstrumentation.cpp:
1421         (WebCore::InspectorInstrumentation::willHandleEventImpl):
1422         (WebCore::InspectorInstrumentation::didFireTimerImpl):
1423         (WebCore::InspectorInstrumentation::didHandleEventImpl): Deleted.
1424         (WebCore::InspectorInstrumentation::cancelPauseOnNativeEvent): Deleted.
1425         * inspector/InspectorInstrumentation.h:
1426         (WebCore::InspectorInstrumentation::willHandleEvent):
1427         (WebCore::InspectorInstrumentation::didHandleEvent): Deleted.
1428         Remove unnecessary code where WebCore is trying to keep track
1429         of pause on next statement but that state is already more
1430         accurately provided by InspectorDebuggerAgent.
1431
1432 2016-11-14  Myles C. Maxfield  <mmaxfield@apple.com>
1433
1434         [WebGL2] Teach WebGLRenderingContextBase about new texture internal formats
1435         https://bugs.webkit.org/show_bug.cgi?id=164525
1436
1437         Reviewed by Dean Jackson.
1438
1439         Test: fast/canvas/webgl/webgl2-texture-upload-enums.html
1440
1441         This patch migrates the existing WebGL calls texImage2D(), texSubImage2D(),
1442         and readPixels() to understand the new WebGL 2 texture types. In WebGL1, the
1443         format and the internalFormat were required to be the same, and we had this
1444         assumption baked into many places in these functions. In WebGL 2, those two
1445         values are often different, which means I had to fix all of these assumptions
1446         in our code. Also, rather than have two completely separate parallel
1447         implementations of these functions, a more forward-looking approach is to
1448         have one implementation which has a few checks to isWebGL1() in strategic
1449         places. (This way, bugs only have to be fixed in a single place). Therefore,
1450         this patch deletes the WebGL 2 versions of these functions.
1451
1452         * html/canvas/WebGL2RenderingContext.cpp: These functions are moved to
1453         WebGLRenderingContextBase.
1454         (WebCore::WebGL2RenderingContext::isIntegerFormat):
1455         (WebCore::WebGL2RenderingContext::copyTexImage2D): Deleted.
1456         (WebCore::WebGL2RenderingContext::texSubImage2DBase): Deleted.
1457         (WebCore::WebGL2RenderingContext::texSubImage2DImpl): Deleted.
1458         (WebCore::WebGL2RenderingContext::texSubImage2D): Deleted.
1459         (WebCore::WebGL2RenderingContext::validateTexFuncParameters): Deleted.
1460         (WebCore::WebGL2RenderingContext::validateTexFuncFormatAndType): Deleted.
1461         (WebCore::WebGL2RenderingContext::validateTexFuncData): Deleted.
1462         * html/canvas/WebGL2RenderingContext.h: Moved function implementations to
1463         WebGLRenderingContextBase.
1464         * html/canvas/WebGLRenderingContext.cpp: Ditto.
1465         (WebCore::WebGLRenderingContext::copyTexImage2D): Deleted.
1466         (WebCore::WebGLRenderingContext::texSubImage2DBase): Deleted.
1467         (WebCore::WebGLRenderingContext::texSubImage2DImpl): Deleted.
1468         (WebCore::WebGLRenderingContext::texSubImage2D): Deleted.
1469         (WebCore::WebGLRenderingContext::validateTexFuncParameters): Deleted.
1470         (WebCore::WebGLRenderingContext::validateTexFuncFormatAndType): Deleted.
1471         (WebCore::WebGLRenderingContext::validateTexFuncData): Deleted.
1472         * html/canvas/WebGLRenderingContext.h: Moved function implementations to
1473         WebGLRenderingContextBase.
1474         * html/canvas/WebGLRenderingContextBase.cpp:
1475         (WebCore::WebGLRenderingContextBase::validateSettableTexInternalFormat):
1476         Teach about new depth texture formats.
1477         (WebCore::WebGLRenderingContextBase::copyTexSubImage2D): Rename
1478         "internalformat" to "internalFormat". Teach about the distinction between
1479         format and internalFormat. When pre-filling textures with 0s to work around
1480         buggy drivers, we need a new way of knowing which format/type arguments to
1481         pass to texSubImage2D() which are compatible with the texture's internal
1482         format. The implementation of this function was added to GraphicsContext3D
1483         and is called here.
1484         (WebCore::WebGLRenderingContextBase::generateMipmap): Teach about the
1485         distinction between format and internalFormat.
1486         (WebCore::internalFormatTheme): This is used so readPixels() knows what
1487         kind of format/type arguments are compatible with the texture's internal
1488         format.
1489         (WebCore::numberOfComponentsForFormat): Ditto.
1490         (WebCore::numberOfComponentsForInternalFormat): Ditto.
1491         (WebCore::WebGLRenderingContextBase::readPixels): Many more format/type
1492         combinations are required in order to test the various new kinds of
1493         textures.
1494         (WebCore::WebGLRenderingContextBase::texImage2DBase): Rename internalformat
1495         to internalFormat, and teach about the distinction between format and
1496         internalFormat.
1497         (WebCore::WebGLRenderingContextBase::validateTexFunc): Ditto.
1498         (WebCore::WebGLRenderingContextBase::texImage2D): Ditto.
1499         (WebCore::WebGLRenderingContextBase::texSubImage2DImpl): Moved from
1500         WebGLRenderingContext.
1501         (WebCore::WebGLRenderingContextBase::texSubImage2D): Ditto.
1502         (WebCore::WebGLRenderingContextBase::validateArrayBufferType): Ditto.
1503         (WebCore::WebGLRenderingContextBase::validateTexFuncData): Ditto.
1504         (WebCore::WebGLRenderingContextBase::validateTexFuncParameters): Ditto.
1505         (WebCore::WebGLRenderingContextBase::validateTexFuncFormatAndType): Ditto.
1506         This is the main function where the new internalFormats are dealt with.
1507         The OpenGL ES spec lists a table of all the internalFormats and all their
1508         compatible format/type values. This table is entered into this function to
1509         check that the combinations are correct.
1510         (WebCore::WebGLRenderingContextBase::texSubImage2DBase): Moved from
1511         WebGLRenderingContext.
1512         (WebCore::WebGLRenderingContextBase::copyTexImage2D): Ditto.
1513         (WebCore::WebGLRenderingContextBase::validateSettableTexFormat): Deleted.
1514         * html/canvas/WebGLRenderingContextBase.h: No longer overrides virtual
1515         functions.
1516         * platform/graphics/GraphicsContext3D.cpp:
1517         (WebCore::GraphicsContext3D::computeFormatAndTypeParameters): Because
1518         this is inside GraphicsContext3D, it doesn't need any isWebGL1() checks.
1519         Teach about new enums.
1520         (WebCore::GraphicsContext3D::possibleFormatAndTypeForInternalFormat):
1521         Ditto.
1522         (WebCore::GraphicsContext3D::packImageData):
1523         (WebCore::GraphicsContext3D::packPixels): It is possible to try to
1524         copy data from a video into one of these new formats. Currently, we
1525         implement this by swizzling on the CPU. Rather than implementing all the
1526         swizzling functions in this patch (which would make this patch much
1527         larger), simply bail in this case. We will implement this later.
1528         (WebCore::GraphicsContext3D::getClearBitsByFormat): Update.
1529         * platform/graphics/GraphicsContext3D.h:
1530         (WebCore::GraphicsContext3D::hasAlpha): Ditto.
1531         (WebCore::GraphicsContext3D::hasColor): Ditto.
1532
1533 2016-11-14  Simon Fraser  <simon.fraser@apple.com>
1534
1535         Scrolling when zoomed doesn't always use the correct layout viewport
1536         https://bugs.webkit.org/show_bug.cgi?id=164756
1537
1538         Reviewed by Dean Jackson.
1539
1540         The scrolling thread was always using the layout viewport rect pushed onto it and
1541         never computing a new one, so when scrolling around after zooming position:fixed
1542         elements would not get the expected visual viewport behavior.
1543
1544         Fix by having ScrollingTreeFrameScrollingNode updating its notion of the layout viewport
1545         on scrolls.
1546
1547         Not testable because we can't dump the scrolling tree on Mac (yet).
1548
1549         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
1550         (WebCore::ScrollingTreeFrameScrollingNode::setLayoutViewport):
1551         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1552         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
1553
1554 2016-11-14  Ryosuke Niwa  <rniwa@webkit.org>
1555
1556         document.createElementNS doesn't construct a custom element
1557         https://bugs.webkit.org/show_bug.cgi?id=164700
1558
1559         Reviewed by Darin Adler.
1560
1561         Fixed the bug that document.createElementNS doesn't create a custom element or enqueue it to upgrade.
1562
1563         Also made constructCustomElementSynchronously not call the custom element constructors with the element's
1564         local name as the first argument, which was a non-standard behavior added during prototyping.
1565
1566         Test: fast/custom-elements/DOMImplementation-createDocument.html
1567               fast/custom-elements/document-createElementNS.html
1568
1569         * bindings/js/JSCustomElementInterface.cpp:
1570         (WebCore::JSCustomElementInterface::constructElementWithFallback): Added a variant that takes QualifiedName
1571         instead of AtomicString.
1572         (WebCore::constructCustomElementSynchronously): Don't add the local name as an argument.
1573         * bindings/js/JSCustomElementInterface.h:
1574
1575         * dom/CustomElementRegistry.cpp:
1576         (WebCore::CustomElementRegistry::findInterface): Just find the interface based on the local name after
1577         checking the namespace URI to be that of the XHTML. We need to ignore the prefix for the purpose of looking
1578         up the custom element definition as specified in the latest HTML specification:
1579         https://html.spec.whatwg.org/multipage/scripting.html#look-up-a-custom-element-definition
1580
1581         * dom/DOMImplementation.cpp:
1582         (WebCore::DOMImplementation::createDocument): Added an assertion to make sure we don't invoke scripts while
1583         constructing the document element.
1584
1585         * dom/Document.cpp:
1586         (WebCore::createUpgradeCandidateElement): Made this function create a HTMLUnknownElement instead of returning
1587         nullptr to share more code. Also added a variant which takes QualifiedName.
1588         (WebCore::isValidHTMLElementName): Added; helpers for createHTMLElementWithNameValidation to call isValidName
1589         on Document with the right argument.
1590         (WebCore::createHTMLElementWithNameValidation): Templatized the function to be called with either AtomicString
1591         or QualifiedName for the name.
1592         (WebCore::createFallbackHTMLElement):
1593         (WebCore::Document::createElementNS): Call createHTMLElementWithNameValidation to create a custom element if
1594         possible. This function ends up re-validating the element name before creating a HTMLUnknownElement but that
1595         shouldn't be a common scenario to matter. In fact, createElementNS is a rarely used API.
1596
1597 2016-11-14  Chris Dumez  <cdumez@apple.com>
1598
1599         Avoid copying attributes vector when constructing a CustomElement in HTMLTreeBuilder
1600         https://bugs.webkit.org/show_bug.cgi?id=164734
1601
1602         Reviewed by Ryosuke Niwa.
1603
1604         Avoid copying attributes vector when constructing a CustomElement in HTMLTreeBuilder.
1605
1606         * html/parser/HTMLConstructionSite.cpp:
1607         (WebCore::HTMLConstructionSite::insertCustomElement):
1608         * html/parser/HTMLConstructionSite.h:
1609         * html/parser/HTMLStackItem.h:
1610         (WebCore::HTMLStackItem::HTMLStackItem):
1611         (WebCore::HTMLStackItem::create):
1612         * html/parser/HTMLTreeBuilder.cpp:
1613         (WebCore::HTMLTreeBuilder::didCreateCustomOrCallbackElement):
1614
1615 2016-11-14  Chris Dumez  <cdumez@apple.com>
1616
1617         Inline QualifiedName::toString() method
1618         https://bugs.webkit.org/show_bug.cgi?id=164726
1619
1620         Reviewed by Ryosuke Niwa.
1621
1622         Inline QualifiedName::toString() method to limit performance impact of r208674.
1623
1624         * dom/QualifiedName.cpp:
1625         (WebCore::QualifiedName::toString): Deleted.
1626         * dom/QualifiedName.h:
1627         (WebCore::QualifiedName::toString):
1628
1629 2016-11-14  Dave Hyatt  <hyatt@apple.com>
1630
1631         [CSS Parser] Support the font-synthesis property
1632         https://bugs.webkit.org/show_bug.cgi?id=164728
1633
1634         Reviewed by Dean Jackson.
1635
1636         * css/parser/CSSPropertyParser.cpp:
1637         (WebCore::consumeFontSynthesis):
1638         (WebCore::CSSPropertyParser::parseSingleValue):
1639
1640 2016-11-12  Sam Weinig  <sam@webkit.org>
1641
1642         [SVG] Moving more special casing of SVG out of the bindings - SVGNumber/SVGPoint/SVGRect/SVGLength/SVGTransform/SVGMatrix
1643         https://bugs.webkit.org/show_bug.cgi?id=164696
1644
1645         Reviewed by Darin Adler.
1646
1647         - Make SVGNumber, SVGPoint, SVGRect, SVGLength, SVGTransform and SVGMatrix
1648           real classes and stop special casing them in the bindings generator. This 
1649           removes the remaining non-list SVG specializations from the bindings generator.
1650         - Renamed existing SVGLength, SVGTransform and SVGMatrix to SVGLengthValue, 
1651           SVGTransformValue and SVGMatrixValue. There are no SVNumberValue, SVGPointValue 
1652           and SVGRectValue classes, as float, FloatPoint and FloatRect can be used 
1653           directly. Going forward, we can get rid of SVGMatrixValue as well, and just
1654           use AffineTransform, but that will be done in a separate change.
1655
1656         * WebCore.xcodeproj/project.pbxproj:
1657         * CMakeLists.txt:
1658         Add new files.
1659
1660         * bindings/js/JSSVGLengthCustom.cpp:
1661         (WebCore::JSSVGLength::value): Deleted.
1662         (WebCore::JSSVGLength::setValue): Deleted.
1663         (WebCore::JSSVGLength::convertToSpecifiedUnits): Deleted.
1664         Removed. This can now be generated completely.
1665
1666         * bindings/scripts/CodeGenerator.pm:
1667         (SkipIncludeHeader):
1668         Remove special casing of SVGNumber. A header for it now exists.
1669
1670         (GetSVGWrappedTypeNeedingTearOff):
1671         Remove special casing SVGPropertyTearOffs. None remain.
1672
1673         (ShouldPassWrapperByReference):
1674         Allow all tear off types to be passed by reference.
1675
1676         (IsSVGTypeWithWritablePropertiesNeedingTearOff):
1677         Remove now unused function.
1678
1679         * bindings/scripts/CodeGeneratorJS.pm:
1680         (GetImplClassName):
1681         (GenerateHeader):
1682         (GenerateImplementation):
1683         (GenerateParametersCheck):
1684         (GenerateImplementationFunctionCall):
1685         (GetSVGPropertyTypes):
1686         (NativeToJSValue):
1687         (GenerateConstructorDefinition):
1688         Remove non-property tear off specific code. 
1689         
1690         (IsNativeType): 
1691         Remove unused function.
1692
1693         * css/CSSPropertyNames.in:
1694         * css/SVGCSSComputedStyleDeclaration.cpp:
1695         (WebCore::strokeDashArrayToCSSValueList):
1696         (WebCore::ComputedStyleExtractor::svgPropertyValue):
1697         * css/StyleBuilderConverter.h:
1698         (WebCore::StyleBuilderConverter::convertSVGLengthValue):
1699         (WebCore::StyleBuilderConverter::convertSVGLengthVector):
1700         (WebCore::StyleBuilderConverter::convertStrokeDashArray):
1701         * css/StyleBuilderCustom.h:
1702         (WebCore::StyleBuilderCustom::applyValueBaselineShift):
1703         * page/animation/CSSPropertyAnimation.cpp:
1704         (WebCore::blendFunc):
1705         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
1706         * rendering/style/RenderStyle.h:
1707         (WebCore::RenderStyle::strokeDashArray):
1708         (WebCore::RenderStyle::setStrokeDashArray):
1709         (WebCore::RenderStyle::baselineShiftValue):
1710         (WebCore::RenderStyle::setBaselineShiftValue):
1711         (WebCore::RenderStyle::kerning):
1712         (WebCore::RenderStyle::setKerning):
1713         * rendering/style/SVGRenderStyle.h:
1714         (WebCore::SVGRenderStyle::initialStrokeDashArray):
1715         (WebCore::SVGRenderStyle::initialBaselineShiftValue):
1716         (WebCore::SVGRenderStyle::initialKerning):
1717         (WebCore::SVGRenderStyle::setStrokeDashArray):
1718         (WebCore::SVGRenderStyle::setKerning):
1719         (WebCore::SVGRenderStyle::setBaselineShiftValue):
1720         (WebCore::SVGRenderStyle::strokeDashArray):
1721         (WebCore::SVGRenderStyle::kerning):
1722         (WebCore::SVGRenderStyle::baselineShiftValue):
1723         * rendering/style/SVGRenderStyleDefs.h:
1724         Update for name change of SVGLength to SVGLengthValue.
1725
1726         * rendering/svg/RenderSVGImage.cpp:
1727         Remove unused include.
1728
1729         * html/canvas/DOMPath.h:
1730         Add an overload that takes a DOMMatrix, now that it is distinct from
1731         AffineTransform.
1732
1733         * rendering/svg/RenderSVGRoot.cpp:
1734         (WebCore::RenderSVGRoot::buildLocalToBorderBoxTransform):
1735         Update for name change of SVGPoint to FloatPoint.
1736
1737         * rendering/svg/SVGRenderSupport.cpp:
1738         (WebCore::SVGRenderSupport::applyStrokeStyleToContext):
1739         * rendering/svg/SVGRenderTreeAsText.cpp:
1740         (WebCore::writeStyle):
1741         * rendering/svg/SVGTextLayoutEngineBaseline.cpp:
1742         (WebCore::SVGTextLayoutEngineBaseline::calculateBaselineShift):
1743         * rendering/svg/SVGTextLayoutEngineSpacing.cpp:
1744         (WebCore::SVGTextLayoutEngineSpacing::calculateCSSKerningAndSpacing):
1745         Update for name change of SVGLength to SVGLengthValue.
1746
1747         * rendering/svg/SVGTextQuery.cpp:
1748         (WebCore::SVGTextQuery::startPositionOfCharacter):
1749         (WebCore::SVGTextQuery::endPositionOfCharacter):
1750         (WebCore::SVGTextQuery::characterNumberAtPosition):
1751         * rendering/svg/SVGTextQuery.h:
1752         Update for name change of SVGPoint to FloatPoint.
1753
1754         * svg/LinearGradientAttributes.h:
1755         * svg/PatternAttributes.h:
1756         * svg/RadialGradientAttributes.h:
1757         Update for name change of SVGLength to SVGLengthValue.
1758
1759         * svg/SVGAllInOne.cpp:
1760         Remove SVGLength.cpp
1761
1762         * svg/SVGAngle.h:
1763         Add missing newline.
1764
1765         * svg/SVGAnimateTransformElement.cpp:
1766         (WebCore::SVGAnimateTransformElement::SVGAnimateTransformElement):
1767         (WebCore::SVGAnimateTransformElement::parseAttribute):
1768         * svg/SVGAnimateTransformElement.h:
1769         Update for name change of SVGTransform to SVGTransformValue.
1770         
1771         * svg/SVGAnimatedLength.cpp:
1772         (WebCore::SVGAnimatedLengthAnimator::SVGAnimatedLengthAnimator):
1773         (WebCore::SVGAnimatedLengthAnimator::constructFromString):
1774         (WebCore::SVGAnimatedLengthAnimator::addAnimatedTypes):
1775         (WebCore::parseLengthFromString):
1776         (WebCore::SVGAnimatedLengthAnimator::calculateAnimatedValue):
1777         (WebCore::SVGAnimatedLengthAnimator::calculateDistance):
1778         * svg/SVGAnimatedLength.h:
1779         * svg/SVGAnimatedLengthList.cpp:
1780         (WebCore::SVGAnimatedLengthListAnimator::SVGAnimatedLengthListAnimator):
1781         (WebCore::SVGAnimatedLengthListAnimator::addAnimatedTypes):
1782         (WebCore::parseLengthListFromString):
1783         (WebCore::SVGAnimatedLengthListAnimator::calculateAnimatedValue):
1784         * svg/SVGAnimatedLengthList.h:
1785         Update for name change of SVGLength to SVGLengthValue.
1786
1787         * svg/SVGAnimatedNumberList.h:
1788         Include the new SVGNumber.h and switch typedef to type alias.
1789
1790         * svg/SVGAnimatedPointList.cpp:
1791         Add now necessary include of SVGPoint.h
1792
1793         * svg/SVGAnimatedRect.h:
1794         Update for name change of SVGPropertyTearOff<FloatRect> to SVGRect.
1795     
1796         * svg/SVGAnimatedTransformList.cpp:
1797         (WebCore::SVGAnimatedTransformListAnimator::SVGAnimatedTransformListAnimator):
1798         (WebCore::SVGAnimatedTransformListAnimator::addAnimatedTypes):
1799         (WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
1800         (WebCore::SVGAnimatedTransformListAnimator::calculateDistance):
1801         Update for name change of SVGTransform to SVGTransformValue.
1802
1803         * svg/SVGAnimatedType.cpp:
1804         (WebCore::SVGAnimatedType::createLength):
1805         (WebCore::SVGAnimatedType::setValueAsString):
1806         * svg/SVGAnimatedType.h:
1807         (WebCore::SVGAnimatedType::length):
1808         * svg/SVGCircleElement.cpp:
1809         (WebCore::SVGCircleElement::parseAttribute):
1810         * svg/SVGCursorElement.cpp:
1811         (WebCore::SVGCursorElement::parseAttribute):
1812         * svg/SVGDocument.cpp:
1813         (WebCore::SVGDocument::startPan):
1814         * svg/SVGEllipseElement.cpp:
1815         (WebCore::SVGEllipseElement::parseAttribute):
1816         * svg/SVGFilterElement.cpp:
1817         (WebCore::SVGFilterElement::parseAttribute):
1818         * svg/SVGFilterPrimitiveStandardAttributes.cpp:
1819         (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
1820         * svg/SVGForeignObjectElement.cpp:
1821         (WebCore::SVGForeignObjectElement::parseAttribute):
1822         * svg/SVGImageElement.cpp:
1823         (WebCore::SVGImageElement::parseAttribute):
1824         * svg/SVGLengthContext.cpp:
1825         (WebCore::SVGLengthContext::resolveRectangle):
1826         (WebCore::SVGLengthContext::resolvePoint):
1827         (WebCore::SVGLengthContext::resolveLength):
1828         * svg/SVGLengthContext.h:
1829         * svg/SVGLengthList.cpp:
1830         (WebCore::SVGLengthList::parse):
1831         * svg/SVGLengthList.h:
1832         (WebCore::SVGPropertyTraits<SVGLengthList>::initialValue):
1833         * svg/SVGLineElement.cpp:
1834         (WebCore::SVGLineElement::parseAttribute):
1835         * svg/SVGLinearGradientElement.cpp:
1836         (WebCore::SVGLinearGradientElement::parseAttribute):
1837         * svg/SVGMarkerElement.cpp:
1838         (WebCore::SVGMarkerElement::parseAttribute):
1839         * svg/SVGMaskElement.cpp:
1840         (WebCore::SVGMaskElement::parseAttribute):
1841         * svg/SVGPatternElement.cpp:
1842         (WebCore::SVGPatternElement::parseAttribute):
1843         * svg/SVGRadialGradientElement.cpp:
1844         (WebCore::SVGRadialGradientElement::parseAttribute):
1845         * svg/SVGRectElement.cpp:
1846         (WebCore::SVGRectElement::parseAttribute):
1847         * svg/SVGTextPathElement.cpp:
1848         (WebCore::SVGTextPathElement::parseAttribute):
1849         Update for name change of SVGLength to SVGLengthValue.
1850
1851         * svg/SVGLength.cpp: Removed.
1852         * svg/SVGLength.h:
1853         (WebCore::SVGLength::create):
1854         (WebCore::SVGLength::unitType):
1855         (WebCore::SVGLength::valueForBindings):
1856         (WebCore::SVGLength::setValueForBindings):
1857         (WebCore::SVGLength::valueInSpecifiedUnits):
1858         (WebCore::SVGLength::setValueInSpecifiedUnits):
1859         (WebCore::SVGLength::valueAsString):
1860         (WebCore::SVGLength::setValueAsString):
1861         (WebCore::SVGLength::newValueSpecifiedUnits):
1862         (WebCore::SVGLength::convertToSpecifiedUnits):
1863         (WebCore::SVGLength::SVGLength):
1864         Implement the SVGLength interface as a tear off.
1865
1866         * svg/SVGLength.idl:
1867         Add annotations for exceptions, custom naming, and remove now unnecessary
1868         custom binding annotation.
1869
1870         * svg/SVGLengthValue.cpp: Copied from Source/WebCore/svg/SVGLength.cpp.
1871         * svg/SVGLengthValue.h: Copied from Source/WebCore/svg/SVGLength.h.
1872
1873         * svg/SVGGraphicsElement.cpp:
1874         (WebCore::SVGGraphicsElement::getCTMForBindings):
1875         (WebCore::SVGGraphicsElement::getScreenCTMForBindings):
1876         (WebCore::SVGGraphicsElement::getBBoxForBindings):
1877         * svg/SVGGraphicsElement.h:
1878         Add bindings specific versions of transformation access functions that return
1879         tear offs.
1880
1881         * svg/SVGGraphicsElement.idl:
1882         Annotate tear off returning functions with NewObject and ImplementedAs as necessary.
1883
1884         * svg/SVGLocatable.cpp:
1885         (WebCore::SVGLocatable::getTransformToElement):
1886         * svg/SVGLocatable.h:
1887         Change getTransformToElement to return a Ref<SVGMatrix> as that is what the binding
1888         wants.
1889
1890         * svg/SVGMatrix.h:
1891         Implement the SVGMatrix interface as a tear off.
1892         
1893         * svg/SVGMatrix.idl:
1894         Add annotations for exceptions. Remove meaningless Immutable annotation.
1895
1896         * svg/SVGMatrixValue.h: Copied from Source/WebCore/svg/SVGMatrix.h.
1897
1898         * svg/SVGNumber.h: Added.
1899         (WebCore::SVGNumber::create):
1900         (WebCore::SVGNumber::valueForBindings):
1901         (WebCore::SVGNumber::setValueForBindings):
1902         (WebCore::SVGNumber::SVGNumber):
1903         Implement the SVGNumber interface as a tear off.
1904
1905         * svg/SVGNumber.idl:
1906         Add exception annotation and custom naming annotations.
1907
1908         * svg/SVGNumberList.h:
1909         Update for name change of SVGPropertyTearOff<float> to SVGNumber.
1910
1911         * svg/SVGPathElement.cpp:
1912         (WebCore::SVGPathElement::getPointAtLength):
1913         * svg/SVGPathElement.h:
1914         Make getPointAtLength return a Ref<SVGPoint> to match the bindings.
1915
1916         * svg/SVGPathElement.idl:
1917         Annotate getPointAtLength with [NewObject].
1918
1919         * svg/SVGPathTraversalStateBuilder.cpp:
1920         (WebCore::SVGPathTraversalStateBuilder::currentPoint):
1921         * svg/SVGPathTraversalStateBuilder.h:
1922         * svg/SVGPathUtilities.cpp:
1923         (WebCore::getPointAtLengthOfSVGPathByteStream):
1924         * svg/SVGPathUtilities.h:
1925         * svg/SVGPointList.cpp:
1926         (WebCore::SVGPointList::valueAsString):
1927         * svg/SVGPointList.h:
1928         * svg/SVGPolyElement.cpp:
1929         Update for name change of SVGPoint to FloatPoint.
1930         
1931         * svg/SVGPoint.h:
1932         (WebCore::SVGPoint::create):
1933         (WebCore::SVGPoint::x):
1934         (WebCore::SVGPoint::setX):
1935         (WebCore::SVGPoint::y):
1936         (WebCore::SVGPoint::setY):
1937         (WebCore::SVGPoint::matrixTransform):
1938         (WebCore::SVGPoint::SVGPoint):
1939         Implement the SVGPoint interface as a tear off. Remove typedef of FloatPoint
1940         to SVGPoint.
1941
1942         * svg/SVGPoint.idl:
1943         Add exception and NewObject annotations.
1944
1945         * svg/SVGRect.h:
1946         (WebCore::SVGRect::create):
1947         (WebCore::SVGRect::x):
1948         (WebCore::SVGRect::setX):
1949         (WebCore::SVGRect::y):
1950         (WebCore::SVGRect::setY):
1951         (WebCore::SVGRect::width):
1952         (WebCore::SVGRect::setWidth):
1953         (WebCore::SVGRect::height):
1954         (WebCore::SVGRect::setHeight):
1955         Implement the SVGRect interface as a tear off. FloatRect SVGPropertyTraits have 
1956         been moved to SVGRectTraits.h.
1957
1958         * svg/SVGRect.idl:
1959         Add exception annotations.
1960
1961         * svg/SVGRectTraits.h: Copied from Source/WebCore/svg/SVGRect.cpp.
1962         
1963         * svg/SVGSVGElement.cpp:
1964         (WebCore::SVGSVGElement::viewport):
1965         (WebCore::SVGSVGElement::currentTranslate):
1966         (WebCore::SVGSVGElement::parseAttribute):
1967         (WebCore::SVGSVGElement::collectIntersectionOrEnclosureList):
1968         (WebCore::SVGSVGElement::getIntersectionList):
1969         (WebCore::SVGSVGElement::getEnclosureList):
1970         (WebCore::SVGSVGElement::checkIntersection):
1971         (WebCore::SVGSVGElement::checkEnclosure):
1972         (WebCore::SVGSVGElement::createSVGNumber):
1973         (WebCore::SVGSVGElement::createSVGLength):
1974         (WebCore::SVGSVGElement::createSVGPoint):
1975         (WebCore::SVGSVGElement::createSVGMatrix):
1976         (WebCore::SVGSVGElement::createSVGRect):
1977         (WebCore::SVGSVGElement::createSVGTransform):
1978         (WebCore::SVGSVGElement::createSVGTransformFromMatrix):
1979         * svg/SVGSVGElement.h:
1980         (WebCore::SVGSVGElement::currentTranslateValue):
1981         (WebCore::SVGSVGElement::currentTranslate): Deleted.
1982         (WebCore::SVGSVGElement::createSVGNumber): Deleted.
1983         Update functions taking tear off values to take the wrappers, and update
1984         the factory functions returning tear offs, to return the wrappers.
1985         
1986         * svg/SVGSVGElement.idl:
1987         Annotate functions/properties returning tear offs with [NewObject].
1988
1989         * svg/SVGTextContentElement.cpp:
1990         (WebCore::SVGTextContentElement::synchronizeTextLength):
1991         (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper):
1992         (WebCore::SVGTextContentElement::textLengthAnimated):
1993         (WebCore::SVGTextContentElement::getStartPositionOfChar):
1994         (WebCore::SVGTextContentElement::getEndPositionOfChar):
1995         (WebCore::SVGTextContentElement::getExtentOfChar):
1996         (WebCore::SVGTextContentElement::getCharNumAtPosition):
1997         (WebCore::SVGTextContentElement::parseAttribute):
1998         * svg/SVGTextContentElement.h:
1999         (WebCore::SVGTextContentElement::specifiedTextLength):
2000         Update functions returning tear off values to return the wrappers
2001         and ones taking the values to take the wrappers.
2002
2003         * svg/SVGTextContentElement.idl:
2004         Annotate functions/properties returning tear offs with [NewObject].
2005
2006         * svg/SVGTransform.cpp:
2007         (WebCore::SVGTransform::matrix):
2008         * svg/SVGTransform.h:
2009         (WebCore::SVGTransform::create):
2010         (WebCore::SVGTransform::type):
2011         (WebCore::SVGTransform::angle):
2012         (WebCore::SVGTransform::setMatrix):
2013         (WebCore::SVGTransform::setTranslate):
2014         (WebCore::SVGTransform::setScale):
2015         (WebCore::SVGTransform::setRotate):
2016         (WebCore::SVGTransform::setSkewX):
2017         (WebCore::SVGTransform::setSkewY):
2018         Implement the SVGTransform interface as a tear off.
2019
2020         * svg/SVGTransform.idl:
2021         Add ConstantsScope annotation to allow the constants to be defined on 
2022         SVGTransformValue. Add exception and NewObject annotations.
2023
2024         * svg/SVGTransformDistance.cpp:
2025         (WebCore::SVGTransformDistance::SVGTransformDistance):
2026         (WebCore::SVGTransformDistance::scaledDistance):
2027         (WebCore::SVGTransformDistance::addSVGTransforms):
2028         (WebCore::SVGTransformDistance::addToSVGTransform):
2029         (WebCore::SVGTransformDistance::distance):
2030         * svg/SVGTransformDistance.h:
2031         * svg/SVGTransformList.cpp:
2032         (WebCore::SVGTransformList::createSVGTransformFromMatrix):
2033         (WebCore::SVGTransformList::consolidate):
2034         * svg/SVGTransformList.h:
2035         (WebCore::SVGPropertyTraits<SVGTransformList>::initialValue):
2036         * svg/SVGTransformable.cpp:
2037         (WebCore::SVGTransformable::parseTransformValue):
2038         (WebCore::parseAndSkipType):
2039         (WebCore::SVGTransformable::parseTransformType):
2040         (WebCore::SVGTransformable::parseTransformAttribute):
2041         * svg/SVGTransformable.h:
2042         * svg/SVGUseElement.cpp:
2043         (WebCore::SVGUseElement::parseAttribute):
2044         Update for name change of SVGTransform to SVGTransformValue.
2045
2046         * svg/SVGTransformList.idl:
2047         Annotate functions returning tear offs with NewObject.
2048
2049         * svg/SVGTransformValue.cpp: Copied from Source/WebCore/svg/SVGTransform.cpp.
2050         * svg/SVGTransformValue.h: Copied from Source/WebCore/svg/SVGTransform.h.
2051
2052         * svg/SVGZoomEvent.cpp:
2053         (WebCore::SVGZoomEvent::zoomRectScreen):
2054         (WebCore::SVGZoomEvent::previousTranslate):
2055         (WebCore::SVGZoomEvent::newTranslate):
2056         * svg/SVGZoomEvent.h:
2057         Update for change to SVGPoint/SVGRect. SVGPoint values become FloatPoints. Functions
2058         returning SVGPoint/SVGRect now return Ref<SVGPoint>/Ref<SVGRect>.
2059
2060         * svg/SVGZoomEvent.idl:
2061         Annotate function returning tear off with NewObject.
2062
2063         * svg/properties/SVGAnimatedListPropertyTearOff.h:
2064         (WebCore::SVGAnimatedListPropertyTearOff::findItem):
2065         Switch typedefs to type aliases. Define ListItemTearOff using SVGPropertyTraits
2066         to get the correct tear off type (as we do for the other list property tear off 
2067         classes.)
2068  
2069         * svg/properties/SVGListProperty.h:
2070         (WebCore::SVGListProperty::clearValues):
2071         (WebCore::SVGListProperty::clearValuesAndWrappers):
2072         (WebCore::SVGListProperty::initializeValues):
2073         (WebCore::SVGListProperty::initializeValuesAndWrappers):
2074         (WebCore::SVGListProperty::getItemValues):
2075         (WebCore::SVGListProperty::getItemValuesAndWrappers):
2076         (WebCore::SVGListProperty::insertItemBeforeValues):
2077         (WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
2078         (WebCore::SVGListProperty::canReplaceItem):
2079         (WebCore::SVGListProperty::replaceItemValues):
2080         (WebCore::SVGListProperty::replaceItemValuesAndWrappers):
2081         (WebCore::SVGListProperty::canRemoveItem):
2082         (WebCore::SVGListProperty::removeItemValues):
2083         (WebCore::SVGListProperty::removeItemValuesAndWrappers):
2084         (WebCore::SVGListProperty::appendItemValues):
2085         (WebCore::SVGListProperty::appendItemValuesAndWrappers):
2086         * svg/properties/SVGListPropertyTearOff.h:
2087         (WebCore::SVGListPropertyTearOff::initialize):
2088         (WebCore::SVGListPropertyTearOff::getItem):
2089         (WebCore::SVGListPropertyTearOff::insertItemBefore):
2090         (WebCore::SVGListPropertyTearOff::replaceItem):
2091         (WebCore::SVGListPropertyTearOff::removeItem):
2092         (WebCore::SVGListPropertyTearOff::appendItem):
2093         * svg/properties/SVGPathSegListPropertyTearOff.h:
2094         * svg/properties/SVGStaticListPropertyTearOff.h:
2095         * svg/properties/SVGTransformListPropertyTearOff.h:
2096         Change functions returning PtrListItemTearOff, to instead return
2097         Ref<ListItemTearOff>. To accomplish this, remove unreachable conditions
2098         that were returning nullptr, and replace them with a assertions (these
2099         were cases where a function like canGetItem() was called, and it only
2100         did one of two things, returning an exception, or returned true).
2101
2102         * svg/properties/SVGMatrixTearOff.h:
2103         Update for SVGMatrix's addition, this can now inherit from SVGMatrix. Remove
2104         incorrect comment and update some SVGMatrix types to SVGMatrixValues.
2105
2106         * svg/properties/SVGStaticPropertyTearOff.h:
2107         Require the use of SVGStaticPropertyTearOff to pass in the tear off type, rather
2108         than the value type, so it can be directly inherited from. This allow the one user 
2109         of this class, SVGSVGElement::currentTranslate, to specialize on SVGPoint directly. 
2110
2111         * bindings/scripts/test/JS/JSTestObj.cpp:
2112         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2113         Update test results now that svg property tear offs are not handled specially.
2114
2115 2016-11-14  Youenn Fablet  <youenn@apple.com>
2116
2117         Move updateSignalingState to PeerConnectionBackend
2118         https://bugs.webkit.org/show_bug.cgi?id=164719
2119
2120         Reviewed by Eric Carlson.
2121
2122         No change of behavior.
2123
2124         Refactoring MediaEndpointPeerConnection signaling state update to PeerConnectionBackend.
2125         It is not specific to MediaEndpointPeerConnection and can be reused for other backends.
2126
2127         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2128         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
2129         (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
2130         * Modules/mediastream/PeerConnectionBackend.cpp:
2131         (WebCore::PeerConnectionBackend::updateSignalingState):
2132         * Modules/mediastream/PeerConnectionBackend.h:
2133
2134 2016-11-14  Dean Jackson  <dino@apple.com>
2135
2136         Handle filter() image type in new CSS Parser
2137         https://bugs.webkit.org/show_bug.cgi?id=164673
2138         <rdar://problems/29231376>
2139
2140         Reviewed by Darin Adler.
2141
2142         Add support for the <image> type filter() to the
2143         new CSS Parser. This involved moving some functions
2144         from CSSPropertyParser into CSSPropertyParserHelpers.
2145
2146         Covered by fast/filter-image tests.
2147
2148         * css/CSSValueKeywords.in:
2149         * css/parser/CSSPropertyParser.cpp:
2150         (WebCore::consumeShadow):
2151         (WebCore::parseSingleShadow): Deleted.
2152         (WebCore::consumeFilterFunction): Deleted.
2153         (WebCore::consumeFilter): Deleted.
2154         * css/parser/CSSPropertyParserHelpers.cpp:
2155         (WebCore::CSSPropertyParserHelpers::consumeFilterImage):
2156         (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
2157         (WebCore::CSSPropertyParserHelpers::isGeneratedImage):
2158         (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
2159         (WebCore::CSSPropertyParserHelpers::consumeFilter):
2160         (WebCore::CSSPropertyParserHelpers::consumeSingleShadow):
2161         * css/parser/CSSPropertyParserHelpers.h:
2162
2163 2016-11-14  Dave Hyatt  <hyatt@apple.com>
2164
2165         [CSS Parser] Support percentages in word-spacing
2166         https://bugs.webkit.org/show_bug.cgi?id=164721
2167
2168         Reviewed by Dean Jackson.
2169
2170         * css/parser/CSSPropertyParser.cpp:
2171         (WebCore::consumeLetterSpacing):
2172         (WebCore::consumeWordSpacing):
2173         (WebCore::consumeSpacing): Deleted.
2174
2175 2016-11-14  Joanmarie Diggs  <jdiggs@igalia.com>
2176
2177         AX: In ARIA 1.1, the implicit value for aria-level on headings is 2
2178         https://bugs.webkit.org/show_bug.cgi?id=164714
2179
2180         Reviewed by Chris Fleizach.
2181
2182         Return 2 rather than 0 if there is not a valid author-provided value
2183         for aria-level on an ARIA heading.
2184
2185         No new tests required as we have sufficient coverage. Added one new
2186         test case to heading-level.html and updated expectations for it and
2187         for xml-roles-exposed.html.
2188
2189         * accessibility/AccessibilityNodeObject.cpp:
2190         (WebCore::AccessibilityNodeObject::headingLevel):
2191
2192 2016-11-14  Youenn Fablet  <youenn@apple.com>
2193
2194         Refresh RTCDataChannel abstract infrastructure
2195         https://bugs.webkit.org/show_bug.cgi?id=164680
2196
2197         Reviewed by Darin Adler.
2198
2199         No real changes, except that a mock data channel is now returned for layout test.
2200         Covered by activated and rebased test.
2201
2202         Adding support for mock data channel.
2203         Updating data channel creation by using dictionary binding infrastructure.
2204         Storing of options directly in RTCDataChannel to reduce the use of the data channel handler.
2205
2206         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2207         (WebCore::MediaEndpointPeerConnection::createDataChannelHandler):
2208         * Modules/mediastream/MediaEndpointPeerConnection.h:
2209         * Modules/mediastream/PeerConnectionBackend.h:
2210         * Modules/mediastream/RTCDataChannel.cpp:
2211         (WebCore::RTCDataChannel::create):
2212         (WebCore::RTCDataChannel::RTCDataChannel):
2213         (WebCore::RTCDataChannel::bufferedAmount):
2214         (WebCore::RTCDataChannel::~RTCDataChannel): Deleted.
2215         (WebCore::RTCDataChannel::label): Deleted.
2216         (WebCore::RTCDataChannel::ordered): Deleted.
2217         (WebCore::RTCDataChannel::maxRetransmitTime): Deleted.
2218         (WebCore::RTCDataChannel::maxRetransmits): Deleted.
2219         (WebCore::RTCDataChannel::protocol): Deleted.
2220         (WebCore::RTCDataChannel::negotiated): Deleted.
2221         (WebCore::RTCDataChannel::id): Deleted.
2222         * Modules/mediastream/RTCDataChannel.h:
2223         * Modules/mediastream/RTCDataChannelEvent.cpp:
2224         (WebCore::RTCDataChannelEvent::create):
2225         (WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
2226         (WebCore::RTCDataChannelEvent::~RTCDataChannelEvent): Deleted.
2227         * Modules/mediastream/RTCDataChannelEvent.h:
2228         * Modules/mediastream/RTCPeerConnection.cpp:
2229         (WebCore::RTCPeerConnection::createDataChannel):
2230         * Modules/mediastream/RTCPeerConnection.h:
2231         * Modules/mediastream/RTCPeerConnection.idl:
2232         * platform/mediastream/MediaEndpoint.cpp:
2233         (WebCore::EmptyMediaEndpoint::EmptyMediaEndpoint): Deleted.
2234         * platform/mediastream/MediaEndpoint.h:
2235         * platform/mediastream/RTCDataChannelHandler.h:
2236         * platform/mediastream/RTCDataChannelHandlerClient.h:
2237         * platform/mediastream/RTCPeerConnectionHandler.h:
2238         (WebCore::RTCDataChannelInit::RTCDataChannelInit): Deleted.
2239         * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
2240         (WebCore::MediaEndpointOwr::createDataChannelHandler):
2241         * platform/mediastream/openwebrtc/MediaEndpointOwr.h:
2242         * platform/mock/MockMediaEndpoint.cpp:
2243         (WebCore::MockMediaEndpoint::createDataChannelHandler):
2244         * platform/mock/MockMediaEndpoint.h:
2245         * platform/mock/RTCDataChannelHandlerMock.cpp:
2246         (WebCore::RTCDataChannelHandlerMock::RTCDataChannelHandlerMock):
2247         * platform/mock/RTCDataChannelHandlerMock.h:
2248
2249 2016-11-14  David Kilzer  <ddkilzer@apple.com>
2250
2251         Bug 164702: WebContent crash due to checked unsigned overflow in WebCore: WebCore::RenderLayerCompositor::requiresCompositingLayer const + 1104
2252         <https://webkit.org/b/164702>
2253         <rdar://problem/29236368>
2254
2255         Reviewed by Darin Adler.
2256
2257         Test: inspector/layers/layers-compositing-reasons.html
2258
2259         * rendering/RenderLayerCompositor.cpp:
2260         (WebCore::RenderLayerCompositor::requiresCompositingForCanvas):
2261         Don't composite if the canvas area overflows.
2262
2263 2016-11-14  Chris Dumez  <cdumez@apple.com>
2264
2265         Fix the !ENABLE(FETCH_API) build after r208613
2266         https://bugs.webkit.org/show_bug.cgi?id=164713
2267
2268         Reviewed by Youenn Fablet.
2269
2270         * bindings/scripts/CodeGeneratorJS.pm:
2271         (GenerateImplementation):
2272
2273 2016-11-13  Darin Adler  <darin@apple.com>
2274
2275         Remove many includes of ExceptionCode.h
2276         https://bugs.webkit.org/show_bug.cgi?id=164706
2277
2278         Reviewed by Alex Christensen.
2279
2280         * Modules/encryptedmedia/CDMPrivateClearKey.cpp: Removed include of ExceptionCode.h.
2281         * Modules/encryptedmedia/CDMPrivateMediaPlayer.cpp: Ditto.
2282         * Modules/fetch/FetchBodyOwner.cpp: Ditto.
2283
2284         * Modules/indexeddb/IDBDatabase.cpp: Added include of ExceptionCode.h.
2285
2286         * Modules/indexeddb/IDBDatabase.h: Removed include of ExceptionCode.h.
2287         * Modules/indexeddb/IDBDatabaseException.cpp: Ditto.
2288
2289         * Modules/indexeddb/IDBIndex.cpp: Added include of ExceptionCode.h.
2290         * Modules/indexeddb/IDBObjectStore.cpp: Ditto.
2291
2292         * Modules/mediastream/MediaConstraintsImpl.cpp: Removed include of ExceptionCode.h.
2293         * Modules/mediastream/MediaDevicesEnumerationRequest.cpp: Ditto.
2294         * Modules/mediastream/MediaDevicesRequest.cpp: Ditto.
2295         * Modules/mediastream/MediaStream.cpp: Ditto.
2296         * Modules/mediastream/MediaStreamTrack.cpp: Ditto.
2297         * Modules/mediastream/RTCDTMFSender.cpp: Ditto.
2298         * Modules/mediastream/RTCDataChannel.cpp: Ditto.
2299         * Modules/mediastream/RTCPeerConnection.cpp: Ditto.
2300
2301         * Modules/notifications/Notification.h: Removed definition of ExceptionCode.
2302         * Modules/streams/ReadableStreamSource.h: Ditto.
2303         * Modules/webaudio/BiquadFilterNode.cpp: Ditto.
2304
2305         * Modules/webaudio/PannerNode.cpp: Removed inclde of ExceptionCode.h.
2306         * Modules/webaudio/WaveShaperNode.cpp: Ditto.
2307
2308         * Modules/webdatabase/Database.cpp:
2309         (WebCore::guidForOriginAndName): Reimplemented using HashMap::ensure.
2310         * Modules/webdatabase/Database.h: Renamed DatabaseGuid to DatabaseGUID and defined
2311         it here instead of a in DatabaseBasicTypes.h; removed that include.
2312
2313         * Modules/webdatabase/DatabaseBasicTypes.h: Removed.
2314
2315         * Modules/webdatabase/DatabaseManager.h: Removed include of DatabaseBasicTypes.h.
2316         * Modules/webdatabase/DatabaseTask.h: Ditto.
2317
2318         * Modules/webdatabase/SQLTransactionBackend.cpp: Removed include of ExceptionCode.h.
2319
2320         * Modules/webdatabase/SQLTransactionBackend.h: Removed include of DatabaseBasicTypes.h.
2321
2322         * WebCore.xcodeproj/project.pbxproj: Removed DatabaseBasicTypes.h, also let Xcode
2323         edit the file.
2324
2325         * bindings/js/ScriptModuleLoader.cpp: Removed include of ExceptionCode.h.
2326         * bindings/js/SerializedScriptValue.cpp: Ditto.
2327         * bindings/js/StructuredClone.cpp: Ditto.
2328
2329         * bindings/scripts/CodeGeneratorJS.pm:
2330         (GenerateParametersCheck): Removed unnecessary include of ExceptionCode.h.
2331
2332         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2333         * bindings/scripts/test/JS/JSTestCEReactions.cpp:
2334         * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
2335         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2336         * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
2337         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2338         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2339         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2340         * bindings/scripts/test/JS/JSTestInterface.cpp:
2341         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2342         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2343         * bindings/scripts/test/JS/JSTestNode.cpp:
2344         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2345         * bindings/scripts/test/JS/JSTestObj.cpp:
2346         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2347         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2348         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2349         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2350         Updated.
2351
2352         * css/CSSMediaRule.cpp: Removed include of ExceptionCode.h.
2353         * css/CSSSupportsRule.cpp: Ditto.
2354         * dom/ClientRectList.cpp: Ditto.
2355
2356         * dom/DOMCoreException.cpp: Added include of ExceptionCode.h.
2357
2358         * dom/DOMImplementation.cpp: Removed include of ExceptionCode.h.
2359         * dom/ExceptionBase.h: Ditto.
2360
2361         * dom/Node.cpp: Added include of ExceptionCode.h.
2362
2363         * dom/NodeIterator.cpp: Removed include of ExceptionCode.h.
2364         (WebCore::NodeIterator::NodePointer::NodePointer): Marked this inline.
2365         (WebCore::NodeIterator::NodePointer::clear): Ditto.
2366         (WebCore::NodeIterator::NodePointer::moveToNext): Ditto.
2367         (WebCore::NodeIterator::NodePointer::moveToPrevious): Ditto.
2368         (WebCore::NodeIterator::NodeIterator): Ditto.
2369         (WebCore::NodeIterator::create): Moved this here from the header.
2370         Now the constructor is inlined instead of this function.
2371         (WebCore::NodeIterator::detach): Deleted. Moved to header.
2372         * dom/NodeIterator.h: Removed definition of ExceptionCode, fixed indentation
2373         of this file and made a few changes as mentioned above.
2374
2375         * dom/ProcessingInstruction.cpp: Removed include of ExceptionCode.h.
2376
2377         * dom/Text.cpp: Added include of ExceptionCode.h.
2378
2379         * dom/TreeWalker.cpp: Removed include of ExceptionCode.h.
2380         * editing/FrameSelection.cpp: Ditto.
2381         * fileapi/WebKitBlobBuilder.cpp: Ditto.
2382         * history/CachedFrame.cpp: Ditto.
2383         * html/HTMLDocument.cpp: Ditto.
2384         * html/HTMLMeterElement.cpp: Ditto.
2385         * html/HTMLObjectElement.cpp: Ditto.
2386         * html/HTMLOptionElement.cpp: Ditto.
2387
2388         * html/HTMLOptionsCollection.cpp: Removed include of ExceptionCode.h.
2389         (WebCore::HTMLOptionsCollection::add): Changed argument to const& to avoid a
2390         little bit of reference count churn.
2391         * html/HTMLOptionsCollection.h: Updated for above.
2392
2393         * html/HTMLProgressElement.cpp: Removed include of ExceptionCode.h.
2394
2395         * html/HTMLSelectElement.cpp:
2396         (WebCore::HTMLSelectElement::add): Changed argument to const& to avoid a
2397         little bit of reference count churn.
2398         * html/HTMLSelectElement.h: Updated for above.
2399
2400         * html/HTMLTextAreaElement.cpp: Removed include of ExceptionCode.h.
2401         * html/canvas/CanvasPattern.cpp: Ditto.
2402
2403         * html/canvas/WebGLContextGroup.h: Removed definition of ExceptionCode.
2404
2405         * html/track/AudioTrack.h: Removed include of ExceptionCode.h.
2406         * html/track/TextTrack.h: Ditto.
2407
2408         * html/track/VTTCue.cpp: Added include of ExceptionCode.h.
2409         * html/track/VTTRegion.cpp: Ditto.
2410
2411         * html/track/VideoTrack.h: Removed include of ExceptionCode.h.
2412         * inspector/DOMEditor.cpp: Ditto.
2413
2414         * inspector/InspectorDatabaseAgent.cpp: Removed include of ExceptionCode.h.
2415         Tweaked the code in the file a bit, marking more things final and making them
2416         private. ALso simplified a couple of the functions a bit.
2417         (WebCore::InspectorDatabaseAgent::didOpenDatabase):
2418         (WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
2419         (WebCore::InspectorDatabaseAgent::executeSQL):
2420         (WebCore::InspectorDatabaseAgent::databaseForId):
2421
2422         * inspector/InspectorIndexedDBAgent.cpp: Removed include of ExceptionCode.h.
2423
2424         * inspector/InspectorStyleSheet.cpp: Added include of ExceptionCode.h.
2425
2426         * page/FocusController.cpp: Removed include of ExceptionCode.h.
2427
2428         * page/Location.h: Removed definition of ExceptionCode.
2429
2430         * page/Page.cpp: Removed include of ExceptionCode.h.
2431         * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm: Ditto.
2432         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: Ditto.
2433         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm: Ditto.
2434         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: Ditto.
2435
2436         * storage/StorageArea.h: Removed definition of ExceptionCode.
2437
2438         * svg/SVGCircleElement.cpp: Removed include of ExceptionCode.h.
2439
2440         * svg/SVGColor.cpp: Added include of ExceptionCode.h.
2441         * svg/SVGPaint.cpp: Ditto.
2442
2443         * svg/SVGStyleElement.cpp: Removed include of ExceptionCode.h.
2444
2445         * svg/properties/SVGListProperty.h: Added include of ExceptionCode.h.
2446
2447         * workers/Worker.cpp: Removed include of ExceptionCode.h.
2448         * workers/WorkerMessagingProxy.cpp: Ditto.
2449
2450         * xml/XMLSerializer.cpp: Removed unneeded includes.
2451         (WebCore::XMLSerializer::serializeToString): Use nullptr.
2452         * xml/XMLSerializer.h: Removed definition of ExceptionCode, fixed indentation
2453         of this file, and made a couple tweaks.
2454
2455 2016-11-14  Youenn Fablet  <youenn@apple.com>
2456
2457         MediaStreamPrivate::create should take vectors of Ref
2458         https://bugs.webkit.org/show_bug.cgi?id=164670
2459
2460         Reviewed by Sam Weinig.
2461
2462         No change of behavior.
2463
2464         * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
2465         (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
2466         * platform/mediastream/MediaStreamPrivate.cpp:
2467         (WebCore::MediaStreamPrivate::create):
2468         * platform/mediastream/MediaStreamPrivate.h:
2469         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
2470         (WebCore::RealtimeMediaSourceCenterMac::createMediaStream):
2471         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
2472         (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
2473         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
2474         (WebCore::MockRealtimeMediaSourceCenter::createMediaStream):
2475
2476 2016-11-14  Joanmarie Diggs  <jdiggs@igalia.com>
2477
2478         AX: [ATK] Expose STATE_SINGLE_LINE and STATE_MULTI_LINE for ARIA searchbox role
2479         https://bugs.webkit.org/show_bug.cgi?id=164712
2480
2481         Reviewed by Chris Fleizach.
2482
2483         Include SearchFieldRole when adding STATE_SINGLE_LINE and STATE_MULTI_LINE
2484         to AtkStateSet.
2485
2486         Test: accessibility/gtk/singleline-and-multiline.html
2487
2488         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2489         (setAtkStateSetFromCoreObject):
2490
2491 2016-11-14  Youenn Fablet  <youennf@gmail.com>
2492
2493         RTCRtpTransceiver should have Ref of sender and receiver
2494         https://bugs.webkit.org/show_bug.cgi?id=164665
2495
2496         Reviewed by Darin Adler.
2497
2498         No change of behavior.
2499
2500         Making RTCRptTransceiver have Ref<RTCRtpSender> and Ref<RTCRtpReceiver>.
2501         Transforming transceiver set list of senders and receivers as vectors of references to reduce count churning.
2502         Also making RTCRptTransceiver have a Ref<RTCIceTransport> instead of a RefPtr.
2503
2504         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2505         (WebCore::MediaEndpointPeerConnection::createOfferTask):
2506         (WebCore::MediaEndpointPeerConnection::createAnswerTask):
2507         (WebCore::createSourceMap):
2508         (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
2509         (WebCore::MediaEndpointPeerConnection::createReceiver):
2510         (WebCore::MediaEndpointPeerConnection::replaceTrack):
2511         * Modules/mediastream/MediaEndpointPeerConnection.h:
2512         * Modules/mediastream/PeerConnectionBackend.h:
2513         * Modules/mediastream/RTCPeerConnection.cpp:
2514         (WebCore::RTCPeerConnection::addTrack):
2515         (WebCore::RTCPeerConnection::removeTrack):
2516         (WebCore::RTCPeerConnection::close):
2517         * Modules/mediastream/RTCPeerConnection.h:
2518         * Modules/mediastream/RTCRtpTransceiver.cpp:
2519         (WebCore::RTCRtpTransceiver::RTCRtpTransceiver):
2520         * Modules/mediastream/RTCRtpTransceiver.h:
2521         (WebCore::RTCRtpTransceiver::create):
2522         (WebCore::RTCRtpTransceiver::sender):
2523         (WebCore::RTCRtpTransceiver::receiver):
2524         (WebCore::RTCRtpTransceiver::iceTransport):
2525         (WebCore::RtpTransceiverSet::senders):
2526         (WebCore::RtpTransceiverSet::receivers):
2527
2528 2016-11-14  Csaba Osztrogonác  <ossy@webkit.org>
2529
2530         Fix various --minimal build issue
2531         https://bugs.webkit.org/show_bug.cgi?id=164479
2532
2533         Reviewed by Darin Adler.
2534
2535         * dom/Node.cpp:
2536         * platform/audio/PlatformMediaSessionManager.cpp:
2537         * testing/Internals.cpp:
2538         (WebCore::Internals::captionsStyleSheetOverride):
2539
2540 2016-11-14  Csaba Osztrogonác  <ossy@webkit.org>
2541
2542         Fix the !ENABLE(VIDEO_TRACK) build
2543         https://bugs.webkit.org/show_bug.cgi?id=164476
2544
2545         Reviewed by Darin Adler.
2546
2547         * css/RuleSet.cpp:
2548         (WebCore::RuleSet::addRule):
2549         * css/parser/CSSParserValues.h:
2550         (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching):
2551         * css/parser/CSSSelectorParser.cpp:
2552         (WebCore::isPseudoElementFunction):
2553         (WebCore::CSSSelectorParser::consumePseudo):
2554
2555 2016-11-14  Miguel Gomez  <magomez@igalia.com>
2556
2557         [GTK] Do not use gstreamer-gl when accelerated compositing is disabled
2558         https://bugs.webkit.org/show_bug.cgi?id=164481
2559
2560         Reviewed by Žan Doberšek.
2561
2562         Check whether accelerated compositing is enabled before creating the gstreamer-gl video sink.
2563
2564         No new tests (Covered by existing tests).
2565
2566         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2567         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
2568
2569 2016-11-14  Csaba Osztrogonác  <ossy@webkit.org>
2570
2571         Fix the !ENABLE(CSS_BOX_DECORATION_BREAK) build
2572         https://bugs.webkit.org/show_bug.cgi?id=164478
2573
2574         Reviewed by Darin Adler.
2575
2576         * css/parser/CSSParserFastPaths.cpp:
2577         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
2578
2579 2016-11-14  Csaba Osztrogonác  <ossy@webkit.org>
2580
2581         Fix the !ENABLE(CSS_GRID_LAYOUT) build
2582         https://bugs.webkit.org/show_bug.cgi?id=164477
2583
2584         Reviewed by Darin Adler.
2585
2586         * css/parser/CSSParserFastPaths.cpp:
2587         (WebCore::isSimpleLengthPropertyID):
2588         * css/parser/CSSPropertyParser.cpp:
2589         (WebCore::CSSPropertyParser::parseSingleValue):
2590         (WebCore::CSSPropertyParser::parseShorthand):
2591
2592 2016-11-14  Csaba Osztrogonác  <ossy@webkit.org>
2593
2594         [EFL] Suppress build warning in generated Geoclue2Interface.c
2595         https://bugs.webkit.org/show_bug.cgi?id=164475
2596
2597         Reviewed by Darin Adler.
2598
2599         * PlatformEfl.cmake:
2600
2601 2016-11-10  Philippe Normand  <pnormand@igalia.com>
2602
2603         [GStreamer][OWR] poor video rendering in apprtc
2604         https://bugs.webkit.org/show_bug.cgi?id=164585
2605
2606         Reviewed by Xabier Rodriguez-Calvar.
2607
2608         The apprtc service uses 3 video elements in total, one for local, one
2609         for remote and one called preview. During a call only remote and
2610         preview are displayed, preview being linked to the same mediastream as
2611         local. The consequence is that 2 OWR video renderers of the same
2612         source are created. When gst-gl is enabled this isn't a problem but
2613         when it is disabled a performance issue appears and the webkit video
2614         sink starts dropping frames.
2615
2616         The solution is to have the video renderer shared between the 2
2617         media players in this scenario.
2618
2619         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
2620         (WebCore::MediaPlayerPrivateGStreamerBase::videoSink): Add video sink getter.
2621         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
2622         (WebCore::MediaPlayerPrivateGStreamerOwr::load): Make sure the m_streamPrivate is
2623         set before creating the video sink.
2624         (WebCore::MediaPlayerPrivateGStreamerOwr::createVideoSink): Re-use video renderer
2625         and sink if they have previously been created for another media player.
2626         * platform/mediastream/MediaStreamPrivate.h: Store GStreamer sink and renderer so
2627         they can be potentially used by multiple media players.
2628         (WebCore::MediaStreamPrivate::setVideoRenderer):
2629         (WebCore::MediaStreamPrivate::getVideoSinkElement):
2630         (WebCore::MediaStreamPrivate::getVideoRenderer):
2631
2632 2016-11-13  Fujii Hironori  <Hironori.Fujii@sony.com>
2633
2634         [HarfBuzz] HarfBuzzShaper should not assume numGlyphs is greater than 0
2635         https://bugs.webkit.org/show_bug.cgi?id=164500
2636
2637         Reviewed by Myles C. Maxfield.
2638
2639         Test: fast/text/international/harfbuzz-runs-with-no-glyph.html
2640
2641         HarfBuzzShaper assumes numGlyphs of HarfBuzzRun is greater than
2642         zero. But this is not necessarily true. If a font does not have a
2643         glyph of SPACE (U+0020), HarfBuzz removes ignorable glyphs. In
2644         this case, HarfBuzzRun can have no glyphs.
2645
2646         * platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
2647         (WebCore::HarfBuzzShaper::HarfBuzzRun::applyShapeResult): Resize
2648         m_offsets to one if m_numGlyphs is zero.
2649         * platform/graphics/harfbuzz/HarfBuzzShaper.h:
2650         (WebCore::HarfBuzzShaper::HarfBuzzRun::glyphs): Use Vector::data()
2651         instread of operator[0].
2652         (WebCore::HarfBuzzShaper::HarfBuzzRun::advances): Ditto.
2653         (WebCore::HarfBuzzShaper::HarfBuzzRun::offsets): Ditto.
2654         (WebCore::HarfBuzzShaper::HarfBuzzRun::glyphToCharacterIndexes): Ditto.
2655
2656 2016-11-13  Chris Dumez  <cdumez@apple.com>
2657
2658         REGRESSION (204441): newsplex.com map does not load
2659         https://bugs.webkit.org/show_bug.cgi?id=164705
2660         <rdar://problem/28753438>
2661
2662         Reviewed by Darin Adler.
2663
2664         Update getElementsByTagName(qualifiedName) implementation to match more closely
2665         the specification at:
2666         - https://dom.spec.whatwg.org/#dom-document-getelementsbytagname
2667         - https://dom.spec.whatwg.org/#concept-getelementsbytagname
2668         - https://dom.spec.whatwg.org/#concept-element-qualified-name
2669
2670         In particular, we no longer split the input qualifiedName into a prefix and a
2671         localName in order to compare those to element.prefix() / element.localName().
2672         Instead, we keep the input qualifiedName as is and compare it to the element's
2673         qualifiedName. This matters for HTML elements inside an HTML document that have
2674         a semicolon in their localname (e.g. 'wx:map'). For this example, the element's
2675         localName and its qualified name are both 'wx:map'. Calling
2676         getElementsByTagName('wx:map') should return it. However, if you split the input
2677         qualifiedName into a prefix and a localName, you end up checking:
2678         'wx' == null && 'map' == 'wx:map'
2679         which does not match.
2680
2681         Test: fast/dom/getElementsByTagName-HTMLElement-prefix.html
2682
2683         * dom/TagCollection.cpp:
2684         (WebCore::TagCollection::TagCollection):
2685         (WebCore::TagCollection::~TagCollection):
2686         (WebCore::HTMLTagCollection::HTMLTagCollection):
2687         (WebCore::HTMLTagCollection::~HTMLTagCollection):
2688         (WebCore::makeQualifiedName): Deleted.
2689         (WebCore::splitQualifiedName): Deleted.
2690         * dom/TagCollection.h:
2691         (WebCore::TagCollection::elementMatches):
2692         (WebCore::HTMLTagCollection::elementMatches):
2693
2694 2016-11-13  Darin Adler  <darin@apple.com>
2695
2696         Remove ExceptionCodePlaceholder
2697         https://bugs.webkit.org/show_bug.cgi?id=164703
2698
2699         Reviewed by Sam Weinig.
2700
2701         * CMakeLists.txt: Removed ExceptionCodePlaceholder.cpp.
2702         * WebCore.xcodeproj/project.pbxproj: Removed ExceptionCodePlaceholder.h/cpp.
2703         Also let Xcode make a change to the file, I think removing an unreferenced
2704         dead entry for a file that is already listed under a different ID.
2705         * dom/DOMAllInOne.cpp: Removed ExceptionCodePlaceholder.cpp.
2706         * dom/ExceptionCodePlaceholder.cpp: Removed.
2707         * dom/ExceptionCodePlaceholder.h: Removed.
2708         * inspector/InspectorDatabaseAgent.cpp: Removed include of ExceptionCodePlaceholder.h.
2709
2710 2016-11-13  Darin Adler  <darin@apple.com>
2711
2712         Fix exception handling in SQL database code, streamline and update code
2713         https://bugs.webkit.org/show_bug.cgi?id=164685
2714
2715         Reviewed by Sam Weinig.
2716
2717         Removed some old abstraction layers that were no longer in use. For example,
2718         i n many cases, calls were going through DatabaseManager, which called through
2719         an abstract class AbstractDatabaseServer to a concrete class DatabaseServer,
2720         which then called through to DatabaseTracker. Clients now mostly just call
2721         DatabaseTracker directly.
2722
2723         * CMakeLists.txt: Removed DatabaseServer.cpp and SQLTransactionClient.cpp.
2724
2725         * Modules/webdatabase/AbstractDatabaseServer.h: Removed.
2726
2727         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
2728         (WebCore::DOMWindowWebDatabase::openDatabase): Use ExceptionOr instead of
2729         DatabaseError to communicate DOM exceptions from DatabaseManager.
2730
2731         * Modules/webdatabase/Database.cpp:
2732         (WebCore::Database::Database): Use a reference instead of a RefPtr&& for database
2733         context. Use unsigned instead of unsigned long. Modernize code to use more
2734         initialization rather than assignment, to initialize scalar data members in the
2735         class definition, and to use HashMap::ensure.
2736         (WebCore::Database::databaseThread): Added. This class asserts that there is a
2737         thread in the constructor, and so it is useful to have a helper for all the other
2738         functions that assumes the thread is present and returns a reference rather than
2739         a pointer.
2740         (WebCore::Database::~Database): Updated since m_scriptExecutionContext is now
2741         a Ref instead of a RefPtr.
2742         (WebCore::Database::openAndVerifyVersion): Use ExceptionOr and databaseThread.
2743         (WebCore::Database::close): Use databaseThread.
2744         (WebCore::Database::performClose): Ditto.
2745         (WebCore::DoneCreatingDatabaseOnExitCaller::DoneCreatingDatabaseOnExitCaller):
2746         Use a reference. Removed unused m_openSuccceeded.
2747         (WebCore::DoneCreatingDatabaseOnExitCaller::~DoneCreatingDatabaseOnExitCaller):
2748         Use DatabaseTracker::singleton by its new name.
2749         (WebCore::DoneCreatingDatabaseOnExitCaller::setOpenSucceeded): Deleted.
2750         (WebCore::Database::performOpenAndVerify): Use ExceptionOr and update for above.
2751         (WebCore::Database::closeDatabase): Updated for name change.
2752         (WebCore::Database::scheduleTransaction): Updated for above, simplified and
2753         streamlined.
2754         (WebCore::Database::scheduleTransactionStep): Use databaseThread.
2755         (WebCore::Database::transactionClient): Deleted. This object is no longer needed.
2756         (WebCore::Database::transactionCoordinator): Use databaseThread.
2757         (WebCore::Database::markAsDeletedAndClose): Removed unnecessary null check for
2758         databaseThread, which can never be null.
2759         (WebCore::Database::estimatedSize): Use unsigned, not unsigned long.
2760         (WebCore::Database::disableAuthorizer): Removed assertion about RefPtr that is
2761         now a Ref and never could have been null.
2762         (WebCore::Database::enableAuthorizer): Ditto.
2763         (WebCore::Database::setAuthorizerPermissions): Ditto.
2764         (WebCore::Database::lastActionChangedDatabase): Ditto.
2765         (WebCore::Database::lastActionWasInsert): Ditto.
2766         (WebCore::Database::resetDeletes): Ditto.
2767         (WebCore::Database::hadDeletes): Ditto.
2768         (WebCore::Database::resetAuthorizer): Removed null check for a RefPtr that is now
2769         a Ref and never could have been null.
2770         (WebCore::Database::runTransaction): Simplified a bit.
2771         (WebCore::Database::tableNames): Use databaseThread.
2772         (WebCore::Database::securityOrigin): Changed to return a reference instead of a
2773         pointer because all the callers need it to do that. If called on the wrong thread,
2774         this will now do a RELEASE_ASSERT_NOT_REACHED. In the old code it would return a
2775         null pointer and then the caller would dereference it a moment later, so it would
2776         still be a crash.
2777         (WebCore::Database::maximumSize): Removed const since it's not really needed and
2778         the DatabaseTracker wants a non-const reference to this database.
2779         (WebCore::Database::didCommitWriteTransaction): Added. Moved this code here from
2780         SQLTransactionClient. There is no abstraction layer, so no reason to not have
2781         this code, quite comparable to the rest of the code in the class, here. I am
2782         assuming this served some more useful purpose back when we had a different back end
2783         for Chromium?
2784         (WebCore::Database::didExceedQuota): Ditto.
2785         * Modules/webdatabase/Database.h: Updated for above changes. Made some functions
2786         return references instead of pointers. Use Ref instead of RefPtr for some things that
2787         can never be null.
2788         * Modules/webdatabase/Database.idl: Added ImplementationLacksVTable because the
2789         Database class is not polymorphic.
2790
2791         * Modules/webdatabase/DatabaseContext.cpp:
2792         (WebCore::DatabaseContext::DatabaseContext): Take a reference instead of a pointer.
2793         Moved data member initialization into class definition. Remove code that tries to do
2794         debug accounting and databasecontext registration and instead just make sure to keep
2795         the ScriptExecutionContext pointing at the DatabaseContext.
2796         (WebCore::DatabaseContext::~DatabaseContext): Ditto.
2797         (WebCore::DatabaseContext::stopDatabases): Ditto.
2798         * Modules/webdatabase/DatabaseContext.h: Updated for the above. Also used the
2799         scriptExecutionContext function inherited from the base class intead of adding our
2800         own, and added a existingDatabaseThread() function, letting us get at the database
2801         thread efficiently without creating a new one.
2802
2803         * Modules/webdatabase/DatabaseError.h: Removed. We now use DOM exceptions directly
2804         instead of our own error enumeration that has to be translated to a DOM exception.
2805
2806         * Modules/webdatabase/DatabaseManager.cpp: Moved the ProposedDatabase class here
2807         from the header file, and had it use references instead of pointers.
2808         (WebCore::DatabaseManager::DatabaseManager): Deleted. There was nothing left to
2809         initialize once the refactoring was done.
2810         (WebCore::DatabaseManager::initialize): Call DatabaseTracker directly instead of
2811         calling through m_server.
2812         (WebCore::DatabaseManager::setClient): Ditto.
2813         (WebCore::DatabaseManager::databaseDirectoryPath): Deleted. Callers will use the
2814         function in DatabaseTracker directly.
2815         (WebCore::DatabaseManager::setDatabaseDirectoryPath): Ditto.
2816         (WebCore::DatabaseManager::existingDatabaseContextFor): Deleted. Callers will use
2817         the ScriptExecutionContext::databaseContext function instead.
2818         (WebCore::DatabaseManager::databaseContext): Renamed from databaseContextFor.
2819         (WebCore::DatabaseManager::registerDatabaseContext): Deleted.
2820         (WebCore::DatabaseManager::unregisterDatabaseContext): Deleted.
2821         (WebCore::DatabaseManager::didConstructDatabaseContext): Deleted.
2822         (WebCore::DatabaseManager::didDestructDatabaseContext): Deleted.
2823         (WebCore::DatabaseManager::exceptionCodeForDatabaseError): Deleted.
2824         (WebCore::logOpenDatabaseError): Tweaked conditionals a bit.
2825         (WebCore::DatabaseManager::openDatabaseBackend): Use ExceptionOr. Changed to call
2826         tryToOpenDatabaseBackend function here in this class rather than using m_server.
2827         (WebCore::DatabaseManager::tryToOpenDatabaseBackend): Added. Moved here from the
2828         DatabaseServer class.
2829         (WebCore::DatabaseManager::addProposedDatabase): Take a reference.
2830         (WebCore::DatabaseManager::removeProposedDatabase): Ditto.
2831         (WebCore::DatabaseManager::openDatabase): Use ExceptionOr.
2832         (WebCore::DatabaseManager::hasOpenDatabases): Use ScriptContext::databaseContext
2833         directly instead of using helper functions in this class.
2834         (WebCore::DatabaseManager::stopDatabases): Ditto.
2835         (WebCore::DatabaseManager::fullPathForDatabase): Take a reference and also call
2836         DatabaseTracker directly instead of calling through m_server.
2837         (WebCore::DatabaseManager::hasEntryForOrigin): Deleted. Callers will use the
2838         function in DatabaseTracker directly.
2839         (WebCore::DatabaseManager::origins): Ditto.
2840         (WebCore::DatabaseManager::databaseNamesForOrigin): Ditto.
2841         (WebCore::DatabaseManager::detailsForNameAndOrigin): Call DatabaseTracker directly
2842         instead of calling through m_server.
2843         (WebCore::DatabaseManager::usageForOrigin): Deleted. Callers will use the
2844         function in DatabaseTracker directly.
2845         (WebCore::DatabaseManager::quotaForOrigin): Ditto.
2846         (WebCore::DatabaseManager::setQuota): Ditto.
2847         (WebCore::DatabaseManager::deleteAllDatabasesImmediately): Ditto.
2848         (WebCore::DatabaseManager::deleteOrigin): Ditto.
2849         (WebCore::DatabaseManager::deleteDatabase): Ditto.
2850         (WebCore::DatabaseManager::closeAllDatabases): Ditto.
2851         (WebCore::DatabaseManager::logErrorMessage): Take a reference.
2852         * Modules/webdatabase/DatabaseManager.h: Updated for changes above.
2853
2854         * Modules/webdatabase/DatabaseManagerClient.h: Use references for security origins.
2855         Also changed #if for iOS so that other platforms can call the iOS-specific functions
2856         and they have inline empty bodies; lets us clean up call sites to not need conditionals.
2857
2858         * Modules/webdatabase/DatabaseServer.cpp: Removed.
2859         * Modules/webdatabase/DatabaseServer.h: Removed.
2860
2861         * Modules/webdatabase/DatabaseTask.cpp:
2862         (WebCore::isolatedCopy): Added. Helper functions for making isolated copies of
2863         exceptions, which can contain strings.
2864         (WebCore::DatabaseOpenTask::DatabaseOpenTask): Use ExceptionOr<void> instead of
2865         a DatabaseError, a String, and a success boolean.
2866         (WebCore::DatabaseOpenTask::doPerformTask): Updated to use ExceptoinOr.
2867         (WebCore::DatabaseTableNamesTask::DatabaseTableNamesTask): Renamed.
2868         (WebCore::DatabaseTableNamesTask::doPerformTask): Added a comment.
2869         * Modules/webdatabase/DatabaseTask.h: Updated for above changes.
2870
2871         * Modules/webdatabase/DatabaseThread.cpp:
2872         (WebCore::DatabaseThread::DatabaseThread): Initialized data members in the class
2873         definition. Removed m_transactionClient.
2874         (WebCore::DatabaseThread::recordDatabaseOpen): Take a reference.
2875         (WebCore::DatabaseThread::recordDatabaseClosed): Ditto.
2876         (WebCore::DatabaseThread::scheduleTask): Use an rvalue reference.
2877         (WebCore::DatabaseThread::scheduleImmediateTask): Ditto.
2878         (WebCore::DatabaseThread::unscheduleDatabaseTasks): Use a lambda instead of a
2879         class for the same-database predicate.
2880         * Modules/webdatabase/DatabaseThread.h: Updated for above.
2881
2882         * Modules/webdatabase/DatabaseTracker.cpp:
2883         (WebCore::isolatedCopy): Added. Helper for making an isolated copy of a vector
2884         of strings.
2885         (WebCore::DatabaseTracker::singleton): Renamed from tracker.
2886         (WebCore::DatabaseTracker::DatabaseTracker): Moved the code from
2887         setDatabaseDirectoryPath in here.
2888         (WebCore::DatabaseTracker::setDatabaseDirectoryPath): Deleted.
2889         (WebCore::DatabaseTracker::databaseDirectoryPath): Deleted.
2890         (WebCore::DatabaseTracker::hasAdequateQuotaForOrigin): Use ExceptionOr.
2891         (WebCore::DatabaseTracker::canEstablishDatabase): Ditto.
2892         (WebCore::DatabaseTracker::retryCanEstablishDatabase): Ditto.
2893         (WebCore::DatabaseTracker::hasEntryForOriginNoLock): Take a reference.
2894         (WebCore::DatabaseTracker::hasEntryForOrigin): Deleted.
2895         (WebCore::DatabaseTracker::hasEntryForDatabase): Take a reference.
2896         (WebCore::DatabaseTracker::maximumSize): Renamed from getMaxSizeForDatabase
2897         and changed to take a reference.
2898         (WebCore::DatabaseTracker::originPath): Take a reference.
2899         (WebCore::DatabaseTracker::fullPathForDatabaseNoLock): Ditto.
2900         (WebCore::DatabaseTracker::fullPathForDatabase): Ditto.
2901         (WebCore::DatabaseTracker::origins): Changed to use a return value instead
2902         of using an out argument.
2903         (WebCore::DatabaseTracker::databaseNamesNoLock): Ditto. Also renamed from
2904         databaseNamesForOriginNoLock.
2905         (WebCore::DatabaseTracker::databaseNames): Ditto. Also renamed from
2906         databaseNamesForOrigin.
2907         (WebCore::DatabaseTracker::detailsForNameAndOrigin): Take a reference.
2908         (WebCore::DatabaseTracker::setDatabaseDetails): Ditto.
2909         (WebCore::DatabaseTracker::doneCreatingDatabase): Ditto.
2910         (WebCore::DatabaseTracker::addOpenDatabase): Ditto.
2911         (WebCore::DatabaseTracker::removeOpenDatabase): Ditto.
2912         (WebCore::DatabaseTracker::getOpenDatabases): Deleted.
2913         (WebCore::DatabaseTracker::originLockFor): Take a reference.
2914         (WebCore::DatabaseTracker::deleteOriginLockFor): Take a reference.
2915         (WebCore::DatabaseTracker::usage): Renamed from usageForOrigin. Take a reference.
2916         (WebCore::DatabaseTracker::quotaNoLock): Renamed from quotaForOriginNoLock.
2917         Take a reference.
2918         (WebCore::DatabaseTracker::quota): Renamed from quatoForOrigin. Take a reference.
2919         (WebCore::DatabaseTracker::setQuota): Take a reference.
2920         (WebCore::DatabaseTracker::addDatabase): Ditto.
2921         (WebCore::DatabaseTracker::deleteAllDatabasesImmediately): Updated now that
2922         origins has a return value.
2923         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince): Ditto.
2924         (WebCore::DatabaseTracker::deleteOrigin): Take a reference.
2925         (WebCore::DatabaseTracker::isDeletingDatabaseOrOriginFor): Ditto.
2926         (WebCore::DatabaseTracker::recordCreatingDatabase): Updated to take a reference,
2927         use unique_ptr, and use HashCountedSet.
2928         (WebCore::DatabaseTracker::doneCreatingDatabase): Ditto.
2929         (WebCore::DatabaseTracker::creatingDatabase): Ditto.
2930         (WebCore::DatabaseTracker::canDeleteDatabase): Take a reference.
2931         (WebCore::DatabaseTracker::recordDeletingDatabase): Updated to take a reference,
2932         and use unique_ptr.
2933         (WebCore::DatabaseTracker::doneDeletingDatabase): Ditto.
2934         (WebCore::DatabaseTracker::isDeletingDatabase): Ditto.
2935         (WebCore::DatabaseTracker::canDeleteOrigin): Take a reference.
2936         (WebCore::DatabaseTracker::isDeletingOrigin): Ditto.
2937         (WebCore::DatabaseTracker::recordDeletingOrigin): Ditto.
2938         (WebCore::DatabaseTracker::doneDeletingOrigin): Ditto.
2939         (WebCore::DatabaseTracker::deleteDatabase): Ditto.
2940         (WebCore::DatabaseTracker::deleteDatabaseFile): Ditto.
2941         (WebCore::DatabaseTracker::removeDeletedOpenedDatabases): Ditto.
2942         (WebCore::DatabaseTracker::scheduleNotifyDatabaseChanged): Ditto.
2943         (WebCore::DatabaseTracker::notifyDatabasesChanged): Ditto.
2944         * Modules/webdatabase/DatabaseTracker.h: Updated for above changes.
2945
2946         * Modules/webdatabase/SQLStatement.cpp:
2947         (WebCore::SQLStatement::SQLStatement): Updated since Database::scriptExecutionContext
2948         now returns a reference.
2949
2950         * Modules/webdatabase/SQLTransaction.cpp:
2951         (WebCore::SQLTransaction::SQLTransaction): Moved data member initialization to
2952         the calss definition. Also updated since Database::scriptExecutionContext now
2953         returns a reference.
2954         (WebCore::SQLTransaction::executeSQL): Use ExceptionOr.
2955         (WebCore::SQLTransaction::checkAndHandleClosedDatabase): Updated since
2956         databaseContext now returns a reference.
2957         (WebCore::SQLTransaction::deliverQuotaIncreaseCallback): Updated to call
2958         didExceedQuota on the database instead of the transaction client.
2959         (WebCore::SQLTransaction::postflightAndCommit): Updated to call
2960         didCommitWriteTransaction on the database instead of the transaction client.
2961         (WebCore::SQLTransaction::acquireOriginLock): Updated for name change of
2962         DatabaseTracker::tracker to DatbaseTracker::singleton.
2963         * Modules/webdatabase/SQLTransaction.h: Updated for above.
2964         * Modules/webdatabase/SQLTransaction.idl: Added MayThrowException to
2965         executeSql. Not technically needed since it's a custom binding.
2966
2967         * Modules/webdatabase/SQLTransactionBackend.cpp:
2968         (WebCore::SQLTransactionBackend::doCleanup): Updated assertion to use
2969         Database::databaseThread.
2970         (WebCore::SQLTransactionBackend::notifyDatabaseThreadIsShuttingDown): Ditto.
2971
2972         * Modules/webdatabase/SQLTransactionClient.cpp: Removed.
2973         * Modules/webdatabase/SQLTransactionClient.h: Removed.
2974
2975         * Modules/webdatabase/SQLTransactionCoordinator.cpp:
2976         (WebCore::getDatabaseIdentifier): Updated to pass a reference.
2977
2978         * WebCore.xcodeproj/project.pbxproj: Removed various deleted files.
2979         Also let Xcode change the whitespace on some lines.
2980
2981         * bindings/js/JSSQLTransactionCustom.cpp:
2982         (WebCore::JSSQLTransaction::executeSql): Use ExceptionOr, specifically by
2983         using the propagateException function.
2984
2985         * dom/ScriptExecutionContext.h: Added databaseContext function. Before, we
2986         had setDatabaseContext, but no way to inspect the pointer that was stored.
2987
2988         * inspector/InspectorDatabaseAgent.cpp: Removed IGNORE_EXCEPTION in a call
2989         to executeSQL, which no longer has an ExceptionCode out argument.
2990
2991         * loader/FrameLoader.cpp:
2992         (WebCore::FrameLoader::stopLoading): Pass a reference in the call to
2993         DatabaseManager::stopDatabases.
2994
2995 2016-11-13  Dan Bernstein  <mitz@apple.com>
2996
2997         Try to fix building with newer versions of clang.
2998
2999         * page/FrameView.h: Don’t export an inline function.
3000
3001 2016-11-13  Darin Adler  <darin@apple.com>
3002
3003         Move crypto code from ExceptionCode to ExceptionOr
3004         https://bugs.webkit.org/show_bug.cgi?id=164698
3005
3006         Reviewed by Sam Weinig.
3007
3008         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
3009         (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
3010         Use the new identifier function instead of getIdentifierForName.
3011         * bindings/js/JSSubtleCryptoCustom.cpp:
3012         (WebCore::normalizeCryptoAlgorithmParameters): Ditto.
3013         (WebCore::toCryptoKeyUsageBitmap): Removed a stray meaningless const.
3014         (WebCore::jsSubtleCryptoFunctionGenerateKeyPromise): Pass
3015         ScriptExecutionContext as a reference instead of a pointer.
3016
3017         * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
3018         (WebCore::createAlgorithmFromJSValue): Use the more efficient version
3019         of setDOMException that uses scope.
3020         (WebCore::JSWebKitSubtleCrypto::encrypt): Ditto. Also updated to use
3021         ExceptionOr instead of ExceptionCode.
3022         (WebCore::JSWebKitSubtleCrypto::decrypt): Ditto.
3023         (WebCore::JSWebKitSubtleCrypto::sign): Ditto.
3024         (WebCore::JSWebKitSubtleCrypto::verify): Ditto.
3025         (WebCore::JSWebKitSubtleCrypto::digest): Ditto.
3026         (WebCore::JSWebKitSubtleCrypto::generateKey): Ditto.
3027         (WebCore::importKey): Ditto.
3028         (WebCore::JSWebKitSubtleCrypto::wrapKey): Ditto.
3029         (WebCore::JSWebKitSubtleCrypto::unwrapKey): Ditto.
3030
3031         * crypto/CryptoAlgorithm.cpp:
3032         (WebCore::CryptoAlgorithm::CryptoAlgorithm): Deleted.
3033         (WebCore::CryptoAlgorithm::~CryptoAlgorithm): Deleted.
3034         (WebCore::CryptoAlgorithm::generateKey): Use ExceptionOr.
3035         (WebCore::CryptoAlgorithm::encrypt): Ditto.
3036         (WebCore::CryptoAlgorithm::decrypt): Ditto.
3037         (WebCore::CryptoAlgorithm::sign): Ditto.
3038         (WebCore::CryptoAlgorithm::verify): Ditto.
3039         (WebCore::CryptoAlgorithm::digest): Ditto.
3040         (WebCore::CryptoAlgorithm::deriveKey): Ditto.
3041         (WebCore::CryptoAlgorithm::deriveBits): Ditto.
3042         (WebCore::CryptoAlgorithm::importKey): Ditto.
3043         (WebCore::CryptoAlgorithm::encryptForWrapKey): Ditto.
3044         (WebCore::CryptoAlgorithm::decryptForUnwrapKey): Ditto.
3045         * crypto/CryptoAlgorithm.h: Use ExceptionOr.
3046         Moved the destructor into the header since it's more efficient for
3047         derived classes to have it inlined. Removed the protected constructor
3048         because since there are pure virtual functions in the class, there is
3049         no risk of anyone misusing the public constructor.
3050
3051         * crypto/CryptoAlgorithmRegistry.cpp:
3052         (WebCore::CryptoAlgorithmRegistry::identifier): Renamed from
3053         getIdentifierForName and changed to use an Optional rather than
3054         using a boolean plus an out argument.
3055         (WebCore::CryptoAlgorithmRegistry::name): Renamed to name from
3056         nameForIdentifier. Also updated to share a single map containing
3057         both names and constructors.
3058         (WebCore::CryptoAlgorithmRegistry::create): Share single map as above.
3059         (WebCore::CryptoAlgorithmRegistry::registerAlgorithm): Updated assertions
3060         to a mroe straightforward style. Share single map for names and constructors.
3061         * crypto/CryptoAlgorithmRegistry.h: Updated for above.
3062
3063         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
3064         (WebCore::CryptoAlgorithmAES_CBC::CryptoAlgorithmAES_CBC): Deleted.
3065         (WebCore::CryptoAlgorithmAES_CBC::~CryptoAlgorithmAES_CBC): Deleted.
3066         (WebCore::CryptoAlgorithmAES_CBC::keyAlgorithmMatches): Use references, ExceptionOr.
3067         (WebCore::CryptoAlgorithmAES_CBC::generateKey): Ditto.
3068         (WebCore::CryptoAlgorithmAES_CBC::encrypt): Ditto.
3069         (WebCore::CryptoAlgorithmAES_CBC::decrypt): Ditto.
3070         (WebCore::CryptoAlgorithmAES_CBC::importKey): Ditto.
3071         * crypto/algorithms/CryptoAlgorithmAES_CBC.h: Updated for above.
3072         Also use constexpr for s_name and s_identifier.
3073
3074         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
3075         (WebCore::CryptoAlgorithmAES_KW::CryptoAlgorithmAES_KW): Deleted.
3076         (WebCore::CryptoAlgorithmAES_KW::~CryptoAlgorithmAES_KW): Deleted.
3077         (WebCore::CryptoAlgorithmAES_KW::keyAlgorithmMatches): Use references, ExceptionOr.
3078         (WebCore::CryptoAlgorithmAES_KW::generateKey): Ditto.
3079         (WebCore::CryptoAlgorithmAES_KW::importKey): Ditto.
3080         (WebCore::CryptoAlgorithmAES_KW::encryptForWrapKey): Ditto.
3081         (WebCore::CryptoAlgorithmAES_KW::decryptForUnwrapKey): Ditto.
3082         * crypto/algorithms/CryptoAlgorithmAES_KW.h: Updated for above.
3083         Also use constexpr for s_name and s_identifier.
3084
3085         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
3086         (WebCore::CryptoAlgorithmHMAC::CryptoAlgorithmHMAC): Deleted.
3087         (WebCore::CryptoAlgorithmHMAC::~CryptoAlgorithmHMAC): Deleted.
3088         (WebCore::CryptoAlgorithmHMAC::generateKey): Use references, ExceptionOr.
3089         (WebCore::CryptoAlgorithmHMAC::sign): Ditto.
3090         (WebCore::CryptoAlgorithmHMAC::verify): Ditto.
3091         (WebCore::CryptoAlgorithmHMAC::importKey): Ditto.
3092         * crypto/algorithms/CryptoAlgorithmHMAC.h: Updated for above.
3093         Also use constexpr for s_name and s_identifier.
3094
3095         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
3096         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::CryptoAlgorithmRSAES_PKCS1_v1_5): Deleted.
3097         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::~CryptoAlgorithmRSAES_PKCS1_v1_5): Deleted.
3098         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey): Use references, ExceptionOr.
3099         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt): Ditto.
3100         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt): Ditto.
3101         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey): Ditto.
3102         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h: Updated for above.
3103         Also use constexpr for s_name and s_identifier.
3104
3105         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
3106         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::CryptoAlgorithmRSASSA_PKCS1_v1_5): Deleted.
3107         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::~CryptoAlgorithmRSASSA_PKCS1_v1_5): Deleted.
3108         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey): Use references, ExceptionOr.
3109         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign): Ditto.
3110         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify): Ditto.
3111         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey): Ditto.
3112         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h: Updated for above.
3113         Also use constexpr for s_name and s_identifier.
3114
3115         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
3116         (WebCore::CryptoAlgorithmRSA_OAEP::CryptoAlgorithmRSA_OAEP): Deleted.
3117         (WebCore::CryptoAlgorithmRSA_OAEP::~CryptoAlgorithmRSA_OAEP): Deleted.
3118         (WebCore::CryptoAlgorithmRSA_OAEP::generateKey): Use references, ExceptionOr.
3119         (WebCore::CryptoAlgorithmRSA_OAEP::encrypt): Ditto.
3120         (WebCore::CryptoAlgorithmRSA_OAEP::decrypt): Ditto.
3121         (WebCore::CryptoAlgorithmRSA_OAEP::importKey): Ditto.
3122         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h: Updated for above.
3123         Also use constexpr for s_name and s_identifier.
3124
3125         * crypto/algorithms/CryptoAlgorithmSHA1.cpp:
3126         (WebCore::CryptoAlgorithmSHA1::CryptoAlgorithmSHA1): Deleted.
3127         (WebCore::CryptoAlgorithmSHA1::~CryptoAlgorithmSHA1): Deleted.
3128         (WebCore::CryptoAlgorithmSHA1::digest): Use ExceptionOr.
3129         * crypto/algorithms/CryptoAlgorithmSHA1.h: Updated for above.
3130         Also use constexpr for s_name and s_identifier.
3131
3132         * crypto/algorithms/CryptoAlgorithmSHA224.cpp:
3133         (WebCore::CryptoAlgorithmSHA224::CryptoAlgorithmSHA224): Deleted.
3134         (WebCore::CryptoAlgorithmSHA224::~CryptoAlgorithmSHA224): Deleted.
3135         (WebCore::CryptoAlgorithmSHA224::digest): Use ExceptionOr.
3136         * crypto/algorithms/CryptoAlgorithmSHA224.h: Updated for above.
3137         Also use constexpr for s_name and s_identifier.
3138
3139         * crypto/algorithms/CryptoAlgorithmSHA256.cpp:
3140         (WebCore::CryptoAlgorithmSHA256::CryptoAlgorithmSHA256): Deleted.
3141         (WebCore::CryptoAlgorithmSHA256::~CryptoAlgorithmSHA256): Deleted.
3142         (WebCore::CryptoAlgorithmSHA256::digest): Use ExceptionOr.
3143         * crypto/algorithms/CryptoAlgorithmSHA256.h: Updated for above.
3144         Also use constexpr for s_name and s_identifier.
3145
3146         * crypto/algorithms/CryptoAlgorithmSHA384.cpp:
3147         (WebCore::CryptoAlgorithmSHA384::CryptoAlgorithmSHA384): Deleted.
3148         (WebCore::CryptoAlgorithmSHA384::~CryptoAlgorithmSHA384): Deleted.
3149         (WebCore::CryptoAlgorithmSHA384::digest): Use ExceptionOr.
3150         * crypto/algorithms/CryptoAlgorithmSHA384.h: Updated for above.
3151         Also use constexpr for s_name and s_identifier.
3152
3153         * crypto/algorithms/CryptoAlgorithmSHA512.cpp:
3154         (WebCore::CryptoAlgorithmSHA512::CryptoAlgorithmSHA512): Deleted.
3155         (WebCore::CryptoAlgorithmSHA512::~CryptoAlgorithmSHA512): Deleted.
3156         (WebCore::CryptoAlgorithmSHA512::digest): Use ExceptionOr.
3157         * crypto/algorithms/CryptoAlgorithmSHA512.h: Updated for above.
3158         Also use constexpr for s_name and s_identifier.
3159
3160         * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
3161         (WebCore::calculateSignature): Use Optional instead of a boolean
3162         return value and an out argument.
3163         (WebCore::CryptoAlgorithmHMAC::platformSign): Use ExceptionOr.
3164         (WebCore::CryptoAlgorithmHMAC::platformVerify): Ditto.
3165         * crypto/gnutls/CryptoAlgorithmAES_CBCGnuTLS.cpp:
3166         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt): Ditto.
3167         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt): Ditto.
3168         * crypto/gnutls/CryptoAlgorithmAES_KWGnuTLS.cpp:
3169         (WebCore::CryptoAlgorithmAES_KW::platformEncrypt): Ditto.
3170         (WebCore::CryptoAlgorithmAES_KW::platformDecrypt): Ditto.
3171         * crypto/gnutls/CryptoAlgorithmHMACGnuTLS.cpp:
3172         (WebCore::CryptoAlgorithmHMAC::platformSign): Ditto.
3173         (WebCore::CryptoAlgorithmHMAC::platformVerify): Ditto.
3174         * crypto/gnutls/CryptoAlgorithmRSAES_PKCS1_v1_5GnuTLS.cpp:
3175         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt): Ditto.
3176         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt): Ditto.
3177         * crypto/gnutls/CryptoAlgorithmRSASSA_PKCS1_v1_5GnuTLS.cpp:
3178         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign): Ditto.
3179         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify): Ditto.
3180         * crypto/gnutls/CryptoAlgorithmRSA_OAEPGnuTLS.cpp:
3181         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt): Ditto.
3182         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt): Ditto.
3183
3184         * crypto/keys/CryptoKeyAES.cpp:
3185         (WebCore::CryptoKeyAES::buildAlgorithm): Updated to use name instead
3186         of nameForIdentifier.
3187         * crypto/keys/CryptoKeyHMAC.cpp: Ditto.
3188         (WebCore::CryptoKeyHMAC::buildAlgorithm):
3189
3190         * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
3191         (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt): Use ExceptionOr.
3192         (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt): Ditto.
3193         * crypto/mac/CryptoAlgorithmAES_KWMac.cpp:
3194         (WebCore::CryptoAlgorithmAES_KW::platformEncrypt): Ditto.
3195         (WebCore::CryptoAlgorithmAES_KW::platformDecrypt): Ditto.
3196         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
3197         (WebCore::commonCryptoHMACAlgorithm): Renamed from
3198         getCommonCryptoHMACAlgorithm and changed to use Optional instead of
3199         a boolean return value and an out argument.
3200         (WebCore::CryptoAlgorithmHMAC::platformSign): Use ExceptionOr.
3201         (WebCore::CryptoAlgorithmHMAC::platformVerify): Ditto.
3202         * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp:
3203         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt): Ditto.
3204         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformDecrypt): Ditto.
3205         * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp:
3206         (WebCore::cryptoDigestAlgorithm): Renamed from
3207         getCryptoDigestAlgorithm and changed to use Optional instead of
3208         a boolean return value and an out argument.
3209         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign): Use ExceptionOr.
3210         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformVerify): Ditto.
3211         * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
3212         (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt): Ditto.
3213         (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt): Ditto.
3214
3215         * crypto/mac/CryptoKeyRSAMac.cpp:
3216         (WebCore::CryptoKeyRSA::buildAlgorithm): Updated to use name instead
3217         of nameForIdentifier.
3218
3219 2016-11-13  Joseph Pecoraro  <pecoraro@apple.com>
3220
3221         Use #pragma once in WebCore
3222         https://bugs.webkit.org/show_bug.cgi?id=164686
3223
3224         Reviewed by Michael Catanzaro.
3225
3226         * css/*.h:
3227         * plugins/*.h:
3228         * rendering/*.h:
3229         * style/*.h:
3230         * svg/*.h:
3231         * testing/*.h:
3232
3233 2016-11-12  Dan Bernstein  <mitz@apple.com>
3234
3235         Tried to fix the iOS build after r208666.
3236
3237         * platform/SuddenTermination.h:
3238
3239 2016-11-12  Simon Fraser  <simon.fraser@apple.com>
3240
3241         Add a way to get the UI-side scrolling tree as text via UIScriptController
3242         https://bugs.webkit.org/show_bug.cgi?id=164697
3243
3244         Reviewed by Zalan Bujtas.
3245
3246         Add dumping to ScrollingTreeNode and subclasses (previously, we could only dump
3247         the scrolling state tree). This re-uses the flags used for state tree dumping.
3248
3249         NodeIDs are not dumped by default because they can depend on earlier tests.
3250
3251         Test: scrollingcoordinator/ios/ui-scrolling-tree.html
3252
3253         * page/scrolling/ScrollingStateNode.h:
3254         * page/scrolling/ScrollingTree.cpp:
3255         (WebCore::ScrollingTree::scrollingTreeAsText):
3256         * page/scrolling/ScrollingTree.h:
3257         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3258         (WebCore::ScrollingTreeFrameScrollingNode::dumpProperties):
3259         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
3260         * page/scrolling/ScrollingTreeNode.cpp:
3261         (WebCore::ScrollingTreeNode::dumpProperties):
3262         (WebCore::ScrollingTreeNode::dump):
3263         * page/scrolling/ScrollingTreeNode.h:
3264         * page/scrolling/ScrollingTreeScrollingNode.cpp:
3265         (WebCore::ScrollingTreeScrollingNode::dumpProperties):
3266         * page/scrolling/ScrollingTreeScrollingNode.h:
3267         * page/scrolling/mac/ScrollingTreeFixedNode.h:
3268         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
3269         (WebCore::ScrollingTreeFixedNode::dumpProperties):
3270         * page/scrolling/mac/ScrollingTreeStickyNode.h:
3271         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
3272         (WebCore::ScrollingTreeStickyNode::dumpProperties):
3273
3274 2016-11-12  Darin Adler  <darin@apple.com>
3275
3276         Remove some use of ExceptionCode in MediaStream
3277         https://bugs.webkit.org/show_bug.cgi?id=164690
3278
3279         Reviewed by Sam Weinig.
3280
3281         * Modules/mediastream/MediaDevices.cpp:
3282         (WebCore::MediaDevices::MediaDevices): Take a Document&.
3283         (WebCore::MediaDevices::create): Ditto.
3284         (WebCore::MediaDevices::~MediaDevices): Deleted.
3285         (WebCore::MediaDevices::getUserMedia): Check document for null and
3286         pass a reference to UserMediaRequest::start. Removed unused ExceptionCode
3287         argument to UserMediaRequest::start, since the only exception was for
3288         a null document.
3289         (WebCore::MediaDevices::enumerateDevices): Check document for null and
3290         pass a reference to MediaDevicesRequest::create. Removed exception
3291         handling entirely because MediaDevicesRequest::create was not ever
3292         raising an exception before.
3293         * Modules/mediastream/MediaDevices.h: Updated for above changes.
3294         * Modules/mediastream/MediaDevices.idl: Removed MayThrowException from
3295         enumerateDevices, because it never throws an exception.
3296
3297         * Modules/mediastream/MediaDevicesRequest.cpp:
3298         (WebCore::MediaDevicesRequest::MediaDevicesRequest): Take a Document&.
3299         Removed unused ExceptionCode& argument.
3300         (WebCore::MediaDevicesRequest::create): Ditto.
3301         * Modules/mediastream/MediaDevicesRequest.h: Updated for above changes.
3302
3303         * Modules/mediastream/NavigatorMediaDevices.cpp:
3304         (WebCore::NavigatorMediaDevices::mediaDevices): Pass a reference.
3305
3306         * Modules/mediastream/UserMediaRequest.cpp:
3307         (WebCore::UserMediaRequest::start): Use ExceptionOr.
3308         (WebCore::UserMediaRequest::UserMediaRequest): Take a Document& and
3309         a UserMediaController&.
3310         * Modules/mediastream/UserMediaRequest.h: Updated for above changes.
3311
3312 2016-11-12  Simon Fraser  <simon.fraser@apple.com>
3313
3314         [iOS WK2] Share some code with Mac for post-async-scroll state reconciliation
3315         https://bugs.webkit.org/show_bug.cgi?id=164694
3316
3317         Reviewed by Zalan Bujtas.
3318
3319         When an async scroll notifications get back to the main thread in
3320         AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll(), we call 
3321         syncViewportConstrainedLayerPositions() to poke the new layer positions on the
3322         GraphicsLayers to match the changes made on the scrolling thread.
3323
3324         However, this was not done on iOS, which will be problematic for a future patch
3325         where we require GraphicsLayer positions and the current fixedPositionViewport rect
3326         to have been computed when in a consistent state.
3327
3328         Fix by factoring some code into reconcileScrollingState(), which is called on iOS/WK2
3329         from WebPage::updateVisibleContentRects() rather than setting the FrameView's scroll offset
3330         directly.
3331
3332         Test: scrollingcoordinator/ios/sync-layer-positions-after-scroll.html
3333
3334         * page/WheelEventDeltaFilter.cpp:
3335         (WebCore::WheelEventDeltaFilter::filteredDelta):
3336         * page/scrolling/AsyncScrollingCoordinator.cpp:
3337         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
3338         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
3339         (WebCore::AsyncScrollingCoordinator::syncViewportConstrainedLayerPositions):
3340         (WebCore::AsyncScrollingCoordinator::syncChildPositions): Deleted.
3341         * page/scrolling/AsyncScrollingCoordinator.h:
3342         * page/scrolling/ScrollingCoordinator.h:
3343         (WebCore::ScrollingCoordinator::reconcileScrollingState):
3344         (WebCore::ScrollingCoordinator::syncViewportConstrainedLayerPositions):
3345         (WebCore::ScrollingCoordinator::syncChildPositions): Deleted.
3346         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
3347         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition):
3348         * platform/Logging.h:
3349         * platform/ScrollView.cpp:
3350         (WebCore::ScrollView::setScrollOffset):
3351         * platform/graphics/ca/TileController.cpp: