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