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