Touch.prototype is undefined on iOS
[WebKit.git] / Source / WebCore / ChangeLog
1 2016-05-10  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Touch.prototype is undefined on iOS
4         https://bugs.webkit.org/show_bug.cgi?id=157560
5         <rdar://problem/26143008>
6
7         Reviewed by Chris Dumez.
8
9         Remove Touch and TouchList attributes from DOMWindow.
10         These attributes should be exposed via generated binding code (JSDOMWindow.cpp).
11
12         * bindings/js/JSDOMWindowCustom.cpp:
13         (WebCore::JSDOMWindow::touch): Deleted.
14         (WebCore::JSDOMWindow::touchList): Deleted.
15         * page/DOMWindow.idl:
16
17 2016-05-11  Darin Adler  <darin@apple.com>
18
19         Change IDBObjectStore.createIndex to take an IDL dictionary
20         https://bugs.webkit.org/show_bug.cgi?id=157520
21
22         Reviewed by Chris Dumez.
23
24         * Modules/indexeddb/IDBDatabase.cpp:
25         (WebCore::IDBDatabase::createObjectStore): Use IDBKeyPath::Type instead of
26         IndexedDB::KeyPathType.
27         * Modules/indexeddb/IDBKeyPath.cpp:
28         (WebCore::IDBKeyPath::IDBKeyPath): Ditto.
29         (WebCore::IDBKeyPath::isValid): Ditto.
30         (WebCore::IDBKeyPath::operator==): Ditto.
31         (WebCore::IDBKeyPath::encode): Ditto.
32         (WebCore::IDBKeyPath::decode): Ditto.
33
34         * Modules/indexeddb/IDBKeyPath.h: Use pragma once. Make constructors non-explicit so
35         we can just pass a string or vector and have it turn into an IDBKeyPath. Added an enum
36         class named Type here and use it instead of IndexedDB::KeyPathType.
37
38         * Modules/indexeddb/IDBObjectStore.cpp:
39         (WebCore::IDBObjectStore::openCursor): Remove unneeded local variable.
40         (WebCore::IDBObjectStore::get): Ditto.
41         (WebCore::IDBObjectStore::doDelete): Ditto.
42         (WebCore::IDBObjectStore::createIndex): Changed argument type to take IndexParameters
43         instead of two seaparate booleans. Also updated to use IDBKeyPath::Type.
44
45         * Modules/indexeddb/IDBObjectStore.h: Removed include of IndexedDB, using a forward
46         decalration instead. Marked the class final. Added an IndexParameters struct and used
47         it for the argument to createIndex.
48
49         * Modules/indexeddb/IDBObjectStore.idl: Stopped using Custom for put, add, and
50         createIndex functions. Stopped using Dictionary for createIndex, using IDBIndexParameters
51         instead as in the specification. Added IDBIndexParameters dictionary definition.
52
53         * Modules/indexeddb/IndexedDB.h: Use pragma once. Removed KeyPathType.
54
55         * bindings/js/IDBBindingUtilities.cpp:
56         (WebCore::injectIDBKeyIntoScriptValue): Use IDBKeyPath::Type instead of
57         IndexedDB::KeyPathType.
58         (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath): Ditto.
59         (WebCore::canInjectIDBKeyIntoScriptValue): Ditto.
60         (WebCore::createKeyPathArray): Ditto.
61         (WebCore::toJS): Ditto.
62         * bindings/js/JSIDBObjectStoreCustom.cpp:
63         (WebCore::putOrAdd): Deleted.
64         (WebCore::JSIDBObjectStore::putFunction): Deleted.
65         (WebCore::JSIDBObjectStore::add): Deleted.
66         (WebCore::JSIDBObjectStore::createIndex): Deleted.
67
68         * bindings/scripts/CodeGeneratorJS.pm:
69         (GenerateParametersCheckExpression): Fixed code that generates a type check for
70         wrappers to only check types is knows how to check: wrappers and arrays, including
71         typed arrays. This prevents it from trying to check dictionaries.
72
73         * inspector/InspectorIndexedDBAgent.cpp: Use IDBKeyPath::Type instead of
74         IndexedDB::KeyPathType.
75
76 2016-05-11  Brady Eidson  <beidson@apple.com>
77
78         Modern IDB: WebWorker support.
79         https://bugs.webkit.org/show_bug.cgi?id=149953
80
81         Reviewed by Alex Christensen.
82
83         No new tests (Covered by changes to existing tests).
84
85         * bindings/generic/RuntimeEnabledFeatures.cpp:
86         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
87
88 2016-05-11  Chris Dumez  <cdumez@apple.com>
89
90         Update Node::appendChild() / replaceChild() / removeChild() / insertBefore() to take references instead of pointers
91         https://bugs.webkit.org/show_bug.cgi?id=157556
92
93         Reviewed by Darin Adler.
94
95         Update Node::appendChild() / replaceChild() / removeChild() / insertBefore()
96         to take references instead of pointers. Do the parameter null checks in the
97         bindings instead of doing it in the implementation on Node.
98
99         Also update the ContainerNode::appendChild() / replaceChild() /
100         insertBefore() to take C++ references instead of Ref<>&& to avoid
101         unnecessarily causing ref counting churns at some call sites (including
102         in the bindings since they are a raw pointer to the nodes). The
103         implementation on ContainerNode was not actually using WTFMove() on the
104         Ref<>&& anyway.
105
106         * Modules/plugins/YouTubePluginReplacement.cpp:
107         (WebCore::YouTubePluginReplacement::installReplacement):
108         * bindings/js/JSNodeCustom.cpp:
109         (WebCore::JSNode::insertBefore):
110         (WebCore::JSNode::replaceChild):
111         (WebCore::JSNode::removeChild):
112         (WebCore::JSNode::appendChild):
113         * dom/ContainerNode.cpp:
114         (WebCore::ContainerNode::insertBefore):
115         (WebCore::ContainerNode::parserInsertBefore):
116         (WebCore::ContainerNode::replaceChild):
117         (WebCore::ContainerNode::appendChild):
118         (WebCore::ContainerNode::parserAppendChild):
119         (WebCore::ContainerNode::cloneChildNodes):
120         (WebCore::ContainerNode::append):
121         (WebCore::ContainerNode::prepend):
122         * dom/ContainerNode.h:
123         * dom/DOMImplementation.cpp:
124         (WebCore::DOMImplementation::createDocument):
125         (WebCore::DOMImplementation::createHTMLDocument):
126         * dom/Document.cpp:
127         (WebCore::Document::setBodyOrFrameset):
128         * dom/Element.cpp:
129         (WebCore::Element::setOuterHTML):
130         * dom/Node.cpp:
131         (WebCore::Node::insertBefore):
132         (WebCore::Node::replaceChild):
133         (WebCore::Node::removeChild):
134         (WebCore::Node::appendChild):
135         (WebCore::Node::before):
136         (WebCore::Node::after):
137         (WebCore::Node::replaceWith):
138         (WebCore::nodeSetPreTransformedFromNodeOrStringVector): Deleted.
139         (WebCore::Node::normalize): Deleted.
140         * dom/Node.h:
141         * dom/Node.idl:
142         * dom/NodeOrString.cpp:
143         (WebCore::convertNodesOrStringsIntoNode):
144         * dom/Range.cpp:
145         (WebCore::Range::processContents):
146         (WebCore::Range::processContentsBetweenOffsets):
147         (WebCore::Range::processNodes):
148         (WebCore::Range::processAncestorsAndTheirSiblings):
149         (WebCore::Range::insertNode):
150         (WebCore::Range::surroundContents):
151         * dom/Range.h:
152         * dom/Text.cpp:
153         (WebCore::Text::splitText):
154         * editing/AppendNodeCommand.cpp:
155         (WebCore::AppendNodeCommand::doApply):
156         * editing/Editor.cpp:
157         (WebCore::Editor::setTextAsChildOfElement):
158         * editing/EditorCommand.cpp:
159         (WebCore::executeInsertNode):
160         * editing/MergeIdenticalElementsCommand.cpp:
161         (WebCore::MergeIdenticalElementsCommand::doApply):
162         (WebCore::MergeIdenticalElementsCommand::doUnapply):
163         * editing/RemoveNodeCommand.cpp:
164         (WebCore::RemoveNodeCommand::doUnapply):
165         * editing/ReplaceNodeWithSpanCommand.cpp:
166         (WebCore::swapInNodePreservingAttributesAndChildren):
167         * editing/ReplaceSelectionCommand.cpp:
168         (WebCore::ReplacementFragment::insertFragmentForTestRendering):
169         * editing/SplitElementCommand.cpp:
170         (WebCore::SplitElementCommand::executeApply):
171         (WebCore::SplitElementCommand::doUnapply):
172         * editing/WrapContentsInDummySpanCommand.cpp:
173         (WebCore::WrapContentsInDummySpanCommand::executeApply):
174         (WebCore::WrapContentsInDummySpanCommand::doUnapply):
175         * editing/cocoa/EditorCocoa.mm:
176         (WebCore::Editor::styleForSelectionStart):
177         * editing/htmlediting.cpp:
178         (WebCore::createTabSpanElement):
179         * editing/ios/EditorIOS.mm:
180         (WebCore::Editor::WebContentReader::readURL):
181         (WebCore::Editor::createFragmentForImageResourceAndAddResource):
182         * editing/mac/EditorMac.mm:
183         (WebCore::Editor::WebContentReader::readFilenames):
184         (WebCore::Editor::WebContentReader::readURL):
185         (WebCore::Editor::createFragmentForImageResourceAndAddResource):
186         * editing/markup.cpp:
187         (WebCore::fillContainerFromString):
188         (WebCore::createFragmentFromText):
189         (WebCore::replaceChildrenWithFragment):
190         (WebCore::replaceChildrenWithText):
191         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
192         (WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree):
193         * html/ColorInputType.cpp:
194         (WebCore::ColorInputType::createShadowSubtree):
195         * html/FTPDirectoryDocument.cpp:
196         (WebCore::FTPDirectoryDocumentParser::appendEntry):
197         (WebCore::FTPDirectoryDocumentParser::createTDForFilename):
198         (WebCore::FTPDirectoryDocumentParser::createBasicDocument):
199         * html/HTMLDetailsElement.cpp:
200         (WebCore::HTMLDetailsElement::didAddUserAgentShadowRoot):
201         * html/HTMLElement.cpp:
202         (WebCore::HTMLElement::setOuterText):
203         (WebCore::HTMLElement::insertAdjacent):
204         * html/HTMLImageElement.cpp:
205         (WebCore::HTMLImageElement::tryCreateImageControls):
206         * html/HTMLKeygenElement.cpp:
207         (WebCore::HTMLKeygenElement::HTMLKeygenElement):
208         * html/HTMLMeterElement.cpp:
209         (WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
210         * html/HTMLOptionElement.cpp:
211         (WebCore::HTMLOptionElement::createForJSConstructor):
212         * html/HTMLProgressElement.cpp:
213         (WebCore::HTMLProgressElement::didAddUserAgentShadowRoot):
214         * html/HTMLTableElement.cpp:
215         (WebCore::HTMLTableElement::createTBody):
216         (WebCore::HTMLTableElement::insertRow):
217         * html/HTMLTableRowElement.cpp:
218         (WebCore::HTMLTableRowElement::insertCell):
219         * html/ImageDocument.cpp:
220         (WebCore::ImageDocument::createDocumentStructure):
221         * html/MediaDocument.cpp:
222         (WebCore::MediaDocumentParser::createDocumentStructure):
223         * html/PluginDocument.cpp:
224         (WebCore::PluginDocumentParser::createDocumentStructure):
225         * html/RangeInputType.cpp:
226         (WebCore::RangeInputType::createShadowSubtree):
227         * html/SearchInputType.cpp:
228         (WebCore::SearchInputType::createShadowSubtree):
229         * html/ValidationMessage.cpp:
230         (WebCore::ValidationMessage::buildBubbleTree):
231         * html/shadow/MediaControlElements.cpp:
232         (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
233         * html/shadow/MediaControls.cpp:
234         (WebCore::MediaControls::createTextTrackDisplay):
235         * html/shadow/MediaControlsApple.cpp:
236         (WebCore::MediaControlsApple::tryCreateControls):
237         * html/shadow/mac/ImageControlsRootElementMac.cpp:
238         (WebCore::ImageControlsRootElement::tryCreate):
239         * html/track/VTTCue.cpp:
240         (WebCore::VTTCue::updateDisplayTree):
241         * html/track/WebVTTParser.cpp:
242         (WebCore::WebVTTTreeBuilder::constructTreeFromToken):
243         * inspector/DOMEditor.cpp:
244         (WebCore::DOMEditor::RemoveChildAction::RemoveChildAction):
245         (WebCore::DOMEditor::InsertBeforeAction::InsertBeforeAction):
246         (WebCore::DOMEditor::ReplaceChildNodeAction::ReplaceChildNodeAction):
247         (WebCore::DOMEditor::insertBefore):
248         (WebCore::DOMEditor::removeChild):
249         (WebCore::DOMEditor::replaceChild):
250         * inspector/DOMEditor.h:
251         * inspector/DOMPatchSupport.cpp:
252         (WebCore::DOMPatchSupport::patchNode):
253         (WebCore::DOMPatchSupport::innerPatchNode):
254         (WebCore::DOMPatchSupport::innerPatchChildren):
255         (WebCore::DOMPatchSupport::insertBeforeAndMarkAsUsed):
256         (WebCore::DOMPatchSupport::removeChildAndMoveToNew):
257         * inspector/DOMPatchSupport.h:
258         * inspector/InspectorCSSAgent.cpp:
259         (WebCore::InspectorCSSAgent::createInspectorStyleSheetForDocument):
260         * inspector/InspectorDOMAgent.cpp:
261         (WebCore::InspectorDOMAgent::removeNode):
262         (WebCore::InspectorDOMAgent::setNodeName):
263         (WebCore::InspectorDOMAgent::moveTo):
264         * page/DragController.cpp:
265         (WebCore::documentFragmentFromDragData):
266         * page/ios/FrameIOS.mm:
267         (WebCore::Frame::initWithSimpleHTMLDocument):
268         * svg/SVGUseElement.cpp:
269         (WebCore::SVGUseElement::cloneTarget):
270         (WebCore::SVGUseElement::expandUseElementsInShadowTree):
271         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree):
272         * xml/XMLErrors.cpp:
273         (WebCore::createXHTMLParserErrorHeader):
274         (WebCore::XMLErrors::insertErrorMessageBlock):
275         * xml/XMLTreeViewer.cpp:
276         (WebCore::XMLTreeViewer::transformDocumentToTreeView):
277         * xml/parser/XMLDocumentParserLibxml2.cpp:
278         (WebCore::XMLDocumentParser::startElementNs):
279         (WebCore::XMLDocumentParser::processingInstruction):
280         (WebCore::XMLDocumentParser::cdataBlock):
281         (WebCore::XMLDocumentParser::comment):
282
283 2016-05-11  Brady Eidson  <beidson@apple.com>
284
285         Modern IDB: IDBOpenDBRequests that are stop()'ed don't notify the IDBServer of that fact.
286         https://bugs.webkit.org/show_bug.cgi?id=157448
287
288         Reviewed by Alex Christensen.
289
290         No new tests (Previously skipped tests cover new behavior, and are now unskipped).
291
292         There's two main parts to this patch:
293         
294         1 - When an IDBOpenDBRequest is stop()'ed due to page navigation or worker termination,
295             we now notify the IDBServer of that.
296         2 - Lot's of little tweaks to UniqueIDBDatabase to handle shutting down version change
297             transactions and/or connections related to the cancelled openDB request.
298             
299         Fortunately the changes to UniqueIDBDatabase were all well covered by existing tests.
300         
301         * Modules/indexeddb/IDBOpenDBRequest.cpp:
302         (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
303         (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
304         (WebCore::IDBOpenDBRequest::cancelForStop):
305         (WebCore::IDBOpenDBRequest::dispatchEvent):
306         * Modules/indexeddb/IDBOpenDBRequest.h:
307
308         * Modules/indexeddb/IDBRequest.cpp:
309         (WebCore::IDBRequest::stop):
310         (WebCore::IDBRequest::cancelForStop):
311         * Modules/indexeddb/IDBRequest.h:
312
313         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
314         (WebCore::IDBClient::IDBConnectionProxy::openDBRequestCancelled):
315         (WebCore::IDBClient::IDBConnectionProxy::didFinishHandlingVersionChangeTransaction):
316         * Modules/indexeddb/client/IDBConnectionProxy.h:
317
318         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
319         (WebCore::IDBClient::IDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
320         (WebCore::IDBClient::IDBConnectionToServer::openDBRequestCancelled):
321         * Modules/indexeddb/client/IDBConnectionToServer.h:
322
323         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
324
325         * Modules/indexeddb/server/IDBServer.cpp:
326         (WebCore::IDBServer::IDBServer::didFinishHandlingVersionChangeTransaction):
327         (WebCore::IDBServer::IDBServer::databaseConnectionClosed):
328         (WebCore::IDBServer::IDBServer::openDBRequestCancelled):
329         * Modules/indexeddb/server/IDBServer.h:
330
331         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
332         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
333         (WebCore::IDBServer::UniqueIDBDatabase::handleCurrentOperation):
334         (WebCore::IDBServer::UniqueIDBDatabase::openDBRequestCancelled):
335         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
336         (WebCore::IDBServer::UniqueIDBDatabase::performCommitTransaction):
337         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
338         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
339         (WebCore::IDBServer::UniqueIDBDatabase::didFinishHandlingVersionChange):
340         (WebCore::IDBServer::UniqueIDBDatabase::performAbortTransaction):
341         (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
342         (WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient):
343         (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
344         (WebCore::IDBServer::UniqueIDBDatabase::forgetErrorCallback):
345         * Modules/indexeddb/server/UniqueIDBDatabase.h:
346
347         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
348         (WebCore::IDBServer::UniqueIDBDatabaseConnection::abortTransactionWithoutCallback):
349         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFinishHandlingVersionChange):
350         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
351
352         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
353         (WebCore::IDBServer::UniqueIDBDatabaseTransaction::didFinishHandlingVersionChange): Deleted.
354         * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
355
356         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
357         (WebCore::InProcessIDBServer::didFinishHandlingVersionChangeTransaction):
358         (WebCore::InProcessIDBServer::openDBRequestCancelled):
359         * Modules/indexeddb/shared/InProcessIDBServer.h:
360
361 2016-05-11  Chris Dumez  <cdumez@apple.com>
362
363         Unreviewed, rolling out r200686.
364
365         Caused a lot of layout test failures
366
367         Reverted changeset:
368
369         "Sites served over insecure connections should not be allowed
370         to use geolocation."
371         https://bugs.webkit.org/show_bug.cgi?id=157423
372         http://trac.webkit.org/changeset/200686
373
374 2016-05-11  Chris Dumez  <cdumez@apple.com>
375
376         Optimize DataDetection's searchForLinkRemovingExistingDDLinks()
377         https://bugs.webkit.org/show_bug.cgi?id=157561
378
379         Reviewed by Ryosuke Niwa.
380
381         Optimize DataDetection's searchForLinkRemovingExistingDDLinks():
382         1. The first loop was using Node::childNodes() to iterate over the child
383            elements. Because of the recursive call, we may end up prepending
384            children as we iterate over them. This is an issue because the
385            childCount was cached before the loop and vector it would blow away
386            the cache inside the NodeList. Switch to using ElementTraversal which
387            should be both safer and more efficient. I don't believe we can use
388            our nice ElementChildIterator here unfortunately as we would hit
389            assertions due the the DOM mutations while iterating.
390         2. The second loop was using again Node::childNodes() and kept calling
391            item(0) to get the first child and move it to make it the previous
392            sibling of its old parent. Again, using childNodes() here is super
393            inefficient because we keep modifying the children and childNodes()
394            returns a live NodeList. The call to NodeList::length() would cache
395            all the children in a Vector, only to blow that cache away after
396           removing the first child. Switch to using ContainerNode::firstChild().
397         3. Drop the parentElement parameter as we can just get it from the child.
398         4. Use tighter typing so we don't end up calling the implementations of
399            insertBefore() / removeChild() that are on Node, thus unnecessarily
400            doing a is<ContainerNode>() check every time.
401         5. Pass element by reference instead of pointer as it cannot be null.
402
403         * editing/cocoa/DataDetection.mm:
404         (WebCore::removeResultLinksFromAnchor):
405         (WebCore::searchForLinkRemovingExistingDDLinks):
406
407 2016-05-11  Rawinder Singh  <rawinder.singh-webkit@cisra.canon.com.au>
408
409         preprocess-idls.pl not ignoring comments during processing
410         https://bugs.webkit.org/show_bug.cgi?id=157559
411
412         Reviewed by Darin Adler.
413
414         Remove comments from IDL file before processing.
415
416         * bindings/scripts/preprocess-idls.pl:
417         (getInterfaceExtendedAttributesFromIDL):
418
419 2016-05-11  Jer Noble  <jer.noble@apple.com>
420
421         Videos allowed to play through the Main Content restriction should not pause when scrolled off-screen.
422         https://bugs.webkit.org/show_bug.cgi?id=157555
423
424         Reviewed by Eric Carlson.
425
426         Test: media/video-main-content-allow-then-scroll.html
427
428         * html/MediaElementSession.cpp:
429         (WebCore::isMainContent):
430
431 2016-05-11  Fujii Hironori  <Hironori.Fujii@sony.com>
432
433         [curl] curl_easy_setopt(CURLOPT_CONNECT_ONLY) should take a long parameter
434         https://bugs.webkit.org/show_bug.cgi?id=157562
435
436         Reviewed by Darin Adler.
437
438         The third argument of a calling curl_easy_setopt is missing.
439
440         * platform/network/curl/SocketStreamHandleCurl.cpp:
441         (WebCore::SocketStreamHandle::startThread): Give the third
442         argument of curl_easy_setopt.
443
444 2016-05-11  Pranjal Jumde  <pjumde@apple.com>
445
446         Sites served over insecure connections should not be allowed to use geolocation.
447         https://bugs.webkit.org/show_bug.cgi?id=157423
448         <rdar://problem/23751632>
449
450         Reviewed by Brent Fulgham.
451
452         Tests: http/tests/security/insecure-geolocation.html
453                http/tests/security/mixedcontent-geolocation-block-insecure-content.html
454                http/tests/security/mixedcontent-geolocation.html
455
456         * Modules/geolocation/Geolocation.cpp:
457         (WebCore::Geolocation::logError):
458         (WebCore::Geolocation::startRequest):
459         Access to Geolocation will be blocked if site is not secure. An error will be logged when access to Geolocation is blocked.
460         (WebCore::Geolocation::shouldBlockGeolocationRequests)
461         Returns true if the access to the geolocation should be blocked.
462         * Modules/geolocation/Geolocation.h:
463         * dom/SecurityContext.h:
464         (WebCore::SecurityContext::foundMixedContent):
465         Returns true if insecure content was accessed over secure connection.
466         (WebCore::SecurityContext::setFoundMixedContent):
467         Sets m_foundMixedContent to true if insecure content is accessed over secure connection.
468         (WebCore::SecurityContext::geolocationAccessed):
469         Returns true if geolocation was accessed
470         (WebCore::SecurityContext::setGeolocationAccessed):
471         Sets m_geolocationAccessed to true if geolocation was accessed.
472         * loader/MixedContentChecker.cpp:
473         (WebCore::MixedContentChecker::canDisplayInsecureContent):
474         Insecure content will be blocked if geolocation was accessed by the page. Updates document to keep track of mixed content.
475         (WebCore::MixedContentChecker::canRunInsecureContent):
476         Insecure content will be blocked if geolocation was accessed by the page. Updates document to keep track of mixed content.
477
478 2016-05-11  Youenn Fablet  <youenn.fablet@crf.canon.fr>
479
480         Ensure DOM iterators remain done
481         https://bugs.webkit.org/show_bug.cgi?id=157453
482
483         Reviewed by Darin Adler.
484
485         Covered by updated test.
486
487         Making DOMWrapped::Iterator an Optional.
488         Setting it to Nullopt on the first time Iterator is returning null.
489
490         For set iterators, incrementing a counter which value is used in forEach callbacks and entries iterators.
491
492         * bindings/js/JSDOMIterator.h:
493         (WebCore::JSDOMIterator<JSWrapper>::asJS):
494         (WebCore::appendForEachArguments):
495         (WebCore::iteratorForEach):
496         (WebCore::JSDOMIterator<JSWrapper>::next):
497
498 2016-05-11  Joanmarie Diggs  <jdiggs@igalia.com>
499
500         [GTK] accessibility/aria-readonly.html is failing
501         https://bugs.webkit.org/show_bug.cgi?id=98357
502
503         Reviewed by Chris Fleizach.
504
505         Add support for ATK_STATE_READ_ONLY and expose the value of aria-readonly
506         as an AtkObject attribute. In order to eliminate duplicate checks, remove
507         isReadOnly() and just use canSetAttributeValue(), moving all the logic into
508         AccessibilityNodeObject. Add AccessibilityObject::supportsARIAReadOnly() so
509         that we can explicitly expose the implicit value for aria-readonly on roles
510         which support this property. Also add support for ATK_STATE_CHECKABLE, both
511         because this state was missing and because it serves a similar function to
512         ATK_STATE_EDITABLE for the purpose of verifying exposure of toggle-able
513         elements that are not read-only.
514
515         Test: accessibility/form-control-value-settable.html
516
517         * accessibility/AccessibilityNodeObject.cpp:
518         (WebCore::AccessibilityNodeObject::canSetValueAttribute):
519         (WebCore::AccessibilityNodeObject::isRequired): Deleted.
520         (WebCore::AccessibilityNodeObject::supportsRequiredAttribute): Deleted.
521         * accessibility/AccessibilityNodeObject.h:
522         * accessibility/AccessibilityObject.cpp:
523         (WebCore::AccessibilityObject::supportsARIAReadOnly):
524         (WebCore::AccessibilityObject::ariaReadOnlyValue):
525         * accessibility/AccessibilityObject.h:
526         (WebCore::AccessibilityObject::isUnvisited): Deleted.
527         * accessibility/AccessibilityRenderObject.cpp:
528         (WebCore::AccessibilityRenderObject::clickPoint):
529         (WebCore::AccessibilityRenderObject::isOffScreen): Deleted.
530         (WebCore::AccessibilityRenderObject::anchorElement): Deleted.
531         (WebCore::AccessibilityRenderObject::internalLinkElement): Deleted.
532         (WebCore::AccessibilityRenderObject::textChanged): Deleted.
533         (WebCore::AccessibilityRenderObject::clearChildren): Deleted.
534         (WebCore::AccessibilityRenderObject::addImageMapChildren): Deleted.
535         * accessibility/AccessibilityRenderObject.h:
536         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
537         (getAttributeSetForAccessibilityObject):
538         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
539         (webkitAccessibleGetAttributes):
540         (setAtkStateSetFromCoreObject):
541         (getInterfaceMaskFromObject):
542         * inspector/InspectorDOMAgent.cpp:
543         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
544
545 2016-05-10  Jeremy Jones  <jeremyj@apple.com>
546
547         Don't update media duration at playback end while seeking.
548         https://bugs.webkit.org/show_bug.cgi?id=157557
549
550         Reviewed by Jer Noble.
551
552         If JavaScript initiates a media element seek just as the media playback ends, don't update duration
553         to the current time as the current time is now the new seek time, not the time when playback ended.
554
555         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
556         (WebCore::MediaPlayerPrivateAVFoundation::didEnd):
557
558 2016-05-10  Joseph Pecoraro  <pecoraro@apple.com>
559
560         Fix typo CaptionUserPreferences::updateCaptionStyleSheetOveride
561         https://bugs.webkit.org/show_bug.cgi?id=157544
562
563         Reviewed by Darin Adler.
564
565         * page/CaptionUserPreferences.cpp:
566         (WebCore::CaptionUserPreferences::setCaptionsStyleSheetOverride):
567         (WebCore::CaptionUserPreferences::updateCaptionStyleSheetOverride):
568         (WebCore::CaptionUserPreferences::updateCaptionStyleSheetOveride): Deleted.
569         * page/CaptionUserPreferences.h:
570         * page/CaptionUserPreferencesMediaAF.cpp:
571         (WebCore::CaptionUserPreferencesMediaAF::updateTimerFired):
572         (WebCore::CaptionUserPreferencesMediaAF::captionPreferencesChanged):
573
574 2016-05-10  Simon Fraser  <simon.fraser@apple.com>
575
576         Remove scrolledContentOffset() from rendering code
577         https://bugs.webkit.org/show_bug.cgi?id=157552
578
579         Reviewed by Zalan Bujtas.
580
581         scrolledContentOffset() is misleading because it returns a scrollPosition().
582         Just use the name scrollPosition(), returning a ScrollPosition (IntPoint),
583         and fix callers that need to convert to layout size.
584
585         * editing/VisibleUnits.cpp:
586         (WebCore::absoluteLineDirectionPointToLocalPointInBlock):
587         * rendering/LayoutState.cpp:
588         (WebCore::LayoutState::LayoutState):
589         * rendering/RenderBlock.cpp:
590         (WebCore::RenderBlock::paintObject):
591         (WebCore::RenderBlock::selectionGapRectsForRepaint):
592         (WebCore::RenderBlock::paintSelection):
593         (WebCore::RenderBlock::nodeAtPoint):
594         (WebCore::RenderBlock::offsetForContents):
595         * rendering/RenderBlockFlow.cpp:
596         (WebCore::RenderBlockFlow::layoutBlock):
597         * rendering/RenderBox.cpp:
598         (WebCore::RenderBox::scrollPosition):
599         (WebCore::RenderBox::applyCachedClipAndScrollOffsetForRepaint):
600         (WebCore::isCandidateForOpaquenessTest):
601         (WebCore::RenderBox::offsetFromContainer):
602         (WebCore::RenderBox::layoutOverflowRectForPropagation):
603         (WebCore::RenderBox::scrolledContentOffset): Deleted.
604         * rendering/RenderBox.h:
605         * rendering/RenderBoxModelObject.cpp:
606         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
607         * rendering/RenderInline.cpp:
608         (WebCore::RenderInline::offsetFromContainer):
609         * rendering/RenderLayer.cpp:
610         (WebCore::RenderLayer::updateLayerPosition):
611         (WebCore::RenderLayer::mapLayerClipRectsToFragmentationLayer):
612         (WebCore::RenderLayer::calculateClipRects):
613         * rendering/RenderLayer.h:
614         * rendering/RenderLayerBacking.cpp:
615         (WebCore::RenderLayerBacking::updateGeometry):
616         * rendering/RenderMultiColumnFlowThread.cpp:
617         (WebCore::RenderMultiColumnFlowThread::offsetFromContainer):
618         * rendering/RenderNamedFlowThread.cpp:
619         (WebCore::RenderNamedFlowThread::decorationsClipRectForBoxInNamedFlowFragment):
620         * rendering/RenderObject.cpp:
621         (WebCore::RenderObject::mapLocalToContainer):
622         (WebCore::RenderObject::pushMappingToContainer):
623         (WebCore::RenderObject::mapAbsoluteToLocalPoint):
624         (WebCore::RenderObject::offsetFromContainer):
625         * rendering/RenderTextControl.cpp:
626         (WebCore::RenderTextControl::hitInnerTextElement):
627
628 2016-05-10  Simon Fraser  <simon.fraser@apple.com>
629
630         Horizontally-scrollable items with a 3d transform are rendered incorrectly in RTL when container has -webkit-overflow-scroll: touch
631         https://bugs.webkit.org/show_bug.cgi?id=157482
632         rdar://problem/26204794
633
634         Reviewed by Zalan Bujtas.
635
636         The compositing code was confused about scroll offsets vs. scroll positions, because
637         of the badly named scrolledContentOffset(); we used that in one place, and scrollOffset()
638         lower down. Change both to use scrollOffset().
639
640         Test: compositing/rtl/rtl-with-transformed-descendants.html
641
642         * rendering/RenderLayerBacking.cpp:
643         (WebCore::RenderLayerBacking::updateGeometry):
644
645 2016-05-10  Enrica Casucci  <enrica@apple.com>
646
647         Numerous block selection issues on iOS.
648         https://bugs.webkit.org/show_bug.cgi?id=157490
649         rdar://problem/25717977
650         rdar://problem/23042215
651
652         Reviewed by Tim Horton.
653
654         * rendering/style/RenderStyle.h:
655         Exporting method.
656
657 2016-05-10  Sam Weinig  <sam@webkit.org>
658
659         Tweak underline style for data detected links
660         https://bugs.webkit.org/show_bug.cgi?id=157546
661
662         Reviewed by Tim Horton.
663
664         Added API Tests in Color.cpp.
665
666         * editing/cocoa/DataDetection.mm:
667         (WebCore::DataDetection::detectContentInRange):
668         Tweak the underline's opacity based on the text color. White-ish text gets
669         46% opacity, everything else gets 26% opacity.
670
671         * platform/graphics/Color.cpp:
672         (WebCore::Color::getHSV):
673         * platform/graphics/Color.h:
674         Add support for getting the HSV (also know as HSB) computation of the color
675         to help determine the "whiteness" of a color.
676
677 2016-05-10  Alex Christensen  <achristensen@webkit.org>
678
679         Handle _schemeUpgraded delegate callbacks in NSURLSessionDataDelegate
680         https://bugs.webkit.org/show_bug.cgi?id=157354
681         rdar://problem/25842107
682
683         Reviewed by Darin Adler.
684
685         No new tests.  This cannot be tested with a self-signed certificate.
686         This needs to be tested once we use real ssl certificates for testing.
687
688         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
689         (-[WebCoreResourceHandleAsDelegate connection:willSendRequest:redirectResponse:]):
690         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
691         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
692         * platform/network/mac/WebCoreURLResponse.h:
693         * platform/network/mac/WebCoreURLResponse.mm:
694         (WebCore::synthesizeRedirectResponseIfNecessary):
695         Take the NSURLRequest instead of the NSURLConnection as a parameter so we can share this code with the NSURLSession loader,
696         which has an NSURLSessionDataTask.  Both have the currentRequest, which is all we need in this function anyway.
697
698 2016-05-10  Joseph Pecoraro  <pecoraro@apple.com>
699
700         Web Inspector: Backend should initiate timeline recordings on page navigations to ensure nothing is missed
701         https://bugs.webkit.org/show_bug.cgi?id=157504
702         <rdar://problem/26188642>
703
704         Reviewed by Brian Burg.
705
706         Test: inspector/timeline/setAutoCaptureInstruments-errors.html
707
708         * inspector/InspectorController.cpp:
709         (WebCore::InspectorController::InspectorController):
710         Pass other agents into the TimelineAgent constructor.
711
712         * inspector/InspectorInstrumentation.cpp:
713         (WebCore::InspectorInstrumentation::frameStartedLoadingImpl):
714         Inform the TimelineAgent whenever the main frame starts a new load.
715
716         * inspector/InspectorTimelineAgent.h:
717         * inspector/InspectorTimelineAgent.cpp:
718         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
719         Initialize new members.
720
721         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
722         Cleanup auto capture state when tearing down.
723
724         (WebCore::InspectorTimelineAgent::setAutoCaptureEnabled):
725         (WebCore::InspectorTimelineAgent::setAutoCaptureInstruments):
726         Set and validate new auto capture state from the frontend.
727
728         (WebCore::InspectorTimelineAgent::mainFrameStartedLoading):
729         When page navigates start an auto capture if needed.
730
731 2016-05-10  Csaba Osztrogonác  <ossy@webkit.org>
732
733         Fix the !ENABLE(SHADOW_DOM) && !ENABLE(DETAILS_ELEMENT) build
734         https://bugs.webkit.org/show_bug.cgi?id=157514
735
736         Reviewed by Ryosuke Niwa.
737
738         * dom/Element.cpp:
739         (WebCore::Element::insertedInto):
740         (WebCore::Element::removedFrom):
741
742 2016-05-10  Csaba Osztrogonác  <ossy@webkit.org>
743
744         Fix the !ENABLE(WEB_TIMING) build
745         https://bugs.webkit.org/show_bug.cgi?id=157515
746
747         Reviewed by Alex Christensen.
748
749         * loader/cache/CachedResourceLoader.cpp:
750         (WebCore::CachedResourceLoader::loadDone):
751
752 2016-05-10  Csaba Osztrogonác  <ossy@webkit.org>
753
754         Fix the !ENABLE(INDEXED_DATABASE) build
755         https://bugs.webkit.org/show_bug.cgi?id=157517
756
757         Reviewed by Alex Christensen.
758
759         * workers/WorkerGlobalScope.cpp:
760         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
761         * workers/WorkerThread.cpp:
762         (WebCore::WorkerThread::WorkerThread):
763
764 2016-05-05  Jer Noble  <jer.noble@apple.com>
765
766         Return a Promise from HTMLMediaElement.play()
767         https://bugs.webkit.org/show_bug.cgi?id=157400
768
769         Reviewed by Eric Carlson.
770
771         Tests: media/media-play-promise-reject-error-notsupported.html
772                media/media-play-promise-reject-load-abort.html
773                media/media-play-promise-reject-pause-abort.html
774                media/media-play-promise-reject-play-notallowed.html
775                media/media-play-promise-reject-play-notsupported.html
776                media/media-play-promise-resolve-when-playing.html
777                media/media-play-promise-resolve.html
778
779         The HTML Living Standard Spec <https://html.spec.whatwg.org/multipage/embedded-content.html>
780         (5 May 2016) adds support for a Promise to be returned by the play() method, to be resolved
781         or rejected at defined points during loading and playback.
782
783         Add utility methods which encapsulate the definitions of the equivalent algorithms from the
784         HTML Spec.  Add a new, overloaded play() method on HTMLMediaElement which takes a DeferredWrapper
785         reference.
786
787         After the change to use scheduleNotifyAboutPlaying() instead of enqueueing the "playing" event
788         directly, we must ensure that the notifyAboutPlaying() task does not get fired before the
789         "play" event preceeding it does. So re-implement GenericEventQueue (which previously used
790         a timer to dispatch events) to use a GenericTaskQueue instead. This ensures that all tasks and
791         events are interleaved in the order in which they were enqueued.
792
793         Additionally, the new pauseAfterDetachedTimerFired() event was firing out of microtask order, which
794         broke some W3C tests after the changes to GenericEventQueue. Move GenericEventQueue and
795         GenericTaskQueue to the same timing source (namely, a WebCore Timer) and interleave Events
796         and Tasks by having GenericEventQueue use GenericTaskQueue to issue its Events. Because
797         Document::postTask() cannot ensure ordering with Timer-based events, switch HTMLMediaElement
798         over to Timer-backed GenericTaskQueues.
799
800         Use a WeakPtr to track the destruction of TaskDispatcher<Timer> objects in pendingDispatchers().
801
802         * dom/GenericEventQueue.cpp:
803         (WebCore::GenericEventQueue::GenericEventQueue):
804         (WebCore::GenericEventQueue::enqueueEvent):
805         (WebCore::GenericEventQueue::close):
806         (WebCore::GenericEventQueue::cancelAllEvents):
807         (WebCore::GenericEventQueue::suspend):
808         (WebCore::GenericEventQueue::resume):
809         (WebCore::GenericEventQueue::sharedTimer): Deleted.
810         (WebCore::GenericEventQueue::sharedTimerFired): Deleted.
811         (WebCore::GenericEventQueue::pendingQueues): Deleted.
812         * dom/GenericEventQueue.h:
813         * platform/GenericTaskQueue.cpp: Added.
814         (WebCore::TaskDispatcher<Timer>::~TaskDispatcher):
815         (WebCore::TaskDispatcher<Timer>::postTask):
816         (WebCore::TaskDispatcher<Timer>::sharedTimer):
817         (WebCore::TaskDispatcher<Timer>::sharedTimerFired):
818         (WebCore::TaskDispatcher<Timer>::pendingDispatchers):
819         (WebCore::TaskDispatcher<Timer>::dispatchOneTask):
820         * platform/GenericTaskQueue.h:
821         (WebCore::TaskDispatcher<Timer>::TaskDispatcher): Deleted.
822         (WebCore::TaskDispatcher<Timer>::postTask): Deleted.
823         (WebCore::TaskDispatcher<Timer>::timerFired): Deleted.
824         * html/HTMLMediaElement.cpp:
825         (WebCore::HTMLMediaElement::HTMLMediaElement):
826         (WebCore::HTMLMediaElement::~HTMLMediaElement):
827         (WebCore::HTMLMediaElement::scheduleResolvePendingPlayPromises):
828         (WebCore::HTMLMediaElement::rejectPendingPlayPromises):
829         (WebCore::HTMLMediaElement::resolvePendingPlayPromises):
830         (WebCore::HTMLMediaElement::scheduleNotifyAboutPlaying):
831         (WebCore::HTMLMediaElement::notifyAboutPlaying):
832         (WebCore::HTMLMediaElement::noneSupported):
833         (WebCore::HTMLMediaElement::cancelPendingEventsAndCallbacks):
834         (WebCore::HTMLMediaElement::setReadyState):
835         (WebCore::HTMLMediaElement::play):
836         (WebCore::HTMLMediaElement::playInternal):
837         (WebCore::HTMLMediaElement::pauseInternal):
838         (WebCore::HTMLMediaElement::contextDestroyed):
839         (WebCore::HTMLMediaElement::stop):
840         (WebCore::HTMLMediaElement::pauseAfterDetachedTask): Renamed from pauseAfterDetachedTimerFired.
841         (WebCore::HTMLMediaElement::removedFrom):
842         (WebCore::HTMLMediaElement::contextDestroyed):
843         * html/HTMLMediaElement.h:
844         * html/HTMLMediaElement.idl:
845         * CMakeLists.txt:
846         * WebCore.xcodeproj/project.pbxproj:
847
848 2016-05-10  Commit Queue  <commit-queue@webkit.org>
849
850         Unreviewed, rolling out r200627.
851         https://bugs.webkit.org/show_bug.cgi?id=157531
852
853         This change has caused crashes in existing LayoutTests
854         (Requested by ryanhaddad on #webkit).
855
856         Reverted changeset:
857
858         "Return a Promise from HTMLMediaElement.play()"
859         https://bugs.webkit.org/show_bug.cgi?id=157400
860         http://trac.webkit.org/changeset/200627
861
862 2016-05-10  Simon Fraser  <simon.fraser@apple.com>
863
864         Fix scrolling tree dumping
865         https://bugs.webkit.org/show_bug.cgi?id=157529
866
867         Reviewed by Tim Horton.
868
869         Scrolling tree dumps cannot contain layerIDs because they are not stable between
870         runs. Fix by adding ScrollingStateTreeAsTextBehavior flags, and not dumping
871         the layerID for tests.
872
873         Sadly RemoteScrollingCoordinatorTransaction has a lot of duplicated code for dumping
874         the scrolling state tree, which should be converted to dumpProperties() at some point.
875         
876         Fix the one test that suffered from this problem, and unskip it.
877
878         Test: fast/scrolling/ios/remove-scrolling-role.html
879
880         * page/scrolling/ScrollingStateFixedNode.cpp:
881         (WebCore::ScrollingStateFixedNode::dumpProperties):
882         * page/scrolling/ScrollingStateFixedNode.h:
883         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
884         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
885         * page/scrolling/ScrollingStateFrameScrollingNode.h:
886         * page/scrolling/ScrollingStateNode.cpp:
887         (WebCore::ScrollingStateNode::dump):
888         (WebCore::ScrollingStateNode::scrollingStateTreeAsText):
889         * page/scrolling/ScrollingStateNode.h:
890         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
891         (WebCore::ScrollingStateOverflowScrollingNode::dumpProperties):
892         * page/scrolling/ScrollingStateOverflowScrollingNode.h:
893         * page/scrolling/ScrollingStateScrollingNode.cpp:
894         (WebCore::ScrollingStateScrollingNode::dumpProperties):
895         * page/scrolling/ScrollingStateScrollingNode.h:
896         * page/scrolling/ScrollingStateStickyNode.cpp:
897         (WebCore::ScrollingStateStickyNode::dumpProperties):
898         * page/scrolling/ScrollingStateStickyNode.h:
899
900 2016-05-10  Csaba Osztrogonác  <ossy@webkit.org>
901
902         Fix the !ENABLE(CSS_REGIONS) build after r198990
903         https://bugs.webkit.org/show_bug.cgi?id=157516
904
905         Reviewed by Ryosuke Niwa.
906
907         * style/StyleTreeResolver.cpp:
908         (WebCore::Style::affectsRenderedSubtree):
909
910 2016-05-05  Jer Noble  <jer.noble@apple.com>
911
912         Return a Promise from HTMLMediaElement.play()
913         https://bugs.webkit.org/show_bug.cgi?id=157400
914
915         Reviewed by Eric Carlson.
916
917         Tests: media/media-play-promise-reject-error-notsupported.html
918                media/media-play-promise-reject-load-abort.html
919                media/media-play-promise-reject-pause-abort.html
920                media/media-play-promise-reject-play-notallowed.html
921                media/media-play-promise-reject-play-notsupported.html
922                media/media-play-promise-resolve-when-playing.html
923                media/media-play-promise-resolve.html
924
925         The HTML Living Standard Spec <https://html.spec.whatwg.org/multipage/embedded-content.html>
926         (5 May 2016) adds support for a Promise to be returned by the play() method, to be resolved
927         or rejected at defined points during loading and playback.
928
929         Add utility methods which encapsulate the definitions of the equivalent algorithms from the
930         HTML Spec.  Add a new, overloaded play() method on HTMLMediaElement which takes a DeferredWrapper
931         reference.
932
933         After the change to use scheduleNotifyAboutPlaying() instead of enqueueing the "playing" event
934         directly, we must ensure that the notifyAboutPlaying() task does not get fired before the
935         "play" event preceeding it does. So re-implement GenericEventQueue (which previously used
936         a timer to dispatch events) to use a GenericTaskQueue instead. This ensures that all tasks and
937         events are interleaved in the order in which they were enqueued.
938
939         Additionally, the new pauseAfterDetachedTimerFired() event was firing out of microtask order, which
940         broke some W3C tests after the changes to GenericEventQueue. Move GenericEventQueue and
941         GenericTaskQueue to the same timing source (namely, a WebCore Timer) and interleave Events
942         and Tasks by having GenericEventQueue use GenericTaskQueue to issue its Events. Because
943         Document::postTask() cannot ensure ordering with Timer-based events, switch HTMLMediaElement
944         over to Timer-backed GenericTaskQueues.
945
946         * dom/GenericEventQueue.cpp:
947         (WebCore::GenericEventQueue::GenericEventQueue):
948         (WebCore::GenericEventQueue::enqueueEvent):
949         (WebCore::GenericEventQueue::close):
950         (WebCore::GenericEventQueue::cancelAllEvents):
951         (WebCore::GenericEventQueue::suspend):
952         (WebCore::GenericEventQueue::resume):
953         (WebCore::GenericEventQueue::sharedTimer): Deleted.
954         (WebCore::GenericEventQueue::sharedTimerFired): Deleted.
955         (WebCore::GenericEventQueue::pendingQueues): Deleted.
956         * dom/GenericEventQueue.h:
957         * platform/GenericTaskQueue.cpp: Added.
958         (WebCore::TaskDispatcher<Timer>::~TaskDispatcher):
959         (WebCore::TaskDispatcher<Timer>::postTask):
960         (WebCore::TaskDispatcher<Timer>::sharedTimer):
961         (WebCore::TaskDispatcher<Timer>::sharedTimerFired):
962         (WebCore::TaskDispatcher<Timer>::pendingDispatchers):
963         (WebCore::TaskDispatcher<Timer>::dispatchOneTask):
964         * platform/GenericTaskQueue.h:
965         (WebCore::TaskDispatcher<Timer>::TaskDispatcher): Deleted.
966         (WebCore::TaskDispatcher<Timer>::postTask): Deleted.
967         (WebCore::TaskDispatcher<Timer>::timerFired): Deleted.
968         * html/HTMLMediaElement.cpp:
969         (WebCore::HTMLMediaElement::HTMLMediaElement):
970         (WebCore::HTMLMediaElement::~HTMLMediaElement):
971         (WebCore::HTMLMediaElement::scheduleResolvePendingPlayPromises):
972         (WebCore::HTMLMediaElement::rejectPendingPlayPromises):
973         (WebCore::HTMLMediaElement::resolvePendingPlayPromises):
974         (WebCore::HTMLMediaElement::scheduleNotifyAboutPlaying):
975         (WebCore::HTMLMediaElement::notifyAboutPlaying):
976         (WebCore::HTMLMediaElement::noneSupported):
977         (WebCore::HTMLMediaElement::cancelPendingEventsAndCallbacks):
978         (WebCore::HTMLMediaElement::setReadyState):
979         (WebCore::HTMLMediaElement::play):
980         (WebCore::HTMLMediaElement::playInternal):
981         (WebCore::HTMLMediaElement::pauseInternal):
982         (WebCore::HTMLMediaElement::contextDestroyed):
983         (WebCore::HTMLMediaElement::stop):
984         (WebCore::HTMLMediaElement::pauseAfterDetachedTask): Renamed from pauseAfterDetachedTimerFired.
985         (WebCore::HTMLMediaElement::removedFrom):
986         (WebCore::HTMLMediaElement::contextDestroyed):
987         * html/HTMLMediaElement.h:
988         * html/HTMLMediaElement.idl:
989         * CMakeLists.txt:
990         * WebCore.xcodeproj/project.pbxproj:
991
992 2016-05-10  Chris Dumez  <cdumez@apple.com>
993
994         Get rid of a lot of calls to RefPtr::release()
995         https://bugs.webkit.org/show_bug.cgi?id=157505
996
997         Reviewed by Alex Christensen.
998
999         Get rid of a lot of calls to RefPtr::release() and use WTFMove() instead.
1000
1001         * Modules/encryptedmedia/MediaKeySession.cpp:
1002         (WebCore::MediaKeySession::addKeyTimerFired):
1003         (WebCore::MediaKeySession::sendMessage):
1004         (WebCore::MediaKeySession::sendError):
1005         * Modules/geolocation/Geolocation.cpp:
1006         (WebCore::createGeoposition):
1007         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
1008         (WebCore::DOMWindowIndexedDatabase::disconnectFrameForDocumentSuspension):
1009         (WebCore::DOMWindowIndexedDatabase::reconnectFrameFromDocumentSuspension):
1010         * Modules/indexeddb/IDBKey.h:
1011         (WebCore::IDBKey::createMultiEntryArray):
1012         * Modules/mediasource/MediaSource.cpp:
1013         (WebCore::MediaSource::scheduleEvent):
1014         * Modules/mediasource/SourceBuffer.cpp:
1015         (WebCore::SourceBuffer::scheduleEvent):
1016         * Modules/mediasource/SourceBufferList.cpp:
1017         (WebCore::SourceBufferList::scheduleEvent):
1018         * Modules/notifications/DOMWindowNotifications.cpp:
1019         (WebCore::DOMWindowNotifications::disconnectFrameForDocumentSuspension):
1020         (WebCore::DOMWindowNotifications::reconnectFrameFromDocumentSuspension):
1021         * Modules/webdatabase/DatabaseManager.cpp:
1022         (WebCore::DatabaseManager::openDatabaseBackend):
1023         * Modules/webdatabase/DatabaseManager.h:
1024         * Modules/webdatabase/SQLCallbackWrapper.h:
1025         (WebCore::SQLCallbackWrapper::unwrap):
1026         * Modules/websockets/WebSocketChannel.cpp:
1027         (WebCore::WebSocketChannel::enqueueTextFrame):
1028         (WebCore::WebSocketChannel::enqueueRawFrame):
1029         (WebCore::WebSocketChannel::enqueueBlobFrame):
1030         (WebCore::WebSocketChannel::processOutgoingFrameQueue):
1031         * bindings/js/JSBlobCustom.cpp:
1032         (WebCore::constructJSBlob):
1033         * bindings/js/JSGeolocationCustom.cpp:
1034         (WebCore::createPositionOptions):
1035         (WebCore::JSGeolocation::getCurrentPosition):
1036         (WebCore::JSGeolocation::watchPosition):
1037         * bindings/js/JSMessagePortCustom.cpp:
1038         (WebCore::fillMessagePortArray):
1039         * bindings/js/JSSQLTransactionCustom.cpp:
1040         (WebCore::JSSQLTransaction::executeSql):
1041         * bindings/js/ScriptControllerMac.mm:
1042         (WebCore::ScriptController::createScriptInstanceForWidget):
1043         * bindings/scripts/CodeGeneratorJS.pm:
1044         (GenerateCallWith):
1045         * crypto/mac/CryptoKeyRSAMac.cpp:
1046         (WebCore::CryptoKeyRSA::generatePair):
1047         * css/CSSBasicShapes.cpp:
1048         (WebCore::buildSerializablePositionOffset):
1049         * css/CSSComputedStyleDeclaration.cpp:
1050         (WebCore::valueForNinePieceImageRepeat):
1051         (WebCore::counterToCSSValue):
1052         (WebCore::ComputedStyleExtractor::propertyValue):
1053         * css/CSSContentDistributionValue.cpp:
1054         (WebCore::CSSContentDistributionValue::customCSSText):
1055         * css/CSSFilterImageValue.cpp:
1056         (WebCore::CSSFilterImageValue::image):
1057         * css/CSSFilterImageValue.h:
1058         * css/CSSGrammar.y.in:
1059         * css/CSSNamedImageValue.cpp:
1060         (WebCore::CSSNamedImageValue::image):
1061         * css/CSSNamedImageValue.h:
1062         * css/CSSParser.cpp:
1063         (WebCore::CSSParser::parseFillProperty):
1064         (WebCore::CSSParser::parseAnimationProperty):
1065         (WebCore::CSSParser::parseInsetRoundedCorners):
1066         (WebCore::ShadowParseContext::commitLength):
1067         (WebCore::CSSParser::parseShadow):
1068         (WebCore::BorderImageSliceParseContext::commitNumber):
1069         (WebCore::BorderImageQuadParseContext::commitNumber):
1070         (WebCore::CSSParser::parseBorderRadius):
1071         (WebCore::CSSParser::parseCounter):
1072         (WebCore::CSSParser::parseDeprecatedGradient):
1073         (WebCore::CSSParser::parseDeprecatedLinearGradient):
1074         (WebCore::CSSParser::parseDeprecatedRadialGradient):
1075         (WebCore::CSSParser::parseLinearGradient):
1076         (WebCore::CSSParser::parseRadialGradient):
1077         (WebCore::CSSParser::parseTransformValue):
1078         (WebCore::CSSParser::parseBuiltinFilterArguments):
1079         (WebCore::CSSParser::parseTextIndent):
1080         (WebCore::CSSParser::popRuleData):
1081         (WebCore::CSSParser::markRuleHeaderStart):
1082         (WebCore::CSSParser::createViewportRule):
1083         * css/CSSParser.h:
1084         * css/CSSParserValues.cpp:
1085         (WebCore::CSSParserValue::createCSSValue):
1086         * css/CSSParserValues.h:
1087         * css/CSSValueList.cpp:
1088         (WebCore::CSSValueList::copy):
1089         * css/CSSValueList.h:
1090         * css/SVGCSSComputedStyleDeclaration.cpp:
1091         (WebCore::ComputedStyleExtractor::svgPropertyValue):
1092         * css/StyleBuilderConverter.h:
1093         (WebCore::StyleBuilderConverter::convertClipPath):
1094         (WebCore::StyleBuilderConverter::convertReflection):
1095         * css/StyleResolver.cpp:
1096         (WebCore::StyleResolver::cachedOrPendingFromValue):
1097         (WebCore::StyleResolver::setOrPendingFromValue):
1098         (WebCore::StyleResolver::cursorOrPendingFromValue):
1099         * css/StyleResolver.h:
1100         * css/StyleRule.cpp:
1101         (WebCore::StyleRuleBase::createCSSOMWrapper):
1102         * css/StyleRule.h:
1103         * dom/Attr.cpp:
1104         (WebCore::Attr::create):
1105         * dom/Attr.h:
1106         * dom/ContainerNode.h:
1107         (WebCore::ChildNodesLazySnapshot::nextNode):
1108         * dom/Document.cpp:
1109         (WebCore::Document::setFocusedElement):
1110         (WebCore::Document::takeDOMWindowFrom):
1111         (WebCore::Document::updateHoverActiveState):
1112         * dom/Element.cpp:
1113         (WebCore::Element::detachAttribute):
1114         (WebCore::Element::setAttributeNodeNS):
1115         (WebCore::Element::ensureAttr):
1116         * dom/Element.h:
1117         * dom/MessagePort.cpp:
1118         (WebCore::MessagePort::dispatchMessages):
1119         (WebCore::MessagePort::entanglePorts):
1120         * dom/NodeIterator.cpp:
1121         (WebCore::NodeIterator::nextNode):
1122         (WebCore::NodeIterator::previousNode):
1123         * dom/Range.cpp:
1124         (WebCore::Range::processContentsBetweenOffsets):
1125         * dom/StyledElement.cpp:
1126         (WebCore::StyledElement::rebuildPresentationAttributeStyle):
1127         * editing/ApplyBlockElementCommand.cpp:
1128         (WebCore::ApplyBlockElementCommand::createBlockElement):
1129         * editing/ApplyBlockElementCommand.h:
1130         * editing/ApplyStyleCommand.cpp:
1131         (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
1132         * editing/CompositeEditCommand.cpp:
1133         (WebCore::CompositeEditCommand::applyCommandToComposite):
1134         (WebCore::CompositeEditCommand::appendBlockPlaceholder):
1135         (WebCore::CompositeEditCommand::insertBlockPlaceholder):
1136         (WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
1137         (WebCore::CompositeEditCommand::insertNewDefaultParagraphElementAt):
1138         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary):
1139         (WebCore::CompositeEditCommand::cloneParagraphUnderNewElement):
1140         (WebCore::CompositeEditCommand::moveParagraphs):
1141         * editing/CompositeEditCommand.h:
1142         * editing/EditingStyle.cpp:
1143         (WebCore::EditingStyle::wrappingStyleForSerialization):
1144         (WebCore::styleFromMatchedRulesForElement):
1145         (WebCore::extractPropertiesNotIn):
1146         (WebCore::backgroundColorInEffect):
1147         * editing/EditingStyle.h:
1148         * editing/Editor.cpp:
1149         (WebCore::Editor::increaseSelectionListLevel):
1150         (WebCore::Editor::increaseSelectionListLevelOrdered):
1151         (WebCore::Editor::increaseSelectionListLevelUnordered):
1152         (WebCore::Editor::findStringAndScrollToVisible):
1153         (WebCore::Editor::rangeOfString):
1154         * editing/Editor.h:
1155         * editing/InsertParagraphSeparatorCommand.cpp:
1156         (WebCore::InsertParagraphSeparatorCommand::cloneHierarchyUnderNewBlock):
1157         * editing/InsertParagraphSeparatorCommand.h:
1158         * editing/MergeIdenticalElementsCommand.cpp:
1159         (WebCore::MergeIdenticalElementsCommand::doUnapply):
1160         * editing/ModifySelectionListLevel.cpp:
1161         (WebCore::IncreaseSelectionListLevelCommand::doApply):
1162         (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevel):
1163         * editing/ModifySelectionListLevel.h:
1164         * editing/RemoveNodeCommand.cpp:
1165         (WebCore::RemoveNodeCommand::doUnapply):
1166         * editing/RemoveNodePreservingChildrenCommand.cpp:
1167         (WebCore::RemoveNodePreservingChildrenCommand::doApply):
1168         * editing/ReplaceSelectionCommand.cpp:
1169         (WebCore::ReplacementFragment::insertFragmentForTestRendering):
1170         * editing/SpellingCorrectionCommand.cpp:
1171         (WebCore::SpellingCorrectionCommand::doApply):
1172         * editing/mac/DictionaryLookup.h:
1173         * editing/mac/DictionaryLookup.mm:
1174         (WebCore::DictionaryLookup::rangeForSelection):
1175         (WebCore::DictionaryLookup::rangeAtHitTestResult):
1176         * html/HTMLFormElement.cpp:
1177         (WebCore::HTMLFormElement::finishRequestAutocomplete):
1178         * html/HTMLMediaElement.cpp:
1179         (WebCore::HTMLMediaElement::scheduleEvent):
1180         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
1181         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
1182         (WebCore::HTMLMediaElement::addTextTrack):
1183         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
1184         * html/HTMLMediaElement.h:
1185         * html/canvas/OESVertexArrayObject.cpp:
1186         (WebCore::OESVertexArrayObject::createVertexArrayOES):
1187         * html/canvas/OESVertexArrayObject.h:
1188         * html/canvas/WebGLRenderingContextBase.cpp:
1189         (WebCore::WebGLRenderingContextBase::getContextAttributes):
1190         * html/canvas/WebGLRenderingContextBase.h:
1191         * html/track/VTTCue.cpp:
1192         (WebCore::VTTCue::getCueAsHTML):
1193         (WebCore::VTTCue::createCueRenderingTree):
1194         * html/track/VTTCue.h:
1195         * html/track/WebVTTElement.cpp:
1196         (WebCore::WebVTTElement::createEquivalentHTMLElement):
1197         * html/track/WebVTTElement.h:
1198         * html/track/WebVTTParser.cpp:
1199         (WebCore::WebVTTTreeBuilder::buildFromString):
1200         (WebCore::WebVTTParser::createDocumentFragmentFromCueText):
1201         * html/track/WebVTTParser.h:
1202
1203 2016-05-05  Gavin Barraclough  <barraclough@apple.com>
1204
1205         Allow some leeway after page load before throttling, to allow post load events to complete.
1206         https://bugs.webkit.org/show_bug.cgi?id=157499
1207
1208         Reviewed by Ryosuke Niwa
1209
1210         * page/PageThrottler.cpp:
1211         (WebCore::PageThrottler::PageThrottler):
1212             - m_pageLoadActivityCounter now affects activity state indirecty, via m_pageLoadActivityHysteresis.
1213         (WebCore::PageThrottler::pageLoadActivityCounterChanged):
1214             - counter updates hysteresis object, which in turn will affect activity state.
1215         * page/PageThrottler.h:
1216             - added m_pageLoadActivityHysteresis, pageLoadActivityCounterChanged.
1217
1218 2016-05-10  Zalan Bujtas  <zalan@apple.com>
1219
1220         REGRESSION (r193610): Drop down menu doesn’t expand at allofbach.com
1221         https://bugs.webkit.org/show_bug.cgi?id=157445
1222
1223         Reviewed by Simon Fraser.
1224
1225         When we don't run transitions (becasuse of to/from 'auto' values) we should also not
1226         report the 'from' value and behave as if we finished the transition already.
1227
1228         Test: fast/animation/height-auto-transition-computed-value.html
1229
1230         * page/animation/KeyframeAnimation.cpp:
1231         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): This is a revert of
1232         looping the 'to' value back to the first keyframe when reverse animation is at the start value (last keyframe).
1233
1234         * platform/Length.cpp:
1235         (WebCore::blend):
1236
1237 2016-05-09  Dean Jackson  <dino@apple.com>
1238
1239         [iOS] <select> elements should render right-aligned when in RTL mode
1240         https://bugs.webkit.org/show_bug.cgi?id=157501
1241         <rdar://problem/26187870>
1242
1243         Reviewed by Antoine Quint.
1244
1245         This is the equivalent of http://webkit.org/b/157112 for iOS.
1246         Handle <select> elements when we're in RTL mode. This means
1247         drawing the button with the drop-down arrow on the left
1248         side, and the button text right-aligned.
1249
1250         Test: fast/forms/select-non-native-rendering-direction.html
1251         plus a bunch of other ones that needed rebaselining.
1252
1253         * rendering/RenderThemeIOS.mm: Rename MenuListButtonPaddingRight to MenuListButtonPaddingAfter.
1254         (WebCore::RenderThemeIOS::popupInternalPaddingBox): Handle both directions.
1255         (WebCore::adjustInputElementButtonStyle):
1256         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations): Handle drawing in
1257         RTL mode.
1258
1259 2016-05-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
1260
1261         NodeList should be iterable
1262         https://bugs.webkit.org/show_bug.cgi?id=131443
1263         <rdar://problem/25731519>
1264
1265         Reviewed by Darin Adler.
1266
1267         Test: fast/dom/nodeListIterator.html
1268
1269         Updating JSKeyValueIterator to support map and set iterators,
1270         depending on the signature of the result type of DOMClass::Iterator::next method.
1271         Symbol.iterator method is made the same as values method for set iterators.
1272
1273         Adding support for NodeList.
1274         Updating FontFaceSet to take benefit of that. 
1275
1276         * bindings/js/JSDOMBinding.h:
1277         (WebCore::jsPair):.
1278         * bindings/js/JSKeyValueIterator.h:
1279         (WebCore::IteratorInspector::decltype): IteratorInspector detects whether the iterator is a set or map iterator.
1280         (WebCore::IteratorInspector::test):
1281         (WebCore::fillForEachArgumentsWithIteratorValue): Specializing according set/map iterator.
1282         (WebCore::iteratorValueToJS): Ditto.
1283         (WebCore::keyValueIteratorForEach):
1284         (WebCore::JSKeyValueIterator<JSWrapper>::next):
1285         * bindings/scripts/CodeGeneratorJS.pm:
1286         (GenerateImplementationIterableFunctions): Removed the line forbidding set iterators.
1287         Making Symbol.iterator function equal to values for set iterators.
1288         * bindings/scripts/test/JS/JSTestNode.cpp: Rebasing with set iterator functions.
1289         * bindings/scripts/test/JS/JSTestObj.cpp: Rebasing according updated function names.
1290         * bindings/scripts/test/TestNode.idl: Making TestNode set iterable.
1291         * css/FontFaceSet.cpp:
1292         (WebCore::FontFaceSet::Iterator::next): Refactoring to make it a set iterator.
1293         * css/FontFaceSet.h:
1294         * css/FontFaceSet.idl:
1295         * dom/NodeList.h: Making NodeList iterable.
1296         (WebCore::NodeList::Iterator::Iterator):
1297         (WebCore::NodeList::Iterator::next):
1298         (WebCore::NodeList::createIterator):
1299         * dom/NodeList.idl:
1300
1301 2016-05-09  Sergio Villar Senin  <svillar@igalia.com>
1302
1303         [css-grid] Implement auto-repeat computation
1304         https://bugs.webkit.org/show_bug.cgi?id=157473
1305
1306         Reviewed by Darin Adler.
1307
1308         We added support for parsing and style for the new auto-repeat syntax. This patch actually
1309         implements the feature by computing the number of auto-repeat tracks that will be part of
1310         the explicit grid depending on the available size on the corresponding axis.
1311
1312         Note that we still do not drop the empty tracks, i.e., auto-fit will work exactly as
1313         auto-fill until the empty track removal is implemented.
1314
1315         Some test results are not totally correct yet because we need to add the line names to the
1316         computed style. As that requires a rather large piece of code it will be done in a follow up
1317         patch. Track sizes are correct though.
1318
1319         Tests: fast/css-grid-layout/grid-auto-fill-columns.html
1320                fast/css-grid-layout/grid-auto-fill-rows.html
1321                fast/css-grid-layout/grid-change-auto-repeat-tracks.html
1322                fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-001.html
1323                fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-002.html
1324                fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-003.html
1325                fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-004.html
1326                fast/css-grid-layout/mozilla/grid-repeat-auto-fill-fit-005.html
1327
1328         * css/CSSParser.cpp:
1329         (WebCore::CSSParser::parseGridTrackRepeatFunction): Add the CSSAutoRepeatValue directly
1330         instead of adding the track size.
1331         * css/StyleBuilderCustom.h: Store the insertion point in style.
1332         * rendering/RenderGrid.cpp:
1333         (WebCore::RenderGrid::guttersSize): Replaced size_t by unsigned.
1334         (WebCore::RenderGrid::rawGridTrackSize): New function which retrieves the track size from
1335         either explicit (including auto-repeat tracks) or implicit tracks.
1336         (WebCore::RenderGrid::gridTrackSize): Use rawGridTrackSize().
1337         (WebCore::RenderGrid::computeAutoRepeatTracksCount): This is the core of the patch. This
1338         method computes the number of auto-repeat tracks that fits on the available size for a given
1339         axis (or 1 if that's indefinite).
1340         * rendering/RenderGrid.h:
1341
1342 2016-05-09  Alex Christensen  <achristensen@webkit.org>
1343
1344         Fix GTK build after r200607
1345
1346         * Modules/notifications/Notification.h:
1347         dir and replaceId are used in WebNotificationManager with NOTIFICATIONS and with LEGACY_NOTIFICATIONS
1348
1349 2016-05-09  Simon Fraser  <simon.fraser@apple.com>
1350
1351         Fix the Windows build after r200602, and do some minor tidyup.
1352
1353         * platform/graphics/ca/PlatformCALayer.h:
1354         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1355         (PlatformCALayerCocoa::contentsHidden):
1356         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
1357         (PlatformCALayerWin::contentsHidden):
1358         (PlatformCALayerWin::setContentsHidden):
1359         * platform/graphics/ca/win/PlatformCALayerWin.h:
1360
1361 2016-05-09  Darin Adler  <darin@apple.com>
1362
1363         Change Notification constructor to take an IDL dictionary instead of a WebCore::Dictionary
1364         https://bugs.webkit.org/show_bug.cgi?id=157466
1365
1366         Reviewed by Alex Christensen.
1367
1368         * Modules/notifications/Notification.cpp: Got rid of unneeded includes.
1369         (WebCore::Notification::Notification): Deleted the unused default constructor. Changed
1370         NotificationCenter argument to be reference rather than PassRefPtr. Changed one of the
1371         ScriptExecutionContext arguments to be a Document since the code relies on that already.
1372         Used the lambda form of timer creation instead of the class member form. Added a FIXME
1373         about when m_notificationCenter can be null.
1374         (WebCore::Notification::create): Changed NotificationCenter argument to be reference
1375         rather than PassRefPtr. Changed options argument to be Options rather than Dictionary.
1376         (WebCore::directionString): Added. Helper because the class still wants to store the
1377         direction as a string, at least for now.
1378         (WebCore::Notification::show): Streamlined the code a bit.
1379         (WebCore::Notification::taskTimerFired): Deleted. Not needed now that we use a lambda
1380         inside the constructor.
1381         (WebCore::Notification::permission): Removed unneeded const from return type.
1382         (WebCore::Notification::permissionString): Ditto.
1383
1384         * Modules/notifications/Notification.h: Used pragma once, updated for changes above.
1385         Removed a number of unused functions, including cancel, setIconURL, setLang,
1386         stopLoadingIcon, detachPresenter, setBody, startLoadingIcon, finishLoadingIcon, and
1387         taskTimerFired.
1388
1389         * Modules/notifications/Notification.idl: Add NotificationOptions and pass it instead
1390         of Dictionary to the constructor. Note that this is only a subset of what is
1391         currently specified in the Notifications API document. The latest document specifies
1392         a much more complex feature with lots more options.
1393
1394         * Modules/notifications/NotificationCenter.cpp:
1395         (WebCore::NotificationCenter::createNotification): Pass a reference rather than a
1396         pointer to this.
1397         * Modules/notifications/NotificationClient.h: Use pragma once. Removed unneeded
1398         includes and forward declarations. Fixed #if to be easier to read.
1399
1400         * bindings/js/JSDOMConvert.h: Reworked the convert functions to use Converter and
1401         DefaultConverter structs so we can do partial specialization in the future and so
1402         we can get custom types for optional values. Used this to make an optional String
1403         just be a null String, so it won't try to use Optional<String> instead. Might get
1404         more complex latter when we add support for nullable.
1405
1406         * bindings/scripts/CodeGeneratorJS.pm:
1407         (GenerateEnumerationImplementationContent): Generate a blank line to make the output
1408         slightly clearer. Tweaked a comment.
1409         (GenerateDefaultValue): Added. Converts the default syntax from IDL into the syntax
1410         needed in C++ code.
1411         (GenerateDefaultValueWithLeadingComma): Added. Helper for use below.
1412         (GenerateDictionaryImplementationContent): Use GenerateDefaultValue and
1413         GenerateDefaultValueWithLeadingComma to make default values.
1414         (GenerateParametersCheck): Use GenerateDefaultValue here in the enumeration code
1415         path. This is a step in the direction of being able to make the whole thing more
1416         generic in the future.
1417
1418         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1419         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1420         * bindings/scripts/test/JS/JSTestObj.cpp:
1421         * bindings/scripts/test/ObjC/DOMTestObj.h:
1422         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1423         Regenerated.
1424
1425         * bindings/scripts/test/TestObj.idl: Simplified and extended some of the test cases
1426         to cover more combinations of the dictionary and enumeration support.
1427
1428 2016-05-09  Brady Eidson  <beidson@apple.com>
1429
1430         Modern IDB: Have server database connections remember the OpenDB request that spawned them.
1431         https://bugs.webkit.org/show_bug.cgi?id=157498
1432
1433         Reviewed by Tim Horton.
1434
1435         No new tests (No testable change in behavior, debug only for now).
1436
1437         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1438         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentOpenOperation):
1439         
1440         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
1441         (WebCore::IDBServer::UniqueIDBDatabaseConnection::create):
1442         (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
1443         (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
1444         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFireVersionChangeEvent):
1445         (WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction):
1446         (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
1447         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
1448         (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction):
1449         * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
1450         (WebCore::IDBServer::UniqueIDBDatabaseConnection::openRequestIdentifier):
1451
1452 2016-05-09  Simon Fraser  <simon.fraser@apple.com>
1453
1454         [iOS] visibility:hidden -webkit-overflow-scrolling: touch divs can interfere with page scrolling
1455         https://bugs.webkit.org/show_bug.cgi?id=157496
1456
1457         Reviewed by Tim Horton.
1458
1459         UIScrollViews are constructed in the UI process for visibility:hidden scrollable elements
1460         with -webkit-overflow-scrolling: touch, and these intercept user events when they should not.
1461
1462         Fix by propagating a "contentsHidden" flag from the web process which is used to turn off
1463         user interaction on these views.
1464
1465         Test: fast/scrolling/ios/touch-scroll-visibility-hidden.html
1466
1467         * platform/graphics/ca/GraphicsLayerCA.cpp:
1468         (WebCore::GraphicsLayerCA::updateContentsVisibility): We have to tell the scrolling layer
1469         if we have visibility:hidden.
1470         * platform/graphics/ca/PlatformCALayer.h:
1471         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
1472         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1473         (PlatformCALayerCocoa::contentsHidden):
1474         (PlatformCALayerCocoa::setContentsHidden):
1475         * rendering/RenderLayerBacking.cpp:
1476         (WebCore::RenderLayerBacking::updateAfterDescendants):
1477
1478 2016-05-09  Myles C. Maxfield  <mmaxfield@apple.com>
1479
1480         Web Font is downloaded even when all the characters in the document are outside its unicode-range
1481         https://bugs.webkit.org/show_bug.cgi?id=42154
1482         <rdar://problem/17779042>
1483
1484         Reviewed by Darin Adler.
1485
1486         Fonts are requested in two stages:
1487         - For a given font family, all the relevant @font-face rules are consulted. We build up a
1488         mapping of unicode-range -> Font object. This result is cached.
1489         - Then, when we have the mapping, we look up the character we are trying to render to
1490         find the appropriate Font object.
1491
1492         However, we are not supposed to create any Font objects (because that causes a download to
1493         be triggered) until we consult with the character we're trying to render. Therefore, this
1494         patch swaps out the Font objects with a FontAccessor. This FontAccessor is essentially a
1495         lazily-created Font. When step 2 starts looking up the appropriate character, the
1496         FontAccessor will be asked to start the download.
1497
1498         Test: fast/text/unicode-range-download.html
1499
1500         * css/CSSFontFace.cpp:
1501         (WebCore::CSSFontFace::removeClient): 
1502         as a client from all its CSSFontFaces.
1503         * css/CSSFontFaceSet.cpp:
1504         (WebCore::CSSFontFaceSet::clear): Clearing the CSSFontFaceSet needs to remove itself as a
1505         client from all its CSSFontFaces.
1506         * css/CSSSegmentedFontFace.cpp:
1507         (WebCore::CSSFontAccessor::create): The lazy Font object.
1508         (WebCore::CSSFontAccessor::CSSFontAccessor): Ditto.
1509         (WebCore::appendFontWithInvalidUnicodeRangeIfLoading): Appends a FontAccessor.
1510         (WebCore::CSSSegmentedFontFace::fontRanges): Create the FontAccessor and use it instead.
1511         * platform/graphics/FontCascadeFonts.cpp:
1512         (WebCore::FontCascadeFonts::determinePitch): Use the fontForFirstRange() convenience
1513         function.
1514         (WebCore::glyphPageFromFontRanges): font() may now return nullptr. Update this function to
1515         handle that.
1516         * platform/graphics/FontRanges.cpp:
1517         (WebCore::FontRanges::Range::font): Trigger the lazy initialization.
1518         (WebCore::TrivialFontAccessor::create): Used in the case where there is only one font in
1519         the Ranges object and it has a full unicode-range.
1520         (WebCore::TrivialFontAccessor::TrivialFontAccessor):
1521         (WebCore::FontRanges::FontRanges): Use TrivialFontAccessor.
1522         (WebCore::FontRanges::glyphDataForCharacter): font() may now return nullptr. Update this
1523         function to handle that. This is where the magic happens: this is where we trigger
1524         downloads only if the character falls within the unicode-range.
1525         (WebCore::FontRanges::fontForFirstRange): Add ASSERT.
1526         (WebCore::FontRanges::isLoading): Update to use the new FontAccessor.
1527         * platform/graphics/FontRanges.h: Ditto.
1528         (WebCore::FontRanges::Range::Range):
1529         (WebCore::FontRanges::Range::fontAccessor):
1530         (WebCore::FontRanges::appendRange):
1531         (WebCore::FontRanges::Range::font): Deleted.
1532         * platform/graphics/FontSelector.h: The virtual base class of FontAccessor. This is
1533         necessary because it must be shared between platform code and non-platform code.
1534         (WebCore::FontAccessor::~FontAccessor):
1535
1536 2016-05-09  Brady Eidson  <beidson@apple.com>
1537
1538         Modern IDB: Prevent the same transaction from being commited/aborted twice.
1539         https://bugs.webkit.org/show_bug.cgi?id=157494
1540
1541         Reviewed by Tim Horton.
1542
1543         When a page navigates or a worker terminates, in rare cases with specific unfortunate timing, the IDBServer
1544         might receive a request to commit/abort a transaction that is already in the process of committing/aborting.
1545         
1546         By moving transactions that are finishing into their own map we can at least detect this situation and
1547         return an error. This seems like an improvement over some mysterious ASSERTs/timeouts.
1548
1549         No new tests:
1550         While apparent that this is at least partially to blame for some existing timeouts/ASSERTs, I could not nail 
1551         down a reliable way to reproduce this with a dedicated test.
1552         
1553         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1554         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase):
1555         (WebCore::IDBServer::UniqueIDBDatabase::performCurrentDeleteOperation):
1556         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
1557         (WebCore::IDBServer::UniqueIDBDatabase::prepareToFinishTransaction):
1558         (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
1559         (WebCore::IDBServer::UniqueIDBDatabase::didPerformCommitTransaction):
1560         (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
1561         (WebCore::IDBServer::UniqueIDBDatabase::didPerformAbortTransaction):
1562         (WebCore::IDBServer::UniqueIDBDatabase::hasUnfinishedTransactions):
1563         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
1564         (WebCore::IDBServer::UniqueIDBDatabase::takeNextRunnableTransaction):
1565         (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted): Renamed from inProgressTransactionCompleted.
1566         (WebCore::IDBServer::UniqueIDBDatabase::inProgressTransactionCompleted): Deleted.
1567         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1568
1569 2016-05-09  Tim Horton  <timothy_horton@apple.com>
1570
1571         Draw border and correct icon for placeholder attachments
1572         https://bugs.webkit.org/show_bug.cgi?id=157495
1573         rdar://problem/19982510
1574
1575         Reviewed by Anders Carlsson.
1576
1577         * Resources/AttachmentPlaceholder.png: Added.
1578         * Resources/AttachmentPlaceholder@2x.png: Added.
1579         * WebCore.xcodeproj/project.pbxproj:
1580         * rendering/RenderThemeMac.mm:
1581         (WebCore::attachmentPlaceholderBorderColor):
1582         (WebCore::paintAttachmentIconPlaceholder):
1583         (WebCore::paintAttachmentProgress):
1584         (WebCore::paintAttachmentPlaceholderBorder):
1585         (WebCore::RenderThemeMac::paintAttachment):
1586         If progress is set, but set to 0, draw a dashed border around the attachment
1587         and use the placeholder "download" artwork.
1588
1589 2016-05-09  Ada Chan  <adachan@apple.com>
1590
1591         Introduce WebVideoFullscreenInterfaceMac::isPlayingVideoInEnhancedFullscreen() and use it in WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen()
1592         https://bugs.webkit.org/show_bug.cgi?id=157493
1593
1594         Reviewed by Dan Bernstein.
1595
1596         * platform/mac/WebVideoFullscreenInterfaceMac.h:
1597         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1598         (WebCore::WebVideoFullscreenInterfaceMac::isPlayingVideoInEnhancedFullscreen):
1599
1600 2016-05-09  Simon Fraser  <simon.fraser@apple.com>
1601
1602         Clean up iOS text autosizing code
1603         https://bugs.webkit.org/show_bug.cgi?id=157489
1604
1605         Reviewed by Zalan Bujtas.
1606
1607         Change the TraverseNextInclusionFunction and HeightTypeTraverseNextInclusionFunction
1608         to take references.
1609         
1610         Use downcast<> more.
1611         
1612         Whitespace cleanup.
1613
1614         * rendering/RenderBlockFlow.cpp:
1615         (WebCore::isNonBlocksOrNonFixedHeightListItems):
1616         * rendering/RenderElement.cpp:
1617         (WebCore::includeNonFixedHeight):
1618         * rendering/RenderObject.cpp:
1619         (WebCore::RenderObject::traverseNext):
1620         * rendering/RenderObject.h:
1621         * rendering/TextAutoSizing.cpp:
1622         (WebCore::TextAutoSizingValue::adjustNodeSizes):
1623         (WebCore::TextAutoSizingValue::reset):
1624
1625 2016-05-09  Anders Carlsson  <andersca@apple.com>
1626
1627         Add injected bundle SPI for getting favicon and touch icon URLs
1628         https://bugs.webkit.org/show_bug.cgi?id=157435
1629
1630         Reviewed by Darin Adler.
1631
1632         * CMakeLists.txt:
1633         Add new files.
1634
1635         * WebCore.xcodeproj/project.pbxproj:
1636         Add new files.
1637
1638         * html/HTMLLinkElement.cpp:
1639         (WebCore::HTMLLinkElement::iconType):
1640         * html/HTMLLinkElement.h:
1641         Rename LinkRelAttribute::IconType to LinkIconType.
1642
1643         * html/LinkIconCollector.cpp: Added.
1644         (WebCore::iconSize):
1645         New helper function that returns the icon size for an icon.
1646
1647         (WebCore::compareIcons):
1648         Icon comparison function, to be used by for sorting.
1649
1650         (LinkIconCollector::iconsOfTypes):
1651         Gather the right icons, sort them (descending by size) and return them.
1652
1653         * html/LinkIconCollector.h:
1654         Added.
1655
1656         * html/LinkIconType.h:
1657         Move icon type declarations here and arrange them so we can use them in an OptionSet.
1658
1659         * html/LinkRelAttribute.cpp:
1660         (WebCore::LinkRelAttribute::LinkRelAttribute):
1661         * html/LinkRelAttribute.h:
1662         * loader/icon/IconController.cpp:
1663         (WebCore::iconFromLinkElements):
1664         Rename IconType to LinkIconType.
1665
1666 2016-05-06  Simon Fraser  <simon.fraser@apple.com>
1667
1668         [iOS WK2] Font size increases on some pages after navigating then going back
1669         https://bugs.webkit.org/show_bug.cgi?id=157441
1670         rdar://problem/22873240
1671
1672         Reviewed by Darin Adler.
1673
1674         Sometimes I want to dump ViewportConfigurations from WebKit2 so export dump().
1675
1676         Test: fast/text-autosizing/ios/text-autosizing-after-back.html
1677
1678         * page/ViewportConfiguration.h:
1679
1680 2016-05-09  Eric Carlson  <eric.carlson@apple.com>
1681
1682         "Main content" restrictions should not apply to media documents
1683         https://bugs.webkit.org/show_bug.cgi?id=157479
1684         <rdar://problem/25840861>
1685
1686         Reviewed by Jer Noble.
1687
1688         No new tests, this change only applies to media documents in a top level document so it
1689         isn't possible to have a layout test.
1690
1691         * html/HTMLMediaElement.cpp:
1692         (WebCore::HTMLMediaElement::HTMLMediaElement): Don't apply restrictions to a media document.
1693
1694 2016-05-09  Dean Jackson  <dino@apple.com>
1695
1696         Update Picture-in-picture artwork
1697         https://bugs.webkit.org/show_bug.cgi?id=157484
1698         <rdar://problem/26177784>
1699
1700         Reviewed by Eric Carlson.
1701
1702         We have new artwork for the picture-in-picture presentation mode. I
1703         also converted it to use SVG (and moved the button style to a
1704         more consistent part of the file).
1705
1706         * Modules/mediacontrols/mediaControlsApple.css:
1707         (video::-webkit-media-controls-panel .picture-in-picture-button):
1708         (video::-webkit-media-controls-panel .picture-in-picture-button.return-from-picture-in-picture):
1709         (video::-webkit-media-controls-panel .picture-in-picture-button:active):
1710         (video::-webkit-media-controls-panel .picture-in-picture-button.return-from-picture-in-picture:active):
1711
1712 2016-05-09  Chris Dumez  <cdumez@apple.com>
1713
1714         Optimize [StrictTypeChecking] on IDL operations
1715         https://bugs.webkit.org/show_bug.cgi?id=157467
1716
1717         Reviewed by Darin Adler.
1718
1719         Optimize [StrictTypeChecking] on IDL operations so that:
1720         - Only generate extra code for nullable parameters because for non-nullable
1721           parameters, JSXXX::toWrapped() will return null in case of a bad input
1722           type. We will then throw a TypeError when null-checking it already.
1723         - After the JSValue::isNullOrUndefined() check, avoid calling
1724           JSXXX::toWrapped() and set nativeValue to nullptr directly.
1725         - Drop the check for JSValue::inherits(JSXXX::info()) and just do a null
1726           check on the value returned by JSXXX::toWrapped(). toWrapped() already
1727           does a JSValue::inherits(JSXXX::info() check. Since we only call
1728           toWrapped() if the JSValue is not null/undefined, a null return value
1729           always indicates a bad input type.
1730
1731         Also update the TypeError message to be more useful when passing null
1732         for non-nullable parameters or assigning null to a non-nullable
1733         attribute. The message is now consistent with the one used for strict
1734         type checking.
1735
1736         No new tests, rebaselined existing tests.
1737
1738         * bindings/js/JSDOMBinding.h:
1739         * bindings/scripts/CodeGeneratorJS.pm:
1740         (GenerateImplementation):
1741         (GenerateParametersCheck):
1742         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1743         (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunction):
1744         * bindings/scripts/test/JS/JSTestInterface.cpp:
1745         (WebCore::setJSTestInterfaceImplementsNode):
1746         (WebCore::setJSTestInterfaceSupplementalNode):
1747         (WebCore::jsTestInterfacePrototypeFunctionImplementsMethod2):
1748         (WebCore::jsTestInterfacePrototypeFunctionSupplementalMethod2):
1749         * bindings/scripts/test/JS/JSTestObj.cpp:
1750         (WebCore::setJSTestObjTestObjAttr):
1751         (WebCore::setJSTestObjLenientTestObjAttr):
1752         (WebCore::setJSTestObjXMLObjAttr):
1753         (WebCore::setJSTestObjTypedArrayAttr):
1754         (WebCore::setJSTestObjWithScriptExecutionContextAttribute):
1755         (WebCore::setJSTestObjWithScriptStateAttributeRaises):
1756         (WebCore::setJSTestObjWithScriptExecutionContextAttributeRaises):
1757         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute):
1758         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeRaises):
1759         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute):
1760         (WebCore::setJSTestObjWithScriptArgumentsAndCallStackAttribute):
1761         (WebCore::jsTestObjPrototypeFunctionVoidMethodWithArgs):
1762         (WebCore::jsTestObjPrototypeFunctionByteMethodWithArgs):
1763         (WebCore::jsTestObjPrototypeFunctionOctetMethodWithArgs):
1764         (WebCore::jsTestObjPrototypeFunctionLongMethodWithArgs):
1765         (WebCore::jsTestObjPrototypeFunctionObjMethodWithArgs):
1766         (WebCore::jsTestObjPrototypeFunctionMethodWithXPathNSResolverParameter):
1767         (WebCore::jsTestObjPrototypeFunctionMethodThatRequiresAllArgsAndThrows):
1768         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
1769         (WebCore::jsTestObjPrototypeFunctionDomStringListFunction):
1770         (WebCore::jsTestObjPrototypeFunctionConvert1):
1771         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithSequence):
1772         (WebCore::jsTestObjPrototypeFunctionStrictFunctionWithArray):
1773         (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
1774         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
1775         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1776         (WebCore::constructJSTestOverloadedConstructors1):
1777         (WebCore::constructJSTestOverloadedConstructors2):
1778         (WebCore::constructJSTestOverloadedConstructors3):
1779         * bindings/scripts/test/TestObj.idl:
1780
1781 2016-05-09  Tim Horton  <timothy_horton@apple.com>
1782
1783         Download progress on attachment elements sometimes exceeds element bounds
1784         https://bugs.webkit.org/show_bug.cgi?id=157440
1785         <rdar://problem/25245440>
1786
1787         Reviewed by Darin Adler.
1788
1789         In the case of very large dynamic type sizes, we can overflow the
1790         bounds of the attachment. It turns out that we used to limit to one
1791         line in many cases anyway, so only wrap if we have only a title and/or icon.
1792         This looks better when you have many of the other elements even in
1793         non-large-type modes.
1794
1795         * rendering/RenderThemeIOS.mm:
1796         (WebCore::AttachmentInfo::buildTitleLines):
1797         (WebCore::AttachmentInfo::AttachmentInfo):
1798         Limit the title to a single line if we have anything
1799         other than a title and icon.
1800
1801         (WebCore::attachmentBorderPath):
1802         (WebCore::paintAttachmentBorder):
1803         (WebCore::RenderThemeIOS::paintAttachment):
1804         Clip to the border, so that even if somehow we paint outside of
1805         the bounds, we don't paint over other parts of the page.
1806
1807 2016-05-09  Ryosuke Niwa  <rniwa@webkit.org>
1808
1809         REGRESSION (198056): Unable to use edit buttons on WordPress
1810         https://bugs.webkit.org/show_bug.cgi?id=157475
1811
1812         Reviewed by Antti Koivisto.
1813
1814         Renamed Event.prototype.deepPath() to composedPath() per discussions on
1815         https://github.com/whatwg/dom/issues/242 as the old name was not Web compatible.
1816
1817         Test: fast/shadow-dom/Extensions-to-Event-Interface.html
1818
1819         * dom/Event.cpp:
1820         (WebCore::Event::composedPath): Renamed from deepPath.
1821         * dom/Event.h:
1822         * dom/Event.idl:
1823
1824 2016-05-09  Alex Christensen  <achristensen@webkit.org>
1825
1826         Don't use DiskCache for media resource loads
1827         https://bugs.webkit.org/show_bug.cgi?id=157405
1828
1829         Reviewed by Darin Adler.
1830
1831         http/tests/security/video-cross-origin-caching.html was loading from the disk cache.
1832         This patch adds an assertion that fires in that test without this fix.
1833
1834         * loader/MediaResourceLoader.cpp:
1835         (WebCore::MediaResourceLoader::requestResource):
1836         * platform/graphics/PlatformMediaResourceLoader.h:
1837         * platform/network/ResourceRequestBase.h:
1838         (WebCore::ResourceRequestBase::hiddenFromInspector):
1839         (WebCore::ResourceRequestBase::setHiddenFromInspector):
1840         (WebCore::ResourceRequestBase::requester):
1841         (WebCore::ResourceRequestBase::setRequester):
1842         * platform/network/cocoa/WebCoreNSURLSession.mm:
1843         (-[WebCoreNSURLSessionDataTask _restart]):
1844         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
1845
1846 2016-05-09  Ryosuke Niwa  <rniwa@webkit.org>
1847
1848         Refactor FocusController::findFocusableElementRecursively
1849         https://bugs.webkit.org/show_bug.cgi?id=157415
1850
1851         Reviewed by Darin Adler.
1852
1853         Refactor FocusController::findFocusableElementRecursively and related functions. Extracted two functions:
1854         nextFocusableElementWithinScope and previousFocusableElementWithinScope out of it since they didn't really share
1855         any code other than calling findFocusableElement at the beginning.
1856
1857         Also renamed internal variant of nextFocusableElement and previousFocusableElement to nextFocusableElementOrScopeOwner
1858         and previousFocusableElementOrScopeOwner. It was confusing to have these internal functions in addition to public
1859         member functions that are used in Objective-C DOM API.
1860
1861         No new tests are added since there should be no behavioral change.
1862
1863         * page/FocusController.cpp:
1864         (WebCore::FocusController::findFocusableElementDescendingDownIntoFrameDocument): Added a FIXME.
1865         (WebCore::FocusController::advanceFocusInDocumentOrder): Use findFocusableElementAcrossFocusScope instead of manually
1866         calling findFocusableElementRecursively and findFocusableElementDescendingDownIntoFrameDocument separately.
1867         (WebCore::FocusController::findFocusableElementAcrossFocusScope): Now that findFocusableElementWithinScope calls
1868         findFocusableElementDescendingDownIntoFrameDocument internally, there is no need to keep around "found" local variable.
1869         Introduce a few early exists for a better clarity.
1870         (WebCore::FocusController::findFocusableElementWithinScope): Renamed from findFocusableElementRecursively. Also call
1871         findFocusableElementDescendingDownIntoFrameDocument here instead of findFocusableElementAcrossFocusScope.
1872         (WebCore::FocusController::nextFocusableElementWithinScope): Extracted from findFocusableElementRecursively.
1873         (WebCore::FocusController::previousFocusableElementWithinScope): Ditto.
1874         (WebCore::FocusController::findFocusableElement):
1875         (WebCore::FocusController::nextFocusableElement): Added a FIXME.
1876         (WebCore::FocusController::previousFocusableElement): Ditto.
1877         (WebCore::FocusController::findFocusableElementOrScopeOwner): Renamed from findFocusableElement for clarity.
1878         (WebCore::FocusController::nextFocusableElementOrScopeOwner): Ditto from nextFocusableElement.
1879         (WebCore::FocusController::previousFocusableElementOrScopeOwner): Ditto from nextFocusableElement.
1880         * page/FocusController.h:
1881
1882 2016-05-09  Manuel Rego Casasnovas  <rego@igalia.com>
1883
1884         [css-grid] Fix static position for positioned grid items
1885         https://bugs.webkit.org/show_bug.cgi?id=157417
1886
1887         Reviewed by Darin Adler.
1888
1889         The spec was updated to define properly the static position
1890         for positioned grid items, but we didn't update the implementation yet:
1891         https://drafts.csswg.org/css-grid-1/issues-wd-20150108#issue-1
1892
1893         We were only setting the static position when the start line
1894         was not auto. Otherwise we were using the default one
1895         which includes the padding.
1896         With the spec change we need to set it always,
1897         even if the start line is auto.
1898
1899         * rendering/RenderGrid.cpp:
1900         (WebCore::RenderGrid::layoutPositionedObject):
1901         (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
1902
1903 2016-05-08  Frederic Wang  <fwang@igalia.com>
1904
1905         RenderMathMLOperator: refactor management of stretchy data and italic correction
1906         https://bugs.webkit.org/show_bug.cgi?id=156913
1907
1908         Reviewed by Darin Adler.
1909
1910         No new tests, behavior is not changed.
1911
1912         The stretchy data uses a shared space to describe horizontal / vertical directions and
1913         unstretched / size variant / glyph assembly. We use a simple struct with some unions to
1914         represent it instead of the current implementation with a class.
1915         We also modify the signature of some functions to retrieve display operator and stretchy
1916         data to use that new structure and prepare the move to a separate MathOperator class.
1917         Finally, we introduce some helper functions to easily set the stretchy data.
1918
1919         * rendering/mathml/RenderMathMLOperator.cpp:
1920         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Use the new data members and
1921         function signatures.
1922         (WebCore::RenderMathMLOperator::setSizeVariant): New helper function to set a size variant.
1923         (WebCore::RenderMathMLOperator::setGlyphAssembly): New helper function to set a glyph
1924         assembly.
1925         (WebCore::RenderMathMLOperator::getGlyphAssemblyFallBack): We change the signature to use a
1926         GlyphAssemblyData.
1927         (WebCore::RenderMathMLOperator::findDisplayStyleLargeOperator): We rename the function and
1928         change its signature to remove the return value. We now also set the italic correction when
1929         a display operator is found.
1930         (WebCore::RenderMathMLOperator::findStretchyData): We change the signature to introduce a
1931         target size and remove the return value. This also does the early return when the base glyph
1932         is large enough.
1933         (WebCore::RenderMathMLOperator::updateStyle): We use the new data members and function
1934         signatures. The check for the base glyph size is now done in findStretchyData, so we just
1935         check whether m_stretchType is Unstretched to do an early return.
1936         (WebCore::RenderMathMLOperator::firstLineBaseline): We use m_stretchType.
1937         (WebCore::RenderMathMLOperator::computeLogicalHeight): Ditto.
1938         (WebCore::RenderMathMLOperator::fillWithVerticalExtensionGlyph): Use the new class members.
1939         (WebCore::RenderMathMLOperator::fillWithHorizontalExtensionGlyph): Ditto.
1940         (WebCore::RenderMathMLOperator::paint): Ditto.
1941         (WebCore::RenderMathMLOperator::paintVerticalGlyphAssembly): Ditto.
1942         (WebCore::RenderMathMLOperator::paintHorizontalGlyphAssembly): Ditto.
1943         (WebCore::RenderMathMLOperator::paintChildren): Ditto.
1944         (WebCore::RenderMathMLOperator::trailingSpaceError): Ditto.
1945         (WebCore::RenderMathMLOperator::italicCorrection): Moved to RenderMathMLOperator.h.
1946         (WebCore::RenderMathMLOperator::getDisplayStyleLargeOperator): Deleted.
1947         * rendering/mathml/RenderMathMLOperator.h:
1948         (WebCore::RenderMathMLOperator::italicCorrection): We just return m_italicCorrection.
1949         (WebCore::RenderMathMLOperator::GlyphAssemblyData::GlyphAssemblyData): New class to store an
1950         assembly of GlyphData.
1951         (WebCore::RenderMathMLOperator::StretchyData::mode): Deleted.
1952         (WebCore::RenderMathMLOperator::StretchyData::variant): Deleted.
1953         (WebCore::RenderMathMLOperator::StretchyData::top): Deleted.
1954         (WebCore::RenderMathMLOperator::StretchyData::extension): Deleted.
1955         (WebCore::RenderMathMLOperator::StretchyData::bottom): Deleted.
1956         (WebCore::RenderMathMLOperator::StretchyData::middle): Deleted.
1957         (WebCore::RenderMathMLOperator::StretchyData::left): Deleted.
1958         (WebCore::RenderMathMLOperator::StretchyData::right): Deleted.
1959         (WebCore::RenderMathMLOperator::StretchyData::setNormalMode): Deleted.
1960         (WebCore::RenderMathMLOperator::StretchyData::setSizeVariantMode): Deleted.
1961         (WebCore::RenderMathMLOperator::StretchyData::setGlyphAssemblyMode): Deleted.
1962         (WebCore::RenderMathMLOperator::StretchyData::StretchyData): Deleted.
1963
1964 2016-05-08  Zalan Bujtas  <zalan@apple.com>
1965
1966         iOS selection: Use inflow containing block for positioned <br>.
1967         https://bugs.webkit.org/show_bug.cgi?id=157115
1968         <rdar://problem/25969295>
1969
1970         Reviewed by Ryosuke Niwa.
1971
1972         Similarly to RenderText, we should just use the inflow containing block for
1973         selected <br> even when it is positioned out of flow. This visually matches Mac OS X
1974         behaviour (selection painting does not get extended to the positioned <br>).
1975
1976         Test: fast/text/fixed-positioned-br-crash.html
1977
1978         * rendering/RenderLineBreak.cpp:
1979         (WebCore::RenderLineBreak::collectSelectionRects):
1980
1981 2016-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
1982
1983         [iOS] Build fix after r200563
1984
1985         Unreviewed.
1986
1987         * editing/cocoa/HTMLConverter.mm:
1988         (_font):
1989
1990 2016-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
1991
1992         [OS X] Migrate our Font classes entirely off of NSFont
1993         https://bugs.webkit.org/show_bug.cgi?id=157464
1994
1995         Reviewed by Darin Adler.
1996
1997         Because NSFont and CTFont are toll-free-bridged, we don't need NSFont at all anywhere.
1998
1999         No new tests because there is no behavior change.
2000
2001         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2002         (accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):
2003         (textMarkerRangeFromRange):
2004         (visiblePositionForStartOfTextMarkerRange):
2005         (visiblePositionForEndOfTextMarkerRange):
2006         (AXAttributedStringRangeIsValid):
2007         (AXAttributeStringSetFont):
2008         (CreateCGColorIfDifferent):
2009         (AXAttributeStringSetStyle):
2010         (textMarkerRangeFromVisiblePositions):
2011         * bindings/objc/DOM.mm:
2012         (-[DOMElement _font]):
2013         * bindings/objc/DOMPrivate.h:
2014         * editing/cocoa/HTMLConverter.mm:
2015         (_font):
2016         (WebCore::editingAttributedStringFromRange):
2017         * editing/mac/EditorMac.mm:
2018         (WebCore::Editor::fontAttributesForSelectionStart):
2019         * platform/graphics/Font.h:
2020         (WebCore::Font::getCTFont):
2021         (WebCore::Font::getNSFont): Deleted.
2022         * platform/graphics/FontPlatformData.h:
2023         (WebCore::FontPlatformData::nsFont): Deleted.
2024         * platform/graphics/cocoa/FontCocoa.mm:
2025         (WebCore::Font::determinePitch):
2026         (WebCore::advanceForColorBitmapFont):
2027         (WebCore::Font::platformWidthForGlyph):
2028         (WebCore::renderingStyle): Deleted.
2029         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
2030
2031 2016-05-08  Chris Dumez  <cdumez@apple.com>
2032
2033         [Bindings] Simplify [RequiresExistingAtomicString] IDL extended attribute handling
2034         https://bugs.webkit.org/show_bug.cgi?id=157465
2035
2036         Reviewed by Darin Adler.
2037
2038         Simplify [RequiresExistingAtomicString] IDL extended attribute handling
2039         in the bindings generator.
2040
2041         * bindings/scripts/CodeGeneratorJS.pm:
2042         (GenerateParametersCheck):
2043         Drop code specific to [RequiresExistingAtomicString].
2044
2045         (JSValueToNative):
2046         Deal with [RequiresExistingAtomicString] IDL extended attribute,
2047         similarly to [AtomicString] and [TreatNullAs].
2048
2049         * bindings/scripts/test/JS/JSTestObj.cpp:
2050         * bindings/scripts/test/TestObj.idl:
2051         Add bindings test coverage.
2052
2053         * dom/DocumentFragment.cpp:
2054         (WebCore::DocumentFragment::getElementById):
2055         * svg/SVGSVGElement.cpp:
2056         (WebCore::SVGSVGElement::getElementById):
2057         Add null check for the id parameter. The generated bindings used to do
2058         this null check for us but it is no longer the case (to make the bindings
2059         generator a bit simpler). This extended attribute is not commonly used
2060         and is meant as a micro-optimization for getElementById().
2061
2062 2016-05-08  David Kilzer  <ddkilzer@apple.com>
2063
2064         Roll out: ThreadSanitizer: Data race and thread leak in WebCore::ScrollingThread::createThreadIfNeeded
2065         <https://webkit.org/b/157462>
2066
2067         This reverts commit r200554.
2068
2069         This doesn't fix the data race, and the thread leak is a
2070         separate issue.
2071
2072         * page/scrolling/ScrollingThread.cpp:
2073         (WebCore::ScrollingThread::createThreadIfNeeded): Roll out the
2074         change.
2075
2076 2016-05-08  Darin Adler  <darin@apple.com>
2077
2078         Follow-up to that last patch (missed review comments).
2079
2080         * page/EventSource.cpp:
2081         (WebCore::EventSource::parseEventStream): Pre-increment, not post-increment.
2082         (WebCore::EventSource::dispatchMessageEvent): More elegant form without explicit StringView.
2083
2084 2016-05-08  Darin Adler  <darin@apple.com>
2085
2086         Change EventSource constructor to take an IDL dictionary instead of a WebCore::Dictionary
2087         https://bugs.webkit.org/show_bug.cgi?id=157459
2088
2089         Reviewed by Chris Dumez.
2090
2091         Patch also includes some updating of EventSource class to modern idioms.
2092
2093         * page/EventSource.cpp:
2094         (WebCore::EventSource::EventSource): Initialize based on Init.
2095         (WebCore::EventSource::create): Take/pass Init instead of Dictionary.
2096
2097         * bindings/js/SerializedScriptValue.cpp:
2098         (WebCore::CloneSerializer::serialize): Take a StringView instead of a string
2099         so callers don't have to allocate a String just to use this.
2100         (WebCore::SerializedScriptValue::create): Ditto.
2101         * bindings/js/SerializedScriptValue.h: Ditto.
2102
2103         * page/EventSource.cpp: Changed defaultReconnectDelay to be a uint64_t
2104         instead of an unsigned long long.
2105         (WebCore::EventSource::EventSource): Changed constructor to take a struct
2106         instead of a Dictionary for eventSourceInit. Also moved initialization of
2107         data members to the header and used ASCIILiteral.
2108         (WebCore::EventSource::create): Changed type to Init and streamlined code
2109         a little bit using auto.
2110         (WebCore::EventSource::connect): Used a reference instead of a pointer.
2111         Also added a FIXME since I noticed that m_requestInFlight is probably not
2112         needed, since it's basically the same thing as "is m_loader null".
2113         (WebCore::EventSource::url): Moved to the header and made it inline.
2114         (WebCore::EventSource::networkRequestEnded): Removed unneeded check that
2115         is already done by all callers and turned it into an assertion.
2116         (WebCore::EventSource::withCredentials): Ditto.
2117         (WebCore::EventSource::readyState): Ditto.
2118         (WebCore::EventSource::responseIsValid): Added. Helper function to make
2119         the logic in didReceiveResponse easier to read. Fixed logic to compare
2120         MIME type ignoring ASCII case, since that's how MIME types work.
2121         (WebCore::EventSource::didReceiveResponse): Use the helper above, and also
2122         move the m_eventStreamOrigin set up code into the valid response case,
2123         since there is no point doing it if the response is not valid. Also use
2124         the early return idiom.
2125         (WebCore::EventSource::didReceiveData): Removed the unneeded explicit
2126         conversion to StringView here. Also removed a FIXME that I fixed.
2127         (WebCore::EventSource::didFinishLoading): Added code to flush the decoder
2128         as mentioned in didReceiveData. Added FIXME about peculiar clearing code
2129         that exists only here. Removed check for empty receive buffer and data
2130         that is not needed since parseEventStream does sufficient checking.
2131         (WebCore::EventSource::didFail): Added FIXME because of things that
2132         didFinishLoading does that seem equally valuable here.
2133         (WebCore::EventSource::parseEventStream): Tweaked types and names of local
2134         variables, and changed to use Optional instead of magic number -1. Also
2135         added a FIXME about how the buffer type is probably not right since we
2136         keep moving the characters in the buffer as we consume the start of it.
2137         (WebCore::EventSource::parseEventStreamLine): Refactor and reorganize so
2138         this doesn't do so much string allocation and is easier to read
2139         (WebCore::EventSource::canSuspendForDocumentSuspension): Tweaked comment.
2140         (WebCore::EventSource::dispatchMessageEvent): Renamed this from
2141         createMessageEvent, and moved more code in here. We now don't have to
2142         allocate a temporary string just to pass it to SerializedScriptValue.
2143
2144         * page/EventSource.h: Updated for changes above. Use pragma once.
2145         Define and use EventSource::Init struct. Other small cleanup.
2146
2147         * page/EventSource.idl: Define EventSourceInit dictionary and use it.
2148         Other small cleanup.
2149
2150 2016-05-07  Darin Adler  <darin@apple.com>
2151
2152         Change HTMLSlotElement::assignedNodes to take a IDL dictionary instead of a WebCore::Dictionary
2153         https://bugs.webkit.org/show_bug.cgi?id=157457
2154
2155         Reviewed by Chris Dumez.
2156
2157         * html/HTMLSlotElement.cpp:
2158         (WebCore::HTMLSlotElement::removedFrom): Fixed typo in comment.
2159         (WebCore::HTMLSlotElement::assignedNodes): Renamed assignedNodesForBindings back to this
2160         and changed the argument type to Optional<AssignedNodesOptions> instead of Dictionary.
2161         Also streamlined the logic a bit.
2162         (WebCore::HTMLSlotElement::enqueueSlotChangeEvent): Changed to use a pointer to the
2163         enqueued event instead of a boolean. With only a boolean, we could end up clearing the
2164         flag in cases where we don't really want to.
2165         (WebCore::HTMLSlotElement::dispatchEvent): Ditto.
2166         (WebCore::HTMLSlotElement::assignedNodesForBindings): Deleted.
2167         * html/HTMLSlotElement.h: Use pragma once. Added AssignedNodeOptions. Changed for the
2168         above, including changing the data member.
2169         * html/HTMLSlotElement.idl: Removed use of ImplementedAs. Fixed the type of the options
2170         dictionary.
2171
2172 2016-05-08  Chris Dumez  <cdumez@apple.com>
2173
2174         [Bindings] Add convert<>() template specializations for integer types
2175         https://bugs.webkit.org/show_bug.cgi?id=157458
2176
2177         Reviewed by Darin Adler.
2178
2179         Add convert<>() template specializations for integer types and use them
2180         in the JS bindings. Also, treat non-32bit types the same way as the
2181         32bit ones, allowing the compiler to optimize out branching based on
2182         the IntegerConversionConfiguration.
2183
2184         * bindings/js/JSCryptoAlgorithmDictionary.cpp:
2185
2186         * bindings/js/JSDOMBinding.cpp:
2187         (WebCore::enforceRange):
2188         (WebCore::toSmallerInt):
2189         (WebCore::toSmallerUInt):
2190         (WebCore::toInt8EnforceRange):
2191         (WebCore::toUInt8EnforceRange):
2192         (WebCore::toInt8Clamp):
2193         (WebCore::toUInt8Clamp):
2194         (WebCore::toInt8):
2195         (WebCore::toUInt8):
2196         (WebCore::toInt16EnforceRange):
2197         (WebCore::toUInt16EnforceRange):
2198         (WebCore::toInt16Clamp):
2199         (WebCore::toUInt16Clamp):
2200         (WebCore::toInt16):
2201         (WebCore::toUInt16):
2202         (WebCore::toInt32EnforceRange):
2203         (WebCore::toInt32Clamp):
2204         (WebCore::toUInt32Clamp):
2205         (WebCore::toUInt32EnforceRange):
2206         (WebCore::toInt64EnforceRange):
2207         (WebCore::toUInt64EnforceRange):
2208         (WebCore::toInt64Clamp):
2209         (WebCore::toUInt64Clamp):
2210         (WebCore::toInt64):
2211         (WebCore::toUInt64):
2212         * bindings/js/JSDOMBinding.h:
2213         - Splt some integer conversion functions into 3 Normal / Clamp /
2214           Enforce versions, similarly to what was done for 32bit types already.
2215           This is so that these can be called from the inline functions in
2216           JSDOMConvert.h, allowing the compiler to optimize out the branches.
2217         - Get rid of some unnecessary state.hadException() checks.
2218
2219         * bindings/js/JSDOMConvert.h:
2220         Add convert<> specializations for integer types.
2221
2222         * bindings/js/JSNodeFilterCustom.cpp:
2223         (WebCore::JSNodeFilter::acceptNode):
2224
2225         * bindings/scripts/CodeGenerator.pm:
2226         - Add utility function to distinguish integer types.
2227         - Have IsNumericType() using the integerType / floatingPointType
2228           hashes to avoid duplication.
2229         - Stop int / unsigned int from integer types as those are not
2230           in Web IDL and they are not used.
2231
2232         * bindings/scripts/CodeGeneratorJS.pm:
2233         (GetIntegerConversionType):
2234         (JSValueToNative):
2235         Use convert<>() for converting JSValue to integer types.
2236
2237         * bindings/scripts/IDLParser.pm:
2238         Stop allowing int / unsigned int types as those are not in Web IDL.
2239
2240         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2241         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
2242         * bindings/scripts/test/JS/JSTestObj.cpp:
2243         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2244         Rebaseline bindings tests.
2245
2246 2016-05-08  Darin Adler  <darin@apple.com>
2247
2248         Correct dictionary bindings handling of optional, null, and undefined
2249         https://bugs.webkit.org/show_bug.cgi?id=157463
2250
2251         Reviewed by Chris Dumez.
2252
2253         * bindings/js/JSDOMBinding.cpp:
2254         (WebCore::propertyValue): Deleted.
2255         * bindings/js/JSDOMBinding.h: Deleted propertyValue, not all that helpful for now.
2256
2257         * bindings/scripts/CodeGeneratorJS.pm:
2258         (GenerateDictionaryImplementationContent): Added a new early exit for convert to
2259         a dictionary type when the value is undefined or null and all members are either
2260         optional or have a default value. This returns the default values for everything
2261         without raising an exception. Added checking that requires that the dictionary
2262         argument is an object and not a regular expression, since that's also called for
2263         in the latest draft of the Web IDL specification. This ends up speeding up the
2264         code a bit since we now use JSObject::get for properties instead of JSValue::get.
2265         (GenerateParametersCheck): Renamed some local variables. Taught the code that
2266         optional dictionaries all have a default value; before it was doing that for the
2267         type "Dictionary" but not the real dictionary types (IsDictionaryType).
2268
2269         * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
2270
2271         * css/FontFace.cpp:
2272         (WebCore::FontFace::create): Changed argument to be Descriptors instead of
2273         Optional<Descriptors>. It would have compiled the other way, but there is now
2274         no caller that will pass a null. Because the IDL dictionary support was new,
2275         this was the only place that was doing it wrong. Good that we "nipped it in the bud"
2276         before doing this in more places.
2277         * css/FontFace.h: Ditto.
2278
2279 2016-05-08  David Kilzer  <ddkilzer@apple.com>
2280
2281         ThreadSanitizer: Data race and thread leak in WebCore::ScrollingThread::createThreadIfNeeded
2282         <https://webkit.org/b/157462>
2283
2284         Reviewed by Darin Adler.
2285
2286         Reproduced with multiple existing tests.
2287
2288         * page/scrolling/ScrollingThread.cpp:
2289         (WebCore::ScrollingThread::createThreadIfNeeded): Use a
2290         std::once_flag to initialize Scrolling Thread since this may be
2291         called from background threads.
2292
2293 2016-05-08  Darin Adler  <darin@apple.com>
2294
2295         Try to fix build without rolling out that last change.
2296
2297         * bindings/js/JSDOMConvert.h:
2298         (WebCore::convert<Vector<String>>): Make this an inline. Just call toNativeArray.
2299
2300 2016-05-07  Darin Adler  <darin@apple.com>
2301
2302         Change MutationObserver::observe to take an IDL dictionary, rather than WebCore::Dictionary
2303         https://bugs.webkit.org/show_bug.cgi?id=157456
2304
2305         Reviewed by Chris Dumez.
2306
2307         * bindings/js/JSDOMConvert.h:
2308         (WebCore::convertOptional): Use a specific Optional null rather than Nullopt so we
2309         can compile the ternary operator.
2310         (WebCore::convert<bool>): Added.
2311         (WebCore::convert<Vector<String>>): Added. Later we probably need to change convert to use
2312         a member function of a class template rather than a function template so we can make partial
2313         specialization work and do this just once for all Vector<T>.
2314
2315         * bindings/js/JSMutationObserverCustom.cpp:
2316         (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots): Streamlined code and removed
2317         some local variables. Changed to call the new observedNodes rather than getObservedNodes.
2318
2319         * bindings/scripts/CodeGeneratorJS.pm:
2320         (GenerateDictionaryImplementationContent): Fixed bug where we tried to call the version of
2321         the convert function with a default value even when there was none.
2322
2323         * bindings/scripts/test/TestObj.idl: Added a test case basically identical to what's needed
2324         in MutationObserver.idl.
2325         * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
2326
2327         * dom/MutationObserver.cpp:
2328         (WebCore::MutationObserver::observe): Chagned function to take a MutationObserver::Init
2329         instead of a Dictionary.
2330         (WebCore::MutationObserver::observationStarted): Changed argument type to a reference.
2331         (WebCore::MutationObserver::observationEnded): Ditto.
2332         (WebCore::MutationObserverMicrotask): Removed unneeded explicit constructor and destructor.
2333         (WebCore::queueMutationObserverCompoundMicrotask): Got rid of unnneeded local variable.
2334         (WebCore::MutationObserver::observedNodes): Renamed to remove the "get" prefix.
2335
2336         * dom/MutationObserver.h: Reduced includes. Added MutationObserver::Init struct and
2337         used it for the type of the argument to the observe function. Changed a few argument
2338         types and removed unused forward declarations.
2339
2340         * dom/MutationObserver.idl: Added MutationObserverInit and used it instead of Dictionary.
2341
2342         * dom/MutationObserverRegistration.cpp:
2343         (WebCore::MutationObserverRegistration::MutationObserverRegistration): Pass a reference.
2344         (WebCore::MutationObserverRegistration::~MutationObserverRegistration): Ditto.
2345
2346 2016-05-07  Chris Dumez  <cdumez@apple.com>
2347
2348         Reduce special handling of XPathNSResolver type in the bindings
2349         https://bugs.webkit.org/show_bug.cgi?id=157454
2350
2351         Reviewed by Darin Adler.
2352
2353         Reduce special handling of XPathNSResolver type in the bindings.
2354
2355         * CMakeLists.txt:
2356         * WebCore.xcodeproj/project.pbxproj:
2357         * bindings/js/JSBindingsAllInOne.cpp:
2358         Add new JSXPathNSResolverCustom.cpp file.
2359
2360         * bindings/js/JSDOMStringListCustom.cpp:
2361         (WebCore::JSDOMStringList::toWrapped):
2362         Take the ExecState by reference instead of pointer.
2363
2364         * bindings/js/JSDOMWindowCustom.cpp:
2365         (WebCore::JSDOMWindow::toWrapped):
2366         Update to take an ExecState& parameter. The bindings now pass
2367         an ExecState to all custom toWrapped() methods for consistency
2368         and flexibility.
2369
2370         * bindings/js/JSDictionary.cpp:
2371         (WebCore::JSDictionary::convertValue):
2372         Pass an ExecState now that those toWrapped() methods expect
2373         it.
2374
2375         * bindings/js/JSEventTargetCustom.cpp:
2376         (WebCore::JSEventTarget::toWrapped):
2377         Update to take an ExecState& parameter.
2378
2379         * bindings/js/JSIDBDatabaseCustom.cpp:
2380         (WebCore::JSIDBDatabase::transaction):
2381         Pass ExecState by reference instead of pointer.
2382
2383         * bindings/js/JSMessageEventCustom.cpp:
2384         (WebCore::handleInitMessageEvent):
2385         Pass ExecState to JSDOMWindow::toWrapped().
2386
2387         * bindings/js/JSXPathNSResolverCustom.cpp: Added.
2388         (WebCore::JSXPathNSResolver::toWrapped):
2389         Provide a custom implementation of JSXPathNSResolver::toWrapped()
2390         instead of having the custom code in the bindings generator.
2391
2392         * bindings/scripts/CodeGeneratorJS.pm:
2393         (AddIncludesForType):
2394         Drop special includes for XPathNSResolver as they are no longer needed.
2395
2396         (GenerateHeader):
2397         Drop special casing of certain types for generating the toWrapped()
2398         declaration by:
2399         1. Relying on GetNativeType() for the return value as certain types
2400            return a RefPtr instead of a raw pointer.
2401         2. Adding an extra ExecState parameter when a custom implementation of
2402            toWrapped() is provided, given that some of them need it.
2403
2404         (GenerateParametersCheck):
2405         Drop custom code for XPathNSResolver and use the normal code path for
2406         this type now. The custom code now resides in the custom implementation
2407         of JSXPathNSResolver::toWrapped(), in custom bindings.
2408
2409         (JSValueToNative):
2410         - Drop NodeFilter from the nativeType hash map as it was updated to
2411           be a callback interface a while back.
2412         - Add XPathNSResolver to nativeType hash map so that we now to use
2413           a RefPtr<> instead of a raw pointer in the bindings. We should
2414           probably add an IDL extended attribute for this at some point.
2415         - Drop special casing for DOMStringList which was outdated since there
2416           is no toDOMStringList() function. DOMStringList has a custom
2417           toWrapped() function instead nowadays so we now call this one
2418           instead. We apparently do not have any DOMStringList parameters
2419           outside our bindings tests at the moment, which is why no one
2420           noticed.
2421         - Pass an ExecState to toWrapped() if the interface has the
2422           JSCustomToNativeObject IDL extended attribute.
2423
2424         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2425         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2426         * bindings/scripts/test/JS/JSTestObj.cpp:
2427         * bindings/scripts/test/ObjC/DOMTestObj.h:
2428         * bindings/scripts/test/ObjC/DOMTestObj.mm:
2429         * bindings/scripts/test/TestObj.idl:
2430         Add bindings test coverage for having an operation with an
2431         XPathNSResolver parameter.
2432
2433         * dom/Document.idl:
2434         * xml/XPathEvaluator.idl:
2435         Drop some unnecessary default parameter values.
2436
2437         * xml/XPathNSResolver.idl:
2438         Add JSCustomToNativeObject IDL extended attribute so that we can
2439         provide our own custom implementation of JSXPathNSResolver::toWrapped(),
2440         instead of having the custom code in the bindings generator.
2441
2442         * dom/Document.cpp:
2443         (WebCore::Document::createExpression):
2444         (WebCore::Document::evaluate):
2445         * dom/Document.h:
2446         * inspector/InspectorNodeFinder.cpp:
2447         * xml/XPathEvaluator.cpp:
2448         (WebCore::XPathEvaluator::createExpression):
2449         (WebCore::XPathEvaluator::evaluate):
2450         * xml/XPathEvaluator.h:
2451         * xml/XPathExpression.cpp:
2452         (WebCore::XPathExpression::createExpression):
2453         * xml/XPathExpression.h:
2454         * xml/XPathParser.cpp:
2455         (WebCore::XPath::Parser::Parser):
2456         (WebCore::XPath::Parser::parseStatement):
2457         * xml/XPathParser.h:
2458         Take XPathNSResolver parameter as a Ref<XPathNSResolver>&& as this is
2459         what the generated bindings now provide us, given that this sometimes
2460         have to create a wrapper around a JSObject.
2461
2462 2016-05-07  Darin Adler  <darin@apple.com>
2463
2464         Fix crash introduced by the last patch.
2465
2466         Fix suggested by Chris Dumez.
2467
2468         * css/FontFace.cpp:
2469         (WebCore::FontFace::FontFace): Roll out incorrect change. Things were getting
2470         initialized in the wrong order in a change I had made to the FontFace constructor
2471         that takes a CSSFontSelector.
2472
2473 2016-05-07  Chris Dumez  <cdumez@apple.com>
2474
2475         Unreviewed, rebaseline bindings tests after r200547.
2476
2477         * bindings/scripts/test/JS/JSTestObj.cpp:
2478         (WebCore::convert<TestObj::FontFaceDescriptors>):
2479
2480 2016-05-07  Darin Adler  <darin@apple.com>
2481
2482         Next step on dictionary bindings, along with other bindings refinements
2483         https://bugs.webkit.org/show_bug.cgi?id=157451
2484
2485         Reviewed by Chris Dumez.
2486
2487         Converted one dictionary, the one passed to the constructor in FontFace.
2488
2489         * WebCore.xcodeproj/project.pbxproj: Updated for name change of JSDOMBuild.h to
2490         JSDOMConvert.h and also let Xcode update a file type.
2491
2492         * bindings/js/JSDOMBinding.cpp:
2493         (WebCore::propertyValue): Added.
2494         * bindings/js/JSDOMBinding.h: Use pragma once. Remove unnecessary forward declaration.
2495         Move all declarations to the top of the file, separating them from definitions. This
2496         is a small step toward better overview of what's in this file and paves the way for
2497         future simplifications and improvements we can make after we observe patterns.
2498         Also removed a couple unused functions.
2499
2500         * bindings/js/JSDOMConvert.h: Renamed from JSDOMBuild.h.
2501         Renamed function templates from build to convert. Added convertOptional.
2502
2503         * bindings/js/ReadableStreamController.cpp:
2504         (WebCore::callFunction): Use auto and remove some unneeded namespacing.
2505         (WebCore::ReadableStreamController::invoke): Ditto. Also remove use of helper function
2506         getPropertyFromObject, since this was the only call site and it was not very helpful.
2507         (WebCore::ReadableStreamController::isControlledReadableStreamLocked): Ditto.
2508         (WebCore::createReadableStream): Ditto.
2509         (WebCore::getReadableStreamReader): Ditto.
2510
2511         * bindings/scripts/CodeGeneratorJS.pm:
2512         (GenerateEnumerationImplementationContent): Updated for name change from build to
2513         convert and JSDOMBuild.h to JSDOMConvert.h.
2514         (GenerateDictionaryImplementationContent): Ditto. Also added code to handle optional
2515         and added explicit exception checking, using local variables. Not clear longer term
2516         if the local variable approach is OK since this will unnecessarily change types like
2517         const String& to String.
2518         (GenerateParametersCheck): Removed local variable $optional and use $parameter->isOptional
2519         directly consistently. This is slightly clearer because the old code used a mix of the
2520         two, and also is a better pattern for when we refactor this into smaller functions.
2521         Note that this function name is not good any more--this is a lot more then parameter checks.
2522         (GetNativeType): Return appropriate name for dictionary types.
2523         (JSValueToNative): Updated for name change from build to convert and JSDOMBuild.h to
2524         JSDOMConvert.h.
2525
2526         * bindings/scripts/test/JS/JSTestObj.cpp:
2527         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2528         Regenerated results.
2529
2530         * bindings/scripts/test/TestObj.idl: Added another dictionary test case, just a copy
2531         of the current state of the one in FontFace.idl.
2532
2533         * css/CSSFontFace.cpp:
2534         (WebCore::CSSFontFace::setUnicodeRange): Update for simplified UnicodeRange struct.
2535         (WebCore::CSSFontFace::setFeatureSettings): Fix to correctly handle being called
2536         with "normal". Also fix so it doesn't call fontPropertyChanged if nothing changed.
2537         Also got rid of return value, which had no real value: it was returning false for
2538         some bad inputs, but others would just lead to assertions, and the real reason this
2539         was OK is that this function is only passed known-valid values.
2540
2541         * css/CSSFontFace.h: Used prama once. Tweaked formatting. Removed return value from
2542         the setFeatureSettings function. Changed UnicodeRange to be struct with public data
2543         members instead a struct with a constructor and getter functions.
2544
2545         * css/CSSFontSelector.cpp:
2546         (WebCore::CSSFontSelector::addFontFaceRule): Updated since setFeatureSettings no
2547         longer has a boolean return value.
2548
2549         * css/CSSSegmentedFontFace.cpp:
2550         (WebCore::appendFontWithInvalidUnicodeRangeIfLoading): Updated for simplified
2551         UnicodeRange struct.
2552
2553         * css/FontFace.cpp:
2554         (WebCore::valueFromDictionary): Deleted.
2555         (WebCore::FontFace::create): Updated to take the descriptors as a struct instead of
2556         a WebCore::Dictionary. Also made that argument optional as specified in the current
2557         specification draft.
2558         (WebCore::FontFace::setFeatureSettings): Updated since setFeatureSettings no longer
2559         has a boolean return value.
2560         (WebCore::FontFace::unicodeRange): Updated for simplified UnicodeRange struct.
2561
2562         * css/FontFace.h: Used pragma once. Removed unneeded includes and forward declarations.
2563         Derived privately from CSSFontFace::Client. Added a FontFace::Descriptors struct and
2564         used it as an argument to the create function as described above.
2565
2566         * css/FontFace.idl: Added FontFaceDescriptors and changed the argument to the
2567         constructor to be an optional FontFaceDescriptors instead of a Dictionary.
2568
2569 2016-05-07  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2570
2571         Rework FontFace promise attribute handling
2572         https://bugs.webkit.org/show_bug.cgi?id=157310
2573
2574         Reviewed by Myles C. Maxfield.
2575
2576         Making promise attributes cached attributes, so that they are created only once.
2577         They are created in the custom binding code and passed to DOM class as needed.
2578
2579         Removed usage of ExecState& from DOM iterators.
2580
2581         No change should be visible from user scripts.
2582
2583         * Modules/fetch/FetchHeaders.cpp:
2584         (WebCore::FetchHeaders::Iterator::next): Removing ExecState parameter.
2585         * Modules/fetch/FetchHeaders.h:
2586         * bindings/js/JSDOMIterator.h:
2587         (WebCore::keyValueIteratorForEach):
2588         (WebCore::JSDOMIterator<JSWrapper>::next): Ditto.
2589         * bindings/js/JSDOMPromise.cpp:
2590         (WebCore::DeferredWrapper::promise): Removed deferred() and added access to promise directly.
2591         * bindings/js/JSDOMPromise.h:
2592         * bindings/js/JSFontFaceCustom.cpp:
2593         (WebCore::JSFontFace::loaded): Using cached attribute to call FontFace::loaded only once.
2594         * bindings/js/JSFontFaceSetCustom.cpp:
2595         (WebCore::JSFontFaceSet::ready): Using cached attribute to call FontFaceSet::ready only once.
2596         * css/CSSFontFace.cpp:
2597         (WebCore::CSSFontFace::wrapper): Removing ExecState parameter.
2598         * css/CSSFontFace.h:
2599         * css/FontFace.cpp:
2600         (WebCore::FontFace::create): Ditto.
2601         (WebCore::FontFace::FontFace): Ditto.
2602         (WebCore::FontFace::fontStateChanged): Updating promise handling.
2603         (WebCore::FontFace::registerLoaded): Resolving/rejecting promise if backing CSSFontFace loading is ended.
2604         (WebCore::FontFace::load): Calling backing load.
2605         * css/FontFace.h:
2606         * css/FontFaceSet.cpp:
2607         (WebCore::FontFaceSet::Iterator::next): Removing ExecState parameter.
2608         (WebCore::FontFaceSet::load): Removing ExecState and ExceptionCode parameter.
2609         (WebCore::FontFaceSet::registerReady): Resolving promise if ready otherwise storing it for resolving it later.
2610         (WebCore::FontFaceSet::completedLoading): Resolving promise if any is stored.
2611         (WebCore::FontFaceSet::create): Deleted.
2612         * css/FontFaceSet.h:
2613         * css/FontFaceSet.idl:
2614
2615 2016-05-07  Jeremy Huddleston Sequoia  <jeremyhu@apple.com>
2616
2617         Fix an incorrect usage of OS(DARWIN) with PLATFORM(COCOA)
2618         https://bugs.webkit.org/show_bug.cgi?id=157167
2619
2620         Reviewed by Myles C. Maxfield.
2621
2622         * platform/graphics/FontPlatformData.h:
2623         (WebCore::FontPlatformData::hash):
2624
2625 2016-05-07  Joanmarie Diggs  <jdiggs@igalia.com>
2626
2627         REGRESSION(r196222): [AX][GTK] accessibility/gtk/caret-offsets.html failing
2628         https://bugs.webkit.org/show_bug.cgi?id=153956
2629
2630         Reviewed by Chris Fleizach.
2631
2632         The reason the test began failing is that it was checking the new caret offset
2633         synchronously. For most of the test cases, this was not a problem. But when the
2634         caret was moved out of a focused link, the focus change (and associated repainting)
2635         delayed the caret-moved event long enough to cause the associated test case to fail.
2636         The test now uses shouldBecomeEqualToString() instead of shouldBeEqualToString().
2637
2638         The test also had a supposedly-correct expectation which was wrong: When moving the
2639         caret to a valid accessible offset, the caret-moved event should be for that offset.
2640         This was not the case for the list item test case because emitTextSelectionChange()
2641         was not adjusting the offset for the RenderListMarker, the text of which is exposed
2642         as part of the ATK_ROLE_LIST_ITEM object. This bug was also fixed and the test case
2643         updated accordingly.
2644
2645         No new tests are needed. The previously-failing test is now passing.
2646
2647         * editing/atk/FrameSelectionAtk.cpp:
2648         (WebCore::emitTextSelectionChange):
2649
2650 2016-05-06  Joseph Pecoraro  <pecoraro@apple.com>
2651
2652         Rename HitTestRequest DisallowShadowContent to DisallowUserAgentShadowContent
2653         https://bugs.webkit.org/show_bug.cgi?id=157447
2654
2655         Reviewed by Ryosuke Niwa.
2656
2657         HitTesting is intended to reach nodes inside shadow content. This property
2658         on the HitTestRequest is intended to avoid hit testing in UserAgent shadow
2659         content. Rename the enum value, and cascading methods for clarity.
2660
2661         * html/MediaElementSession.cpp:
2662         (WebCore::isMainContent):
2663         * page/EventHandler.cpp:
2664         (WebCore::EventHandler::eventMayStartDrag):
2665         (WebCore::EventHandler::updateSelectionForMouseDrag):
2666         (WebCore::EventHandler::hitTestResultAtPoint):
2667         (WebCore::EventHandler::handleMousePressEvent):
2668         (WebCore::EventHandler::handleMouseDoubleClickEvent):
2669         (WebCore::EventHandler::mouseMoved):
2670         (WebCore::EventHandler::handleMouseMoveEvent):
2671         (WebCore::EventHandler::handleMouseReleaseEvent):
2672         (WebCore::EventHandler::handleMouseForceEvent):
2673         (WebCore::EventHandler::updateDragAndDrop):
2674         (WebCore::EventHandler::isInsideScrollbar):
2675         (WebCore::EventHandler::sendContextMenuEvent):
2676         (WebCore::EventHandler::sendContextMenuEventForKey):
2677         (WebCore::EventHandler::hoverTimerFired):
2678         (WebCore::EventHandler::dragSourceEndedAt):
2679         (WebCore::EventHandler::handleDrag):
2680         (WebCore::EventHandler::dispatchSyntheticTouchEventIfEnabled):
2681         * page/EventHandler.h:
2682         * page/FocusController.cpp:
2683         (WebCore::updateFocusCandidateIfNeeded):
2684         * rendering/HitTestRequest.h:
2685         (WebCore::HitTestRequest::HitTestRequest):
2686         (WebCore::HitTestRequest::disallowsUserAgentShadowContent):
2687         (WebCore::HitTestRequest::disallowsShadowContent): Deleted.
2688         * rendering/HitTestResult.cpp:
2689         (WebCore::HitTestResult::setToNonUserAgentShadowAncestor):
2690         (WebCore::HitTestResult::addNodeToRectBasedTestResult):
2691         (WebCore::HitTestResult::setToNonShadowAncestor): Deleted.
2692         * rendering/HitTestResult.h:
2693         * rendering/RenderEmbeddedObject.cpp:
2694         (WebCore::RenderEmbeddedObject::isReplacementObscured):
2695         * rendering/RenderLayer.cpp:
2696         (WebCore::RenderLayer::calculateClipRects):
2697         * rendering/svg/RenderSVGResourceClipper.cpp:
2698         (WebCore::RenderSVGResourceClipper::hitTestClipContent):
2699         * testing/Internals.cpp:
2700         (WebCore::Internals::nodesFromRect):
2701
2702 2016-05-06  Joseph Pecoraro  <pecoraro@apple.com>
2703
2704         Web Inspector: Inspect Element and Element Selection searching should work with Shadow DOM Nodes
2705         https://bugs.webkit.org/show_bug.cgi?id=157446
2706         <rdar://problem/24688447>
2707
2708         Reviewed by Ryosuke Niwa.
2709
2710         * inspector/InspectorDOMAgent.cpp:
2711         (WebCore::InspectorDOMAgent::innerParentNode):
2712         The Inspector backend was informing the frontend that all ShadowRoots
2713         were floating and had no parent. Get the host element for ShadowRoots.
2714
2715         * rendering/HitTestResult.cpp:
2716         (WebCore::moveOutOfUserAgentShadowTree):
2717         (WebCore::HitTestResult::setToNonShadowAncestor):
2718         EventHandler::mouseMoved is calling setToNonShadowAncestor before
2719         notifying Page::chrome / Inspector about the moused over element.
2720         This should be the deepest non-user-agent-shadow node.
2721
2722 2016-05-06  Joseph Pecoraro  <pecoraro@apple.com>
2723
2724         Web Inspector: Misc CommandLineAPI cleanup
2725         https://bugs.webkit.org/show_bug.cgi?id=157450
2726
2727         Reviewed by Ryosuke Niwa.
2728
2729         * inspector/CommandLineAPIModuleSource.js:
2730         (bind):
2731
2732 2016-05-06  Simon Fraser  <simon.fraser@apple.com>
2733
2734         Enable IOS_TEXT_AUTOSIZING on Mac and make it testable
2735         https://bugs.webkit.org/show_bug.cgi?id=157432
2736         rdar://problem/16406720
2737
2738         Reviewed by Dean Jackson.
2739
2740         Enable IOS_TEXT_AUTOSIZING on Mac so it can be tested.
2741
2742         Make the setTextAutosizingEnabled() Setting work, and plumb it through WK1 and WK2
2743         preferences for WTR and DRT. Make textAutosizingWindowSizeOverride() work, for layout tests.
2744         These two settings are shared with TEXT_AUTOSIZING.
2745
2746         Add a TextAutosizing log channel, which is useful for generated -expected.html results.
2747
2748         Move adjustComputedFontSizesOnBlocks() and related code from RenderObject to RenderElement
2749         without changes.
2750
2751         An implication of this set of changes is that the way clients enable text autosizing
2752         has changed. Previously, they set the "MinimumZoomFontSize" preference to 0.
2753         Settings::defaultMinimumZoomFontSize() used to do this in order to enable text autosizing
2754         on iPhone only, not iPad.
2755
2756         Now the preferred technique is to leave minimumZoomFontSize alone, and to use textAutosizingEnabled()
2757         instead. Settings::defaultTextAutosizingEnabled() now does the check for iPhone.
2758
2759         UIWebView calls WebKitGetMinimumZoomFontSize() to setup the default minimum font zoom size,
2760         which will now always return 15, but had no other code that toggled this. So it's safe to just rely
2761         on Settings::defaultTextAutosizingEnabled() doing the right thing for iPhone/iPad.
2762
2763         Test: fast/text-autosizing/ios/autosize-width.html
2764
2765         * Configurations/FeatureDefines.xcconfig:
2766         * dom/Document.cpp:
2767         (WebCore::Document::addAutoSizingNode):
2768         * page/FrameView.cpp:
2769         (WebCore::FrameView::layout):
2770         * page/Settings.cpp:
2771         (WebCore::Settings::Settings): Deleted.
2772         (WebCore::Settings::setTextAutosizingEnabled): Deleted.
2773         (WebCore::Settings::setTextAutosizingWindowSizeOverride): Deleted.
2774         * page/Settings.h:
2775         (WebCore::Settings::textAutosizingEnabled): Deleted.
2776         (WebCore::Settings::textAutosizingWindowSizeOverride): Deleted.
2777         * page/Settings.in:
2778         * page/cocoa/SettingsCocoa.mm:
2779         (WebCore::Settings::defaultMinimumZoomFontSize):
2780         (WebCore::Settings::defaultTextAutosizingEnabled):
2781         * platform/Logging.h:
2782         * rendering/RenderBlockFlow.cpp:
2783         (WebCore::RenderBlockFlow::adjustComputedFontSizes):
2784         * rendering/RenderElement.cpp:
2785         (WebCore::includeNonFixedHeight):
2786         (WebCore::RenderElement::adjustComputedFontSizesOnBlocks):
2787         (WebCore::RenderElement::resetTextAutosizing):
2788         * rendering/RenderElement.h:
2789         * rendering/RenderObject.cpp:
2790         (WebCore::includeNonFixedHeight): Deleted.
2791         (WebCore::RenderObject::adjustComputedFontSizesOnBlocks): Deleted.
2792         (WebCore::RenderObject::resetTextAutosizing): Deleted.
2793         * rendering/RenderObject.h:
2794         * rendering/TextAutoSizing.cpp:
2795         (WebCore::TextAutoSizingValue::adjustNodeSizes):
2796         * testing/InternalSettings.cpp:
2797         (WebCore::InternalSettings::Backup::Backup):
2798         (WebCore::InternalSettings::Backup::restoreTo):
2799         (WebCore::InternalSettings::setTextAutosizingEnabled):
2800         (WebCore::InternalSettings::setTextAutosizingWindowSizeOverride):
2801         * testing/InternalSettings.h:
2802
2803 2016-05-06  Joseph Pecoraro  <pecoraro@apple.com>
2804
2805         Web Inspector: Console: Variables defined with let/const aren't accessible outside of console's scope
2806         https://bugs.webkit.org/show_bug.cgi?id=150752
2807         <rdar://problem/23343385>
2808
2809         Reviewed by Mark Lam.
2810
2811         Test: inspector/runtime/evaluate-CommandLineAPI.html
2812
2813         * inspector/CommandLineAPIModuleSource.js:
2814         (bind):
2815         (this.member.toString):
2816         (CommandLineAPI):
2817         (CommandLineAPIImpl.prototype):
2818         (slice): Deleted.
2819         (bound): Deleted.
2820         (bound.toString): Deleted.
2821         (inScopeVariables): Deleted.
2822         (customToStringMethod): Deleted.
2823         Simplify now that we don't need to do our own variable shadow checking.
2824
2825 2016-05-06  Tim Horton  <timothy_horton@apple.com>
2826
2827         <attachment> element should understand UTIs
2828         https://bugs.webkit.org/show_bug.cgi?id=157425
2829         <rdar://problem/25585401>
2830
2831         Reviewed by Anders Carlsson.
2832
2833         UTIs are often much more specific than MIME types, so we should allow
2834         clients of <attachment> to use them to get more accurate icons.
2835
2836         Test: fast/attachment/attachment-uti.html
2837
2838         * platform/graphics/Icon.h:
2839         * platform/graphics/mac/IconMac.mm:
2840         (WebCore::Icon::createIconForMIMEType): Deleted.
2841         Remove the now-unused createIconForMIMEType.
2842
2843         * platform/network/mac/UTIUtilities.h:
2844         * platform/network/mac/UTIUtilities.mm:
2845         (WebCore::isDeclaredUTI):
2846         Expose UTTypeIsDeclared as isDeclaredUTI.
2847
2848         * rendering/RenderThemeIOS.mm:
2849         (WebCore::iconForAttachment):
2850         * rendering/RenderThemeMac.mm:
2851         (WebCore::iconForAttachment):
2852         If the attachment's type is a UTI, request the icon for it directly.
2853         If it's a MIME type, convert to a UTI before requesting.
2854
2855 2016-05-06  Chris Dumez  <cdumez@apple.com>
2856
2857         Clean up converting from JSValue to float / double in the bindings generator
2858         https://bugs.webkit.org/show_bug.cgi?id=157407
2859
2860         Reviewed by Darin Adler.
2861
2862         Clean up converting from JSValue to float / double in the bindings generator:
2863         - Handle all aspects of converting to float / double inside JSValueToNative()
2864           instead of relying partly on the call sites.
2865         - Add a build<>() template function to JSDOMBuild.h that is now
2866           called from the bindings to convert to float / double and deal with
2867           non-finite values.
2868         - Provide a better message with the TypeError that is thrown for non-finite
2869           values.
2870
2871         No new tests, rebaselined existing tests.
2872
2873         * bindings/js/JSDOMBinding.cpp:
2874         (WebCore::throwSequenceTypeError):
2875         (WebCore::throwNonFiniteTypeError):
2876         * bindings/js/JSDOMBinding.h:
2877         * bindings/js/JSDOMBuild.h:
2878         (WebCore::build):
2879         * bindings/scripts/CodeGenerator.pm:
2880         (IsFloatingPointType):
2881         * bindings/scripts/CodeGeneratorJS.pm:
2882         (JSValueToNative):
2883         (GenerateImplementation): Deleted.
2884         (GenerateParametersCheck): Deleted.
2885         (GenerateReturnParameters): Deleted.
2886         * bindings/scripts/test/JS/JSTestObj.cpp:
2887         (WebCore::setJSTestObjStrictFloat):
2888         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalDoubleIsNaN):
2889         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalFloatIsNaN):
2890         (WebCore::jsTestObjPrototypeFunctionStrictFunction):
2891         (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
2892         (WebCore::jsTestObjPrototypeFunctionAny):
2893         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
2894         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
2895         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2896         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
2897
2898 2016-05-06  Dean Jackson  <dino@apple.com>
2899
2900         Regions, Shapes and Tracks don't need runtime features
2901         https://bugs.webkit.org/show_bug.cgi?id=157426
2902         <rdar://problem/26146262>
2903
2904         Reviewed by Simon Fraser.
2905
2906         The following RuntimeEnabledFeatures can be removed since
2907         we have no need to disable them (they are stable and have
2908         shipped for a while):
2909         - CSS Regions
2910         - CSS Shapes
2911         - Media tracks
2912
2913         * bindings/generic/RuntimeEnabledFeatures.cpp:
2914         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): Deleted.
2915         * bindings/generic/RuntimeEnabledFeatures.h:
2916         (WebCore::RuntimeEnabledFeatures::setCSSShapesEnabled): Deleted.
2917         (WebCore::RuntimeEnabledFeatures::cssShapesEnabled): Deleted.
2918         (WebCore::RuntimeEnabledFeatures::setCSSRegionsEnabled): Deleted.
2919         (WebCore::RuntimeEnabledFeatures::cssRegionsEnabled): Deleted.
2920         (WebCore::RuntimeEnabledFeatures::setCSSCompositingEnabled): Deleted.
2921         (WebCore::RuntimeEnabledFeatures::cssCompositingEnabled): Deleted.
2922         (WebCore::RuntimeEnabledFeatures::webkitVideoTrackEnabled): Deleted.
2923         (WebCore::RuntimeEnabledFeatures::setWebkitVideoTrackEnabled): Deleted.
2924         * css/CSSParser.cpp:
2925         (WebCore::isSimpleLengthPropertyID):
2926         (WebCore::isValidKeywordPropertyAndValue):
2927         (WebCore::CSSParser::parseValue):
2928         (WebCore::CSSParser::parseFillProperty):
2929         (WebCore::CSSParser::createRegionRule):
2930         (WebCore::CSSParserContext::CSSParserContext): Deleted.
2931         (WebCore::operator==): Deleted.
2932         (WebCore::CSSParser::parseShapeProperty): Deleted.
2933         (WebCore::CSSParser::cssRegionsEnabled): Deleted.
2934         (WebCore::CSSParser::cssCompositingEnabled): Deleted.
2935         (WebCore::CSSParser::parseFlowThread): Deleted.
2936         (WebCore::CSSParser::parseRegionThread): Deleted.
2937         * css/CSSParser.h:
2938         * css/CSSParserMode.h:
2939         * dom/Document.cpp:
2940         (WebCore::Document::webkitGetNamedFlows):
2941         (WebCore::Document::cssRegionsEnabled): Deleted.
2942         (WebCore::Document::cssCompositingEnabled): Deleted.
2943         * dom/Document.h:
2944         * dom/Element.cpp:
2945         (WebCore::Element::unregisterNamedFlowContentElement):
2946         (WebCore::Element::webkitRegionOverset):
2947         (WebCore::Element::webkitGetRegionFlowRanges): Deleted.
2948         * html/HTMLMediaElement.cpp:
2949         (WebCore::HTMLMediaElement::scheduleDelayedAction):
2950         (WebCore::HTMLMediaElement::pendingActionTimerFired):
2951         (WebCore::HTMLMediaElement::prepareForLoad):
2952         (WebCore::HTMLMediaElement::loadInternal):
2953         (WebCore::HTMLMediaElement::setReadyState):
2954         (WebCore::HTMLMediaElement::playbackProgressTimerFired):
2955         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
2956         (WebCore::HTMLMediaElement::userCancelledLoad):
2957         (WebCore::HTMLMediaElement::setVideoFullscreenLayer):
2958         (WebCore::HTMLMediaElement::hasClosedCaptions):
2959         (WebCore::HTMLMediaElement::setClosedCaptionsVisible):
2960         (WebCore::HTMLMediaElement::configureTextTrackDisplay):
2961         (WebCore::HTMLMediaElement::finishParsingChildren): Deleted.
2962         (WebCore::HTMLMediaElement::audioTrackEnabledChanged): Deleted.
2963         (WebCore::HTMLMediaElement::videoTrackSelectedChanged): Deleted.
2964         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Deleted.
2965         (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): Deleted.
2966         (WebCore::HTMLMediaElement::mediaPlayerDidAddVideoTrack): Deleted.
2967         (WebCore::HTMLMediaElement::addAudioTrack): Deleted.
2968         (WebCore::HTMLMediaElement::addTextTrack): Deleted.
2969         (WebCore::HTMLMediaElement::addVideoTrack): Deleted.
2970         (WebCore::HTMLMediaElement::removeAudioTrack): Deleted.
2971         (WebCore::HTMLMediaElement::removeTextTrack): Deleted.
2972         (WebCore::HTMLMediaElement::removeVideoTrack): Deleted.
2973         (WebCore::HTMLMediaElement::audioTracks): Deleted.
2974         (WebCore::HTMLMediaElement::textTracks): Deleted.
2975         (WebCore::HTMLMediaElement::videoTracks): Deleted.
2976         (WebCore::HTMLMediaElement::didAddTextTrack): Deleted.
2977         (WebCore::HTMLMediaElement::didRemoveTextTrack): Deleted.
2978         * html/HTMLTrackElement.cpp:
2979         (WebCore::HTMLTrackElement::parseAttribute):
2980         (WebCore::HTMLTrackElement::scheduleLoad): Deleted.
2981         (WebCore::HTMLTrackElement::canLoadURL): Deleted.
2982         * rendering/RenderBlockFlow.cpp:
2983         (WebCore::RenderBlockFlow::createRenderNamedFlowFragmentIfNeeded):
2984         * testing/InternalSettings.cpp:
2985         (WebCore::InternalSettings::Backup::Backup):
2986         (WebCore::InternalSettings::Backup::restoreTo): Deleted.
2987         (WebCore::InternalSettings::setCSSShapesEnabled): Deleted.
2988         * testing/InternalSettings.h:
2989         * testing/InternalSettings.idl:
2990
2991 2016-05-06  Brady Eidson  <beidson@apple.com>
2992
2993         Modern IDB (Workers): Start running a lot of the workers tests.
2994         https://bugs.webkit.org/show_bug.cgi?id=157424
2995
2996         Reviewed by Sam Weinig.
2997
2998         No new tests (Covered by enabling a whole bunch of existing tests).
2999
3000         * Modules/indexeddb/IDBDatabase.cpp:
3001         (WebCore::IDBDatabase::stop): Call removeAllEventListeners() to clean up the Worker VM
3002           before it shuts down.
3003
3004         * Modules/indexeddb/IDBRequest.cpp:
3005         (WebCore::IDBRequest::stop): Call removeAllEventListeners()
3006
3007         * Modules/indexeddb/IDBTransaction.cpp:
3008         (WebCore::IDBTransaction::IDBTransaction): Initialize with the correct VM.
3009         (WebCore::IDBTransaction::stop): Call removeAllEventListeners()
3010         (WebCore::IDBTransaction::operationDidComplete):
3011
3012         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
3013         (WebCore::IDBClient::IDBConnectionProxy::takeIDBOpenDBRequest):
3014         (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest): Don't take the request from
3015           the map, but rather let the request take itself from its appropriate thread.
3016         * Modules/indexeddb/client/IDBConnectionProxy.h:
3017
3018         * Modules/indexeddb/client/TransactionOperation.h:
3019         (WebCore::IDBClient::TransactionOperation::completed): Rework clearing out the completion 
3020           handler, as the handler itself might hold the last reference to `this`.
3021
3022         * page/SecurityOrigin.h:
3023         (WebCore::SecurityOrigin::hasUniversalAccess):
3024
3025         * workers/WorkerGlobalScope.cpp:
3026         (WebCore::WorkerGlobalScope::WorkerGlobalScope): If the parent context's SecurityOrigin had
3027           universal access, grant it to this one.
3028
3029 2016-05-06  Ryosuke Niwa  <rniwa@webkit.org>
3030
3031         FKA: No way to get focus from DOM to shadow DOM components (Was: HTML5 media controls not keyboard accessible)
3032         https://bugs.webkit.org/show_bug.cgi?id=117857
3033
3034         Reviewed by Jer Noble.
3035
3036         The bug was caused by hasCustomFocusLogic returning true on media elements.
3037
3038         Fix the bug by removing this function so that FocusController will walk into the shadow tree of media elements
3039         to look for focusable elements. This will allow AT such as Voice Over to iterate through controls.
3040
3041         We don't seem to draw focus rings inside the media elements but that could be tweaked in a separate patch.
3042
3043         Test: media/tab-focus-inside-media-elements.html
3044
3045         * html/HTMLMediaElement.cpp:
3046         (WebCore::HTMLMediaElement::hasCustomFocusLogic): Deleted.
3047         * html/HTMLMediaElement.h:
3048
3049 2016-05-06  Anders Carlsson  <andersca@apple.com>
3050
3051         Tidy up the LinkRelAttribute code
3052         https://bugs.webkit.org/show_bug.cgi?id=157429
3053
3054         Reviewed by Sam Weinig.
3055
3056         Get rid of IconURL.h and move the IconType enumeration inside LinkRelAttribute.
3057         Remove the InvalidIcon enum declaration and use WTF::Optional instead.
3058
3059         * WebCore.xcodeproj/project.pbxproj:
3060         * dom/IconURL.h: Removed.
3061         * html/HTMLLinkElement.cpp:
3062         (WebCore::HTMLLinkElement::iconType):
3063         (WebCore::HTMLLinkElement::addSubresourceAttributeURLs):
3064         * html/HTMLLinkElement.h:
3065         * html/LinkRelAttribute.cpp:
3066         (WebCore::LinkRelAttribute::LinkRelAttribute):
3067         * html/LinkRelAttribute.h:
3068         * html/parser/HTMLPreloadScanner.cpp:
3069         (WebCore::TokenPreloadScanner::StartTagScanner::relAttributeIsStyleSheet):
3070         * loader/FrameLoader.h:
3071         * loader/FrameLoaderClient.h:
3072         * loader/icon/IconController.cpp:
3073         (WebCore::iconFromLinkElements):
3074
3075 2016-05-06  Jer Noble  <jer.noble@apple.com>
3076
3077         Muted media elements should be allowed to autoplay, even if RequireUserGestureForAudioRateChange is set.
3078         https://bugs.webkit.org/show_bug.cgi?id=157404
3079         <rdar://problem/26016802>
3080
3081         Reviewed by Eric Carlson.
3082
3083         Test: media/audio-playback-restriction-play-muted.html
3084
3085         Add element.muted() as a critera of whether playback is permitted when
3086         RequireUserGestureForAudioRateChange is set. Also, make sure to re-evaluate whether the
3087         element should be playing when muted is changed without a user gesture.
3088
3089         * html/HTMLMediaElement.cpp:
3090         (WebCore::HTMLMediaElement::setMuted):
3091         * html/MediaElementSession.cpp:
3092         (WebCore::MediaElementSession::playbackPermitted):
3093
3094 2016-05-06  Brent Fulgham  <bfulgham@apple.com>
3095
3096         Don't use invalidated ResourceLoadStatistics iterators
3097         https://bugs.webkit.org/show_bug.cgi?id=157412
3098         <rdar://problem/26133153>
3099
3100         Reviewed by Chris Dumez.
3101
3102         ResourceLoadObserver::logFrameNavigation was using references bound to the 'value'
3103         member of iterators from the ResourceLoadStatistics HashMap. When new entries were
3104         added, these iterators were invalidated causing the references to refer to invalid
3105         memory.
3106
3107         Renamed 'resourceStatisticsForPrimaryDomain' to 'ensureResourceStatisticsForPrimaryDomain'
3108         to clarify that it may mutate the underlying HashMap, thereby invalidating any
3109         existing iterators.
3110
3111         * loader/ResourceLoadObserver.cpp:
3112         (WebCore::ResourceLoadObserver::logFrameNavigation): Protect against HashMap
3113         elements being copied/moved when new intries are added.
3114         * loader/ResourceLoadStatisticsStore.cpp:
3115         (WebCore::ResourceLoadStatisticsStore::setResourceStatisticsForPrimaryDomain): Added.
3116         * loader/ResourceLoadStatisticsStore.h:
3117
3118 2016-05-06  Manuel Rego Casasnovas  <rego@igalia.com>
3119
3120         [css-grid] Unprefix CSS Grid Layout properties
3121         https://bugs.webkit.org/show_bug.cgi?id=157137
3122
3123         Reviewed by Simon Fraser.
3124
3125         Remove "-webkit" prefix from all the grid layout properties,
3126         including the display value.
3127         Update the source code to remove the prefix where it was used too.
3128
3129         * css/CSSComputedStyleDeclaration.cpp:
3130         (WebCore::isLayoutDependent):
3131         (WebCore::ComputedStyleExtractor::propertyValue):
3132         * css/CSSParser.cpp:
3133         (WebCore::isSimpleLengthPropertyID):
3134         (WebCore::isValidKeywordPropertyAndValue):
3135         (WebCore::CSSParser::parseValue):
3136         (WebCore::CSSParser::parseGridGapShorthand):
3137         (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns):
3138         (WebCore::CSSParser::parseGridTemplateShorthand):
3139         (WebCore::CSSParser::parseGridShorthand):
3140         (WebCore::CSSParser::parseGridAreaShorthand):
3141         * css/CSSPrimitiveValueMappings.h:
3142         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3143         * css/CSSPropertyNames.in:
3144         * css/CSSValueKeywords.in:
3145         * css/StyleBuilderCustom.h:
3146         (WebCore::StyleBuilderCustom::applyInitialGridTemplateAreas):
3147         (WebCore::StyleBuilderCustom::applyInheritGridTemplateAreas):
3148         (WebCore::StyleBuilderCustom::applyValueGridTemplateAreas):
3149         (WebCore::StyleBuilderCustom::applyInitialGridTemplateColumns):
3150         (WebCore::StyleBuilderCustom::applyInheritGridTemplateColumns):
3151         (WebCore::StyleBuilderCustom::applyValueGridTemplateColumns):
3152         (WebCore::StyleBuilderCustom::applyInitialGridTemplateRows):
3153         (WebCore::StyleBuilderCustom::applyInheritGridTemplateRows):
3154         (WebCore::StyleBuilderCustom::applyValueGridTemplateRows):
3155         * css/StyleProperties.cpp:
3156         (WebCore::StyleProperties::getPropertyValue):
3157
3158 2016-05-06  Nan Wang  <n_wang@apple.com>
3159
3160         AX: <attachment> element should have a replacement character
3161         https://bugs.webkit.org/show_bug.cgi?id=157406
3162
3163         Reviewed by Chris Fleizach.
3164
3165         Make sure attachment element is considered as a replaced node.
3166
3167         Test: accessibility/mac/attachment-element-replacement-character.html
3168
3169         * editing/TextIterator.cpp:
3170         (WebCore::isRendererReplacedElement):
3171
3172 2016-05-06  Nan Wang  <n_wang@apple.com>
3173
3174         AX: String for document range is empty if end visible position anchors to a ignored replaced node
3175         https://bugs.webkit.org/show_bug.cgi?id=157403
3176
3177         Reviewed by Chris Fleizach.
3178
3179         The CharacterOffset that is converted from VisiblePositon is wrong when the VisiblePostion anchors
3180         to an ignored replaced node. Fixed it by adjusting the offset of the CharacterOffset correctly in 
3181         such case.
3182
3183         Test: accessibility/mac/text-marker-string-for-document-end-replaced-node.html
3184
3185         * accessibility/AXObjectCache.cpp:
3186         (WebCore::characterOffsetsInOrder):
3187         (WebCore::AXObjectCache::characterOffsetFromVisiblePosition):
3188         (WebCore::AXObjectCache::accessibilityObjectForTextMarkerData):
3189
3190 2016-05-05  David Kilzer  <ddkilzer@apple.com>
3191
3192         [iOS] WebCore does not need to link to CoreAudio, GraphicsServices, SystemConfiguration frameworks
3193         <https://webkit.org/b/157413>
3194         <rdar://problem/26104189>
3195
3196         Reviewed by Gavin Barraclough.
3197
3198         * Configurations/WebCore.xcconfig:
3199         (OTHER_LDFLAGS_BASE_ios): Remove "-framework GraphicsServices".
3200         (OTHER_LDFLAGS_PLATFORM[sdk=macosx*]): Add "-framework CoreAudio"
3201         and "-framework SystemConfiguration".
3202         * WebCore.xcodeproj/project.pbxproj: Remove CoreAudio.framework
3203         and SystemConfiguration.framework from the project file.
3204
3205 2016-05-05  Brady Eidson  <beidson@apple.com>
3206
3207         Modern IDB (Workers): Get everything to the right threads.
3208         https://bugs.webkit.org/show_bug.cgi?id=157398
3209
3210         Reviewed by Alex Christensen.
3211
3212         No new tests (No current change in behavior, will be tested as bug 149953 is resolved, enabling IDB in workers).
3213
3214         * dom/ScriptExecutionContext.h:
3215         (WebCore::ScriptExecutionContext::postCrossThreadTask): Add a helper to post a CrossThreadTask to a context.
3216                 
3217         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
3218         (WebCore::IDBClient::performCallbackOnCorrectThread): Helper to perform an IDB callback on either the main thread
3219           or Worker thread as necessary.
3220         (WebCore::IDBClient::IDBConnectionProxy::openDatabase):
3221         (WebCore::IDBClient::IDBConnectionProxy::deleteDatabase):
3222         (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest):
3223         (WebCore::IDBClient::IDBConnectionProxy::createObjectStore):
3224         (WebCore::IDBClient::IDBConnectionProxy::deleteObjectStore):
3225         (WebCore::IDBClient::IDBConnectionProxy::clearObjectStore):
3226         (WebCore::IDBClient::IDBConnectionProxy::createIndex):
3227         (WebCore::IDBClient::IDBConnectionProxy::deleteIndex):
3228         (WebCore::IDBClient::IDBConnectionProxy::putOrAdd):
3229         (WebCore::IDBClient::IDBConnectionProxy::getRecord):
3230         (WebCore::IDBClient::IDBConnectionProxy::getCount):
3231         (WebCore::IDBClient::IDBConnectionProxy::deleteRecord):
3232         (WebCore::IDBClient::IDBConnectionProxy::openCursor):
3233         (WebCore::IDBClient::IDBConnectionProxy::iterateCursor):
3234         (WebCore::IDBClient::IDBConnectionProxy::completeOperation):
3235         (WebCore::IDBClient::IDBConnectionProxy::abortOpenAndUpgradeNeeded):
3236         (WebCore::IDBClient::IDBConnectionProxy::fireVersionChangeEvent):
3237         (WebCore::IDBClient::IDBConnectionProxy::didFireVersionChangeEvent):
3238         (WebCore::IDBClient::IDBConnectionProxy::notifyOpenDBRequestBlocked):
3239         (WebCore::IDBClient::IDBConnectionProxy::establishTransaction):
3240         (WebCore::IDBClient::IDBConnectionProxy::didStartTransaction):
3241         (WebCore::IDBClient::IDBConnectionProxy::commitTransaction):
3242         (WebCore::IDBClient::IDBConnectionProxy::didCommitTransaction):
3243         (WebCore::IDBClient::IDBConnectionProxy::abortTransaction):
3244         (WebCore::IDBClient::IDBConnectionProxy::didAbortTransaction):
3245         (WebCore::IDBClient::IDBConnectionProxy::didFinishHandlingVersionChangeTransaction):
3246         (WebCore::IDBClient::IDBConnectionProxy::databaseConnectionClosed):
3247         (WebCore::IDBClient::IDBConnectionProxy::scheduleMainThreadTasks):
3248         (WebCore::IDBClient::IDBConnectionProxy::handleMainThreadTasks):
3249         * Modules/indexeddb/client/IDBConnectionProxy.h:
3250         (WebCore::IDBClient::IDBConnectionProxy::callConnectionOnMainThread): Helper to marshall IDB operations from the
3251           Worker thread to the main thread.
3252         (WebCore::IDBClient::IDBConnectionProxy::postMainThreadTask):
3253
3254         * Modules/indexeddb/IDBTransaction.cpp:
3255         (WebCore::IDBTransaction::originThreadID):
3256         * Modules/indexeddb/IDBTransaction.h:
3257         
3258         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
3259         (WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
3260         * Modules/indexeddb/client/IDBConnectionToServer.h:
3261
3262         * Modules/indexeddb/client/IDBConnectionToServerDelegate.h:
3263
3264         * Modules/indexeddb/client/TransactionOperation.cpp:
3265         (WebCore::IDBClient::TransactionOperation::scriptExecutionContext):
3266         * Modules/indexeddb/client/TransactionOperation.h:
3267
3268         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
3269         (WebCore::nextClientResourceNumber):
3270
3271         * Modules/indexeddb/shared/InProcessIDBServer.cpp:
3272         (WebCore::InProcessIDBServer::putOrAdd):
3273         * Modules/indexeddb/shared/InProcessIDBServer.h:
3274
3275 2016-05-05  Dean Jackson  <dino@apple.com>
3276
3277         4 and 8 digit color attributes should use the crazypants algorithm, not the CSS one.
3278         https://bugs.webkit.org/show_bug.cgi?id=157402
3279         <rdar://problem/26131142>
3280
3281         Reviewed by Simon Fraser.
3282
3283         Noel and Tab from Google alerted me to the fact I broke some legacy
3284         HTML color attributes when I added support for 4 and 8 digit hex colors
3285         in CSS. The fix is to favor the "crazy" parsing unless we know it is a 3 or 6
3286         digit hex value (in which case we try the CSS algorithm first).
3287
3288         Covered by reverting an existing test.
3289
3290         * html/HTMLElement.cpp:
3291         (WebCore::HTMLElement::addHTMLColorToStyle):
3292
3293 2016-05-05  Brady Eidson  <beidson@apple.com>
3294
3295         Modern IDB (Workers): Remove the need for IDBConnectionProxy to expose its IDBConnectionToServer.
3296         https://bugs.webkit.org/show_bug.cgi?id=157394
3297
3298         Reviewed by Alex Christensen.
3299
3300         No new tests (No current change in behavior, will be tested as bug 149953 makes progress).
3301
3302         * Modules/indexeddb/IDBDatabase.cpp:
3303         (WebCore::IDBDatabase::transaction):
3304         (WebCore::IDBDatabase::fireVersionChangeEvent):
3305         (WebCore::IDBDatabase::dispatchEvent):
3306         * Modules/indexeddb/IDBDatabase.h:
3307         (WebCore::IDBDatabase::serverConnection): Deleted.
3308
3309         * Modules/indexeddb/IDBOpenDBRequest.cpp:
3310         (WebCore::IDBOpenDBRequest::requestCompleted):
3311
3312         * Modules/indexeddb/IDBRequest.cpp:
3313         (WebCore::IDBRequest::IDBRequest):
3314
3315         * Modules/indexeddb/IDBTransaction.cpp:
3316         (WebCore::IDBTransaction::connectionProxy):
3317         (WebCore::IDBTransaction::serverConnection): Deleted.
3318         * Modules/indexeddb/IDBTransaction.h:
3319
3320         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
3321         (WebCore::IDBClient::IDBConnectionProxy::abortOpenAndUpgradeNeeded):
3322         (WebCore::IDBClient::IDBConnectionProxy::connectionToServer): Deleted.
3323         * Modules/indexeddb/client/IDBConnectionProxy.h:
3324
3325         * Modules/indexeddb/client/IDBConnectionToServer.cpp:
3326         (WebCore::IDBClient::IDBConnectionToServer::abortOpenAndUpgradeNeeded):
3327
3328         * Modules/indexeddb/client/TransactionOperation.h:
3329         (WebCore::IDBClient::TransactionOperation::TransactionOperation):
3330
3331         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
3332         (WebCore::IDBCursorInfo::IDBCursorInfo):
3333
3334         * Modules/indexeddb/shared/IDBRequestData.cpp:
3335         (WebCore::IDBRequestData::IDBRequestData):
3336
3337         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
3338         (WebCore::IDBResourceIdentifier::IDBResourceIdentifier):
3339         * Modules/indexeddb/shared/IDBResourceIdentifier.h:
3340
3341         * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
3342         (WebCore::IDBTransactionInfo::clientTransaction):
3343         * Modules/indexeddb/shared/IDBTransactionInfo.h:
3344
3345 2016-05-05  Commit Queue  <commit-queue@webkit.org>
3346
3347         Unreviewed, rolling out r200479.
3348         https://bugs.webkit.org/show_bug.cgi?id=157397
3349
3350         A LayoutTest added with this change is crashing on Mac WK1
3351         test runs. (Requested by ryanhaddad on #webkit).
3352
3353         Reverted changeset:
3354
3355         "For keyboard users, activating a fragment URL should transfer
3356         focus and caret to the destination"
3357         https://bugs.webkit.org/show_bug.cgi?id=116046
3358         http://trac.webkit.org/changeset/200479
3359
3360 2016-05-05  Chris Dumez  <cdumez@apple.com>
3361
3362         CORS check is sometimes incorrectly failing for media loads
3363         https://bugs.webkit.org/show_bug.cgi?id=157370
3364         <rdar://problem/26071607>
3365
3366         Reviewed by Alex Christensen.
3367
3368         When the media library is issuing a conditional request for a media
3369         element that had the 'crossorigin' attribute, we would fail the CORS
3370         check and log an error if the server were to respond with a "304 Not
3371         Modified" response because the 304 response usually does not have
3372         the necessary "Access-Control-Allow-Origin: *" header (At least for
3373         Apache) and we cannot use the cached headers either since WebKit
3374         does not have them.
3375
3376         To work around the problem in the short term, we now drop the
3377         conditional headers from the request that the media library is
3378         giving us when the media element has the 'crossorigin' attribute
3379         set. As a result, the server will never respond with a 304 and we
3380         will be able to do a CORS check on the full (e.g. 206) response.
3381
3382         In the long term, we need to deal with this better as this means
3383         we may sometimes fail to reuse cached data. For now, this is only
3384         potentially inefficient in the cases that were broken (i.e. no
3385         video would play and we would log an error in the console).
3386
3387         Test: http/tests/security/video-cross-origin-caching.html
3388
3389         * loader/MediaResourceLoader.cpp:
3390         (WebCore::MediaResourceLoader::requestResource):
3391         Make the request unconditional if the media element has the
3392         'crossorigin' attribute set.
3393
3394         * platform/network/ResourceRequestBase.cpp:
3395         (WebCore::ResourceRequestBase::isConditional):
3396         (WebCore::ResourceRequestBase::makeUnconditional):
3397         When fixing the bug above, I noticed that those method do not do
3398         the right thing if the m_httpHeaderFields data member has not
3399         been populated yet. m_httpHeaderFields is lazily initialized so
3400         we need to call updateResourceRequest() before using it.
3401
3402 2016-05-05  Zalan Bujtas  <zalan@apple.com>
3403
3404         Stop traversing at the container block when computing RTL inline static distance.
3405         https://bugs.webkit.org/show_bug.cgi?id=157349
3406         <rdar://problem/25994087>
3407
3408         Reviewed by David Hyatt.
3409
3410         When computing the inline static distance for a child renderer, we start at its enclosing box
3411         and traverse up all the way to the container block.
3412         However when the enclosing box is the ancestor of the container block, we
3413         should just bail out right away since there's no container to use to adjust the position.
3414
3415         Test: fast/multicol/positioned-rtl-column-crash.html
3416
3417         * rendering/RenderBox.cpp:
3418         (WebCore::computeInlineStaticDistance):
3419
3420 2016-05-05  Ada Chan  <adachan@apple.com>
3421
3422         Add WebKitAdditions extension points in media controls related code in RenderThemeMac
3423         https://bugs.webkit.org/show_bug.cgi?id=157390
3424
3425         Reviewed by Anders Carlsson.
3426
3427         * rendering/RenderThemeMac.mm:
3428         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
3429         (WebCore::RenderThemeMac::mediaControlsScript):
3430
3431 2016-05-05  Jer Noble  <jer.noble@apple.com>
3432
3433         [WK2] Media controls don't update if controller is created after the interface is created
3434         https://bugs.webkit.org/show_bug.cgi?id=157376
3435
3436         Reviewed by Beth Dakin.
3437
3438         Add getter methods to WebPlaybackSessionModel so that the model's values can be retrieved
3439         if those values were missed before the equivalent WebPlaybackSessionInterface methods were
3440         called. This necessatates a bunch of changes in HTMLMediaElement and related classes to
3441         change PassRefPtr<TimeRanges> types to Ref<TimeRanges> (and one change in TimeRanges itself).
3442         WebPlaybackSessionModelMediaElement can implement these new getter methods by querying the
3443         values from the HTMLMediaElement, something it was doing already, so most of those changes
3444         are simple refactoring.
3445
3446         There's no reason any longer for WebVideoFullscreenModel to inherit from WebPlaybackSessionModel,
3447         so remove that superclass.
3448
3449         In WebPlaybackSessionInterfaceMac, when a new WebPlaybackControlsManager is set, use the new
3450         getter methods on WebPlaybackSessionModel to update the values in the manager.
3451
3452         * html/HTMLMediaElement.cpp:
3453