Remove EFL from WebCore
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-02-16  Anders Carlsson  <andersca@apple.com>
2
3         Remove EFL from WebCore
4         https://bugs.webkit.org/show_bug.cgi?id=168477
5
6         Reviewed by Brian Burg.
7
8         * accessibility/AccessibilityList.cpp:
9         (WebCore::AccessibilityList::childHasPseudoVisibleListItemMarkers):
10         * accessibility/AccessibilityNodeObject.cpp:
11         (WebCore::AccessibilityNodeObject::canSetValueAttribute):
12         * accessibility/AccessibilityObject.cpp:
13         (WebCore::AccessibilityObject::AccessibilityObject):
14         (WebCore::AccessibilityObject::textIteratorBehaviorForTextRange):
15         * accessibility/AccessibilityObject.h:
16         * accessibility/AccessibilityRenderObject.cpp:
17         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
18         * accessibility/AccessibilityTableColumn.cpp:
19         (WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored):
20         * accessibility/AccessibilityTableHeaderContainer.cpp:
21         (WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored):
22         * crypto/CryptoKey.cpp:
23         * crypto/keys/CryptoKeyRSA.h:
24         * dom/Document.cpp:
25         (WebCore::Document::implicitClose):
26         * editing/Editor.cpp:
27         (WebCore::Editor::performCutOrCopy):
28         (WebCore::Editor::copyImage):
29         * editing/Editor.h:
30         * editing/FrameSelection.h:
31         * html/HTMLCanvasElement.cpp:
32         (WebCore::requiresAcceleratedCompositingForWebGL):
33         * inspector/InspectorFrontendHost.cpp:
34         (WebCore::InspectorFrontendHost::port):
35         * loader/HistoryController.cpp:
36         (WebCore::HistoryController::restoreScrollPositionAndViewState):
37         * loader/icon/IconDatabase.cpp:
38         (WebCore::IconDatabase::performURLImport):
39         * page/ContextMenuController.cpp:
40         (WebCore::ContextMenuController::contextMenuItemSelected):
41         (WebCore::ContextMenuController::populate):
42         (WebCore::ContextMenuController::checkOrEnableIfNeeded):
43         * page/DragController.cpp:
44         (WebCore::DragController::startDrag):
45         * page/EventHandler.cpp:
46         (WebCore::EventHandler::eventInvertsTabsToLinksClientCallResult):
47         * page/FrameView.cpp:
48         (WebCore::FrameView::layout):
49         * platform/ContextMenuItem.h:
50         * platform/Cursor.h:
51         * platform/DragData.h:
52         * platform/DragImage.h:
53         * platform/FileSystem.h:
54         * platform/LocalizedStrings.h:
55         * platform/MIMETypeRegistry.cpp:
56         (WebCore::initializeSupportedImageMIMETypesForEncoding):
57         * platform/NotImplemented.h:
58         * platform/Pasteboard.h:
59         * platform/PlatformKeyboardEvent.h:
60         * platform/PlatformMouseEvent.h:
61         * platform/PlatformSpeechSynthesizer.h:
62         * platform/PlatformWheelEvent.h:
63         * platform/Widget.h:
64         * platform/graphics/ANGLEWebKitBridge.h:
65         * platform/graphics/BitmapImage.h:
66         * platform/graphics/GraphicsContext3D.h:
67         * platform/graphics/Icon.h:
68         * platform/graphics/Image.h:
69         (WebCore::Image::getEvasObject): Deleted.
70         * platform/graphics/IntPoint.h:
71         * platform/graphics/IntRect.h:
72         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
73         (WebCore::Extensions3DOpenGL::createVertexArrayOES):
74         (WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
75         (WebCore::Extensions3DOpenGL::isVertexArrayOES):
76         (WebCore::Extensions3DOpenGL::bindVertexArrayOES):
77         (WebCore::Extensions3DOpenGL::supportsExtension):
78         * platform/graphics/opengl/Extensions3DOpenGL.h:
79         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
80         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
81         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
82         (WebCore::GraphicsContext3D::createForCurrentGLContext):
83         (WebCore::GraphicsContext3D::reshape):
84         (WebCore::GraphicsContext3D::createVertexArray):
85         (WebCore::GraphicsContext3D::deleteVertexArray):
86         (WebCore::GraphicsContext3D::isVertexArray):
87         (WebCore::GraphicsContext3D::bindVertexArray):
88         * platform/graphics/opengl/TemporaryOpenGLSetting.cpp:
89         * platform/network/NetworkStateNotifier.h:
90         * platform/posix/FileSystemPOSIX.cpp:
91         * rendering/RenderLayerCompositor.cpp:
92         (WebCore::RenderLayerCompositor::ensureRootLayer):
93         * rendering/RenderText.cpp:
94         (WebCore::RenderText::previousOffsetForBackwardDeletion):
95         * xml/XSLStyleSheetLibxslt.cpp:
96         * xml/XSLTExtensions.cpp:
97         * xml/XSLTProcessorLibxslt.cpp:
98         * xml/XSLTUnicodeSort.cpp:
99
100 2017-02-16  Zalan Bujtas  <zalan@apple.com>
101
102         Simple line layout: Add forced line layout info to coverage print.
103         https://bugs.webkit.org/show_bug.cgi?id=168470
104
105         Reviewed by Simon Fraser.
106
107         This is about potential vs. actual coverage:
108
109         Simple line layout potential coverage: 65.05%
110         Simple line layout actual coverage: 46.60%
111         Forced line layout blocks: 4 content length: 57(18.45%)
112
113         Not testable.
114
115         * rendering/SimpleLineLayout.cpp:
116         (WebCore::SimpleLineLayout::printSimpleLineLayoutCoverage):
117
118 2017-02-16  Anders Carlsson  <andersca@apple.com>
119
120         Rename DataTransfer functions to indicate whether they are for dragging or dropping
121         https://bugs.webkit.org/show_bug.cgi?id=168478
122
123         Reviewed by Tim Horton.
124
125         * dom/DataTransfer.cpp:
126         (WebCore::DataTransfer::createForDrag):
127         (WebCore::DataTransfer::createForDrop):
128         (WebCore::DataTransfer::createForDragAndDrop): Deleted.
129         * dom/DataTransfer.h:
130         * page/DragController.cpp:
131         (WebCore::DragController::dragExited):
132         (WebCore::DragController::performDragOperation):
133         (WebCore::DragController::tryDHTMLDrag):
134         * page/mac/EventHandlerMac.mm:
135         (WebCore::EventHandler::createDraggingDataTransfer):
136
137 2017-02-16  Anders Carlsson  <andersca@apple.com>
138
139         Rename EventHandler::freeDataTransfer to invalidateDataTransfer
140         https://bugs.webkit.org/show_bug.cgi?id=168472
141
142         Reviewed by Tim Horton.
143
144         The code doesn't necessarily free the data transfer object, so rename the member function
145         to reflect that. Also, get rid of a goto.
146
147         * page/EventHandler.cpp:
148         (WebCore::EventHandler::invalidateDataTransfer):
149         (WebCore::EventHandler::dragSourceEndedAt):
150         (WebCore::EventHandler::handleDrag):
151         (WebCore::EventHandler::freeDataTransfer): Deleted.
152         * page/EventHandler.h:
153
154 2017-02-16  Alex Christensen  <achristensen@webkit.org>
155
156         Special URLs without a host are invalid
157         https://bugs.webkit.org/show_bug.cgi?id=168461
158
159         Reviewed by Tim Horton.
160
161         http://? should be invalid.  This matches Chrome and the spec and the intent of my implementation
162         of URLParser which already fails with urls like http:// and this was just an oversight.
163         Covered by newly passing web platform tests.  Updated API tests.
164
165         * platform/URLParser.cpp:
166         (WebCore::URLParser::parse):
167
168 2017-02-16  Zalan Bujtas  <zalan@apple.com>
169
170         Simple line layout: Add support for pagination.
171         https://bugs.webkit.org/show_bug.cgi?id=168355
172         <rdar://problem/30119769>
173
174         Reviewed by David Hyatt.
175
176         This patch adds basic support for paginated content including widows and orphans.
177
178         This is based on the normal line layout pagination logic. However there are 2 major
179         advantages here (and they allow us to have a much simpler logic):
180         1. all the lines are positioned by the time we start paginating them and
181         2. lines always have uniform heights. 
182
183         This is not enabled yet.
184
185         * rendering/RenderBlockFlow.h:
186         * rendering/SimpleLineLayout.cpp:
187         (WebCore::SimpleLineLayout::computeLineTopAndBottomWithOverflow):
188         (WebCore::SimpleLineLayout::computeLineBreakIndex):
189         (WebCore::SimpleLineLayout::setPageBreakForLine):
190         (WebCore::SimpleLineLayout::computeOffsetAfterLineBreak):
191         (WebCore::SimpleLineLayout::updateMinimumPageHeight):
192         (WebCore::SimpleLineLayout::adjustLinePositionsForPagination):
193         (WebCore::SimpleLineLayout::create):
194         (WebCore::SimpleLineLayout::Layout::create):
195         (WebCore::SimpleLineLayout::Layout::Layout):
196         * rendering/SimpleLineLayout.h:
197         (WebCore::SimpleLineLayout::Layout::isPaginated):
198         (WebCore::SimpleLineLayout::Layout::struts):
199         * rendering/SimpleLineLayoutFunctions.h:
200         (WebCore::SimpleLineLayout::computeFlowHeight):
201         * rendering/SimpleLineLayoutResolver.h:
202         (WebCore::SimpleLineLayout::RunResolver::Run::computeBaselinePosition):
203
204 2017-02-11  Filip Pizlo  <fpizlo@apple.com>
205
206         The collector thread should only start when the mutator doesn't have heap access
207         https://bugs.webkit.org/show_bug.cgi?id=167737
208
209         Reviewed by Keith Miller.
210
211         Added new tests in JSTests and LayoutTests.
212         
213         The WebCore changes involve:
214         
215         - Refactoring around new header discipline.
216         
217         - Adding crazy GC APIs to window.internals to enable us to test the GC's runloop discipline.
218
219         * ForwardingHeaders/heap/GCFinalizationCallback.h: Added.
220         * ForwardingHeaders/heap/IncrementalSweeper.h: Added.
221         * ForwardingHeaders/heap/MachineStackMarker.h: Added.
222         * ForwardingHeaders/heap/RunningScope.h: Added.
223         * bindings/js/CommonVM.cpp:
224         * testing/Internals.cpp:
225         (WebCore::Internals::parserMetaData):
226         (WebCore::Internals::isReadableStreamDisturbed):
227         (WebCore::Internals::isGCRunning):
228         (WebCore::Internals::addGCFinalizationCallback):
229         (WebCore::Internals::stopSweeping):
230         (WebCore::Internals::startSweeping):
231         * testing/Internals.h:
232         * testing/Internals.idl:
233
234 2017-02-16  Jiewen Tan  <jiewen_tan@apple.com>
235
236         [WebCrypto] remove toJSValueFromJsonWebKey from custom SubtleCrypto binding codes
237         https://bugs.webkit.org/show_bug.cgi?id=167026
238
239         Reviewed by Chris Dumez.
240
241         Covered by existing tests.
242
243         * bindings/js/JSSubtleCryptoCustom.cpp:
244         (WebCore::jsSubtleCryptoFunctionExportKeyPromise):
245         (WebCore::jsSubtleCryptoFunctionWrapKeyPromise):
246         (WebCore::toJSValueFromJsonWebKey): Deleted.
247         * crypto/JsonWebKey.h:
248         * crypto/JsonWebKey.idl:
249         * crypto/RsaOtherPrimesInfo.idl:
250         Change std::optional<String> to String in order to use toJS<IDLDictionary<JsonWebKey>>.
251         * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
252         (WebCore::CryptoAlgorithmAES_CBC::importKey):
253         * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
254         (WebCore::CryptoAlgorithmAES_KW::importKey):
255         * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
256         (WebCore::CryptoAlgorithmHMAC::importKey):
257         * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
258         (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
259         * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
260         (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
261         * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
262         (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
263         * crypto/keys/CryptoKeyAES.cpp:
264         (WebCore::CryptoKeyAES::importJwk):
265         Only check if key_ops contains all of the specified usages when key_ops field of jwk is present,
266         as per the specification: https://www.w3.org/TR/WebCryptoAPI/#aes-cbc-operations
267         * crypto/keys/CryptoKeyAES.h:
268         * crypto/keys/CryptoKeyHMAC.cpp:
269         (WebCore::CryptoKeyHMAC::importJwk):
270         * crypto/keys/CryptoKeyHMAC.h:
271         * crypto/keys/CryptoKeyRSA.cpp:
272         (WebCore::CryptoKeyRSA::importJwk):
273         Accommodate the change from std::optional<String> to String.
274         * crypto/mac/CryptoKeyRSAMac.cpp:
275         (WebCore::CryptoKeyRSA::create):
276         Add a null check for p.
277
278 2017-02-16  Antti Koivisto  <antti@apple.com>
279
280         Execute pending scripts asynchronously after stylesheet loads complete
281         https://bugs.webkit.org/show_bug.cgi?id=168367
282         rdar://problem/30561379
283
284         Reviewed by Andreas Kling.
285
286         The current synchronous execution is fragile and creates various problems.
287
288         * css/StyleSheetContents.cpp:
289         (WebCore::StyleSheetContents::checkLoaded):
290         * dom/ContainerNode.cpp:
291         (WebCore::ContainerNode::takeAllChildrenFrom):
292         (WebCore::ContainerNode::notifyChildInserted):
293         (WebCore::ContainerNode::removeChild):
294         (WebCore::ContainerNode::parserRemoveChild):
295         (WebCore::ContainerNode::removeChildren):
296
297             Remove various places where we would trigger delayed synchronous execution.
298
299         * dom/Document.cpp:
300         (WebCore::Document::Document):
301         (WebCore::Document::recalcStyle):
302
303             Trigger scroll to anchor at the end of style resolution instead of when style sheet load completes.
304
305         (WebCore::Document::didRemoveAllPendingStylesheet):
306
307             Call asynchronous script execution function.
308
309         * dom/Document.h:
310         (WebCore::Document::setNeedsNotifyRemoveAllPendingStylesheet): Deleted.
311         (WebCore::Document::notifyRemovePendingSheetIfNeeded): Deleted.
312         * dom/ScriptableDocumentParser.cpp:
313         (WebCore::ScriptableDocumentParser::ScriptableDocumentParser):
314         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheetsSoon):
315         (WebCore::ScriptableDocumentParser::scriptsWaitingForStylesheetsExecutionTimerFired):
316
317             Add a timer for executing pending scripts.
318
319         (WebCore::ScriptableDocumentParser::detach):
320         * dom/ScriptableDocumentParser.h:
321         (WebCore::ScriptableDocumentParser::executeScriptsWaitingForStylesheets):
322         * html/HTMLLinkElement.cpp:
323         (WebCore::HTMLLinkElement::removedFrom):
324         (WebCore::HTMLLinkElement::removePendingSheet):
325         * html/HTMLLinkElement.h:
326         * html/parser/HTMLDocumentParser.cpp:
327         (WebCore::HTMLDocumentParser::detach):
328         * loader/DocumentLoader.cpp:
329         (WebCore::DocumentLoader::isLoadingInAPISense):
330
331             Stay in loading state if we have a pending script. This matches existing behavior.
332
333         * style/StyleScope.cpp:
334         (WebCore::Style::Scope::removePendingSheet):
335         * style/StyleScope.h:
336
337 2017-02-16  Anders Carlsson  <andersca@apple.com>
338
339         Set the DHTML drag image in the DHTML type check
340         https://bugs.webkit.org/show_bug.cgi?id=168451
341
342         Reviewed by Wenson Hsieh.
343
344         * page/DragController.cpp:
345         (WebCore::DragController::startDrag):
346
347 2017-02-16  Anders Carlsson  <andersca@apple.com>
348
349         Begin removing EFL code from WebCore.
350
351         Rubber-stamped by Alex Christensen.
352
353         * PlatformEfl.cmake: Removed.
354         * editing/efl/EditorEfl.cpp: Removed.
355         * page/efl/DragControllerEfl.cpp: Removed.
356         * page/efl/EventHandlerEfl.cpp: Removed.
357         * platform/audio/efl/AudioBusEfl.cpp: Removed.
358         * platform/efl/CursorEfl.cpp: Removed.
359         * platform/efl/DefaultTheme/CMakeLists.txt: Removed.
360         * platform/efl/DefaultTheme/default.edc: Removed.
361         * platform/efl/DefaultTheme/widget/button/button.edc: Removed.
362         * platform/efl/DefaultTheme/widget/button/img_button_focus.png: Removed.
363         * platform/efl/DefaultTheme/widget/button/img_button_hover.png: Removed.
364         * platform/efl/DefaultTheme/widget/button/img_button_normal.png: Removed.
365         * platform/efl/DefaultTheme/widget/button/img_button_press.png: Removed.
366         * platform/efl/DefaultTheme/widget/check/check.edc: Removed.
367         * platform/efl/DefaultTheme/widget/check/img_check_bg_disabled.png: Removed.
368         * platform/efl/DefaultTheme/widget/check/img_check_bg_enabled.png: Removed.
369         * platform/efl/DefaultTheme/widget/check/img_check_off.png: Removed.
370         * platform/efl/DefaultTheme/widget/check/img_check_off_focus.png: Removed.
371         * platform/efl/DefaultTheme/widget/check/img_check_off_hover.png: Removed.
372         * platform/efl/DefaultTheme/widget/check/img_check_on.png: Removed.
373         * platform/efl/DefaultTheme/widget/check/img_check_on_focus.png: Removed.
374         * platform/efl/DefaultTheme/widget/check/img_check_on_hover.png: Removed.
375         * platform/efl/DefaultTheme/widget/combo/combo.edc: Removed.
376         * platform/efl/DefaultTheme/widget/combo/combo_focus.png: Removed.
377         * platform/efl/DefaultTheme/widget/combo/combo_focus_button.png: Removed.
378         * platform/efl/DefaultTheme/widget/combo/combo_focus_button_transparent.png: Removed.
379         * platform/efl/DefaultTheme/widget/combo/combo_focus_transparent.png: Removed.
380         * platform/efl/DefaultTheme/widget/combo/combo_hover.png: Removed.
381         * platform/efl/DefaultTheme/widget/combo/combo_hover_button.png: Removed.
382         * platform/efl/DefaultTheme/widget/combo/combo_hover_button_transparent.png: Removed.
383         * platform/efl/DefaultTheme/widget/combo/combo_hover_transparent.png: Removed.
384         * platform/efl/DefaultTheme/widget/combo/combo_normal.png: Removed.
385         * platform/efl/DefaultTheme/widget/combo/combo_normal_button.png: Removed.
386         * platform/efl/DefaultTheme/widget/combo/combo_normal_button_transparent.png: Removed.
387         * platform/efl/DefaultTheme/widget/combo/combo_normal_transparent.png: Removed.
388         * platform/efl/DefaultTheme/widget/combo/combo_press.png: Removed.
389         * platform/efl/DefaultTheme/widget/combo/combo_press_button.png: Removed.
390         * platform/efl/DefaultTheme/widget/combo/combo_press_button_transparent.png: Removed.
391         * platform/efl/DefaultTheme/widget/combo/combo_press_transparent.png: Removed.
392         * platform/efl/DefaultTheme/widget/combo/icon.png: Removed.
393         * platform/efl/DefaultTheme/widget/entry/entry.edc: Removed.
394         * platform/efl/DefaultTheme/widget/entry/img_focused.png: Removed.
395         * platform/efl/DefaultTheme/widget/entry/img_hovered.png: Removed.
396         * platform/efl/DefaultTheme/widget/entry/img_normal.png: Removed.
397         * platform/efl/DefaultTheme/widget/progressbar/bt_base.png: Removed.
398         * platform/efl/DefaultTheme/widget/progressbar/progressbar.edc: Removed.
399         * platform/efl/DefaultTheme/widget/progressbar/shelf_inset.png: Removed.
400         * platform/efl/DefaultTheme/widget/radio/img_radio_bg_disabled.png: Removed.
401         * platform/efl/DefaultTheme/widget/radio/img_radio_bg_enabled.png: Removed.
402         * platform/efl/DefaultTheme/widget/radio/img_radio_off.png: Removed.
403         * platform/efl/DefaultTheme/widget/radio/img_radio_off_focus.png: Removed.
404         * platform/efl/DefaultTheme/widget/radio/img_radio_off_hover.png: Removed.
405         * platform/efl/DefaultTheme/widget/radio/img_radio_on.png: Removed.
406         * platform/efl/DefaultTheme/widget/radio/img_radio_on_focus.png: Removed.
407         * platform/efl/DefaultTheme/widget/radio/img_radio_on_hover.png: Removed.
408         * platform/efl/DefaultTheme/widget/radio/radio.edc: Removed.
409         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar.edc: Removed.
410         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_horizontal.png: Removed.
411         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_vertical.png: Removed.
412         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_horizontal.png: Removed.
413         * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_vertical.png: Removed.
414         * platform/efl/DefaultTheme/widget/search/cancel/cancel_normal_button.png: Removed.
415         * platform/efl/DefaultTheme/widget/search/cancel/cancel_normal_button2.png: Removed.
416         * platform/efl/DefaultTheme/widget/search/cancel/search_cancel.edc: Removed.
417         * platform/efl/DefaultTheme/widget/search/decoration/decoration_normal_button.png: Removed.
418         * platform/efl/DefaultTheme/widget/search/decoration/search_decoration.edc: Removed.
419         * platform/efl/DefaultTheme/widget/search/field/field_focused.png: Removed.
420         * platform/efl/DefaultTheme/widget/search/field/field_hovered.png: Removed.
421         * platform/efl/DefaultTheme/widget/search/field/field_normal.png: Removed.
422         * platform/efl/DefaultTheme/widget/search/field/search_field.edc: Removed.
423         * platform/efl/DefaultTheme/widget/slider/slider.edc: Removed.
424         * platform/efl/DefaultTheme/widget/slider/slider_fill_h.png: Removed.
425         * platform/efl/DefaultTheme/widget/slider/slider_fill_v.png: Removed.
426         * platform/efl/DefaultTheme/widget/slider/slider_h.png: Removed.
427         * platform/efl/DefaultTheme/widget/slider/slider_thumb_h.png: Removed.
428         * platform/efl/DefaultTheme/widget/slider/slider_thumb_press_h.png: Removed.
429         * platform/efl/DefaultTheme/widget/slider/slider_thumb_press_v.png: Removed.
430         * platform/efl/DefaultTheme/widget/slider/slider_thumb_v.png: Removed.
431         * platform/efl/DefaultTheme/widget/slider/slider_v.png: Removed.
432         * platform/efl/DefaultTheme/widget/spinner/sp_bg.png: Removed.
433         * platform/efl/DefaultTheme/widget/spinner/sp_down_default.png: Removed.
434         * platform/efl/DefaultTheme/widget/spinner/sp_down_hover.png: Removed.
435         * platform/efl/DefaultTheme/widget/spinner/sp_down_pressed.png: Removed.
436         * platform/efl/DefaultTheme/widget/spinner/sp_up_default.png: Removed.
437         * platform/efl/DefaultTheme/widget/spinner/sp_up_hover.png: Removed.
438         * platform/efl/DefaultTheme/widget/spinner/sp_up_pressed.png: Removed.
439         * platform/efl/DefaultTheme/widget/spinner/spinner.edc: Removed.
440         * platform/efl/DragDataEfl.cpp: Removed.
441         * platform/efl/DragImageEfl.cpp: Removed.
442         * platform/efl/EflInspectorUtilities.cpp: Removed.
443         * platform/efl/EflInspectorUtilities.h: Removed.
444         * platform/efl/EflKeyboardUtilities.cpp: Removed.
445         * platform/efl/EflKeyboardUtilities.h: Removed.
446         * platform/efl/EflScreenUtilities.cpp: Removed.
447         * platform/efl/EflScreenUtilities.h: Removed.
448         * platform/efl/ErrorsEfl.cpp: Removed.
449         * platform/efl/ErrorsEfl.h: Removed.
450         * platform/efl/EventLoopEfl.cpp: Removed.
451         * platform/efl/FileSystemEfl.cpp: Removed.
452         * platform/efl/LocalizedStringsEfl.cpp: Removed.
453         * platform/efl/MIMETypeRegistryEfl.cpp: Removed.
454         * platform/efl/MainThreadSharedTimerEfl.cpp: Removed.
455         * platform/efl/PasteboardEfl.cpp: Removed.
456         * platform/efl/PlatformKeyboardEventEfl.cpp: Removed.
457         * platform/efl/PlatformMouseEventEfl.cpp: Removed.
458         * platform/efl/PlatformScreenEfl.cpp: Removed.
459         * platform/efl/PlatformSpeechSynthesisProviderEfl.cpp: Removed.
460         * platform/efl/PlatformSpeechSynthesisProviderEfl.h: Removed.
461         * platform/efl/PlatformSpeechSynthesizerEfl.cpp: Removed.
462         * platform/efl/PlatformWheelEventEfl.cpp: Removed.
463         * platform/efl/ScrollbarThemeEfl.cpp: Removed.
464         * platform/efl/ScrollbarThemeEfl.h: Removed.
465         * platform/efl/SoundEfl.cpp: Removed.
466         * platform/efl/TemporaryLinkStubs.cpp: Removed.
467         * platform/efl/UserAgentEfl.cpp: Removed.
468         * platform/efl/WidgetEfl.cpp: Removed.
469         * platform/gamepad/efl/GamepadsEfl.cpp: Removed.
470         * platform/graphics/efl/CairoUtilitiesEfl.cpp: Removed.
471         * platform/graphics/efl/CairoUtilitiesEfl.h: Removed.
472         * platform/graphics/efl/EvasGLContext.cpp: Removed.
473         * platform/graphics/efl/EvasGLContext.h: Removed.
474         * platform/graphics/efl/EvasGLSurface.cpp: Removed.
475         * platform/graphics/efl/EvasGLSurface.h: Removed.
476         * platform/graphics/efl/GraphicsContext3DEfl.cpp: Removed.
477         * platform/graphics/efl/GraphicsContext3DPrivate.cpp: Removed.
478         * platform/graphics/efl/GraphicsContext3DPrivate.h: Removed.
479         * platform/graphics/efl/IconEfl.cpp: Removed.
480         * platform/graphics/efl/ImageBufferEfl.cpp: Removed.
481         * platform/graphics/efl/ImageEfl.cpp: Removed.
482         * platform/graphics/efl/IntPointEfl.cpp: Removed.
483         * platform/graphics/efl/IntRectEfl.cpp: Removed.
484         * platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp: Removed.
485         * platform/network/efl/NetworkStateNotifierEfl.cpp: Removed.
486         * rendering/RenderThemeEfl.cpp: Removed.
487         * rendering/RenderThemeEfl.h: Removed.
488
489 2017-02-16  Joseph Pecoraro  <pecoraro@apple.com>
490
491         [Resource Timing] Support Resource Timing in Workers
492         https://bugs.webkit.org/show_bug.cgi?id=168086
493         <rdar://problem/30430117>
494
495         Reviewed by Alex Christensen.
496
497         Worker's load resources through the Document that loaded them. However,
498         their PerformanceResourceTiming entries should be added to the Performance
499         object inside the Worker context, not the Document's context.
500
501         This change adds an InitiatorContext to ResourceLoadOptions so that loaders
502         can determine if the load was initiated by the Document or a Worker. This
503         allows loaders to then know if the ResourceTiming data they collect should
504         be added to the Document's Performance object or forwarded on to the Worker's.
505
506         This adds a new ThreadableLoaderClient method intended only for the purpose
507         of adding the ResourceTiming information to the Worker's Performance object.
508         Unlike other ThreadableLoaderClient methods that are bridged and forwarded
509         on to a client inside the worker (e.g. XMLHttpRequest or FetchLoader) this
510         method never needs to be handled by clients and can be uniformly handled by
511         the WorkerThreadableLoader itself.
512
513         We also add a new ResourceTiming object that encapsulates all of the data
514         ultimately needed for a PerformanceResourceTimingEntry object. This allows
515         for all of the information to be gathered while loading on the Document
516         before serializing across to the Worker. That includes the Timing-Allow-Origin
517         check which uses the SecurityOrigin of the Worker.
518
519         This also modernizes and addresses issues in the Resource Timing implementation.
520         Better handling cases like loading from the Cache, Synchronous Loads, and
521         improving initiatorType information.
522
523         Tests: imported/w3c/web-platform-tests/resource-timing/rt-cors.html
524                imported/w3c/web-platform-tests/resource-timing/rt-cors.worker.html
525                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-css.html
526                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-element.html
527                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-fetch.html
528                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-media.html
529                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-other.html
530                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-script-module.html
531                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType-xmlhttprequest.html
532                imported/w3c/web-platform-tests/resource-timing/rt-initiatorType.worker.html
533                imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.html
534                imported/w3c/web-platform-tests/resource-timing/rt-performance-extensions.worker.html
535                imported/w3c/web-platform-tests/resource-timing/rt-resource-errors.html
536                imported/w3c/web-platform-tests/resource-timing/rt-resource-ignored.html
537                imported/w3c/web-platform-tests/resource-timing/rt-resources-per-frame.html
538                imported/w3c/web-platform-tests/resource-timing/rt-resources-per-worker.html
539                imported/w3c/web-platform-tests/resource-timing/rt-serialization.html
540                imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-frames.html
541                imported/w3c/web-platform-tests/resource-timing/rt-shared-resource-in-workers.html
542                performance-api/resource-timing-apis.html
543
544         * CMakeLists.txt:
545         * WebCore.xcodeproj/project.pbxproj:
546         New files.
547
548         * platform/network/NetworkLoadTiming.h:
549         (WebCore::NetworkLoadTiming::reset): Deleted.
550         We no longer need to reset.
551
552         * loader/ResourceTiming.cpp: Added.
553         (WebCore::passesTimingAllowCheck):
554         (WebCore::ResourceTiming::fromCache):
555         (WebCore::ResourceTiming::fromLoad):
556         (WebCore::ResourceTiming::fromSynchronousLoad):
557         (WebCore::ResourceTiming::ResourceTiming):
558         (WebCore::ResourceTiming::isolatedCopy):
559         * loader/ResourceTiming.h: Added.
560         (WebCore::ResourceTiming::url):
561         (WebCore::ResourceTiming::initiator):
562         (WebCore::ResourceTiming::loadTiming):
563         (WebCore::ResourceTiming::networkLoadTiming):
564         (WebCore::ResourceTiming::allowTimingDetails):
565         (WebCore::ResourceTiming::overrideInitiatorName):
566         (WebCore::ResourceTiming::ResourceTiming):
567         Class that encapsulates all of the data needed for a PerformanceResourceTiming entry.
568         There are three static constructors indicating the different ways this object can
569         be constructed and the different data available at the time of construction.
570
571         * loader/ResourceLoaderOptions.h:
572         Add the new InitiatorContext, default to Document.
573
574         * loader/ThreadableLoaderClient.h:
575         (WebCore::ThreadableLoaderClient::didFinishTiming):
576         New client method only used by WorkerThreadableLoader.
577
578         * loader/WorkerThreadableLoader.h:
579         * loader/WorkerThreadableLoader.cpp:
580         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
581         (WebCore::WorkerThreadableLoader::MainThreadBridge::didFinishTiming):
582         All loads initiated in a WorkerThreadableLoader get identified as InitiatorContext::Worker.
583         Add timing information to the Performance object when received. No need to inform clients.
584
585         * loader/DocumentThreadableLoader.h:
586         * loader/DocumentThreadableLoader.cpp:
587         (WebCore::DocumentThreadableLoader::finishedTimingForWorkerLoad):
588         (WebCore::DocumentThreadableLoader::loadRequest):
589         Provide APIs to pass timing data on to a WorkerThreadableLoader.
590         Create ResourceTiming data for synchronous loads.
591
592         * loader/LoadTiming.h:
593         * loader/LoadTiming.cpp:
594         (WebCore::LoadTiming::isolatedCopy):
595         Add isolatedCopy to allow this data to be passed across to a Worker.
596
597         * loader/ResourceTimingInformation.h:
598         * loader/ResourceTimingInformation.cpp:
599         (WebCore::ResourceTimingInformation::shouldAddResourceTiming):
600         (WebCore::ResourceTimingInformation::addResourceTiming):
601         (WebCore::ResourceTimingInformation::storeResourceTimingInitiatorInformation):
602         Refactor to remove unused / unnecessary bits. Extract out some helpful code.
603         Changed this to match when Blink decides when to add or ignore entries, however
604         this may change over time.
605
606         * loader/SubresourceLoader.cpp:
607         (WebCore::SubresourceLoader::didFinishLoading):
608         (WebCore::SubresourceLoader::notifyDone):
609         (WebCore::SubresourceLoader::reportResourceTiming):
610         * loader/SubresourceLoader.h:
611         * loader/cache/CachedRawResource.cpp:
612         (WebCore::CachedRawResource::finishedTimingForWorkerLoad):
613         * loader/cache/CachedRawResource.h:
614         * loader/cache/CachedRawResourceClient.h:
615         (WebCore::CachedRawResourceClient::finishedTimingForWorkerLoad):
616         Plumbing to report timing information to Worker if this resource was loaded for a Worker.
617
618         * loader/cache/CachedResource.cpp:
619         (WebCore::CachedResource::CachedResource):
620         * loader/cache/CachedResource.h:
621         (WebCore::CachedResource::initiatorName):
622         Store the initiator name on the CachedResource like other data added to the original
623         CachedResourceRequest. This is a bit of a hack but follows an existing pattern, and
624         cleans up other hacks that worked around this later on.
625
626         * loader/cache/CachedResourceLoader.h:
627         * loader/cache/CachedResourceLoader.cpp:
628         (WebCore::CachedResourceLoader::requestResource):
629         (WebCore::CachedResourceLoader::revalidateResource):
630         (WebCore::CachedResourceLoader::loadResource):
631         Simply the creation of a ResourceTiming object for cache hits.
632         Report timing information to Worker if this resource was loaded for a Worker.
633
634         (WebCore::CachedResourceLoader::loadDone):
635         Eliminate this redundant point attempting to add a ResourceTiming entry.
636
637         * loader/cache/CachedResourceRequest.cpp:
638         (WebCore::CachedResourceRequest::initiatorName):
639         Update to match the spec. The fallback is "other".
640
641         * page/Performance.h:
642         * page/Performance.cpp:
643         (WebCore::Performance::setResourceTimingBufferSize):
644         (WebCore::Performance::addResourceTiming):
645         Update to support PerformanceObservers.
646         Update to match spec (event should bubble).
647
648         * page/PerformanceResourceTiming.h:
649         * page/PerformanceResourceTiming.cpp:
650         (WebCore::PerformanceResourceTiming::create):
651         (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
652         (WebCore::PerformanceResourceTiming::fetchStart):
653         (WebCore::PerformanceResourceTiming::domainLookupStart):
654         (WebCore::PerformanceResourceTiming::domainLookupEnd):
655         (WebCore::PerformanceResourceTiming::connectStart):
656         (WebCore::PerformanceResourceTiming::connectEnd):
657         (WebCore::PerformanceResourceTiming::secureConnectionStart):
658         (WebCore::PerformanceResourceTiming::requestStart):
659         (WebCore::PerformanceResourceTiming::responseStart):
660         (WebCore::PerformanceResourceTiming::responseEnd):
661         (WebCore::PerformanceResourceTiming::networkLoadTimeToDOMHighResTimeStamp):
662         Construct with a ResourceTiming object containing all the data we need for the entry.
663         Update to match spec for what is required, should fallback, should be zero, etc.
664
665         (WebCore::passesTimingAllowCheck): Deleted.
666         Extracted this to ResourceTiming creation time in the loading context,
667         since this can't be determined on the Worker context without also having
668         all of the header information from each resource response.
669
670         * page/PerformanceResourceTiming.idl:
671         Expose to Workers!
672
673 2017-02-16  Yusuke Suzuki  <utatane.tea@gmail.com>
674
675         [JSC] Drop PassRefPtr in inspector/
676         https://bugs.webkit.org/show_bug.cgi?id=168420
677
678         Reviewed by Alex Christensen.
679
680         Use Ref<Inspector::ScriptArguments> and Ref<ScriptCallStack> as much as possible.
681         It drops some unnecessary null checks.
682
683         * bindings/scripts/CodeGeneratorJS.pm:
684         (GenerateCallWith):
685         * bindings/scripts/test/JS/JSTestObj.cpp:
686         (WebCore::jsTestObjPrototypeFunctionWithScriptArgumentsAndCallStackCaller):
687         * dom/ScriptExecutionContext.cpp:
688         (WebCore::ScriptExecutionContext::PendingException::PendingException):
689         * inspector/InspectorInstrumentation.cpp:
690         (WebCore::InspectorInstrumentation::consoleCountImpl):
691         (WebCore::InspectorInstrumentation::stopConsoleTimingImpl):
692         (WebCore::InspectorInstrumentation::consoleTimeStampImpl):
693         * inspector/InspectorInstrumentation.h:
694         (WebCore::InspectorInstrumentation::consoleCount):
695         (WebCore::InspectorInstrumentation::stopConsoleTiming):
696         (WebCore::InspectorInstrumentation::consoleTimeStamp):
697         * inspector/InspectorNetworkAgent.cpp:
698         (WebCore::InspectorNetworkAgent::buildInitiatorObject):
699         * inspector/TimelineRecordFactory.cpp:
700         (WebCore::TimelineRecordFactory::createGenericRecord):
701         * inspector/WebInjectedScriptManager.cpp:
702         (WebCore::WebInjectedScriptManager::WebInjectedScriptManager):
703         * inspector/WebInjectedScriptManager.h:
704         * page/DOMWindow.cpp:
705         (WebCore::DOMWindow::postMessageTimerFired):
706         We dispatch appropriate addMessage function according to whether
707         `timer.stackTrace()` is nullptr.
708
709         * page/PageConsoleClient.cpp:
710         (WebCore::PageConsoleClient::addMessage):
711         (WebCore::PageConsoleClient::messageWithTypeAndLevel):
712         (WebCore::PageConsoleClient::count):
713         (WebCore::PageConsoleClient::timeEnd):
714         (WebCore::PageConsoleClient::timeStamp):
715         * page/PageConsoleClient.h:
716         * workers/WorkerConsoleClient.cpp:
717         (WebCore::WorkerConsoleClient::messageWithTypeAndLevel):
718         (WebCore::WorkerConsoleClient::count):
719         (WebCore::WorkerConsoleClient::timeEnd):
720         (WebCore::WorkerConsoleClient::timeStamp):
721         * workers/WorkerConsoleClient.h:
722         * workers/WorkerGlobalScope.cpp:
723         (WebCore::WorkerGlobalScope::addMessage):
724
725 2017-02-16  Chris Fleizach  <cfleizach@apple.com>
726
727         AX: Make form validation accessible on iOS
728         https://bugs.webkit.org/show_bug.cgi?id=168400
729
730         Reviewed by Chris Dumez.
731
732         Hide the popover content of form validation from accessibility (since its not interactable)
733         and instead announce the message.
734
735         * platform/ios/ValidationBubbleIOS.mm:
736         (WebCore::ValidationBubble::show):
737
738 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
739
740         Clean up use of some CALayer-related SPI
741         https://bugs.webkit.org/show_bug.cgi?id=168401
742
743         Reviewed by Tim Horton.
744
745         Use -setDrawsAsynchronously: rather than the old -setAcceleratesDrawing: SPI.
746
747         Remove CATiledLayer-related stuff from QuartzCoreSPI.h, since we don't use it any more.
748
749         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
750         (PlatformCALayerCocoa::acceleratesDrawing):
751         (PlatformCALayerCocoa::setAcceleratesDrawing):
752         * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm:
753         (-[WebTiledBackingLayer setDrawsAsynchronously:]): This override passes the state
754         onto the TileController.
755         (-[WebTiledBackingLayer setAcceleratesDrawing:]): Deleted.
756         * platform/ios/LegacyTileGridTile.mm:
757         (WebCore::LegacyTileGridTile::LegacyTileGridTile):
758         * platform/spi/cocoa/QuartzCoreSPI.h:
759
760 2017-02-16  Yusuke Suzuki  <utatane.tea@gmail.com>
761
762         Web Inspector: allow import() inside the inspector
763         https://bugs.webkit.org/show_bug.cgi?id=167457
764
765         Reviewed by Ryosuke Niwa.
766
767         When evaluating `import("...")`, we need the caller's context to resolve
768         the module specifier correctly. For example, if `import("./cocoa.js")` is
769         evaluated in the script "drinks/hot.js", this module name is resolved to
770         "drinks/cocoa.js". If the same import operator is evaluated in the script
771         "menu/all.js", the module specifier becomes "menu/cocoa.js".
772
773         Previously we reject the import operator if the caller does not have such
774         a context. These context is SourceOrigin and its ScriptFetcher. While they
775         are offered in the script tag and other code evaluations, the inspector
776         console does not offer that. These class are offered in the WebCore side
777         and we should not touch these classes in the JSC's inspector code.
778
779         Now we relax the above restriction. If the above caller information is not
780         offered, we fallback to the default one. In the web page, we use the page's
781         URL as the caller's source origin. This allows us to evaluate the import
782         operator in the inspector console.
783
784         And as of r167698, the console recognizes `await import("...")` form. We use
785         this to test this `import()` in the console functionality.
786
787         Test: inspector/controller/runtime-controller-import.html
788
789         * bindings/js/ScriptModuleLoader.cpp:
790         (WebCore::ScriptModuleLoader::importModule):
791
792 2017-02-16  Miguel Gomez  <magomez@igalia.com>
793
794         [GTK] scroll with transparent background not repainted after scrollY >= 32768
795         https://bugs.webkit.org/show_bug.cgi?id=154283
796
797         Reviewed by Carlos Garcia Campos.
798
799         Due to a limitation of the pixman backend, which uses 16 bits to hold signed integers, cairo is
800         not able to draw anything when using transformation matrices with values bigger than 32768. When
801         drawing patterns into large pages, the matrices values can overflow those 16 bits, so cairo doesn't
802         draw anything in, which causes the reported transparent backgrounds.
803
804         The patch modifies the transformation matrices both from the current context and the pattern we
805         are painting, to avoid them to hold values that cannot stored in 16 bits.
806
807         There's still the possibility that this happens, but it would require using a pattern with a size
808         bigger than 32768.
809
810         Based on a previous patch by Gwang Yoon Hwang  <yoon@igalia.com>.
811
812         Test: fast/backgrounds/background-repeat-long-scroll.html
813
814         * platform/graphics/cairo/CairoUtilities.cpp:
815         (WebCore::drawPatternToCairoContext):
816
817 2017-02-16  Carlos Garcia Campos  <cgarcia@igalia.com>
818
819         [GTK] Images are never read from the clipboard
820         https://bugs.webkit.org/show_bug.cgi?id=168419
821
822         Reviewed by Sergio Villar Senin.
823
824         We write images in the clipboard, but we don't read them.
825
826         Fixes: editing/pasteboard/paste-image-using-image-data.html
827
828         * editing/Editor.cpp:
829         (WebCore::Editor::createFragmentForImageAndURL): Moved from EditorMac.mm since it's cross-platform code.
830         * editing/Editor.h:
831         * editing/gtk/EditorGtk.cpp:
832         (WebCore::createFragmentFromPasteboardData): Check if there's an image in the selection, and use
833         Editor::createFragmentForImageAndURL in that case.
834         * editing/mac/EditorMac.mm:
835         (WebCore::Editor::createFragmentForImageAndURL): Deleted.
836         * platform/gtk/PasteboardHelper.cpp:
837         (WebCore::PasteboardHelper::getClipboardContents): Check also if there's an image in the clipboard.
838
839 2017-02-15  Jer Noble  <jer.noble@apple.com>
840
841         REGRESSION (r212311): NULL-dereference in HTMLMediaElement::prepareToPlay()
842         https://bugs.webkit.org/show_bug.cgi?id=168404
843         <rdar://problem/30547188>
844
845         Reviewed by Brian Weinstein.
846
847         Prior to r212311, m_player was always guaranteed to be initialized when calling
848         prepareToPlay(). r212311 began calling prepareToPlay() on a subsequent run-loop iteration
849         after creating m_player. So now check whether m_player is NULL before calling methods on it.
850
851         * html/HTMLMediaElement.cpp:
852         (WebCore::HTMLMediaElement::prepareToPlay):
853
854 2017-02-15  Eric Carlson  <eric.carlson@apple.com>
855
856         [MediaStream] delete CaptureDeviceInfo struct
857         https://bugs.webkit.org/show_bug.cgi?id=168395
858
859         The CaptureDeviceInfo struct and CaptureDevice class were almost identical, so
860         add an "enabled" field to the later, delete the former, and switch all uses of
861         CaptureDeviceInfo to CaptureDevice.
862
863         Do some minor drive-by cleanup of AVCaptureDeviceManager::refreshCaptureDevices
864         and CaptureDeviceManager::captureDeviceFromDeviceID.
865         
866         Reviewed by Sam Weinig.
867
868         No new tests, no behavior change.
869
870         * Modules/mediastream/MediaDevicesRequest.cpp:
871         (WebCore::MediaDevicesRequest::start): SourceKind -> DeviceType
872         * platform/mediastream/CaptureDevice.h:
873         (WebCore::CaptureDevice::CaptureDevice):
874         (WebCore::CaptureDevice::type): Renamed from kind.
875         (WebCore::CaptureDevice::setType):
876         (WebCore::CaptureDevice::enabled): Added.
877         (WebCore::CaptureDevice::setEnabled):
878         (WebCore::CaptureDevice::kind): Deleted.
879         (WebCore::CaptureDevice::setKind): Deleted.
880
881         * platform/mediastream/CaptureDeviceManager.cpp:
882         (CaptureDeviceManager::getSourcesInfo):
883         (CaptureDeviceManager::captureDeviceFromDeviceID): Don't call sourceWithUID.
884         (CaptureDeviceManager::bestSourcesForTypeAndConstraints):
885         (CaptureDeviceManager::sourceWithUID):
886         * platform/mediastream/CaptureDeviceManager.h:
887         (WebCore::CaptureDeviceManager::refreshCaptureDevices):
888         (WebCore::CaptureDeviceManager::refreshCaptureDeviceList): Deleted.
889
890         * platform/mediastream/mac/AVCaptureDeviceManager.h:
891         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
892         (WebCore::AVCaptureDeviceManager::captureDevices):
893         (WebCore::deviceIsAvailable):
894         (WebCore::AVCaptureDeviceManager::refreshCaptureDevices):
895         (WebCore::AVCaptureDeviceManager::createMediaSourceForCaptureDeviceWithConstraints):
896         (WebCore::AVCaptureDeviceManager::deviceConnected):
897         (WebCore::AVCaptureDeviceManager::deviceDisconnected):
898         (WebCore::AVCaptureDeviceManager::captureDeviceList): Deleted.
899         (WebCore::shouldConsiderDeviceInDeviceList): Deleted.
900         (WebCore::AVCaptureDeviceManager::refreshCaptureDeviceList): Deleted.
901         * platform/mock/MockRealtimeMediaSource.cpp:
902         (WebCore::MockRealtimeMediaSource::audioDeviceInfo):
903         (WebCore::MockRealtimeMediaSource::videoDeviceInfo):
904
905 2017-02-15  Sam Weinig  <sam@webkit.org>
906
907         [WebIDL] Remove custom conversion from FontFace code by using a Variant
908         https://bugs.webkit.org/show_bug.cgi?id=168384
909
910         Reviewed by Alex Christensen.
911
912         Match the font face spec and use a union rather than any in the FontFace constructor.
913
914         Test: Added additional cases to fast/text/font-face-javascript.html.
915
916         * css/FontFace.cpp:
917         (WebCore::FontFace::create):
918         * css/FontFace.h:
919         * css/FontFace.idl:
920
921 2017-02-15  Jer Noble  <jer.noble@apple.com>
922
923         Disabled Media Sources should render black/silence
924         https://bugs.webkit.org/show_bug.cgi?id=168281
925
926         Reviewed by Eric Carlson.
927
928         Test: webrtc/video-disabled-black.html
929
930         Pass the enabled flag setting down from the MediaStreamTrackPrivate to its underlying
931         source, including RealtimeMediaSource and RealtimeOutgoingAudio/VideoSource. When either
932         enabled is cleared or muted is set, generate empty (black or silent) media, as opposed to
933         pausing media or (worse) continuing to send generated media.
934
935         * platform/mediastream/MediaStreamTrackPrivate.cpp:
936         (WebCore::MediaStreamTrackPrivate::setEnabled):
937         (WebCore::MediaStreamTrackPrivate::sourceEnabledChanged):
938         * platform/mediastream/MediaStreamTrackPrivate.h:
939         * platform/mediastream/RealtimeMediaSource.cpp:
940         (WebCore::RealtimeMediaSource::setEnabled):
941         * platform/mediastream/RealtimeMediaSource.h:
942         (WebCore::RealtimeMediaSource::enabled):
943         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
944         * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
945         (WebCore::MockRealtimeAudioSourceMac::render):
946         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
947         (WebCore::RealtimeOutgoingAudioSource::sourceMutedChanged):
948         (WebCore::RealtimeOutgoingAudioSource::sourceEnabledChanged):
949         (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
950         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
951         * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
952         (WebCore::RealtimeOutgoingVideoSource::sourceMutedChanged):
953         (WebCore::RealtimeOutgoingVideoSource::sourceEnabledChanged):
954         (WebCore::RealtimeOutgoingVideoSource::videoSampleAvailable):
955         * platform/mediastream/mac/RealtimeOutgoingVideoSource.h:
956         * platform/mock/MockRealtimeVideoSource.cpp:
957         (WebCore::MockRealtimeVideoSource::generateFrame):
958
959 2017-02-15  Wenson Hsieh  <wenson_hsieh@apple.com>
960
961         Editing history scripts should not add the contenteditable attribute or override key events
962         https://bugs.webkit.org/show_bug.cgi?id=168389
963         <rdar://problem/30529945>
964
965         Reviewed by Dan Bernstein.
966
967         Clients that hook into editing history tracking should handle setting the contenteditable attribute on the body
968         rather than have the script add it to the body. Additionally, this script should NOT be overriding any keydown
969         events. These were initially added for compatibility with a test harness early on, and should have been removed
970         earlier.
971
972         * Scripts/DumpEditingHistory.js:
973
974 2017-02-15  Jer Noble  <jer.noble@apple.com>
975
976         Pass "RequiresCustomURLLoading" in AVURLAsset options dictionary
977         https://bugs.webkit.org/show_bug.cgi?id=168381
978
979         Reviewed by Eric Carlson.
980
981         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
982         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
983
984 2017-02-15  Anders Carlsson  <andersca@apple.com>
985
986         Fix build.
987
988         * page/DragController.cpp:
989         (WebCore::DragController::doSystemDrag):
990
991 2017-02-15  Anders Carlsson  <andersca@apple.com>
992
993         Modernize DragClient::startDrag somewhat
994         https://bugs.webkit.org/show_bug.cgi?id=168379
995
996         Reviewed by Tim Horton.
997
998         Change DragClient::startDrag to take a DragImage instead of a DragImageRef, and to pass along the source action
999         instead of whether it's a link or not.
1000
1001         * loader/EmptyClients.cpp:
1002         * page/DragClient.h:
1003         * page/DragController.cpp:
1004         (WebCore::DragController::startDrag):
1005         (WebCore::DragController::doImageDrag):
1006         (WebCore::DragController::doSystemDrag):
1007         * page/DragController.h:
1008
1009 2017-02-15  Chris Dumez  <cdumez@apple.com>
1010
1011         Expose Symbol.toPrimitive / valueOf on Location instances
1012         https://bugs.webkit.org/show_bug.cgi?id=168295
1013
1014         Reviewed by Geoffrey Garen, Keith Miller and Mark Lam.
1015
1016         Expose Symbol.toPrimitive / valueOf on Location instances as per:
1017         - https://html.spec.whatwg.org/#the-location-interface
1018
1019         Firefox and Chrome already comply with the specification.
1020
1021         Tests: fast/dom/location-valueOf-after-object-prototype-update.html
1022                fast/dom/location-valueOf-after-object-prototype-update2.html
1023                imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-symbol-toprimitive.html
1024                imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-valueof.html
1025
1026         * bindings/scripts/CodeGeneratorJS.pm:
1027         (GenerateImplementation):
1028
1029 2017-02-15  Aakash Jain  <aakash_jain@apple.com>
1030
1031         Remove WebIOSEvent interface
1032         https://bugs.webkit.org/show_bug.cgi?id=168368
1033
1034         Reviewed by Tim Horton.
1035
1036         * platform/ios/WebEvent.h: Removed WebIOSEvent.
1037
1038 2017-02-15  Chris Dumez  <cdumez@apple.com>
1039
1040         [iOS] Form Validation Bubble should be sensitive to Dynamic Type
1041         https://bugs.webkit.org/show_bug.cgi?id=168291
1042         <rdar://problem/30508593>
1043
1044         Reviewed by Tim Horton.
1045
1046         Update ValidationBubble implementation on iOS to stop obeying the
1047         minimum font size setting, given that this setting is not exposed
1048         on iOS. Instead, we now rely on
1049         [UIFont preferredFontForTextStyle:UIFontTextStyleCallout], which
1050         will give us a font whose size obeys Dynamic Type [1] setting on iOS.
1051
1052         [1] https://developer.apple.com/ios/human-interface-guidelines/visual-design/typography/
1053
1054         No new tests, no easily testable.
1055
1056         * platform/ios/ValidationBubbleIOS.mm:
1057         (WebCore::ValidationBubble::ValidationBubble):
1058
1059 2017-02-15  Yusuke Suzuki  <utatane.tea@gmail.com>
1060
1061         [JSC] Drop PassRefPtr
1062         https://bugs.webkit.org/show_bug.cgi?id=168320
1063
1064         Reviewed by Saam Barati.
1065
1066         * bindings/js/ScriptSourceCode.h:
1067         (WebCore::ScriptSourceCode::ScriptSourceCode):
1068         Use Ref and pass it to SourceCode.
1069
1070         * replay/ReplayController.cpp:
1071         (WebCore::ReplayController::frameNavigated):
1072         Pass reference.
1073
1074 2017-02-15  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1075
1076         [GStreamer][MSE][EME] Handle protection event also at decryptor level
1077         https://bugs.webkit.org/show_bug.cgi?id=168316
1078
1079         Reviewed by Žan Doberšek.
1080
1081         So far in MSE pipeline we were handling the encryption events
1082         only when they arrived at the demuxer but this won't work in any
1083         kind of key renegotiation as the event will never arrive. Now we
1084         connect to the element messages, check for the drm id and send it
1085         to the private player for processing.
1086
1087         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1088         (WebCore::appendPipelineElementMessageCallback):
1089         (WebCore::AppendPipeline::AppendPipeline):
1090         (WebCore::AppendPipeline::handleElementMessage):
1091         * platform/graphics/gstreamer/mse/AppendPipeline.h:
1092
1093 2017-02-15  Zan Dobersek  <zdobersek@igalia.com>
1094
1095         [EME] MediaKeys::setServerCertificate() must resolve with 'false' when certificates aren't supported
1096         https://bugs.webkit.org/show_bug.cgi?id=168362
1097
1098         Reviewed by Xabier Rodriguez-Calvar.
1099
1100         In MediaKeys::setServerCertificate(), when the CDM implementation
1101         doesn't support server certificates, it should resolve the promise
1102         with the 'false' value, as mandated by the specification, and not
1103         reject it.
1104
1105         A test case in mock-MediaKeys-setServerCertificate.html is updated.
1106
1107         * Modules/encryptedmedia/MediaKeys.cpp:
1108         (WebCore::MediaKeys::setServerCertificate):
1109
1110 2017-02-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1111
1112         REGRESSION (r206014): HTTPHeaderMap does not consistently use comma without space to separate values of header fields
1113         https://bugs.webkit.org/show_bug.cgi?id=168115
1114
1115         Reviewed by Darin Adler.
1116
1117         In r206014 HTTPHeaderMap::add() was updated to combine common headers with ',' instead of ", " to match the
1118         fetch specification, but the uncommon headers are still combined with ", ".
1119
1120         * platform/network/HTTPHeaderMap.cpp:
1121         (WebCore::HTTPHeaderMap::add):
1122
1123 2017-02-14  Ryosuke Niwa  <rniwa@webkit.org>
1124
1125         An assertion failure inside removeChildren
1126         https://bugs.webkit.org/show_bug.cgi?id=168069
1127
1128         Reviewed by Brent Fulgham.
1129
1130         The bug was caused by notifyRemovePendingSheet executing scripts synchronously where it shouldn't.
1131
1132         Removed the call to notifyRemovePendingSheetIfNeeded in notifyChildNodeRemoved. Instead, invoke it
1133         in its call sites when they're safe.
1134
1135         Test: http/tests/security/move-iframe-within-focus-handler-inside-removal.html
1136
1137         * dom/ContainerNode.cpp:
1138         (WebCore::ContainerNode::takeAllChildrenFrom):
1139         (WebCore::ContainerNode::notifyChildInserted):
1140         (WebCore::ContainerNode::removeChild):
1141         (WebCore::ContainerNode::parserRemoveChild):
1142         (WebCore::ContainerNode::replaceAllChildren):
1143         (WebCore::ContainerNode::removeChildren):
1144         * dom/ContainerNodeAlgorithms.cpp:
1145         (WebCore::notifyChildNodeRemoved):
1146
1147 2017-02-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1148
1149         [GStreamer] Several tests are timing out after r212349
1150         https://bugs.webkit.org/show_bug.cgi?id=168359
1151
1152         Reviewed by Žan Doberšek.
1153
1154         This is because they are failing the cross origin check. Those tests are not using WebKitWebSrc, but
1155         GstFileSrc. I didn't consider the case of source not being a WebKitWebSrc.
1156
1157         Fixes several timeout instroduced in r212349.
1158
1159         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1160         (WebCore::MediaPlayerPrivateGStreamer::hasSingleSecurityOrigin): Split the source check in two. First check if
1161         it's nullptr, and return false. Then check if it's a WebKitWebSrc and return true if it isn't.
1162
1163 2017-02-14  Brent Fulgham  <bfulgham@apple.com>
1164
1165         Revalidate URL after events that could trigger navigations
1166         https://bugs.webkit.org/show_bug.cgi?id=168071
1167         <rdar://problem/30450379>
1168
1169         Reviewed by Ryosuke Niwa.
1170
1171         When arbitary javascript runs during a load, we should revalidate
1172         the URLs involved to make sure they are still valid.
1173
1174         Tests: http/tests/plugins/navigation-during-load-embed.html
1175                http/tests/plugins/navigation-during-load.html
1176
1177         * html/HTMLEmbedElement.cpp:
1178         (WebCore::HTMLEmbedElement::updateWidget): Confirm we are still allowed to
1179         load the URL after executing JS callbacks.
1180         * html/HTMLFrameElementBase.cpp:
1181         (WebCore::HTMLFrameElementBase::isURLAllowed): Split existing function into
1182         existing protected method, and a new public method that checks a passed URL
1183         for validity.
1184         * html/HTMLFrameElementBase.h:
1185         * html/HTMLFrameOwnerElement.h:
1186         (WebCore::HTMLFrameOwnerElement::isURLAllowed):
1187         * html/HTMLObjectElement.cpp:
1188         (WebCore::HTMLObjectElement::updateWidget): Confirm we are still allowed to
1189         load the URL after executing JS callbacks.
1190         * loader/SubframeLoader.cpp:
1191         (WebCore::SubframeLoader::requestFrame): Ditto.
1192
1193 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1194
1195         [GStreamer] Implement MediaPlayerPrivate::hasSingleSecurityOrigin()
1196         https://bugs.webkit.org/show_bug.cgi?id=168322
1197
1198         Reviewed by Žan Doberšek.
1199
1200         It currently returns true unconditionally. Add resolved-location property to WebKitWebSourceGStreamer to track
1201         the resolved url returned by the server and use that from MediaPlayerPrivate to check if there was a cross
1202         origin redirection.
1203
1204         Fixes: http/tests/security/canvas-remote-read-remote-video-redirect.html
1205
1206         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1207         (WebCore::MediaPlayerPrivateGStreamer::hasSingleSecurityOrigin):
1208         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1209         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1210         (webKitWebSrcFinalize):
1211         (webKitWebSrcGetProperty):
1212         (webKitWebSrcStart):
1213         (webKitWebSrcQueryWithParent):
1214         (webKitWebSrcGetUri):
1215         (webKitWebSrcSetUri):
1216         (StreamingClient::handleResponseReceived):
1217         (ResourceHandleStreamingClient::wasBlocked):
1218         (ResourceHandleStreamingClient::cannotShowURL):
1219
1220 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1221
1222         Unreviewed, rolling out r211967.
1223
1224         Caused rendering issues in HiDPI
1225
1226         Reverted changeset:
1227
1228         "[GTK] scroll with transparent background not repainted after
1229         scrollY >= 32768"
1230         https://bugs.webkit.org/show_bug.cgi?id=154283
1231         http://trac.webkit.org/changeset/211967
1232
1233 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1234
1235         [GTK] Update cookie manager API to properly work with ephemeral sessions
1236         https://bugs.webkit.org/show_bug.cgi?id=168230
1237
1238         Reviewed by Michael Catanzaro.
1239
1240         Add implementation for deleteAllCookiesModifiedSince. Note that this only works when the timespan is 0, we need
1241         new libsoup API to support removing recently modified cookies.
1242
1243         * platform/network/soup/CookieJarSoup.cpp:
1244         (WebCore::deleteAllCookiesModifiedSince):
1245
1246 2017-02-14  Joseph Pecoraro  <pecoraro@apple.com>
1247
1248         [WebIDL] Improve serializer = { inherit }
1249         https://bugs.webkit.org/show_bug.cgi?id=168293
1250
1251         Reviewed by Youenn Fablet.
1252
1253         * bindings/scripts/CodeGeneratorJS.pm:
1254         (GenerateHeader):
1255         Expose a serialize() method on the interface.
1256
1257         (GenerateSerializerFunction):
1258         (GenerateSerializerAttributesForInterface): Deleted.
1259         Subclasses that have `serializer = { inherit }` can use
1260         their parent's serialize() method to get the initial object.
1261         We can now collapse everything back into a single function
1262         because we only generate code for our own attributes.
1263
1264         * bindings/scripts/test/JS/JSTestNode.cpp:
1265         (WebCore::JSTestNode::serialize):
1266         (WebCore::jsTestNodePrototypeFunctionToJSONCaller):
1267         * bindings/scripts/test/JS/JSTestNode.h:
1268         * bindings/scripts/test/JS/JSTestObj.cpp:
1269         (WebCore::JSTestObj::serialize):
1270         (WebCore::jsTestObjPrototypeFunctionToJSONCaller):
1271         * bindings/scripts/test/JS/JSTestObj.h:
1272         * bindings/scripts/test/JS/JSTestSerialization.cpp:
1273         (WebCore::JSTestSerialization::serialize):
1274         (WebCore::jsTestSerializationPrototypeFunctionToJSONCaller):
1275         * bindings/scripts/test/JS/JSTestSerialization.h:
1276         * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
1277         (WebCore::JSTestSerializationInherit::serialize):
1278         (WebCore::jsTestSerializationInheritPrototypeFunctionToJSONCaller):
1279         * bindings/scripts/test/JS/JSTestSerializationInherit.h:
1280         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
1281         (WebCore::JSTestSerializationInheritFinal::serialize):
1282         (WebCore::jsTestSerializationInheritFinalPrototypeFunctionToJSONCaller):
1283         * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h:
1284         Updated results.
1285
1286 2017-02-14  Aakash Jain  <aakash_jain@apple.com>
1287
1288         Move methods from WebCoreThread.h to WebCoreThreadInternal.h
1289         https://bugs.webkit.org/show_bug.cgi?id=168326
1290
1291         Reviewed by Alexey Proskuryakov.
1292
1293         * platform/ios/wak/WebCoreThread.h: Move methods WebThreadRunLoop and WebThreadCurrentContext to WebCoreThreadInternal.h
1294         * platform/ios/wak/WebCoreThreadInternal.h: Ditto.
1295         * platform/ios/wak/WebCoreThreadRun.cpp: Removed WebCoreThread.h as it is already included by WebCoreThreadInternal.h
1296         * platform/ios/wak/WKGraphics.mm: Included WebCoreThreadInternal.h, it subsequently includes WebCoreThread.h
1297         * inspector/InspectorTimelineAgent.cpp: Ditto.
1298         * page/mac/PageMac.mm: Ditto.
1299         * platform/cf/MainThreadSharedTimerCF.cpp: Ditto.
1300         * platform/cocoa/MemoryPressureHandlerCocoa.mm: Ditto.
1301         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Ditto.
1302         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp: Ditto.
1303         * bindings/js/CommonVM.cpp: included WebCoreThreadInternal.h
1304
1305 2017-02-14  Wenson Hsieh  <wenson_hsieh@apple.com>
1306
1307         [WK2] Support data interaction on links
1308         https://bugs.webkit.org/show_bug.cgi?id=168331
1309         <rdar://problem/30200837>
1310
1311         Reviewed by Tim Horton.
1312
1313         Adds support for data interaction on links at the WebCore layer, refactoring some drag-and-drop code on the Mac
1314         along the way. Also adds two new TestWebKitAPI unit tests in DataInteractionTests.mm: LinkToInput and
1315         BackgroundImageLinkToInput (see Tools/ChangeLog for more information).
1316
1317         * page/DragController.cpp:
1318         (WebCore::DragController::startDrag):
1319         (WebCore::DragController::doImageDrag):
1320         (WebCore::DragController::doSystemDrag):
1321
1322         Introduce platformAdjustDragImageForDeviceScaleFactor, and special-case drag images for links to anchor at the
1323         bottom center.
1324
1325         * platform/DragImage.cpp:
1326         (WebCore::platformAdjustDragImageForDeviceScaleFactor):
1327
1328         Scale the drag image up by the device scale factor. In WebDragClient, we scale the image back down to the
1329         original size. It seems the reason we do this extra dance is because the image sizing heuristic in between
1330         assumes that the image dimensions are for a non-retina device, but this work should really not be necessary if
1331         we tweak the heuristic to account for deviceScaleFactor. We should address this in a separate patch.
1332
1333         * platform/DragImage.h:
1334         * platform/graphics/Path.h:
1335
1336 2017-02-14  Basuke Suzuki  <Basuke.Suzuki@am.sony.com>
1337
1338         [CURL] ResourceError created with error information should have default type Type::General
1339         https://bugs.webkit.org/show_bug.cgi?id=168345
1340
1341         Reviewed by Alex Christensen.
1342
1343         ResourceError has separate implementaion for each platform
1344         so that the interface should be same.
1345         On CURL port, the constructor with error information has
1346         different default value on `type` parameter. It is Type::Null but other implementaitons have Type::General.
1347         This causes some ResourceError is created inconsistent. 
1348
1349         * platform/network/curl/ResourceError.h:
1350         (WebCore::ResourceError::ResourceError):
1351
1352 2017-02-14  Youenn Fablet  <youennf@gmail.com>
1353
1354         [WebRTC] Add support for libwebrtc negotiation needed event
1355         https://bugs.webkit.org/show_bug.cgi?id=168267
1356
1357         Reviewed by Eric Carlson.
1358
1359         Test: webrtc/negotiatedneeded-event-addStream.html
1360
1361         Moving generic code (markAsNeedingNegotiation) from MediaEndpointPeerConnection to PeerConnectionBackend.
1362         This code handles the control of sending or not the negotiationneeded event.
1363
1364         Updating mock to use markAsNeedingNegotiation when streams are changed.
1365         Updating libwebrtc backend to call markAsNeedingNegotiation when required by libwebrtc implementation.
1366
1367         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1368         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
1369         * Modules/mediastream/MediaEndpointPeerConnection.h:
1370         * Modules/mediastream/PeerConnectionBackend.cpp:
1371         (WebCore::PeerConnectionBackend::markAsNeedingNegotiation):
1372         * Modules/mediastream/PeerConnectionBackend.h:
1373         (WebCore::PeerConnectionBackend::isNegotiationNeeded):
1374         (WebCore::PeerConnectionBackend::clearNegotiationNeededState):
1375         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1376         (WebCore::LibWebRTCMediaEndpoint::OnRenegotiationNeeded):
1377         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1378         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1379         * testing/MockLibWebRTCPeerConnection.cpp:
1380         (WebCore::MockLibWebRTCPeerConnection::AddStream):
1381         (WebCore::MockLibWebRTCPeerConnection::RemoveStream):
1382
1383 2017-02-14  Brady Eidson  <beidson@apple.com>
1384
1385         Unreviewed followup to r212330 to fix Debug builds
1386
1387         * loader/DocumentThreadableLoader.cpp:
1388         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Add call to relaxAdoptionRequirement().
1389
1390 2017-02-14  Matt Rajca  <mrajca@apple.com>
1391
1392         Website policies: iframes should respect the autoplay policy of the top-level document
1393         https://bugs.webkit.org/show_bug.cgi?id=168333
1394
1395         Reviewed by Alex Christensen.
1396
1397         API tests were added.
1398
1399         * html/HTMLMediaElement.cpp:
1400         (WebCore::HTMLMediaElement::HTMLMediaElement):
1401
1402 2017-02-14  Dean Jackson  <dino@apple.com>
1403
1404         Rename preferLowPowerWebGLRendering setting to forceWebGLUsesLowPower
1405         https://bugs.webkit.org/show_bug.cgi?id=168339
1406         <rdar://problem/30522092>
1407
1408         Reviewed by Simon Fraser.
1409
1410         Use a setting name that more clearly reflects what it is doing. It's not
1411         preferring to use the low-power GPU, it's forcing it.
1412
1413         * html/canvas/WebGLRenderingContextBase.cpp:
1414         (WebCore::WebGLRenderingContextBase::create):
1415         * page/Settings.in:
1416
1417 2017-02-14  Brady Eidson  <beidson@apple.com>
1418
1419         Speculative fix for: Crash in DocumentThreadableLoader::redirectReceived.
1420         <rdar://problem/29899473> and https://bugs.webkit.org/show_bug.cgi?id=168337
1421
1422         Reviewed by Geoffrey Garen.
1423
1424         No new tests (Unable to find a reproduction).
1425
1426         * loader/DocumentThreadableLoader.cpp:
1427         (WebCore::DocumentThreadableLoader::loadRequest):
1428
1429 2017-02-14  Youenn Fablet  <youenn@apple.com>
1430
1431         [WebRTC] Remove obsolete WebRTC stats API
1432         https://bugs.webkit.org/show_bug.cgi?id=167910
1433
1434         Reviewed by Alex Christensen.
1435
1436         No change of behavior as removed constructs are not functional.
1437         Removing RTCStatsResponse which no longer exists and made RTCStatsReport an empty container for now.
1438
1439         * CMakeLists.txt:
1440         * DerivedSources.cpp:
1441         * DerivedSources.make:
1442         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1443         (WebCore::MediaEndpointPeerConnection::getStats):
1444         * Modules/mediastream/MediaEndpointPeerConnection.h:
1445         * Modules/mediastream/PeerConnectionBackend.h:
1446         * Modules/mediastream/RTCPeerConnection.cpp:
1447         (WebCore::RTCPeerConnection::getStats):
1448         * Modules/mediastream/RTCStatsReport.cpp:
1449         (WebCore::RTCStatsReport::create): Deleted.
1450         (WebCore::RTCStatsReport::RTCStatsReport): Deleted.
1451         (WebCore::RTCStatsReport::names): Deleted.
1452         (WebCore::RTCStatsReport::local): Deleted.
1453         (WebCore::RTCStatsReport::remote): Deleted.
1454         (WebCore::RTCStatsReport::addStatistic): Deleted.
1455         * Modules/mediastream/RTCStatsReport.h:
1456         (WebCore::RTCStatsReport::create):
1457         (WebCore::RTCStatsReport::timestamp): Deleted.
1458         (WebCore::RTCStatsReport::id): Deleted.
1459         (WebCore::RTCStatsReport::type): Deleted.
1460         (WebCore::RTCStatsReport::stat): Deleted.
1461         * Modules/mediastream/RTCStatsReport.idl:
1462         * Modules/mediastream/RTCStatsResponse.cpp: Removed.
1463         * Modules/mediastream/RTCStatsResponse.h: Removed.
1464         * Modules/mediastream/RTCStatsResponse.idl: Removed.
1465         * WebCore.xcodeproj/project.pbxproj:
1466         * platform/mediastream/MediaEndpoint.h:
1467         (WebCore::MediaEndpoint::getStats):
1468         * platform/mediastream/RTCStatsRequest.h: Removed.
1469         * platform/mediastream/RTCStatsResponseBase.h: Removed.
1470
1471 2017-02-14  Karim H  <karim@karhm.com>
1472
1473         Removed unused methods of WebCore::FileStream
1474         https://bugs.webkit.org/show_bug.cgi?id=168025
1475
1476         Reviewed by Michael Catanzaro.
1477
1478         * fileapi/AsyncFileStream.cpp:
1479         (WebCore::AsyncFileStream::openForWrite): Deleted.
1480         (WebCore::AsyncFileStream::write): Deleted.
1481         (WebCore::AsyncFileStream::truncate): Deleted.
1482         * fileapi/AsyncFileStream.h:
1483         * platform/FileStream.cpp:
1484         (WebCore::FileStream::openForWrite): Deleted.
1485         (WebCore::FileStream::write): Deleted.
1486         (WebCore::FileStream::truncate): Deleted.
1487         * platform/FileStream.h:
1488
1489 2017-02-14  Chris Dumez  <cdumez@apple.com>
1490
1491         HTML Form Validation bubble should take minimum font size setting into consideration
1492         https://bugs.webkit.org/show_bug.cgi?id=168271
1493         <rdar://problem/29869869>
1494
1495         Reviewed by Simon Fraser.
1496
1497         HTML Form Validation bubble should take minimum font size setting into consideration
1498         for better accessibility.
1499
1500         Test: fast/forms/validation-message-minimum-font-size.html
1501
1502         * platform/ValidationBubble.h:
1503         (WebCore::ValidationBubble::create):
1504         (WebCore::ValidationBubble::fontSize):
1505         * platform/ios/ValidationBubbleIOS.mm:
1506         (WebCore::ValidationBubble::ValidationBubble):
1507         * platform/mac/ValidationBubbleMac.mm:
1508         (WebCore::ValidationBubble::ValidationBubble):
1509         Update the ValidationBubble constructor to take in Settings. For now, there is a
1510         single setting that is the minimum font size and that is taken into account when
1511         setting the font size of the validation bubble text.
1512
1513 2017-02-14  Eric Carlson  <eric.carlson@apple.com>
1514
1515         [MediaStream] add navigator.getUserMedia for compatibility with legacy content
1516         https://bugs.webkit.org/show_bug.cgi?id=168324
1517         <rdar://problem/30513125>
1518
1519         Reviewed by Youenn Fablet.
1520
1521         Tests: fast/mediastream/argument-types.html
1522                fast/mediastream/getusermedia.html
1523                fast/mediastream/webkitGetUserMedia-shadowing-then.html
1524
1525         * CMakeLists.txt:
1526         * DerivedSources.cpp:
1527         * DerivedSources.make:
1528         * Modules/mediastream/MediaDevices.idl:
1529         * Modules/mediastream/NavigatorUserMedia.idl: Added.
1530         * Modules/mediastream/NavigatorUserMedia.js: Added.
1531         * WebCore.xcodeproj/project.pbxproj:
1532         * bindings/js/WebCoreBuiltinNames.h:
1533         * page/Navigator.idl:
1534
1535 2017-02-14  Chris Dumez  <cdumez@apple.com>
1536
1537         Fallback to legacy type only when event is trusted
1538         https://bugs.webkit.org/show_bug.cgi?id=168301
1539
1540         Reviewed by Ryosuke Niwa.
1541
1542         Fallback to legacy type only when event is trusted as per a recent
1543         DOM specification change:
1544         - https://github.com/whatwg/dom/issues/404
1545         - https://github.com/whatwg/dom/pull/406
1546
1547         No new tests, rebaselined existing test.
1548
1549         * dom/EventTarget.cpp:
1550         (WebCore::legacyType):
1551         (WebCore::EventTarget::fireEventListeners):
1552
1553 2017-02-13  Dean Jackson  <dino@apple.com>
1554
1555         Rename preferLowPowerToHighPerformance to powerPreference
1556         https://bugs.webkit.org/show_bug.cgi?id=168269
1557         <rdar://problem/30504444>
1558
1559         Reviewed by Chris Dumez.
1560
1561         Based on the discussion in https://github.com/KhronosGroup/WebGL/pull/2283.
1562
1563         Change WebGLContextAttributes's preferLowPowerToHighPerformance boolean
1564         into a powerPreference enum taking three values. The implementation
1565         of the enum is in GraphicsContext3DAttributes.
1566
1567         While the name and values have changed, there should be no change in
1568         behaviour caused by this patch.
1569
1570         * html/canvas/WebGLContextAttributes.h: Use GraphicsContext3DAttributes
1571         enum GraphicsContext3DPowerPreference.
1572         * html/canvas/WebGLContextAttributes.idl: Rename and add the WebIDL enum.
1573         * html/canvas/WebGLRenderingContextBase.cpp: Use the new values.
1574         (WebCore::WebGLRenderingContextBase::create):
1575         (WebCore::WebGLRenderingContextBase::registerWithWebGLStateTracker):
1576         * platform/WebGLStateTracker.cpp:
1577         * platform/WebGLStateTracker.h: Update the state tracker to use the new
1578         values.
1579         * platform/graphics/GraphicsContext3DAttributes.h:
1580         * platform/graphics/mac/GraphicsContext3DMac.mm:
1581         (WebCore::setPixelFormat): Accept GraphicsContext3DPowerPreference as a parameter.
1582         (WebCore::GraphicsContext3D::GraphicsContext3D):
1583
1584 2017-02-14  Youenn Fablet  <youennf@gmail.com>
1585
1586         [WebRTC] Implement description getters for libwebrtc RTCPeerConnection
1587         https://bugs.webkit.org/show_bug.cgi?id=168234
1588
1589         Reviewed by Alex Christensen.
1590
1591         Allows passing W3C webrtc tests.
1592
1593         Implementing localDescription/remoteDescription using libwebrtc backend.
1594         current and pending description getters are made the same as local/remote getters for the moment.
1595         This should be fixed when upgrading to latest libwebrtc revision.
1596
1597         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1598         (WebCore::toSessionDescriptionType):
1599         (WebCore::fromSessionDescriptionType):
1600         (WebCore::fromSessionDescription):
1601         (WebCore::LibWebRTCMediaEndpoint::localDescription):
1602         (WebCore::LibWebRTCMediaEndpoint::remoteDescription):
1603         (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
1604         (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription):
1605         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
1606         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1607         (WebCore::LibWebRTCPeerConnectionBackend::localDescription):
1608         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1609
1610 2017-02-14  Jeremy Jones  <jeremyj@apple.com>
1611
1612         When playing inline after fullscreen, set a flag instead of adding attribute plays inline, and use in requiresFullscreenForVideoPlayback.
1613         https://bugs.webkit.org/show_bug.cgi?id=167815
1614         rdar://problem/27685077
1615
1616         Reviewed by Jer Noble.
1617
1618         Test: media/media-fullscreen-loop-inline.html
1619
1620         When video is allowed to play inline after fullscreen. Looped video causes play state to update, which can send video back to fullscreen when
1621         allowsInline is false. This change will set a new flag when allowsInlineMediaPlaybackAfterFullscreen allows inline playback that can be tested
1622         in requiresFullscreenForVideoPlayback to prevent sending video back into fullscreen when video loops.
1623
1624         * html/HTMLMediaElement.cpp:
1625         (WebCore::HTMLMediaElement::enterFullscreen):
1626         (WebCore::HTMLMediaElement::exitFullscreen):
1627         * html/HTMLMediaElement.h:
1628         (WebCore::HTMLMediaElement::isTemporarilyAllowingInlinePlaybackAfterFullscreen): Added.
1629         * html/MediaElementSession.cpp:
1630         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
1631
1632 2017-02-14  Jer Noble  <jer.noble@apple.com>
1633
1634         Video elements with MediaSource objects set by srcObject are not cleared when srcObject is set to null
1635         https://bugs.webkit.org/show_bug.cgi?id=168268
1636
1637         Reviewed by Eric Carlson.
1638
1639         Test: fast/mediastream/MediaStream-MediaElement-setObject-null.html
1640
1641         Make the setSrcObject() operation compliant with the HTML spec. Since the specification defines
1642         srcObject in terms of either a MediaSource, MediaStream, or Blob object, add the variant typedef
1643         to HTMLMediaElement and move the definition out of the Modules/mediastream extension IDL and into
1644         HTMLMediaElement.idl. Then bring the "media elements load" and "resource selection" algorithms up
1645         to their most recent definitions in the HTML5 spec.
1646
1647         Drive-by fix: Allow the (admittedly weird) single-element-union type in IDL.
1648
1649         * CMakeLists.txt:
1650         * DerivedSources.cpp:
1651         * DerivedSources.make:
1652         * Modules/mediastream/HTMLMediaElementMediaStream.cpp: Removed.
1653         * Modules/mediastream/HTMLMediaElementMediaStream.h: Removed.
1654         * Modules/mediastream/HTMLMediaElementMediaStream.idl: Removed.
1655         * WebCore.xcodeproj/project.pbxproj:
1656         * bindings/scripts/IDLParser.pm:
1657         (parseUnionType):
1658         * html/HTMLAudioElement.cpp:
1659         (WebCore::HTMLAudioElement::createForJSConstructor):
1660         * html/HTMLMediaElement.cpp:
1661         (WebCore::actionName):
1662         (WebCore::HTMLMediaElement::parseAttribute):
1663         (WebCore::HTMLMediaElement::insertedInto):
1664         (WebCore::HTMLMediaElement::scheduleDelayedAction):
1665         (WebCore::HTMLMediaElement::scheduleNextSourceChild):
1666         (WebCore::HTMLMediaElement::pendingActionTimerFired):
1667         (WebCore::HTMLMediaElement::setSrcObject):
1668         (WebCore::HTMLMediaElement::load):
1669         (WebCore::HTMLMediaElement::prepareForLoad):
1670         (WebCore::HTMLMediaElement::selectMediaResource):
1671         (WebCore::HTMLMediaElement::loadResource):
1672         (WebCore::HTMLMediaElement::playInternal):
1673         (WebCore::HTMLMediaElement::pauseInternal):
1674         (WebCore::HTMLMediaElement::sourceWasAdded):
1675         (WebCore::HTMLMediaElement::clearMediaPlayer):
1676         (WebCore::HTMLMediaElement::resume):
1677         (WebCore::HTMLMediaElement::mediaCanStart):
1678         (WebCore::HTMLMediaElement::createMediaPlayer):
1679         (WebCore::HTMLMediaElement::loadInternal): Deleted.
1680         * html/HTMLMediaElement.h:
1681         (WebCore::HTMLMediaElement::srcObject):
1682         * html/HTMLMediaElement.idl:
1683         * platform/ContentType.h:
1684
1685 2017-02-14  Aakash Jain  <aakash_jain@apple.com>
1686
1687         Remove unused WebThreadContextIsCurrent method from WebCoreThread.h
1688         https://bugs.webkit.org/show_bug.cgi?id=168254
1689
1690         Reviewed by Dan Bernstein.
1691
1692         * platform/ios/wak/WebCoreThread.h: Removed unused WebThreadContextIsCurrent.
1693         * platform/ios/wak/WebCoreThread.mm:
1694         (WebThreadContextIsCurrent): Deleted.
1695
1696 2017-02-14  Alexey Proskuryakov  <ap@apple.com>
1697
1698         WebCore shouldn't export SystemMemory.h
1699         https://bugs.webkit.org/show_bug.cgi?id=168285
1700
1701         Reviewed by Alex Christensen.
1702
1703         * WebCore.xcodeproj/project.pbxproj:
1704
1705 2017-02-13  Filip Pizlo  <fpizlo@apple.com>
1706
1707         worker.postMessage should throw a TypeError if a SharedArrayBuffer is in the transfer list
1708         https://bugs.webkit.org/show_bug.cgi?id=168277
1709
1710         Reviewed by Mark Lam.
1711
1712         Test: workers/sab/postMessage-transfer-type-error.html
1713         
1714         This is a simple spec compliance change. The title says it all.
1715
1716         * bindings/js/SerializedScriptValue.cpp:
1717         (WebCore::SerializedScriptValue::create):
1718
1719 2017-02-14  Zan Dobersek  <zdobersek@igalia.com>
1720
1721         HTMLMediaElement: WebKitMediaKeys member name should be prefixed
1722         https://bugs.webkit.org/show_bug.cgi?id=168297
1723
1724         Reviewed by Xabier Rodriguez-Calvar.
1725
1726         Rename the LEGACY_ENCRYPTED_MEDIA m_mediaKeys variable to m_webkitMediaKeys
1727         so that it contains the legacy prefix, just like the API. This will make
1728         room for the MediaKeys member variable that will be implemented under
1729         the ENCRYPTED_MEDIA guards.
1730
1731         * html/HTMLMediaElement.cpp:
1732         (WebCore::HTMLMediaElement::mediaPlayerCachedKeyForKeyId):
1733         (WebCore::HTMLMediaElement::webkitSetMediaKeys):
1734         * html/HTMLMediaElement.h:
1735         (WebCore::HTMLMediaElement::webkitKeys):
1736
1737 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1738
1739         [GTK] Make DragImageRef a RefPtr instead of a plain pointer
1740         https://bugs.webkit.org/show_bug.cgi?id=168296
1741
1742         Reviewed by Sergio Villar Senin.
1743
1744         Use RefPtr<cairo_surface_t> as DragImageRef for GTK+ port to avoid memory leaks.
1745
1746         * platform/DragImage.h:
1747         * platform/gtk/DragImageGtk.cpp:
1748         (WebCore::dragImageSize):
1749         (WebCore::deleteDragImage):
1750         (WebCore::scaleDragImage):
1751         (WebCore::dissolveDragImageToFraction):
1752         (WebCore::createDragImageFromImage):
1753         (WebCore::createDragImageIconForCachedImageFilename):
1754
1755 2017-02-14  Vanessa Chipirrás Navalón  <vchipirras@igalia.com>
1756
1757         [GStreamer][MSE] Some GStreamer log messages are generated with the 'default' category
1758         https://bugs.webkit.org/show_bug.cgi?id=168015
1759
1760         Reviewed by Xabier Rodriguez-Calvar.
1761
1762         The elements AppendPipeline, PlaybackPipeline, MediaSourceClientGstreamerMSE do not have
1763         a defined Gstreamer log category, then the webkitmse category has been added to them.
1764         WebKitMediaSourceGstreamer has its own category but was not declared at the beginning of
1765         the .cpp file.
1766
1767         * platform/graphics/gstreamer/mse/AppendPipeline.cpp: Added webkitmse category.
1768         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
1769         Added webkitmse category and gst header.
1770         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: Added webkitmse category.
1771         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
1772         Added webkitmediasrc category.
1773
1774 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1775
1776         CookieManager only works with the default session
1777         https://bugs.webkit.org/show_bug.cgi?id=168229
1778
1779         Reviewed by Alex Christensen.
1780
1781         Update cookie observer API to use a std::function instead of a function pointer and make it work with multiple
1782         sessions in the backends that support it.
1783
1784         * platform/network/CookieStorage.h:
1785         * platform/network/cf/CookieStorageCFNet.cpp:
1786         (WebCore::cookieChangeCallbackMap):
1787         (WebCore::notifyCookiesChanged):
1788         (WebCore::startObservingCookieChanges):
1789         (WebCore::stopObservingCookieChanges):
1790         * platform/network/mac/CookieStorageMac.mm:
1791         (-[WebCookieStorageObjCAdapter startListeningForCookieChangeNotificationsWithCallback:]):
1792         (-[WebCookieStorageObjCAdapter stopListeningForCookieChangeNotifications]):
1793         (WebCore::startObservingCookieChanges):
1794         (WebCore::stopObservingCookieChanges):
1795         * platform/network/soup/CookieStorageSoup.cpp:
1796         (WebCore::cookieChangeCallbackMap):
1797         (WebCore::soupCookiesChanged):
1798         (WebCore::startObservingCookieChanges):
1799         (WebCore::stopObservingCookieChanges):
1800
1801 2017-02-13  Antoine Quint  <graouts@apple.com>
1802
1803         REGRESSION: Update volume and scrubbing slider to match HI designs
1804         https://bugs.webkit.org/show_bug.cgi?id=168170
1805         <rdar://problem/28095266>
1806
1807         Reviewed by Dean Jackson.
1808
1809         We bring the designs of the control's background materials, scrubber and
1810         volume slider up to spec.
1811
1812         The first important set of changes is that, on macOS, the materials and colors
1813         were incorrect. Buttons and time labels now set a mix-blend-mode to correctly
1814         appear vibrant against the media, and the controls bar, volume container
1815         and tracks menu now use a new BackgroundTint node to correctly apply both
1816         a backdrop-filter and blended tint above it.
1817
1818         The second important set of changes is the rendering of the sliders. Up to now
1819         we would simply style the <input type="range"> track and thumb, applying solid
1820         fills and strokes. We now draw sliders in two ways depending on the platform.
1821         
1822         On macOS, we draw the whole slider with a <canvas> element with "mix-blend-mode"
1823         set to "plus-lighter". On iOS, we draw the track as a <div> with "mix-blend-mode"
1824         set to "plus-darker" and draw the fill (up to the thumb) in the <canvas> with
1825         no blend mode to obtain a pure white color, finally the thumb is rendered by the
1826         <input> element. We couldn't draw the pure white color with the track in the
1827         same <canvas> due to the "plus-darker" blend mode.
1828
1829         Test: media/modern-media-controls/background-tint/background-tint.html
1830
1831         * Modules/modern-media-controls/controls/airplay-button.css:
1832         (button.airplay.on):
1833         * Modules/modern-media-controls/controls/background-tint.css: Added.
1834         (.background-tint):
1835         (.background-tint,):
1836         (.background-tint > .blur):
1837         (.background-tint > .tint):
1838         * Modules/modern-media-controls/controls/background-tint.js: Added.
1839         (BackgroundTint):
1840         * Modules/modern-media-controls/controls/ios-inline-media-controls.css:
1841         (.media-controls.ios.inline .scrubber.slider):
1842         (.media-controls.ios.inline .scrubber.slider > div):
1843         (.media-controls.ios.inline .scrubber.slider > input::-webkit-slider-thumb):
1844         (.media-controls.ios.inline .scrubber.slider > .fill): Deleted.
1845         * Modules/modern-media-controls/controls/macos-compact-inline-media-controls.css:
1846         (.media-controls.mac.inline.compact .volume-slider-container):
1847         (.media-controls.mac.inline.compact .volume.slider):
1848         (.media-controls.mac.inline.compact .scrubber.slider > input::-webkit-slider-thumb): Deleted.
1849         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.css:
1850         (.media-controls.mac.fullscreen > .controls-bar):
1851         (.media-controls.mac.fullscreen > .controls-bar > .background-tint > div):
1852         (.media-controls.mac.fullscreen .volume.slider):
1853         (.media-controls.mac.fullscreen button.volume-up):
1854         (.media-controls.mac.fullscreen button.rewind):
1855         (.media-controls.mac.fullscreen button.forward):
1856         (.media-controls.mac.fullscreen .buttons-container.right button):
1857         (.media-controls.mac.fullscreen .scrubber):
1858         (.media-controls.mac.fullscreen > .controls-bar button): Deleted.
1859         (.media-controls.mac.fullscreen button.airplay): Deleted.
1860         (.media-controls.mac.fullscreen button.aspect-ratio): Deleted.
1861         (.media-controls.mac.fullscreen button.pip): Deleted.
1862         (.media-controls.mac.fullscreen button.tracks): Deleted.
1863         (.media-controls.mac.fullscreen button.fullscreen): Deleted.
1864         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
1865         * Modules/modern-media-controls/controls/macos-inline-media-controls.css:
1866         (.media-controls.mac.inline .scrubber.slider):
1867         (.media-controls.mac.inline .volume-slider-container):
1868         (.media-controls.mac.inline .volume-slider-container > .background-tint):
1869         (.media-controls.mac.inline .volume-slider-container > .background-tint > div):
1870         (.media-controls.mac.inline .volume.slider):
1871         (.media-controls.mac.inline button): Deleted.
1872         (.media-controls.mac.inline button:active): Deleted.
1873         (.media-controls.mac.inline > .controls-bar button): Deleted.
1874         (.media-controls.mac.inline > .controls-bar,): Deleted.
1875         (.media-controls.mac.inline .volume-slider-container:before): Deleted.
1876         * Modules/modern-media-controls/controls/macos-inline-media-controls.js:
1877         (MacOSInlineMediaControls.prototype.layout):
1878         * Modules/modern-media-controls/controls/macos-media-controls.css: Added.
1879         (.media-controls.mac button:active):
1880         (.media-controls.mac > .controls-bar button):
1881         (.media-controls.mac > .controls-bar .time-label):
1882         (.media-controls.mac > .controls-bar .slider > canvas):
1883         (.media-controls.mac > .controls-bar .slider > input::-webkit-slider-thumb):
1884         * Modules/modern-media-controls/controls/scrubber.css: Removed.
1885         * Modules/modern-media-controls/controls/scrubber.js:
1886         (Scrubber):
1887         (Scrubber.prototype.get buffered):
1888         (Scrubber.prototype.set buffered):
1889         (Scrubber.prototype.draw):
1890         (Scrubber.prototype._drawMacOS):
1891         (Scrubber.prototype._drawiOS):
1892         * Modules/modern-media-controls/controls/slider.css:
1893         (.slider):
1894         (.slider > canvas,):
1895         (.slider > canvas):
1896         (.slider > input):
1897         (.slider > input,): Deleted.
1898         (.slider > .fill): Deleted.
1899         (.slider > input::-webkit-slider-thumb): Deleted.
1900         * Modules/modern-media-controls/controls/slider.js:
1901         (Slider.prototype.set value):
1902         (Slider.prototype.set width):
1903         (Slider.prototype.commitProperty):
1904         (Slider.prototype.layout):
1905         (Slider.prototype.draw):
1906         (Slider.prototype._handleInputEvent):
1907         (Slider.prototype._handleChangeEvent):
1908         (addRoundedRect):
1909         (Slider.prototype._updateFill): Deleted.
1910         * Modules/modern-media-controls/controls/start-button.css:
1911         (button.start):
1912         * Modules/modern-media-controls/controls/time-control.js:
1913         * Modules/modern-media-controls/controls/time-label.css:
1914         (.time-label):
1915         * Modules/modern-media-controls/controls/tracks-panel.css:
1916         (.tracks-panel):
1917         (.tracks-panel > .background-tint > div):
1918         (.tracks-panel > section):
1919         (.tracks-panel > section:first-of-type):
1920         (.tracks-panel > section > h3):
1921         (.tracks-panel > section > ul):
1922         (.tracks-panel > section > ul > li):
1923         (.tracks-panel > section > ul > li:focus):
1924         (.tracks-panel > section > ul > li.selected:before):
1925         (.tracks-panel > section > ul > li.animated):
1926         (.tracks-panel-section): Deleted.
1927         (.tracks-panel-section:first-of-type): Deleted.
1928         (.tracks-panel-section > h3): Deleted.
1929         (.tracks-panel-section > ul): Deleted.
1930         (.tracks-panel-section > ul > li): Deleted.
1931         (.tracks-panel-section > ul > li:focus): Deleted.
1932         (.tracks-panel-section > ul > li.selected:before): Deleted.
1933         (.tracks-panel-section > ul > li.animated): Deleted.
1934         * Modules/modern-media-controls/controls/tracks-panel.js:
1935         (TracksPanel.prototype._childrenFromDataSource):
1936         (TracksPanel.prototype._childrenFromDataSource.): Deleted.
1937         * Modules/modern-media-controls/controls/volume-slider.js:
1938         (VolumeSlider):
1939         (VolumeSlider.prototype.handleEvent):
1940         (VolumeSlider.prototype.draw):
1941         * Modules/modern-media-controls/js-files:
1942         * Modules/modern-media-controls/media/scrubbing-support.js:
1943         (ScrubbingSupport.prototype.get mediaEvents):
1944         (ScrubbingSupport.prototype.syncControl):
1945         (ScrubbingSupport):
1946
1947 2017-02-13  Alex Christensen  <achristensen@webkit.org>
1948
1949         URLs with an invalid IPv4 address should be invalid
1950         https://bugs.webkit.org/show_bug.cgi?id=168260
1951
1952         Reviewed by Tim Horton.
1953
1954         All URL hosts are fed through the IPv4 parser.  https://webkit.org/ doesn't
1955         look enough like an IPv4 address to be considered an invalid IPv4 address, so 
1956         we continue to the String host processing.  http://127.0.0.257 does, though, and
1957         according to https://url.spec.whatwg.org/#concept-ipv4-parser parsing that URL
1958         should fail.
1959
1960         Covered by newly passing web platform tests.
1961
1962         * platform/URLParser.cpp:
1963         (WebCore::URLParser::parseIPv4Host):
1964         (WebCore::URLParser::parseHostAndPort):
1965         * platform/URLParser.h:
1966
1967 2017-02-13  Dan Bernstein  <mitz@apple.com>
1968
1969         Reverted r212275. It still breaks some Apple-internal builds.
1970
1971         * platform/spi/mac/TUCallSPI.h:
1972
1973 2017-02-13  Joseph Pecoraro  <pecoraro@apple.com>
1974
1975         Address ESLint warnings in modern-media-controls
1976         https://bugs.webkit.org/show_bug.cgi?id=168224
1977
1978         Reviewed by Alexey Proskuryakov.
1979
1980         * Modules/modern-media-controls/controls/controls-bar.js:
1981         * Modules/modern-media-controls/controls/fullscreen-button.js:
1982         * Modules/modern-media-controls/controls/layout-node.js:
1983         * Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
1984         * Modules/modern-media-controls/controls/media-controls.js:
1985         * Modules/modern-media-controls/controls/scheduler.js:
1986         * Modules/modern-media-controls/controls/seek-button.js:
1987         * Modules/modern-media-controls/controls/tracks-panel.js:
1988         * Modules/modern-media-controls/controls/volume-slider.js:
1989         * Modules/modern-media-controls/gesture-recognizers/gesture-recognizer.js:
1990         * Modules/modern-media-controls/gesture-recognizers/pinch.js:
1991         * Modules/modern-media-controls/media/fullscreen-support.js:
1992         * Modules/modern-media-controls/media/media-controller.js:
1993         * Modules/modern-media-controls/media/placard-support.js:
1994         * Modules/modern-media-controls/media/status-support.js:
1995         Address pedantic warnings.
1996
1997 2017-02-13  Dan Bernstein  <mitz@apple.com>
1998
1999         Restored changes from r212210 in a way that does not break the build.
2000
2001         * platform/spi/mac/TUCallSPI.h:
2002
2003 2017-02-13  Zalan Bujtas  <zalan@apple.com>
2004
2005         FontCascade::widthForSimpleText should skip applyTransforms() when kerning and ligatures are off.
2006         https://bugs.webkit.org/show_bug.cgi?id=168251
2007         <rdar://problem/30498102>
2008
2009         Reviewed by Antti Koivisto.
2010
2011         Covered by existing (perf)tests.
2012
2013         * platform/graphics/FontCascade.cpp:
2014         (WebCore::FontCascade::widthForSimpleText):
2015
2016 2017-02-12  Brian Burg  <bburg@apple.com>
2017
2018         Web Inspector: expose system user interface layout direction through InspectorFrontendHost
2019         https://bugs.webkit.org/show_bug.cgi?id=168209
2020         <rdar://problem/11573736>
2021
2022         Reviewed by Joseph Pecoraro.
2023
2024         Forward the UserInterfaceLayoutDirection of the inspector page. If the WebKit client has
2025         properly set the UI directionality from system settings in PageClient, this will get inherited
2026         automatically by the Inspector's WebPage instance.
2027
2028         * inspector/InspectorFrontendClient.h:
2029         * inspector/InspectorFrontendClientLocal.cpp:
2030         (WebCore::InspectorFrontendClientLocal::userInterfaceLayoutDirection):
2031         * inspector/InspectorFrontendClientLocal.h:
2032
2033         * inspector/InspectorFrontendHost.h:
2034         * inspector/InspectorFrontendHost.idl:
2035         * inspector/InspectorFrontendHost.cpp:
2036         (WebCore::InspectorFrontendHost::userInterfaceLayoutDirection):
2037         Expose the directionality to the frontend as "ltr" or "rtl" strings.
2038
2039 2017-02-13  Zalan Bujtas  <zalan@apple.com>
2040
2041         Simple line layout: Do not measure runs with trailing whitespace when kerning and ligatures are off.
2042         https://bugs.webkit.org/show_bug.cgi?id=168247
2043         <rdar://problem/30497288>
2044
2045         Reviewed by Antti Koivisto.
2046
2047         The width of the run is supposed to be the same with or without the trailing whitespace.
2048
2049         Covered by performance test.
2050
2051         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2052         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
2053         (WebCore::SimpleLineLayout::TextFragmentIterator::textWidth):
2054         * rendering/SimpleLineLayoutTextFragmentIterator.h:
2055
2056 2017-02-13  Karim H  <karim@karhm.com>
2057
2058         Added the other missing BSTR roles tag names.
2059         https://bugs.webkit.org/show_bug.cgi?id=165545
2060
2061         Reviewed by Chris Fleizach.
2062
2063         Test: accessibility/win/bstr-elements-role.html
2064
2065         * accessibility/AccessibilityRenderObject.cpp:
2066         (WebCore::shouldReturnTagNameAsRoleForMSAA):
2067
2068 2017-02-13  Youenn Fablet  <youennf@gmail.com>
2069
2070         [WebRTC] Creating RTCPeerConnection with libwebrtc backend is crashing on rwt
2071         https://bugs.webkit.org/show_bug.cgi?id=168250
2072
2073         Reviewed by Alex Christensen.
2074
2075         Covered by webrtc tests in LayoutTests and in web-platform-tests.
2076         Making mock peer connection factory keep a ref of the real libwebrtc peer connection factory.
2077         That way, it can create real libwebrtc backends whenever requested by tests.
2078
2079         Moving LibWebRTCUtils.h routines as static LibWebRTCProvider methods.
2080         In the future, we should make them no longer static.
2081
2082         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
2083         (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
2084         (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer):
2085         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
2086         * WebCore.xcodeproj/project.pbxproj:
2087         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCUtils.cpp.
2088         (WebCore::LibWebRTCProvider::callOnWebRTCNetworkThread):
2089         (WebCore::LibWebRTCProvider::callOnWebRTCSignalingThread):
2090         (WebCore::LibWebRTCProvider::factory):
2091         (WebCore::LibWebRTCProvider::setPeerConnectionFactory):
2092         (WebCore::createActualPeerConnection):
2093         (WebCore::LibWebRTCProvider::createPeerConnection):
2094         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2095         * platform/mediastream/libwebrtc/LibWebRTCUtils.h: Removed.
2096         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
2097         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
2098         * testing/Internals.cpp:
2099         * testing/MockLibWebRTCPeerConnection.cpp:
2100         (WebCore::useMockRTCPeerConnectionFactory):
2101         (WebCore::MockLibWebRTCPeerConnectionForIceCandidates::gotLocalDescription):
2102         (WebCore::releaseInNetworkThread):
2103         (WebCore::MockLibWebRTCPeerConnection::SetLocalDescription):
2104         (WebCore::MockLibWebRTCPeerConnection::SetRemoteDescription):
2105         (WebCore::MockLibWebRTCPeerConnection::CreateOffer):
2106         (WebCore::MockLibWebRTCPeerConnection::CreateAnswer):
2107
2108 2017-02-13  Anders Carlsson  <andersca@apple.com>
2109
2110         Simplify DragController::startDrag
2111         https://bugs.webkit.org/show_bug.cgi?id=168240
2112
2113         Reviewed by Tim Horton.
2114
2115         Use early returns instead of assigning to a variable that's returned at the end of the function.
2116
2117         * page/DragController.cpp:
2118         (WebCore::DragController::startDrag):
2119
2120 2017-02-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
2121
2122         The current frame of an image should not deleted if another frame is asynchronously being decoded
2123         https://bugs.webkit.org/show_bug.cgi?id=167618
2124
2125         Reviewed by Simon Fraser.
2126
2127         Test: fast/images/animated-image-draw-while-decode.html
2128
2129         If the memory cache asks the BitmapImage to destroy all its frames while
2130         the next frame is being decoded, a thread contention may happen. This can
2131         happen when BitmapImage::draw() is called and the next frame is not ready
2132         yet for drawing, so the current frame has to be drawn. This will invoke
2133         a frame decoding in the same image from the drawing committing thread.
2134
2135         We can avoid that by destroying all the frames except the current frame if
2136         the image is asynchronously decoding its frames. This should not add extra
2137         memory overhead because building the image frame cache and then destroying
2138         it, when needed, is an on-going process. The frames will be allocated and
2139         decoded all the time and all of them can be destroyed except the current one.
2140         
2141         * platform/graphics/BitmapImage.cpp:
2142         (WebCore::BitmapImage::destroyDecodedData):
2143         (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
2144         The logic of destroying the ImageFrames was split among BitmapImage, ImageSource
2145         and ImageFrameCache. Move all the logic to BitmapImage and have ImageFrameCache
2146         be responsible only for destroying a range of ImageFrames.
2147
2148         (WebCore::BitmapImage::draw): add an ASSERT_IMPLIES to ensure the current frame
2149         is ready to be rendered if the next frame is being decoded.
2150         
2151         * platform/graphics/BitmapImage.h: Move a const from ImageFrameCache.h to BitmapImage.h.
2152
2153         * platform/graphics/ImageFrameCache.cpp:
2154         (WebCore::ImageFrameCache::destroyDecodedData):
2155         (WebCore::ImageFrameCache::destroyDecodedDataIfNecessary): Deleted.
2156         * platform/graphics/ImageFrameCache.h:
2157         (WebCore::ImageFrameCache::destroyAllDecodedData):
2158         (WebCore::ImageFrameCache::destroyAllDecodedDataExcludeFrame):
2159         (WebCore::ImageFrameCache::destroyDecodedDataBeforeFrame):
2160         Make ImageFrameCache be responsible for destroying a range of ImageFrames.
2161         This range might include all the frames, all the frames but up to a specific
2162         frame, or all the frames but exclude one frame in the middle.
2163         
2164         * platform/graphics/ImageSource.cpp:
2165         (WebCore::ImageSource::clear): No need to call clearFrameBufferCache() from clear().
2166         The decision to call clearFrameBufferCache() or clear() is moved to
2167         BitmapImage::destroyDecodedData().
2168          
2169         (WebCore::ImageSource::destroyDecodedData): Deleted.
2170         (WebCore::ImageSource::destroyDecodedDataIfNecessary): Deleted.
2171         These functions are replaced by another set of functions in ImageSource.h.
2172         
2173         * platform/graphics/ImageSource.h:
2174         (WebCore::ImageSource::destroyAllDecodedData):
2175         (WebCore::ImageSource::destroyAllDecodedDataExcludeFrame):
2176         (WebCore::ImageSource::destroyDecodedDataBeforeFrame):
2177         (WebCore::ImageSource::hasDecodingQueue):
2178         These are new wrappers which call the corresponding ImageFrameCache functions.
2179
2180 2017-02-13  Myles C. Maxfield  <mmaxfield@apple.com>
2181
2182         [Cocoa] Stop soft-linking CTRunGetBaseAdvancesAndOrigins()
2183         https://bugs.webkit.org/show_bug.cgi?id=168256
2184
2185         Reviewed by Alex Christensen.
2186
2187         Use of this function is already behind a platform guard.
2188
2189         No new tests because there is no behavior change.
2190
2191         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2192         (SOFT_LINK): Deleted.
2193
2194 2017-02-13  Jiewen Tan  <jiewen_tan@apple.com>
2195
2196         [WebCrypto] WebInspector should indicate webkitSubtle is deprecated
2197         https://bugs.webkit.org/show_bug.cgi?id=165913
2198         <rdar://problem/30477222>
2199
2200         Reviewed by Joseph Pecoraro.
2201
2202         Covered by existing tests.
2203
2204         * page/Crypto.cpp:
2205         (WebCore::Crypto::webkitSubtle):
2206
2207 2017-02-13  Simon Fraser  <simon.fraser@apple.com>
2208
2209         Call WKDestroyRenderingResources() on iOS when tabs are backgrounded
2210         https://bugs.webkit.org/show_bug.cgi?id=168261
2211         rdar://problem/30481079
2212
2213         Reviewed by Tim Horton.
2214
2215         Add CABackingStoreCollectBlocking() to QuartzCoreSPI.h, and fix files in WebCore
2216         that do a framework include.
2217
2218         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
2219         * platform/graphics/cocoa/WebActionDisablingCALayerDelegate.h:
2220         * platform/spi/cocoa/QuartzCoreSPI.h:
2221         * platform/spi/mac/NSViewSPI.h:
2222
2223 2017-02-13  Youenn Fablet  <youenn@apple.com>
2224
2225         ASSERTION FAILED: !m_bodyLoader
2226         https://bugs.webkit.org/show_bug.cgi?id=166986
2227
2228         Reviewed by Sam Weinig.
2229
2230         Refactoring to make the unset/set pending activity part of body loader.
2231         This allows ensuring to not forget to do that by simply deleting the body loader.
2232
2233         * Modules/fetch/FetchResponse.cpp:
2234         (WebCore::FetchResponse::fetch):
2235         (WebCore::FetchResponse::BodyLoader::didSucceed):
2236         (WebCore::FetchResponse::BodyLoader::didFail):
2237         (WebCore::FetchResponse::BodyLoader::BodyLoader):
2238         (WebCore::FetchResponse::BodyLoader::~BodyLoader):
2239         (WebCore::FetchResponse::stop):
2240         * Modules/fetch/FetchResponse.h:
2241
2242 2017-02-13  Aakash Jain  <aakash_jain@apple.com>
2243
2244         Remove unused WebCoreThreadSafe.h
2245         https://bugs.webkit.org/show_bug.cgi?id=168236
2246
2247         Reviewed by Dan Bernstein.
2248
2249         * platform/ios/wak/WebCoreThreadSafe.h: Removed.
2250         * WebCore.xcodeproj/project.pbxproj: Removed WebCoreThreadSafe.h
2251         * platform/ios/wak/WebCoreThread.mm: Removed WebCoreThreadSafe.h and included WAKWindow.h directly
2252
2253 2017-02-13  Anders Carlsson  <andersca@apple.com>
2254
2255         Fix iOS build.
2256
2257         * platform/ios/DragImageIOS.mm:
2258         (WebCore::deleteDragImage):
2259
2260 2017-02-13  Sam Weinig  <sam@webkit.org>
2261
2262         Rename MediaQueryExp.h/cpp to MediaQueryExpression.h/cpp
2263         https://bugs.webkit.org/show_bug.cgi?id=168249
2264
2265         Reviewed by Dean Jackson.
2266
2267         Fix a FIXME and rename MediaQueryExp.h/cpp to match the class it contains, MediaQueryExpression.
2268
2269         * CMakeLists.txt:
2270         * WebCore.xcodeproj/project.pbxproj:
2271         * css/CSSAllInOne.cpp:
2272         * css/MediaQuery.h:
2273         * css/MediaQueryEvaluator.h:
2274         * css/MediaQueryExp.cpp: Removed.
2275         * css/MediaQueryExp.h: Removed.
2276         * css/MediaQueryExpression.cpp: Copied from Source/WebCore/css/MediaQueryExp.cpp.
2277         * css/MediaQueryExpression.h: Copied from Source/WebCore/css/MediaQueryExp.h.
2278         * css/parser/MediaQueryParser.h:
2279
2280 2017-02-13  Aakash Jain  <aakash_jain@apple.com>
2281
2282         WAKResponder should be exported from WebCore
2283         https://bugs.webkit.org/show_bug.cgi?id=168245
2284
2285         Reviewed by Dan Bernstein.
2286
2287         * platform/ios/wak/WAKResponder.h:
2288
2289 2017-02-13  Simon Fraser  <simon.fraser@apple.com>
2290
2291         Log to the History Channel in a few more places
2292         https://bugs.webkit.org/show_bug.cgi?id=168252
2293
2294         Reviewed by Brady Eidson.
2295
2296         *** Aliens ***
2297
2298         * loader/HistoryController.cpp:
2299         (WebCore::HistoryController::restoreScrollPositionAndViewState):
2300         (WebCore::HistoryController::updateForReload):
2301         * loader/NavigationScheduler.cpp:
2302         (WebCore::NavigationScheduler::scheduleHistoryNavigation):
2303         (WebCore::NavigationScheduler::timerFired):
2304         (WebCore::NavigationScheduler::cancel):
2305         * page/History.cpp:
2306         (WebCore::History::go):
2307
2308 2017-02-13  Alex Christensen  <achristensen@webkit.org>
2309
2310         Percent should be allowed in non-special URL hosts
2311         https://bugs.webkit.org/show_bug.cgi?id=168255
2312
2313         Reviewed by Tim Horton.
2314
2315         In the last few weeks, the spec has consolidated its sets of code points.
2316         Now forbidden host code points replace the old invalid host code points with
2317         the modification that percents are allowed in non-special hosts because we
2318         percent-encode non-ascii code points in non-special hosts.
2319         See https://url.spec.whatwg.org/#concept-opaque-host-parser
2320
2321         Covered by newly passing web platform tests.
2322
2323         * platform/URLParser.cpp:
2324         (WebCore::isC0Control):
2325         (WebCore::isInUserInfoEncodeSet):
2326         (WebCore::URLParser::hasForbiddenHostCodePoint):
2327         (WebCore::URLParser::parseHostAndPort):
2328         (WebCore::isInvalidDomainCharacter): Deleted.
2329         (WebCore::URLParser::hasInvalidDomainCharacter): Deleted.
2330         * platform/URLParser.h:
2331
2332 2017-02-13  Anders Carlsson  <andersca@apple.com>
2333
2334         Fix Windows build.
2335
2336         * platform/win/PasteboardWin.cpp:
2337         (WebCore::Pasteboard::setDragImage):
2338
2339 2017-02-13  Alex Christensen  <achristensen@webkit.org>
2340
2341         Fix Yosemite build after r211765
2342         https://bugs.webkit.org/show_bug.cgi?id=168246
2343         <rdar://problem/30494174>
2344
2345         Reviewed by Brady Eidson.
2346
2347         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2348         (SOFT_LINK):
2349
2350 2017-02-13  Anders Carlsson  <andersca@apple.com>
2351
2352         Add a DragImage class that wraps a DragImageRef
2353         https://bugs.webkit.org/show_bug.cgi?id=168131
2354
2355         Reviewed by Beth Dakin.
2356
2357         This allows us to get rid of the explicit deleteDragImage calls and will make additional cleanup of the
2358         various drag code paths possible. No functionality change.
2359
2360         * dom/DataTransfer.cpp:
2361         (WebCore::DataTransfer::updateDragImage):
2362         * page/DragController.cpp:
2363         (WebCore::DragController::startDrag):
2364         (WebCore::DragController::doImageDrag):
2365         (WebCore::DragController::doSystemDrag):
2366         * page/DragController.h:
2367         * platform/DragImage.cpp:
2368         (WebCore::DragImage::DragImage):
2369         (WebCore::DragImage::operator=):
2370         (WebCore::DragImage::~DragImage):
2371         * platform/DragImage.h:
2372         * platform/Pasteboard.h:
2373         * platform/StaticPasteboard.h:
2374         * platform/mac/PasteboardMac.mm:
2375         (WebCore::Pasteboard::setDragImage):
2376
2377 2017-02-13  Chris Dumez  <cdumez@apple.com>
2378
2379         Regression(r211455): ASSERTION FAILED: frameView || pageCacheState() == InPageCache in com.apple.WebCore: WebCore::Document::destroyRenderTree
2380         https://bugs.webkit.org/show_bug.cgi?id=168237
2381         <rdar://problem/30494165>
2382
2383         Reviewed by Gavin Barraclough.
2384
2385         Drop bad assertion under document::destroyRenderTree() that was introduced in r211455.
2386         The assertion seemed like a good idea but the issue is that CachedFrame::destroy()
2387         reset's the document's pageCacheState before calling Document::prepareForDestruction().
2388
2389         No new tests, this fixes assertion hits on our bots.
2390
2391         * dom/Document.cpp:
2392         (WebCore::Document::destroyRenderTree):
2393
2394 2017-02-13  Myles C. Maxfield  <mmaxfield@apple.com>
2395
2396         Update custom line breaking iterators to the latest version of Unicode
2397         https://bugs.webkit.org/show_bug.cgi?id=168182
2398
2399         Reviewed by Zalan Bujtas.
2400
2401         Clean up our breaking code to be more descriptive about the difference between
2402         line-break: auto vs line-break: loose | normal | strict. The only difference is
2403         that we have some hardcoded tables to speed up character iteration for
2404         line-break: auto.
2405
2406         Tests: TestWebKitAPI WebKit2.LineBreaking
2407
2408         * rendering/BreakLines.h:
2409         (WebCore::nextBreakablePosition):
2410         (WebCore::nextBreakablePositionIgnoringNBSP):
2411         (WebCore::nextBreakablePositionWithoutShortcut):
2412         (WebCore::nextBreakablePositionIgnoringNBSPWithoutShortcut):
2413         (WebCore::isBreakable):
2414         (WebCore::nextBreakablePositionNonLoosely): Deleted.
2415         (WebCore::nextBreakablePositionLoosely): Deleted.
2416         (WebCore::nextBreakablePositionLoose): Deleted.
2417         (WebCore::nextBreakablePositionIgnoringNBSPLoose): Deleted.
2418         * rendering/RenderText.cpp:
2419         (WebCore::RenderText::computePreferredLogicalWidths):
2420         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2421         (WebCore::SimpleLineLayout::nextBreakablePositionInSegment):
2422         * rendering/line/BreakingContext.h:
2423         (WebCore::BreakingContext::handleText):
2424         (WebCore::BreakingContext::optimalLineBreakLocationForTrailingWord):
2425
2426 2017-02-13  Youenn Fablet  <youenn@apple.com>
2427
2428         Remove @getUserMedia identifier
2429         https://bugs.webkit.org/show_bug.cgi?id=168216
2430
2431         Reviewed by Sam Weinig.
2432
2433         No change of behavior.
2434
2435         * Modules/mediastream/MediaDevices.idl:
2436         * bindings/js/WebCoreBuiltinNames.h:
2437
2438 2017-02-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2439
2440         [GTK] Non-accelerated drawing is broken with HiDPI
2441         https://bugs.webkit.org/show_bug.cgi?id=168128
2442
2443         Reviewed by Michael Catanzaro.
2444
2445         When device scale factor changes, the page notifies the page overlay controller about it. Then overlay root
2446         layers are created to be notified about the device scale factor. That causes us to enter in accelerated
2447         compositing mode, because the graphics layer factory is called. But the render layer compositor doesn't really
2448         enter in accelerated mode, because there aren't page overlays, the accelerated mode is not forced and the website
2449         doesn't require acceleration either. This leaves our drawing area in an inconsistent state, it thinks it's in AC
2450         mode because it has a layer tree host, but without a root layer attached, so nothing is rendered. The page
2451         overlay controller doesn't need to create the layers when device scale factor changes, when an overlay is
2452         installed, layers will be created with the current device scale factor anyway.
2453
2454         * page/PageOverlayController.cpp:
2455         (WebCore::PageOverlayController::didChangeDeviceScaleFactor): Return early if not initialized yet.
2456
2457 2017-02-13  Csaba Osztrogonác  <ossy@webkit.org>
2458
2459         REGRESSION(r210845) Build broken with ENABLE_MHTML disabled
2460         https://bugs.webkit.org/show_bug.cgi?id=167771
2461
2462         Reviewed by Daniel Bates.
2463
2464         * loader/DocumentLoader.cpp:
2465         (WebCore::DocumentLoader::commitData):
2466
2467 2017-02-12  Dan Bernstein  <mitz@apple.com>
2468
2469         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
2470
2471         * platform/spi/mac/TUCallSPI.h: Reverted to r212210.
2472
2473 2017-02-12  Dan Bernstein  <mitz@apple.com>
2474
2475         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
2476
2477         * platform/spi/mac/TUCallSPI.h:
2478
2479 2017-02-12  Dan Bernstein  <mitz@apple.com>
2480
2481         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
2482
2483         * platform/spi/mac/TUCallSPI.h:
2484
2485 2017-02-12  Dan Bernstein  <mitz@apple.com>
2486
2487         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
2488
2489         * platform/spi/mac/NSMenuSPI.h: Replaced declaration of deprecated method with its current
2490           equivalent.
2491
2492 2017-02-12  Dan Bernstein  <mitz@apple.com>
2493
2494         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
2495
2496         * platform/spi/mac/NSImmediateActionGestureRecognizerSPI.h:
2497
2498 2017-02-12  Ryosuke Niwa  <rniwa@webkit.org>
2499
2500         parserRemoveChild should unload subframes
2501         https://bugs.webkit.org/show_bug.cgi?id=168151
2502
2503         Reviewed by Darin Adler.
2504
2505         Fix the bug that the adoption agency algorithm does not unload subframes as it disconnects nodes.
2506
2507         Also moved calls to nodeWillBeRemoved inside NoEventDispatchAssertion to expand on r211965.
2508
2509         Tests: fast/parser/adoption-agency-clear-focus-range.html
2510                fast/parser/adoption-agency-unload-iframe-1.html
2511                fast/parser/adoption-agency-unload-iframe-2.html
2512
2513         * dom/ContainerNode.cpp:
2514         (WebCore::ContainerNode::takeAllChildrenFrom): Rewritten using idioms used in removeChildren and parserAppendChild.
2515
2516         Disconnect all subframes first since this can synchronously dispatch an unload event. Then update DOM ranges,
2517         the focused element, and other states in the document.
2518
2519         Second, use the regular removeBetween, notifyChildNodeRemoved, childrenChanged sequence of calls to disconnect nodes
2520         instead of a single call to removeDetachedChildren to properly disconnect child nodes since those nodes may have
2521         already come live due to execution of synchronous scripts prior to the adoption agency algorithm has run, or in
2522         response to the unload event we just dispatched.
2523
2524         Third, append these nodes using parserAppendChild to avoid dispatching mutation events.
2525
2526         (WebCore::willRemoveChild): Removed the call to nodeWillBeRemoved. It's now called within NoEventDispatchAssertion
2527         in each call site of willRemoveChild and willRemoveChildren.
2528         (WebCore::willRemoveChildren): Ditto.
2529         (WebCore::ContainerNode::removeChild): Call nodeWillBeRemoved inside NoEventDispatchAssertion.
2530         (WebCore::ContainerNode::replaceAllChildren): Call nodeWillBeRemoved inside NoEventDispatchAssertion.
2531         (WebCore::ContainerNode::parserRemoveChild): Disconnect subframes and update document's states.
2532
2533         * html/parser/HTMLConstructionSite.cpp:
2534         (WebCore::executeTakeAllChildrenAndReparentTask): Add a release assert that new parent does not already have a parent. 
2535
2536 2017-02-12  Ryosuke Niwa  <rniwa@webkit.org>
2537
2538         REGRESSION (r179497): Crash inside setAttributeNode
2539         https://bugs.webkit.org/show_bug.cgi?id=168161
2540         <rdar://problem/30451581>
2541
2542         Reviewed by Andreas Kling.
2543
2544         The bug was caused by setAttributeNode calling setAttributeInternal with the same element data as the one used
2545         to call removeAttributeInternal despite of the fact removeAttributeInternal could have invoked arbitrary scripts
2546         and mutated element's m_elementData.
2547
2548         Fixed the bug by calling with setAttributeInternal with the result of new invocation of ensureUniqueElementData().
2549
2550         Test: fast/dom/Attr/make-unique-element-data-while-replacing-attr.html
2551
2552         * dom/Element.cpp:
2553         (WebCore::Element::setAttributeNode):
2554
2555 2017-02-12  Ryosuke Niwa  <rniwa@webkit.org>
2556
2557         Rebaseline bindings tests after r212207.
2558
2559         * bindings/scripts/test/JS/JSTestObj.cpp:
2560         * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
2561
2562 2017-02-12  Dan Bernstein  <mitz@apple.com>
2563
2564         [Cocoa] Some -respondsToSelector: checks are unnecessary
2565         https://bugs.webkit.org/show_bug.cgi?id=168183
2566
2567         Reviewed by Tim Horton.
2568
2569         * English.lproj/Localizable.strings: Removed a string that’s no longer needed after the
2570           change to WebKit2/Platform/mac/MenuUtilities.mm.
2571
2572         * editing/mac/DictionaryLookup.mm:
2573         (WebCore::showPopupOrCreateAnimationController): Removed check whether
2574           LULookupDefinitionModule responds to +showDefinitionForTerm:relativeToRect:ofView:options:.
2575
2576         * platform/cocoa/NetworkExtensionContentFilter.mm:
2577         (WebCore::NetworkExtensionContentFilter::initialize): Changed to use
2578           -[NEFilterSource setSourceAppIdentifier:], without checking, instead of
2579           -setSourceAppBundleID:, which does not exist.
2580
2581         * platform/cocoa/ScrollController.mm:
2582         (systemUptime): Deleted.
2583         (WebCore::ScrollController::snapRubberBand): Use -[NSProcessInfo systemUptime] directly.
2584
2585         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2586         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Remove unnecessary check.
2587
2588         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2589         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): Ditto.
2590         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode): Ditto.
2591         (WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck): Replaced
2592           -respondsToSelector: check with -isKindOfClass: check corresponding to the above cast.
2593         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep): Removed unnecessary
2594           check.
2595
2596         * platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
2597         (WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer): Removed unnecessary checks.
2598
2599         * platform/graphics/mac/WebGLLayer.mm:
2600         (-[WebGLLayer initWithGraphicsContext3D:]): Ditto.
2601
2602         * platform/mac/PlatformEventFactoryMac.mm:
2603         (WebCore::typeForEvent): Removed check whether NSMenu responds to +menuTypeForEvent: and
2604           all code to handle that case that it doesn’t.
2605
2606         * platform/mac/WebVideoFullscreenController.mm:
2607         (-[WebVideoFullscreenController applicationDidResignActive:]): Removed check whether
2608           NSWindow responds to -isOnActiveSpace.
2609         (-[WebVideoFullscreenController updateMenuAndDockForFullscreen]): Removed check whether
2610           NSApplication responds to -setPresentationOptions:
2611
2612         * platform/mac/WebVideoFullscreenInterfaceMac.mm:
2613         (-[WebVideoFullscreenInterfaceMacObjC updateIsPlaying:newPlaybackRate:]): Removed
2614           unnecessary -respondsToSelector: check.
2615         (-[WebVideoFullscreenInterfaceMacObjC setVideoDimensions:]): Ditto.
2616         (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]): Ditto.
2617
2618         * platform/spi/cf/CFNetworkSPI.h: Moved declarations of
2619           -[NSURLCache _initWithMemoryCapacity:diskCapacity:relativePath:] and
2620           -[NSURLCache _CFURLCache] to the !USE(APPLE_INTERNAL_SDK) section.
2621
2622         * platform/spi/cocoa/NEFilterSourceSPI.h: Added declaration of NEFilterSource’
2623           sourceAppIdentifier property to the !USE(APPLE_INTERNAL_SDK) section and deleted
2624           unconditional declaration of sourceAppBundleID property, which doesn’t exist.
2625
2626         * platform/spi/cocoa/QuartzCoreSPI.h: Removed redundant declarations.
2627
2628         * platform/spi/ios/DataDetectorsUISPI.h: Moved declarations of DDDetectionController methods
2629           from WebKit2/UIProcess/ios/{WKActionSheetAssistant,WKContentViewInteraction}.mm to here.
2630           Removed an unused declaration.
2631
2632         * platform/spi/mac/LookupSPI.h: Moved redundant declarations into the
2633           !USE(APPLE_INTERNAL_SDK) section.
2634
2635         * platform/spi/mac/NSMenuSPI.h: Changed to import NSMenu_Private.h when using the
2636           Apple internal SDK. Cleaned up the declarations for the other case.
2637
2638         * platform/spi/mac/TUCallSPI.h: Changed to import TUCall_Strings.h when use the Apple
2639           internal SDK.
2640
2641 2017-02-11  Sam Weinig  <sam@webkit.org>
2642
2643         Remove the remaining functions out of JSDOMBinding
2644         https://bugs.webkit.org/show_bug.cgi?id=168179
2645
2646         Reviewed by Darin Adler.
2647
2648         Move utility functions into more appropriate locations.
2649         - Move hasIteratorMethod to runtime/IteratorOperations.h
2650         - Move nonCachingStaticFunctionGetter to runtime/Lookup.h
2651         - Move addImpureProperty to CommonVM
2652
2653         Remove toJS overload that took a Vector<T>. Replace it's usage
2654         with toJS<IDLSequence<T>> usage. To make this work, added two
2655         new types, IDLIDBKeyData and IDLIDBValue.
2656
2657         * Modules/indexeddb/IDBCursor.cpp:
2658         (WebCore::IDBCursor::setGetResult):
2659         * Modules/indexeddb/IDBRequest.cpp:
2660         (WebCore::IDBRequest::setResult):
2661         (WebCore::IDBRequest::setResultToStructuredClone):
2662         Adopt JSDOMConvert infrastructure for conversions using new types.
2663
2664         * bindings/IDLTypes.h:
2665         * bindings/js/JSDOMConvertIndexedDB.h:
2666         (WebCore::JSConverter<IDLIDBKeyData>::convert):
2667         (WebCore::JSConverter<IDLIDBValue>::convert):
2668         Add new types for IDBKeyData and IDBValue.
2669
2670         * bindings/js/CommonVM.cpp:
2671         (WebCore::addImpureProperty):
2672         * bindings/js/CommonVM.h:
2673         Move addImpureProperty here from JSDOMBinding.
2674
2675         * bindings/js/IDBBindingUtilities.cpp:
2676         (WebCore::idbKeyDataToScriptValue): Deleted.
2677         * bindings/js/IDBBindingUtilities.h:
2678         Remove unused idbKeyDataToScriptValue, and group like functions
2679         together.
2680
2681         * bindings/js/JSDOMBinding.cpp: Removed.
2682         * bindings/js/JSDOMBinding.h:
2683         (WebCore::nonCachingStaticFunctionGetter): Deleted.
2684         (WebCore::toJS): Deleted.
2685         Move/remove functions.
2686
2687         * bindings/js/JSDOMConvertUnion.h:
2688         Update for move of hasIteratorMethod to runtime/IteratorOperations.h
2689
2690         * bindings/js/JSDOMWindowCustom.cpp:
2691         * bindings/js/JSHTMLDocumentCustom.cpp:
2692         * bindings/js/JSLocationCustom.cpp:
2693         Update for move of nonCachingStaticFunctionGetter to runtime/Lookup.h
2694
2695         * bindings/js/JSSubtleCryptoCustom.cpp:
2696         Remove unneeded include of runtime/IteratorOperations.h
2697
2698         * bindings/scripts/CodeGeneratorJS.pm:
2699         (GenerateOverloadedFunctionOrConstructor):
2700         Include runtime/IteratorOperations when needing to distinguish a sequence.
2701
2702         * html/HTMLDocument.cpp:
2703         Replace include of JSDOMBinding.h with CommonVM.h for addImpureProperty.
2704
2705 2017-02-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2706
2707         [GTK] Handle caps lock indicator in event modifiers
2708         https://bugs.webkit.org/show_bug.cgi?id=168186
2709
2710         Reviewed by Michael Catanzaro.
2711
2712         Add helper function to check if caps lock is present in the given modifiers. We need this because in GDK
2713         GDK_LOCK_MASK might be either CapsLock or ShiftLock in X11. We use this new method in all platform event
2714         implementations to add the appropriate modifiers.
2715
2716         Fixes: fast/events/special-key-events-in-input-text.html
2717
2718         * platform/PlatformKeyboardEvent.h:
2719         * platform/gtk/PlatformKeyboardEventGtk.cpp:
2720         (WebCore::modifiersForGdkKeyEvent):
2721         (WebCore::PlatformKeyboardEvent::modifiersContainCapsLock):
2722         * platform/gtk/PlatformMouseEventGtk.cpp:
2723         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
2724         * platform/gtk/PlatformWheelEventGtk.cpp:
2725         (WebCore::PlatformWheelEvent::PlatformWheelEvent):
2726
2727 2017-02-11  Sam Weinig  <sam@webkit.org>
2728
2729         Remove custom bindings for XSLTProcessor.idl
2730         https://bugs.webkit.org/show_bug.cgi?id=168174
2731
2732         Reviewed by Andreas Kling.
2733
2734         * CMakeLists.txt:
2735         * WebCore.xcodeproj/project.pbxproj:
2736         * bindings/js/JSBindingsAllInOne.cpp:
2737         * bindings/js/JSXSLTProcessorCustom.cpp: Removed.
2738         Remove file.
2739  
2740         * bindings/js/JSDOMBinding.cpp:
2741         (WebCore::jsStringOrUndefined): Deleted.
2742         * bindings/js/JSDOMBinding.h:
2743         Remove now unused jsStringOrUndefined.
2744
2745         * xml/XSLTProcessor.cpp:
2746         (WebCore::XSLTProcessor::setParameter):
2747         (WebCore::XSLTProcessor::getParameter):
2748         (WebCore::XSLTProcessor::removeParameter):
2749         * xml/XSLTProcessor.idl:
2750         Replace custom bindings bindings with early returns. One subtle difference
2751         between the custom bindings and this, is that getParameter will return 
2752         jsNull() rather than jsUndefined() for null String returns. This matches
2753         all other bindings.
2754
2755 2017-02-11  Olivier Blin  <olivier.blin@softathome.com>
2756
2757         [GStreamer][MSE][EME] Fix decryptor assignment
2758         https://bugs.webkit.org/show_bug.cgi?id=168122
2759
2760         Reviewed by Michael Catanzaro.
2761
2762         The new decryptor is a floating reference so we should not use the
2763         adopt GRefPtr constructor, but use the regular assignment operator
2764         that will sink the object (clear the floating flag).
2765
2766         This fixes assertions in debug build.
2767
2768         See previous pipeline fix in r210851 and WPE commit
2769         06020b18831e1c0eead34e2c1a5a4b7d026c227d.
2770
2771         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2772         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
2773         Do not use adoptGRef(), it prevented the object from being sunk.
2774
2775 2017-02-11  Simon Fraser  <simon.fraser@apple.com>
2776
2777         Avoid a redundant scroll to 0,0 when navigating back to a url with no fragment
2778         https://bugs.webkit.org/show_bug.cgi?id=168177
2779
2780         Reviewed by Sam Weinig.
2781
2782         FrameView::scrollToFragment() is called from FrameLoader::scrollToFragmentWithParentBoundary()
2783         when navigating within the page. If the URL had no fragment identifier, this code would
2784         call into FrameView::scrollToAnchor() with an empty name, where maintainScrollPositionAtAnchor()
2785         used the document as the anchor, thus scrolling to 0,0. Later, history().restoreScrollPositionAndViewState()
2786         the restores the scroll position from history.
2787         
2788         This scroll to 0,0 happened to be not visible to the page because of scroll event
2789         coalescing, but it makes implementation of history.scrollRestoration harder, so avoid it
2790         by just returning early from FrameView::scrollToFragment() if there is no fragment,
2791         making sure to clear the document's CSSTarget.
2792
2793         * dom/Document.cpp:
2794         (WebCore::Document::setCSSTarget):
2795         * page/FrameView.cpp:
2796         (WebCore::FrameView::scrollToFragment):
2797         (WebCore::FrameView::scrollToAnchor):
2798
2799 2017-02-11  Chris Dumez  <cdumez@apple.com>
2800
2801         Implement URL's toJSON()
2802         https://bugs.webkit.org/show_bug.cgi?id=167979
2803
2804         Reviewed by Sam Weinig.
2805
2806         Implement URL's toJSON() as per:
2807         - https://url.spec.whatwg.org/#dom-url-tojson
2808
2809         This is already supported by Firefox.
2810
2811         Also, drop URLUtils.idl as it is no longer in the specification.
2812         Merge its content to DOMURL.idl as per the URL specification.
2813
2814         Finally, mark href attribute as stringifier and drop the toString()
2815         operation to match the specification. This fixes a bug where our
2816         toString property was not enumerable but should have been.
2817
2818         Tests: fast/url/url-tojson.html
2819                imported/w3c/web-platform-tests/url/url-tojson.html
2820
2821         * CMakeLists.txt:
2822         * DerivedSources.make:
2823         * WebCore.xcodeproj/project.pbxproj:
2824         * html/DOMURL.idl:
2825         * html/URLUtils.h:
2826         (WebCore::URLUtils<T>::toJSON):
2827         * html/URLUtils.idl: Removed.
2828
2829 2017-02-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2830
2831         [GTK][EFL] Implement MIMETypeRegistry::getPreferredExtensionForMIMEType
2832         https://bugs.webkit.org/show_bug.cgi?id=168163
2833
2834         Reviewed by Michael Catanzaro.
2835
2836         It's missing causing several HTML anchor download tests to fail because the suggested filename missed the
2837         extension. This patch moves MIMETypeRegistry::appendFileExtensionIfNecessary() from the cocoa specific file to the
2838         common file because it's not actually platform specific. MIMETypeRegistry::getPreferredExtensionForMIMEType() is
2839         what platforms should implement.
2840
2841         Fixes: fast/dom/HTMLAnchorElement/anchor-download-user-triggered-synthetic-click.html
2842                fast/dom/HTMLAnchorElement/anchor-download.html
2843                fast/dom/HTMLAnchorElement/anchor-file-blob-download-no-extension.html
2844                fast/dom/HTMLAnchorElement/anchor-nodownload-set.html
2845
2846         * platform/MIMETypeRegistry.cpp:
2847         (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
2848         * platform/cocoa/MIMETypeRegistryCocoa.mm:
2849         (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary): Deleted.
2850         * platform/efl/MIMETypeRegistryEfl.cpp:
2851         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
2852         * platform/gtk/MIMETypeRegistryGtk.cpp:
2853         (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType):
2854
2855 2017-02-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2856
2857         Unreviewed. Update imageTitle translatable string.
2858
2859         To match mac port. Fixes fast/images/imageDocument-title.html.
2860
2861         * platform/gtk/LocalizedStringsGtk.cpp:
2862         (WebCore::imageTitle):
2863
2864 2017-02-10  John Wilander  <wilander@apple.com>
2865
2866         Updates to Resource Load Statistics: Get the right website data store and introduce timeout for user interaction
2867         https://bugs.webkit.org/show_bug.cgi?id=167474
2868         <rdar://problem/24681808>
2869         <rdar://problem/24703286>
2870         <rdar://problem/30290270>
2871
2872         This patch does the following:
2873         1. Gets the right website data store. API::WebsiteDataStore::defaultDataStore()
2874             does not provide the right data store.
2875         2. Introduces timeout for user interaction. A domain needs interaction every 30
2876             days to stay in that category.
2877         3. Adds grandfathered to the statistics model in preparation for grandfathering of
2878             existing data records.
2879         4. Adds test infrastructure to allow testing of the various rules in place for
2880             data records removal.
2881         5. Fixes various smaller bugs that were found as part of setting up the tests.
2882         6. Regresses the data records removal counting. We need to come up with a thread
2883             safe way of gathering removal statistics from more than one data store now
2884             that we potentially interact with multiple stores.
2885         7. Adds a first set of layout tests for resource load statistics.
2886
2887         Reviewed by Andy Estes.
2888
2889         Tests: http/tests/loading/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html
2890                http/tests/loading/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html
2891                http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html
2892                http/tests/loading/resourceLoadStatistics/prevalent-resource-with-user-interaction.html
2893                http/tests/loading/resourceLoadStatistics/prevalent-resource-without-user-interaction.html
2894
2895         * dom/Document.cpp:
2896         (WebCore::Document::updateLastHandledUserGestureTimestamp):
2897             This now calls ResourceLoadObserver::logUserInteraction() every time since
2898             we want to keep track of the most recent user interaction.
2899         * loader/ResourceLoadObserver.cpp:
2900         (WebCore::ResourceLoadObserver::statisticsStore):
2901             New getter used by WebResourceLoadStatisticsManager::resetToConsistentState().
2902         (WebCore::reduceTimeResolutionToOneDay):
2903             Convenience function.
2904         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2905             Reduces time resolution for privacy reasons.
2906         (WebCore::ResourceLoadObserver::logUserInteraction):
2907         (WebCore::ResourceLoadObserver::clearUserInteraction):
2908         (WebCore::ResourceLoadObserver::hasHadUserInteraction):
2909         (WebCore::ResourceLoadObserver::setPrevalentResource):
2910         (WebCore::ResourceLoadObserver::isPrevalentResource):
2911         (WebCore::ResourceLoadObserver::clearPrevalentResource):
2912         (WebCore::ResourceLoadObserver::setTimeToLiveUserInteraction):
2913         (WebCore::ResourceLoadObserver::fireDataModificationHandler):
2914             New functions that allow WebKitTestRunner to stage exact
2915             statistics, fire the handler, and test the outcome.
2916         * loader/ResourceLoadObserver.h:
2917         * loader/ResourceLoadStatistics.cpp:
2918         (WebCore::ResourceLoadStatistics::encode):
2919         (WebCore::ResourceLoadStatistics::decode):
2920         (WebCore::ResourceLoadStatistics::toString):
2921         (WebCore::ResourceLoadStatistics::merge):
2922             Support for statistics mostRecentUserInteraction, grandfathered, and
2923             dataRecordsRemoved.
2924         * loader/ResourceLoadStatistics.h:
2925         * loader/ResourceLoadStatisticsStore.cpp:
2926         (WebCore::ResourceLoadStatisticsStore::setTimeToLiveUserInteraction):
2927             New function that allows WebKitTestRunner to test 
2928             aging out of user interaction.
2929         (WebCore::ResourceLoadStatisticsStore::hasHadRecentUserInteraction):
2930             Now takes into account the timestamp and ages
2931             out user interaction.
2932         (WebCore::ResourceLoadStatisticsStore::prevalentResourceDomainsWithoutUserInteraction):
2933             Now makes use of ResourceLoadStatisticsStore::hasHadRecentUserInteraction().
2934         * loader/ResourceLoadStatisticsStore.h:
2935
2936 2017-02-10  Sam Weinig  <sam@webkit.org>
2937
2938         [WebIDL] Cleanup XMLHttpRequest's bindings
2939         https://bugs.webkit.org/show_bug.cgi?id=168067
2940
2941         Reviewed by Chris Dumez.
2942
2943         * bindings/js/JSDOMBinding.cpp:
2944         (WebCore::jsOwnedStringOrNull): Deleted.
2945         * bindings/js/JSDOMBinding.h:
2946         Remove jsOwnedStringOrNull and inline it into it's one use
2947         in JSXMLHttpRequestCustom.
2948
2949         * bindings/js/JSXMLHttpRequestCustom.cpp:
2950         (WebCore::JSXMLHttpRequest::responseText):
2951         (WebCore::SendFunctor::SendFunctor): Deleted.
2952         (WebCore::SendFunctor::line): Deleted.
2953         (WebCore::SendFunctor::column): Deleted.
2954         (WebCore::SendFunctor::url): Deleted.
2955         (WebCore::SendFunctor::operator()): Deleted.
2956         (WebCore::JSXMLHttpRequest::send): Deleted.
2957         * xml/XMLHttpRequest.cpp:
2958         (WebCore::XMLHttpRequest::send):
2959         * xml/XMLHttpRequest.h:
2960         Remove custom send, replacing it with a single send implementation that
2961         takes a variant.
2962
2963         * xml/XMLHttpRequest.idl:
2964         Cleanup the IDL to better match the spec. Update correct types where trivial.
2965
2966 2017-02-10  Chris Dumez  <cdumez@apple.com>
2967
2968         document.origin doesn't match spec
2969         https://bugs.webkit.org/show_bug.cgi?id=168022
2970
2971         Reviewed by Sam Weinig.
2972
2973         Update document.origin to return the origin in the expected format:
2974         - https://dom.spec.whatwg.org/#dom-document-origin
2975
2976         Change: "https_webkit.org_0 -> "https://webkit.org".
2977
2978         The new behavior matches Firefox and Chrome.
2979
2980         No new tests, updated existing tests.
2981
2982         * dom/Document.cpp:
2983         (WebCore::Document::origin):
2984
2985 2017-02-10  Daniel Bates  <dabates@apple.com>
2986
2987         Attempt to fix the build following <https://trac.webkit.org/changeset/212173>
2988         (https://bugs.webkit.org/show_bug.cgi?id=166774)
2989
2990         * dom/Document.cpp:
2991         (WebCore::Document::detachFromCachedFrame): Use ASSER_UNUSED() instead of ASSERT() since
2992         the parameter cachedFrame is unused in non-debug build.
2993
2994 2017-02-10  Daniel Bates  <dabates@apple.com>
2995
2996         Detach frame from document when entering page cache
2997         https://bugs.webkit.org/show_bug.cgi?id=166774
2998         <rdar://problem/29904368>
2999
3000         Reviewed by Chris Dumez.
3001
3002         When a page enters the page cache it is unnecessary for it to hold a reference to its
3003         associated frame because subsequent interactions with the page do not need to make use
3004         of it. Once a page exits the page cache we associate it with its frame.
3005
3006         * dom/Document.cpp:
3007         (WebCore::Document::frameDestroyed): Update comment to reflect the renaming of disconnectFromFrame().
3008         (WebCore::Document::attachToCachedFrame): Added.
3009         (WebCore::Document::detachFromCachedFrame): Added.
3010         (WebCore::Document::prepareForDestruction): Only call CSSAnimationController::detachFromDocument() if
3011         we have a frame. Substitute detachFromFrame() for disconnectFromFrame() as the latter was renamed to
3012         the former.
3013         (WebCore::Document::hasEverCalledWindowOpen): Deleted.
3014         (WebCore::Document::markHasCalledWindowOpen): Deleted.
3015         (WebCore::Document::disconnectFromFrame): Renamed to detachFromFrame.
3016         * dom/Document.h:
3017         (WebCore::Document::detachFromFrame): Renamed; formerly named disconnectFromFrame(). Changed
3018         visibility from public to private and made this function inline.
3019         * history/CachedFrame.cpp:
3020         (WebCore::CachedFrameBase::pruneDetachedChildFrames): Remove cached child frames that were
3021         removed from the page when it was in the page cache as there is no need to restore such frames.
3022         (WebCore::CachedFrameBase::restore): Call pruneDetachedChildFrames() before restoring the
3023         frame tree.
3024         (WebCore::CachedFrame::CachedFrame): Detach from the frame.
3025         (WebCore::CachedFrame::open): Assert that we have a document and re-attach the frame.
3026         (WebCore::CachedFrame::destroy): Update assertion as this function should only be called for a
3027         frameless document. Only detach the FrameView, DocumentLoader, and Page when the cached frame is for
3028         subframe and is associated with a Page object. Call CSSAnimationController::detachFromDocument() to
3029         detach the animation controller from the document as it is being destroyed. We have to do this here
3030         because the document does not have a frame. And Document::prepareForDestruction() only calls
3031         CSSAnimationController::detachFromDocument() if the document has a frame.
3032         * history/CachedFrame.h:
3033         * history/PageCache.cpp:
3034         (WebCore::canCachePage): Remove logic that prevents caching of a page that called window.open()
3035         or has an opener as it is feasible to keep such pages in the page cache.
3036         * html/HTMLFrameElementBase.cpp:
3037         (WebCore::HTMLFrameElementBase::finishedInsertingSubtree): Fix style nit.
3038         * loader/FrameLoader.cpp:
3039         (WebCore::FrameLoader::frameDetached): Only stop all loaders and stop active DOM objects if the
3040         page is not in- or about to enter- the page cache. A page in the page cache has finished loading
3041         and its active DOM objects are suspended. Also fix style nit in comment.
3042         (WebCore::FrameLoader::detachFromParent): Only stop all loaders if the page is not in- or about to
3043         enter- the page cache. A page in the page cache has finished loading. Also added a comment to explain
3044         that we protect the frame because stopAllLoaders() can cause the frame to be deallocated.
3045         * page/DOMWindow.cpp:
3046         (WebCore::DOMWindow::createWindow): Remove logic to call markHasCalledWindowOpen() as this
3047         function will be removed.
3048         * page/DiagnosticLoggingKeys.cpp:
3049         (WebCore::DiagnosticLoggingKeys::hasCalledWindowOpenKey): Deleted.
3050         (WebCore::DiagnosticLoggingKeys::hasOpenerKey): Deleted.
3051         * page/DiagnosticLoggingKeys.h:
3052         * page/Page.cpp:
3053         (WebCore::Page::openedByWindowOpen): Deleted.
3054         * page/Page.h:
3055         * page/Settings.in: Remove setting allowsPageCacheWithWindowOpener.
3056
3057 2017-02-10  Simon Fraser  <simon.fraser@apple.com>
3058
3059         REGRESSION (r211845): [ios-simulator] LayoutTest compositing/masks/solid-color-masked.html is a flaky failure
3060         https://bugs.webkit.org/show_bug.cgi?id=168054
3061
3062         Reviewed by Tim Horton.
3063
3064         When adding mask layers, there was an ordering dependency. There was a hack in GraphicsLayerCA::setVisibleAndCoverageRects()
3065         to propagate m_intersectsCoverageRect to masks. However, if GraphicsLayerCA::setVisibleAndCoverageRects()
3066         ran on the masked layer before the mask was added, nothing updated the "m_intersectsCoverageRect" state of the mask layer.
3067
3068         Fix by explicitly calling setVisibleAndCoverageRects() on the mask layer, passing the same rects and
3069         viewport-constrained state as for its host layer (we already assume that their geometry matches).
3070
3071         Tested by compositing/masks/solid-color-masked.html
3072
3073         * platform/graphics/ca/GraphicsLayerCA.cpp:
3074         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
3075         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
3076
3077 2017-02-10  Commit Queue  <commit-queue@webkit.org>
3078
3079         Unreviewed, rolling out r212154, r212154, and r212156.
3080         https://bugs.webkit.org/show_bug.cgi?id=168156
3081
3082         broke internal builds (Requested by smfr on #webkit).
3083
3084         Reverted changesets:
3085
3086         "Add a DragImage class that wraps a DragImageRef"
3087         https://bugs.webkit.org/show_bug.cgi?id=168131
3088         http://trac.webkit.org/changeset/212154
3089
3090         "Add a DragImage class that wraps a DragImageRef"
3091         https://bugs.webkit.org/show_bug.cgi?id=168131
3092         http://trac.webkit.org/changeset/212154
3093
3094         "Try to fix the iOS and Windows builds."
3095         http://trac.webkit.org/changeset/212156
3096
3097 2017-02-10  Csaba Osztrogonác  <ossy@webkit.org>
3098
3099         Fix the !ENABLE(WEBGL) build
3100         https://bugs.webkit.org/show_bug.cgi?id=168112
3101
3102         Reviewed by Alex Christensen.
3103
3104         * html/canvas/WebGLRenderingContextBase.h:
3105
3106 2017-02-10  Youenn Fablet  <youenn@apple.com>
3107
3108         [Fetch API] fetch fails when undefined is passed as headers
3109         https://bugs.webkit.org/show_bug.cgi?id=168043
3110
3111         Reviewed by Geoffrey Garen.
3112
3113         Covered by updated test.
3114
3115         * Modules/fetch/FetchInternals.js:
3116         (fillFetchHeaders): Exit early in case of undefined headers, since it is an optional parameter.
3117
3118 2017-02-10  Csaba Osztrogonác  <ossy@webkit.org>
3119
3120         Fix the !ENABLE(WEB_TIMING) build
3121         https://bugs.webkit.org/show_bug.cgi?id=168113
3122
3123         Reviewed by Alex Christensen.
3124
3125         * workers/WorkerGlobalScope.cpp:
3126         (WebCore::WorkerGlobalScope::WorkerGlobalScope):
3127
3128 2017-02-10  Joseph Pecoraro  <pecoraro@apple.com>
3129
3130         Update features.json for Performance Timing APIs
3131         https://bugs.webkit.org/show_bug.cgi?id=168148
3132
3133         Reviewed by Simon Fraser.
3134
3135         * features.json:
3136
3137 2017-02-10  Anders Carlsson  <andersca@apple.com>
3138
3139         Try to fix the iOS and Windows builds.
3140
3141         * platform/ios/DragImageIOS.mm:
3142         (WebCore::deleteDragImage):
3143         * platform/win/PasteboardWin.cpp:
3144         (WebCore::Pasteboard::setDragImage):
3145
3146 2017-02-10  Anders Carlsson  <andersca@apple.com>
3147
3148         Add a DragImage class that wraps a DragImageRef
3149         https://bugs.webkit.org/show_bug.cgi?id=168131
3150
3151         Reviewed by Beth Dakin.
3152
3153         This allows us to get rid of the explicit deleteDragImage calls and will make additional cleanup of the
3154         various drag code paths possible. No functionality change.
3155
3156         * dom/DataTransfer.cpp:
3157         (WebCore::DataTransfer::updateDragImage):
3158         * page/DragController.cpp:
3159         (WebCore::DragController::startDrag):
3160         (WebCore::DragController::doImageDrag):
3161         (WebCore::DragController::doSystemDrag):
3162         * page/DragController.h:
3163         * platform/DragImage.cpp:
3164         (WebCore::DragImage::DragImage):
3165         (WebCore::DragImage::operator=):
3166         (WebCore::DragImage::~DragImage):
3167         * platform/DragImage.h:
3168         * platform/Pasteboard.h:
3169         * platform/StaticPasteboard.h:
3170         * platform/mac/PasteboardMac.mm:
3171         (WebCore::Pasteboard::setDragImage):
3172
3173 2017-02-10  Simon Fraser  <simon.fraser@apple.com>
3174
3175         Make sure the "inwindow" flag propagates to TiledBackings for masks and reflections
3176         https://bugs.webkit.org/show_bug.cgi?id=168127
3177         rdar://problem/30467120
3178
3179         Reviewed by Tim Horton.
3180         
3181         Replace the special-case, but wrong, GraphicsLayer traversal in setIsInWindowIncludingDescendants()
3182         which forgot to hit masks and replica layers with a generic traverse() function, which
3183         is then used for setting 'inWindow' as well as resetting tracked repaints.
3184
3185         Tests: compositing/tiling/tiled-mask-inwindow.html
3186                compositing/tiling/tiled-reflection-inwindow.html
3187
3188         * page/PageOverlayController.cpp:
3189         (WebCore::PageOverlayController::layerWithDocumentOverlays):
3190         (WebCore::PageOverlayController::layerWithViewOverlays):
3191         * platform/graphics/GraphicsLayer.cpp:
3192         (WebCore::GraphicsLayer::setIsInWindow):
3193         (WebCore::GraphicsLayer::setReplicatedByLayer):
3194         (WebCore::GraphicsLayer::traverse):
3195         (WebCore::GraphicsLayer::setIsInWindowIncludingDescendants): Deleted.
3196         * platform/graphics/GraphicsLayer.h:
3197         * rendering/RenderLayerCompositor.cpp:
3198         (WebCore::RenderLayerCompositor::setIsInWindow):
3199         (WebCore::RenderLayerCompositor::resetTrackedRepaintRects):
3200         (WebCore::resetTrackedRepaintRectsRecursive): Deleted.
3201
3202 2017-02-09  Simon Fraser  <simon.fraser@apple.com>
3203
3204         Tiled layers are sometimes left with some tiles when outside the viewport
3205         https://bugs.webkit.org/show_bug.cgi?id=168104
3206         rdar://problem/30459055
3207
3208         Reviewed by Tim Horton.
3209
3210         When the coverage rect of a TiledBacking goes from a non-empty rect to an empty rect, we
3211         shouldn't just early return from TileGrid::revalidateTiles(), otherwise we are left with some
3212         tiles. Run through the function as normal, which will remove all the tiles for an empty coverage rect.
3213         
3214         Minor logging changes.
3215
3216         Test: tiled-drawing/tile-coverage-iframe-to-zero-coverage.html
3217
3218         * platform/graphics/ca/TileGrid.cpp:
3219         (WebCore::TileGrid::revalidateTiles):
3220
3221 2017-02-10  Zalan Bujtas  <zalan@apple.com>
3222
3223         Mail hangs when removing multiple rows from large table.
3224         https://bugs.webkit.org/show_bug.cgi?id=168103
3225         <rdar://problem/30090186>
3226
3227         Reviewed by Ryosuke Niwa.
3228
3229         DeleteSelectionCommand::removeNode doesn't actually destroy table structure items,
3230         but instead it removes their content. In order to be able to continue editing the table after
3231         the delete, we need to ensure that its cells' width and height are > 0. Currently we issue layout on
3232         each table item recursively.
3233         This patch delays the layout until after we've finished with the entire subtree delete (10x progression).
3234
3235         Performance test added.
3236
3237         * editing/DeleteSelectionCommand.cpp:
3238         (WebCore::DeleteSelectionCommand::insertBlockPlaceholderForTableCellIfNeeded):
3239         (WebCore::DeleteSelectionCommand::removeNodeUpdatingStates):
3240         (WebCore::shouldRemoveContentOnly):
3241         (WebCore::DeleteSelectionCommand::removeNode):
3242         * editing/DeleteSelectionCommand.h:
3243
3244 2017-02-10  Joseph Pecoraro  <pecoraro@apple.com>
3245
3246         [Resource Timing] Enable Resource Timing by default in Tests
3247         https://bugs.webkit.org/show_bug.cgi?id=168145
3248
3249         Reviewed by Ryosuke Niwa.
3250
3251         * loader/ResourceTimingInformation.cpp:
3252         (WebCore::ResourceTimingInformation::addResourceTiming):
3253         * testing/InternalSettings.cpp:
3254         (WebCore::InternalSettings::Backup::Backup):
3255         (WebCore::InternalSettings::Backup::restoreTo):
3256         (WebCore::InternalSettings::setResourceTimingEnabled): Deleted.
3257         * testing/InternalSettings.h:
3258         * testing/InternalSettings.idl:
3259         No longer needed for tests.
3260
3261 2017-02-10  Dan Bernstein  <mitz@apple.com>
3262
3263         [Cocoa] Add shouldChangeSelectedRange to WKWebProcessPlugInEditingDelegate
3264         https://bugs.webkit.org/show_bug.cgi?id=168097
3265
3266         Reviewed by Tim Horton.
3267
3268         Added a userTriggered argument to FrameSelection::setSelectedRange so that WebKit2 can
3269         indicate that changes should be agreed to by the delegate.
3270
3271         * editing/FrameSelection.cpp:
3272         (WebCore::FrameSelection::setSelectedRange): If the change is user-triggered, check with
3273           shouldChangeSelection.
3274         * editing/FrameSelection.h:
3275
3276 2017-02-10  Jonathan Bedard  <jbedard@apple.com>
3277
3278         Removing LayoutTestRelay
3279         https://bugs.webkit.org/show_bug.cgi?id=165927
3280
3281         Reviewed by Daniel Bates.
3282         Part 2
3283
3284         LayoutTestRelay uses SPI, since recent versions of the iOS SDK allow for installing apps on
3285         simulators through simctl (iOS 10 and later), use this functionality instead.
3286
3287         * platform/RuntimeApplicationChecks.mm:
3288         (WebCore::IOSApplication::isDumpRenderTree): Update comment to reflect removal of LayoutTestRelay.
3289
3290 2017-02-10  Youenn Fablet  <youenn@apple.com>
3291
3292         [WebRTC] Implement Outgoing libwebrtc audio source support
3293         https://bugs.webkit.org/show_bug.cgi?id=168118
3294
3295         Reviewed by Eric Carlson.
3296
3297         No new automated tests as we need the audio rendering to work to test the whole loop.
3298
3299         Using an AudioSampleDataSource to convert the captured data to libwebrtc expected format.
3300         Capturing and pushing data happens in the capture thread.
3301         Pulling of converted data happens in libwebrtc thread.
3302
3303         Introducing LibWebRTCAudioFormat.h to centralize libwbebrtc expected audio format.
3304
3305         * WebCore.xcodeproj/project.pbxproj:
3306         * platform/audio/WebAudioBufferList.cpp:
3307         (WebCore::WebAudioBufferList::WebAudioBufferList): Missing initialization leads to assertion failure.
3308         * platform/audio/mac/AudioSampleBufferList.cpp:
3309         (WebCore::AudioSampleBufferList::copyFrom): In case of interleaved channels, there is one buffer but two channels.
3310         * platform/audio/mac/AudioSampleDataSource.cpp:
3311         (WebCore::AudioSampleDataSource::pushSamples):
3312         (WebCore::AudioSampleDataSource::pullAvalaibleSamplesAsChunks):
3313         * platform/audio/mac/AudioSampleDataSource.h:
3314         * platform/mediastream/libwebrtc/LibWebRTCAudioFormat.h: Added.
3315         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
3316         (WebCore::libwebrtcAudioFormat):
3317         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
3318         (WebCore::RealtimeOutgoingAudioSource::sourceMutedChanged):
3319         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
3320         (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
3321         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
3322
3323 2017-02-10  Ryosuke Niwa  <rniwa@webkit.org>
3324
3325         HTMLConstructionSiteTask::Insert should never be called on a node with a parent
3326         https://bugs.webkit.org/show_bug.cgi?id=168099
3327
3328         Reviewed by Sam Weinig.
3329
3330         insertAlreadyParsedChild always use HTMLConstructionSiteTask::InsertAlreadyParsedChild instead
3331         of using HTMLConstructionSiteTask::Insert when fostering a child.
3332
3333         Also combine the step to take all children and re-parenting into a single task instead of
3334         separately issuing TakeAllChildren and Reparent tasks.
3335
3336         No new tests since this is a refactoring.
3337
3338         * html/parser/HTMLConstructionSite.cpp:
3339         (WebCore::insert): Now asserts that the child node never have a parent.
3340         (WebCore::executeInsertAlreadyParsedChildTask): Moved the code to remove the parent here.
3341         (WebCore::executeTakeAllChildrenAndReparentTask): Renamed from executeTakeAllChildrenTask
3342         now that this function also does the reparenting.
3343         (WebCore::executeTask):
3344         (WebCore::HTMLConstructionSite::reparent): Removed the variant only used with takeAllChildren.
3345         (WebCore::HTMLConstructionSite::insertAlreadyParsedChild): Always use InsertAlreadyParsedChild
3346         instead of calling fosterParent which uses Insert when fostering parents.
3347         (WebCore::HTMLConstructionSite::takeAllChildrenAndReparent): Renamed from takeAllChildren.
3348         * html/parser/HTMLConstructionSite.h:
3349         (WebCore::HTMLConstructionSiteTask:Operation):
3350         * html/parser/HTMLTreeBuilder.cpp:
3351         (WebCore::HTMLTreeBuilder::callTheAdoptionAgency):
3352
3353 2017-02-10  Dave Hyatt  <hyatt@apple.com>
3354
3355         [CSS Parser] Make intercap property values serialize correctly
3356         https://bugs.webkit.org/show_bug.cgi?id=168073
3357
3358         Reviewed by Zalan Bujtas.
3359
3360         Fix CSS value keywords to preserve case when the value contains capital
3361         letters. Examples include optimizeSpeed, translateX, scaleY, etc.
3362
3363         * css/CSSPrimitiveValueMappings.h:
3364         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3365         (WebCore::CSSPrimitiveValue::operator EPointerEvents):
3366         (WebCore::CSSPrimitiveValue::operator TextRenderingMode):
3367         (WebCore::CSSPrimitiveValue::operator EImageRendering):
3368         (WebCore::CSSPrimitiveValue::operator EColorInterpolation):
3369         (WebCore::CSSPrimitiveValue::operator EColorRendering):
3370         (WebCore::CSSPrimitiveValue::operator EShapeRendering):
3371         * css/MediaQueryEvaluator.cpp:
3372         (WebCore::colorGamutEvaluate):
3373         * css/SVGCSSValueKeywords.in:
3374         * css/TransformFunctions.cpp:
3375         (WebCore::transformOperationType):
3376         (WebCore::transformsForValue):
3377         * css/makevalues.pl:
3378         * css/parser/CSSParserFastPaths.cpp:
3379         (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
3380         (WebCore::parseTransformTranslateArguments):
3381         (WebCore::parseSimpleTransformValue):
3382         * css/parser/CSSPropertyParser.cpp:
3383         (WebCore::consumeTransformValue):
3384         * css/parser/CSSPropertyParserHelpers.cpp:
3385         (WebCore::CSSPropertyParserHelpers::parseColorFunctionParameters):
3386
3387 2017-02-10  Zan Dobersek  <zdobersek@igalia.com>
3388
3389         [EME] Implement MediaKeySession::load()
3390         https://bugs.webkit.org/show_bug.cgi?id=168041
3391
3392         Reviewed by Xabier Rodriguez-Calvar.
3393
3394         Implement the MediaKeySession::load() method, tracing the steps as they
3395         are defined in the EME specification. The only exception is step 8.3,
3396         which requires additional facility that tracks currently open sessions
3397         and provides information whether for a given session ID there's already
3398         a MediaKeySession that's not yet been closed.
3399
3400         Session ID sanitization is done through the CDM::sanitizeSessionId()
3401         method, which relays the task to the CDMPrivate implementation.
3402
3403         The CDMInstance::loadSession() virtual method is called with the session
3404         type, sanitized ID, the Document's origin (in string form) and the
3405         callback that's invoked upon completion of the task. The callback
3406         checks whether the operation was successful, or examines the reason for
3407         the load failure in case it wasn't, rejecting the promise in the latter
3408         case either immediately or in the following task at the latest.
3409
3410         When the load was successful, the optional known keys, expiration time
3411         and message are handled appropriately, and the promise is resolved.
3412
3413         MockCDM::sanitizeSessionId() implementation only treats
3414         'valid-loaded-session' as a valid session ID.
3415         MockCDMInstance::loadSession() implementation is kept slim for now, only
3416         providing the 'license-renewal' message when invoking the passed-in
3417         callback. Known keys and expiration time will also be tested once the
3418         relevant MediaKeySession algorithms are implemented.
3419
3420         Test: media/encrypted-media/mock-MediaKeySession-load.html
3421
3422         * Modules/encryptedmedia/CDM.cpp:
3423         (WebCore::CDM::sanitizeSessionId):
3424         * Modules/encryptedmedia/CDM.h:
3425         * Modules/encryptedmedia/CDMInstance.h:
3426         * Modules/encryptedmedia/CDMPrivate.h:
3427         * Modules/encryptedmedia/MediaKeySession.cpp:
3428         (WebCore::MediaKeySession::load):
3429         * testing/MockCDMFactory.cpp:
3430         (WebCore::MockCDM::sanitizeSessionId):
3431         (WebCore::MockCDMInstance::loadSession):
3432         * testing/MockCDMFactory.h:
3433
3434 2017-02-10  Zan Dobersek  <zdobersek@igalia.com>
3435
3436         [EME] Implement MediaKeySession::sessionClosed()
3437         https://bugs.webkit.org/show_bug.cgi?id=168039
3438
3439         Reviewed by Xabier Rodriguez-Calvar.
3440
3441         Implement the 'session closed' algorithm for MediaKeySession by
3442         following the specified steps. After this algorithm is run, the
3443         session should be considered closed, which we track via the m_closed
3444         member variable on the class. This is set to true before the promise
3445         that's accessible through the 'closed' attribute is resolved.
3446
3447         Because the algorithm requires the CDM instance to store any record
3448         of key usage when the session's type is 'persistent-usage-record', the
3449         storeRecordOfKeyUsage() virtual method is added to the CDMInstance
3450         interface. MockCDMInstance implementation is left unimplemented for now.
3451
3452         JSMediaKeySession::closed() accessor now has a custom implementation
3453         that creates a deferred promise for that object if there's none yet, and
3454         shares it with the wrapped class through the registerClosedPromise()
3455         method, storing a reference to the promise in the m_closedPromise
3456         member variable, or resolving the promise immediately if the session was
3457         already closed.
3458
3459         Test cases added to media/encrypted-media/mock-MediaKeySession-close.html.
3460
3461         * Modules/encryptedmedia/CDMInstance.h:
3462         * Modules/encryptedmedia/MediaKeySession.cpp:
3463         (WebCore::MediaKeySession::registerClosedPromise):
3464         (WebCore::MediaKeySession::sessionClosed):
3465         * Modules/encryptedmedia/MediaKeySession.h:
3466         * bindings/js/JSMediaKeySessionCustom.cpp:
3467         (WebCore::JSMediaKeySession::closed):
3468         * testing/MockCDMFactory.cpp:
3469         (WebCore::MockCDMInstance::storeRecordOfKeyUsage):
3470         * testing/MockCDMFactory.h:
3471
3472 2017-02-10  Zan Dobersek  <zdobersek@igalia.com>
3473
3474         [EME] Implement MediaKeySession::updateKeyStatuses(), MediaKeyStatusMap
3475         https://bugs.webkit.org/show_bug.cgi?id=167888
3476
3477         Reviewed by Xabier Rodriguez-Calvar.
3478
3479         Implement MediaKeySession::updateKeyStatuses(), transforming the passed-in
3480         KeyStatusVector into a Vector mapping the key IDs to MediaKeyStatus values.
3481         A keystatuseschange event is fired on the MediaKeySession object afterwards.
3482         The queueing of the task that runs the 'attemp to resume playback' on the
3483         related HTMLMediaElement objects isn't done yet since that algorithm isn't
3484         implemented yet.
3485
3486         The statuses Vector is stored on the MediaKeySession object. That Vector is
3487         then exposed through the MediaKeyStatusMap object, each such object being
3488         unique to one MediaKeySession object. The implementation of MediaKeyStatusMap
3489         thus keeps a reference to the session object as long as that object is alive,
3490         and queries the MediaKeySession::statuses() getter to access the Vector that
3491         contains status information for all the key IDs.
3492
3493         MediaKeyStatusMap::Iterator object keeps a reference to the MediaKeyStatusMap
3494         object and accesses the statuses by indexing into the status Vector of the
3495         related MediaKeySession object.
3496
3497         CDMInstance::updateLicense() now accepts the session ID string as the first
3498         argument, making it possible to specify which session should be updated.
3499
3500         MockCDMFactory::keysForSessionWithID() returns an optional reference to the
3501         Vector value in the session map that lists all the key IDs that are being
3502         stored for that session.
3503
3504         MockCDMInstance::updateLicense() now detects the 'keys-changed' entry in the
3505         passed-in response data, and upon detecting that constructs a KeyStatusVector
3506         object containing all the keys for that session. KeyStatus::Usable is returned
3507         for each object at the moment, but this should be adjustable in the future
3508         through additional parameters passed through the response data. The Vector
3509         object is then passed to the callback and is then passed to the 'update key
3510         statuses' algorithm in MediaKeySession.
3511
3512         Covered by a test case in media/encrypted-media/mock-MediaKeySession-update.html.
3513
3514         * Modules/encryptedmedia/CDMInstance.h:
3515         * Modules/encryptedmedia/MediaKeySession.cpp:
3516         (WebCore::MediaKeySession::MediaKeySession):
3517         (WebCore::MediaKeySession::~MediaKeySession):
3518         (WebCore::MediaKeySession::update):
3519         (WebCore::MediaKeySession::updateKeyStatuses):
3520         * Modules/encryptedmedia/MediaKeySession.h:
3521         * Modules/encryptedmedia/MediaKeyStatusMap.cpp:
3522         (WebCore::MediaKeyStatusMap::MediaKeyStatusMap):
3523         (WebCore::MediaKeyStatusMap::detachSession):
3524         (WebCore::MediaKeyStatusMap::size):
3525         (WebCore::keyIdsMatch):
3526         (WebCore::MediaKeyStatusMap::has):
3527         (WebCore::MediaKeyStatusMap::get):
3528         (WebCore::MediaKeyStatusMap::Iterator::Iterator):
3529         (WebCore::MediaKeyStatusMap::Iterator::next):
3530         * Modules/encryptedmedia/MediaKeyStatusMap.h:
3531         (WebCore::MediaKeyStatusMap::create):
3532         * Modules/encryptedmedia/MediaKeyStatusMap.idl:
3533         * testing/MockCDMFactory.cpp:
3534         (WebCore::MockCDMFactory::keysForSessionWithID):
3535         (WebCore::MockCDMInstance::updateLicense):
3536         * testing/MockCDMFactory.h:
3537
3538 2017-02-09  Simon Fraser  <simon.fraser@apple.com>
3539
3540         Improve IOSurfacePool logging
3541         https://bugs.webkit.org/show_bug.cgi?id=168098
3542
3543         Reviewed by Tim Horton.
3544
3545         Pass a string to DUMP_POOL_STATISTICS so we can tell what's triggering the
3546         logging.
3547
3548         * platform/graphics/cg/IOSurfacePool.cpp:
3549         (WebCore::IOSurfacePool::takeSurface):
3550         (WebCore::IOSurfacePool::addSurface):
3551         (WebCore::IOSurfacePool::evict):
3552         (WebCore::IOSurfacePool::collectionTimerFired):
3553         (WebCore::IOSurfacePool::showPoolStatistics):
3554         * platform/graphics/cg/IOSurfacePool.h:
3555
3556 2017-02-09  Alex Christensen  <achristensen@webkit.org>
3557
3558         Unreviewed, rolling out r212040.
3559
3560         Broke build.  I'm not surprised
3561
3562         Reverted changeset:
3563
3564         "[WebRTC][Mac] Activate libwebrtc"
3565         https://bugs.webkit.org/show_bug.cgi?id=167293
3566         http://trac.webkit.org/changeset/212040
3567
3568 2017-02-09  Chris Dumez  <cdumez@apple.com>
3569
3570         [Mac][WK2] Use MIME type to add file extension to downloads' suggested filenames when missing
3571         https://bugs.webkit.org/show_bug.cgi?id=168077
3572         <rdar://problem/30412595>
3573
3574         Reviewed by Alex Christensen.
3575
3576         Add utility function to MIMETypeRegistry that appends an extension to
3577         a filename if necessary, based on a provided MIME type.
3578
3579         Tests: fast/dom/HTMLAnchorElement/anchor-file-blob-download-no-extension.html
3580                http/tests/download/anchor-download-no-extension.html
3581
3582         * platform/MIMETypeRegistry.cpp:
3583         (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
3584         * platform/MIMETypeRegistry.h:
3585         * platform/cocoa/MIMETypeRegistryCocoa.mm:
3586         (WebCore::MIMETypeRegistry::appendFileExtensionIfNecessary):
3587
3588 2017-02-09  Youenn Fablet  <youenn@apple.com>
3589
3590         [WebRTC][Mac] Activate libwebrtc
3591         https://bugs.webkit.org/show_bug.cgi?id=167293
3592
3593         Reviewed by Alex Christensen.
3594
3595         * Configurations/WebCore.xcconfig:
3596         * Configurations/WebCoreTestSupport.xcconfig:
3597
3598 2017-02-09  Philip Rogers  <pdr@google.com>
3599
3600         SVG clip-path references can clip out later content
3601         https://bugs.webkit.org/show_bug.cgi?id=164181
3602
3603         Reviewed by Said Abou-Hallawa.
3604
3605         RenderSVGResourceClipper can modify the GraphicsContext state (through the path-only
3606         clipping codepath) so we need to ensure RenderLayer::setupClipPath saves the context
3607         and its caller restores it back so later content is not clipped as well.
3608
3609         This patch is based on a chromium patch by fs@opera.com:
3610         https://chromium.googlesource.com/chromium/src/+/b3f7e7d2c4afb3c7e5c7eb438ff5933cbe2109b3
3611
3612         Test: css3/masking/clip-path-reference-restore.html
3613
3614         * rendering/RenderLayer.cpp:
3615         (WebCore::RenderLayer::setupClipPath): Add a GC save and return true to restore. Also switch to downcast instead of static_cast.
3616
3617 2017-02-09  Filip Pizlo  <fpizlo@apple.com>
3618
3619         SharedArrayBuffer does not need to be in the transfer list
3620         https://bugs.webkit.org/show_bug.cgi?id=168079
3621
3622         Reviewed by Geoffrey Garen and Keith Miller.
3623
3624         Tests: workers/sab/multi-memory-multi-buffer.html
3625                workers/sab/multi-memory.html
3626                workers/sab/no-transfer.html
3627                workers/sab/postMessage-clones.html
3628                workers/sab/sent-from-worker-no-transfer.html
3629                workers/sab/sent-from-worker-transfer.html
3630
3631         The SAB API that we originally implemented required that SABs get put in transfer lists
3632         when they are sent to workers.
3633         
3634         The new SAB API that everyone is converging towards requires that you do not put the
3635         SAB in the transfer list. That's supposed to be an error. Instead, anytime that a SAB
3636         is part of any message to or from a dedicated worker then it is automatically shared.
3637         
3638         The new API provides a lot more clarity about what is supposed to happen in contexts
3639         that support transfering but don't support sharing.
3640         
3641         Right now this patch allows both styles to work, but I hope we can disable the transfer
3642         list capability soon.
3643
3644         * bindings/js/IDBBindingUtilities.cpp:
3645         (WebCore::deserializeIDBValueToJSValue):
3646         * bindings/js/JSMessageEventCustom.cpp:
3647         (WebCore::JSMessageEvent::data):
3648         * bindings/js/SerializedScriptValue.cpp:
3649         (WebCore::CloneSerializer::serialize):
3650         (WebCore::CloneSerializer::CloneSerializer):
3651         (WebCore::CloneSerializer::dumpIfTerminal):
3652         (WebCore::CloneDeserializer::deserialize):
3653         (WebCore::CloneDeserializer::CloneDeserializer):
3654         (WebCore::CloneDeserializer::readTerminal):
3655         (WebCore::SerializedScriptValue::SerializedScriptValue):
3656         (WebCore::SerializedScriptValue::create):
3657         (WebCore::SerializedScriptValue::deserialize):
3658         * bindings/js/SerializedScriptValue.h:
3659         (): Deleted.
3660         * dom/CustomEvent.cpp:
3661         (WebCore::CustomEvent::trySerializeDetail):
3662         * dom/ErrorEvent.cpp:
3663         (WebCore::ErrorEvent::trySerializeError):
3664         * dom/MessageEvent.cpp:
3665         (WebCore::MessageEvent::trySerializeData):
3666         * dom/PopStateEvent.cpp:
3667         (WebCore::PopStateEvent::trySerializeState):
3668         * workers/DedicatedWorkerGlobalScope.cpp:
3669         (WebCore::DedicatedWorkerGlobalScope::postMessage):
3670         * workers/Worker.cpp:
3671         (WebCore::Worker::postMessage):
3672
3673 2017-02-09  Brent Fulgham  <bfulgham@apple.com>
3674
3675         Unreviewed build fix after r212025.
3676
3677         inDocument -> isConnected
3678
3679         * html/FormAssociatedElement.cpp:
3680         (WebCore::FormAssociatedElement::didMoveToNewDocument):
3681         (WebCore::FormAssociatedElement::resetFormAttributeTargetObserver):
3682         * html/HTMLFormElement.cpp:
3683         (WebCore::HTMLFormElement::formElementIndex):
3684
3685 2017-02-09  Chris Dumez  <cdumez@apple.com>
3686
3687         Make sure Event keeps its current target element alive
3688         https://bugs.webkit.org/show_bug.cgi?id=167885
3689         <rdar://problem/30376972>
3690
3691         Reviewed by Brent Fulgham.
3692
3693         Make sure Event keeps its current target element alive to avoid
3694         crashes if it is accessed by JS after it has been garbage collected.
3695
3696         Test: fast/events/currentTarget-gc-crash.html
3697
3698         * dom/Event.cpp:
3699         (WebCore::Event::setCurrentTarget):
3700         * dom/Event.h:
3701         (WebCore::Event::currentTarget):
3702
3703 2017-02-09  Ryosuke Niwa  <rniwa@webkit.org>
3704
3705         Crash in render tree after dynamically mutating the slot value
3706         https://bugs.webkit.org/show_bug.cgi?id=167502
3707
3708         Reviewed by Antti Koivisto.
3709
3710         The crash was caused by attributeChanged not destructing the render tree after an assigned element had been
3711         removed from its slot. Since the style resolver can no longer find this element in the flat tree, we need to
3712         delete its render object as if the element had been removed from the DOM tree.
3713
3714         Tests: fast/html/details-summary-slot.html
3715                fast/shadow-dom/shadow-slot-attribute-change-crash.html
3716
3717         * dom/Element.cpp:
3718         (WebCore::Element::attributeChanged):
3719         * html/HTMLSummaryElement.cpp:
3720         (WebCore::SummarySlotElement): Added. Always use the default slot regardless of the slot attribute's value.
3721         (WebCore::HTMLSummaryElement::create): Use SummarySlotElement
3722
3723 2017-02-09  Antti Koivisto  <antti@apple.com>
3724
3725         Details element doesn't work correctly when mutating content between closing and opening
3726         https://bugs.webkit.org/show_bug.cgi?id=167310
3727
3728         Reviewed by Ryosuke Niwa.
3729
3730         Tests: fast/html/details-close-modify-open.html
3731                fast/shadow-dom/slot-remove-mutate-add.html
3732
3733         * dom/SlotAssignment.cpp:
3734         (WebCore::SlotAssignment::didChangeSlot):
3735
3736             Always reset the slot assignment when content is mutated.
3737
3738 2017-02-09  Chris Dumez  <cdumez@apple.com>
3739
3740         Crash under FormSubmission::create()
3741         https://bugs.webkit.org/show_bug.cgi?id=167200
3742         <rdar://problem/30096323>
3743
3744         Reviewed by Darin Adler.
3745
3746         The issue is that FormSubmission::create() was iterating over
3747         form.associatedElements() as was calling Element::appendFormData()
3748         in the loop. HTMLObjectElement::appendFormData() was calling
3749         pluginWidget(PluginLoadingPolicy::Load) which causes a synchronous
3750         layout and can fire events (such as focus event) synchronously.
3751         Firing those events synchronously allows the JS to modify the
3752         form.associatedElements() vector we are currently iterating on.
3753
3754         To avoid this issue, we now call pluginWidget(PluginLoadingPolicy::DoNotLoad)
3755         in HTMLObjectElement::appendFormData() as we are not allowed to fire
3756         synchronous events at this point. I also added a security assertion
3757         in FormSubmission::create() to catch cases where we fire JS events
3758         while iterating over the form associated elements to more easily
3759         notice these things in the future.
3760
3761         Test: fast/forms/formsubmission-appendFormData-crash.html
3762
3763         * html/HTMLObjectElement.cpp:
3764         (WebCore::HTMLObjectElement::appendFormData):
3765         * loader/FormSubmission.cpp:
3766         (WebCore::FormSubmission::create):
3767
3768 2017-02-09  Chris Dumez  <cdumez@apple.com>
3769
3770         Crash under HTMLFormElement::registerFormElement()
3771         https://bugs.webkit.org/show_bug.cgi?id=167162
3772
3773         Reviewed by Ryosuke Niwa.
3774
3775         didMoveToNewDocument() was re-registering FormAttributeTargetObserver
3776         even if the element's inDocument was not set yet. As a result, it was
3777         possible for FormAssociatedElement::resetFormOwner() to be called
3778         when the element was in the tree but with its inDocument still being
3779         false (because insertedInto() has not been called yet). This could
3780         end up calling HTMLFormElement::registerFormElement() even though
3781         the element is still recognized as detached. This is an issue because
3782         HTMLFormElement::m_associatedElements's order and its corresponding
3783         indexes (m_associatedElementsBeforeIndex / m_associatedElementsAfterIndex)
3784         rely on the position of the element with regards to the form element
3785         (before / inside / after).
3786
3787         To address the issue, we now only register the FormAttributeTargetObserver
3788         in didMoveToNewDocument() if the inDocument flag is set to true. This
3789         is similar to what is done at other call sites of
3790         resetFormAttributeTargetObserver(). We also ignore the form content
3791         attribute in HTMLFormElement::formElementIndex() if the element is
3792         not connected.
3793
3794         As per the HTML specification [1], the form content attribute is only
3795         taken if the element is connected (i.e. inDocument flag is true).
3796
3797         Note that FormAssociatedElement::findAssociatedForm() was already
3798         ignoring the form content attribute if the element is disconnected.
3799
3800         [1] https://html.spec.whatwg.org/#reset-the-form-owner (step 3)
3801
3802         Test: fast/forms/registerFormElement-crash.html
3803
3804         * html/FormAssociatedElement.cpp:
3805         (WebCore::FormAssociatedElement::didMoveToNewDocument):
3806         Only call resetFormAttributeTargetObserver() if inDocument flag is set,
3807         similarly to what is done at other call sites.
3808
3809         (WebCore::FormAssociatedElement::resetFormAttributeTargetObserver):
3810         Add an assertion to make sure no one call this method on an element that
3811         is not connected.
3812
3813         * html/HTMLFormElement.cpp:
3814         (WebCore::HTMLFormElement::formElementIndex):
3815         Ignore the form content attribute if the element is not connected, as
3816         per the HTML specification [1].
3817
3818 2017-02-09  Antti Koivisto  <antti@apple.com>
3819
3820         Tear down existing renderers when adding a shadow root.
3821         https://bugs.webkit.org/show_bug.cgi?id=167117
3822
3823         Reviewed by Andreas Kling.
3824
3825         Adding a shadow root may cause children no longer be part of the flat tree. If they had renderers
3826         tear down code would no longer reach them.
3827
3828         Test: fast/shadow-dom/attach-shadow-teardown.html
3829
3830         * dom/Element.cpp:
3831         (WebCore::Element::addShadowRoot):
3832
3833             Tear down existing render tree when adding a shadow root.
3834
3835 2017-02-09  Brent Fulgham  <bfulgham@apple.com>
3836
3837         Handle synchronous layout when setting a selection range
3838         https://bugs.webkit.org/show_bug.cgi?id=167092
3839         <rdar://problem/30041640>
3840
3841         Reviewed by Antti Koivisto.
3842
3843         The 'innerTextElement' of a form control can change during layout due
3844         to arbitrary JavaScript executing. Handle the case where the inner text
3845         element has changed so that current render box height is while setting
3846         a selection range.
3847
3848         Test: fast/forms/input-type-change-during-selection.html
3849
3850         * html/HTMLTextFormControlElement.cpp:
3851         (WebCore::HTMLTextFormControlElement::setSelectionRange):
3852
3853 2017-02-09  Alex Christensen  <achristensen@webkit.org>
3854
3855         Fix CMake build.
3856
3857         * PlatformMac.cmake:
3858
3859 2017-02-09  Brent Fulgham  <bfulgham@apple.com>
3860
3861         Disconnect shadow children of root when detaching a frame
3862         https://bugs.webkit.org/show_bug.cgi?id=166851
3863         <rdar://problem/29930443>
3864
3865         Reviewed by Andy Estes.
3866
3867         If the root of the tree we are disconnecting has a shadow element, include it in the set of
3868         things to disconnect.
3869
3870         Tests: fast/shadow-dom/shadow-at-root-during-disconnect.html
3871
3872         * dom/ContainerNodeAlgorithms.cpp:
3873         (WebCore::disconnectSubframes):
3874
3875 2017-02-09  Alexey Proskuryakov  <ap@apple.com>
3876
3877         Remove unused WebThreadRunSync
3878         https://bugs.webkit.org/show_bug.cgi?id=168024
3879
3880         Reviewed by Tim Horton.
3881
3882         * platform/ios/wak/WebCoreThreadRun.cpp:
3883         * platform/ios/wak/WebCoreThreadRun.h:
3884         * platform/ios/wak/WebCoreThreadSystemInterface.cpp:
3885         (InitWebCoreThreadSystemInterface):
3886
3887 2017-02-09  Ryan Haddad  <ryanhaddad@apple.com>
3888
3889         Unreviewed, rolling out r211802.
3890
3891         This change caused fast/regions/inline-block-inside-anonymous-
3892         overflow-with-covered-controls.html to be a flaky failure.
3893
3894         Reverted changeset:
3895
3896         "[Modern Media Controls] Improve handling of <video> with only
3897         audio tracks"
3898         https://bugs.webkit.org/show_bug.cgi?id=167836
3899         http://trac.webkit.org/changeset/211802
3900
3901 2017-02-09  Alex Christensen  <achristensen@webkit.org>
3902
3903         Fix i386 libwebrtc build
3904         https://bugs.webkit.org/show_bug.cgi?id=168038
3905
3906         * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
3907         DataChannelInterface::buffered_amount returns a uint64_t, and we want a size_t.
3908         If this overflows, then we've run out of memory and crashed a long time ago.
3909
3910 2017-02-09  Andreas Kling  <akling@apple.com>
3911
3912         Document::settings() should return a const Settings&.
3913         <https://webkit.org/b/168061>
3914
3915         Reviewed by Geoffrey Garen.
3916
3917         - Make Document::settings() return a const reference.
3918         - Added Document::mutableSettings() for all your non-const needs.
3919         - Fixed up settings generator to produce const getters.
3920         - Simplify a few settings() call sites that exposed themselves.
3921
3922         * Modules/applepay/ApplePaySession.cpp:
3923         (WebCore::shouldDiscloseApplePayCapability):
3924         * Modules/mediastream/UserMediaRequest.cpp:
3925         (WebCore::canCallGetUserMedia):
3926         * css/CSSFontFace.cpp:
3927         (WebCore::CSSFontFace::appendSources):
3928         * css/CSSFontSelector.cpp:
3929         (WebCore::resolveGenericFamily):
3930         * css/StyleResolver.h:
3931         (WebCore::StyleResolver::settings):
3932         * dom/Document.h:
3933         (WebCore::Document::settings):
3934         (WebCore::Document::mutableSettings):
3935         * html/FTPDirectoryDocument.cpp:
3936         (WebCore::createTemplateDocumentData):
3937         * html/HTMLCanvasElement.cpp:
3938         (WebCore::shouldEnableWebGL):
3939         * html/HTMLEmbedElement.cpp:
3940         (WebCore::HTMLEmbedElement::rendererIsNeeded):
3941         * html/HTMLSelectElement.cpp:
3942         (WebCore::HTMLSelectElement::menuListDefaultEventHandler):
3943         * html/ImageDocument.cpp:
3944         (WebCore::ImageDocument::updateDuringParsing):
3945         * page/csp/ContentSecurityPolicy.cpp:
3946         (WebCore::ContentSecurityPolicy::allowContentSecurityPolicySourceStarToMatchAnyProtocol):
3947         * page/make_settings.pl:
3948         (printGetterAndSetter):
3949         * rendering/SimpleLineLayout.cpp:
3950         (WebCore::SimpleLineLayout::toggleSimpleLineLayout):
3951
3952 2017-02-09  Jer Noble  <jer.noble@apple.com>
3953
3954         Make passing PlatformAudioData in audioSamplesAvaliable const-correct.
3955         https://bugs.webkit.org/show_bug.cgi?id=168051
3956
3957         Reviewed by Eric Carlson.
3958
3959         Modify all the functions which take a (conceptually) read-only audio buffer const-correct.
3960
3961         Drive-by fix: AudioSampleBufferList::copyFrom() set a ivar pointer to the passed in
3962         AudioBufferList. Ensure that the ivar is reset when copyFrom() returns by using a
3963         SetForScope.
3964
3965         * platform/audio/mac/AudioSampleBufferList.cpp:
3966         (WebCore::AudioSampleBufferList::copyFrom):
3967         * platform/audio/mac/AudioSampleBufferList.h:
3968         * platform/audio/mac/AudioSampleDataSource.cpp:
3969         (WebCore::AudioSampleDataSource::pushSamplesInternal):
3970         (WebCore::AudioSampleDataSource::pushSamples):
3971         * platform/audio/mac/AudioSampleDataSource.h:
3972         * platform/mediastream/RealtimeMediaSource.cpp:
3973         (WebCore::RealtimeMediaSource::audioSamplesAvailable):
3974         * platform/mediastream/RealtimeMediaSource.h:
3975         (WebCore::RealtimeMediaSource::Observer::audioSamplesAvailable):
3976         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
3977         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
3978         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.h:
3979         * platform/mediastream/mac/RealtimeOutgoingAudioSource.cpp:
3980         (WebCore::RealtimeOutgoingAudioSource::audioSamplesAvailable):
3981         * platform/mediastream/mac/RealtimeOutgoingAudioSource.h:
3982
3983 2017-02-09  Jer Noble  <jer.noble@apple.com>
3984
3985         Fix some logging statements in MediaPlayerPrivateMediaStreamAVFObjC
3986         https://bugs.webkit.org/show_bug.cgi?id=168063
3987
3988         Reviewed by Eric Carlson.
3989
3990         Make the format string match the types passed in (i.e., floats, not strings).
3991
3992         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3993         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateSampleTimes):
3994
3995 2017-02-09  Eric Carlson  <eric.carlson@apple.com>
3996
3997         [MediaStream Mac] Handle NULL m_sampleBufferDisplayLayer
3998         https://bugs.webkit.org/show_bug.cgi?id=168060
3999
4000         Reviewed by Jer Noble.
4001
4002         No new&