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