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