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