[GStreamer][MSE] Trim space between codecs
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2017-10-27  Alicia Boya García  <aboya@igalia.com>
2
3         [GStreamer][MSE] Trim space between codecs
4         https://bugs.webkit.org/show_bug.cgi?id=178160
5
6         Reviewed by Xabier Rodriguez-Calvar.
7
8         Modify supportsCodecs() to accept a Vector<String> instead of
9         receiving a string and parsing itself.
10
11         This improves passrate for `mediasource-is-type-supported` as it
12         ensures that whitespace between codecs is now trimmed and codec
13         strings such as `video/webm;codecs="opus, vp9"` are matched as a valid
14         type, as required by the spec.
15
16         This patch also renames supportCodecs() to supportAllCodecs() and adds
17         a new variant, supportCodec(), that checks for support of an
18         individual codec.
19
20         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
21         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
22         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
23         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodec):
24         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsAllCodecs):
25         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
26         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
27
28 2017-10-27  Michael Catanzaro  <mcatanzaro@igalia.com>
29
30         [GTK] Crash in WebCore::SelectionRangeData::apply
31         https://bugs.webkit.org/show_bug.cgi?id=177808
32
33         Reviewed by Carlos Garcia Campos.
34
35         The problem appears to be a name collision between WebCore::SelectionData and
36         WebCore::SelectionData. Yes, those are the same names. It seems the destructor for a
37         Source/WebCore/platform/gtk/SelectionData.h SelectionData is being called on a
38         Source/WebCore/rendering/SelectionRangeData.cpp SelectionData. Yikes. Can you forgive the
39         poor linker for not being magic?
40
41         This fixes crashes in approximately one bajillion tests.
42
43         * rendering/SelectionRangeData.cpp: Move SelectionData into an anonymous namespace.
44
45 2017-10-26  Basuke Suzuki  <Basuke.Suzuki@sony.com>
46
47         [WinCairo] Fix build after WebCore moves to unified source.
48         https://bugs.webkit.org/show_bug.cgi?id=178920
49
50         Added empty implementations to fix link error.
51
52         Reviewed by Ryosuke Niwa.
53
54         * platform/network/curl/DNSCurl.cpp:
55         (WebCore::DNSResolveQueue::updateIsUsingProxy):
56         (WebCore::DNSResolveQueue::platformResolve):
57
58 2017-10-26  Jeremy Jones  <jeremyj@apple.com>
59
60         Implement seek tolerance methods in WebAVPlayerController.
61         https://bugs.webkit.org/show_bug.cgi?id=178838
62         rdar://problem/33781777
63
64         Reviewed by Eric Carlson.
65
66         No new tests because this doesn't change any behavior in the page, but exposes seek tolerance to fullscreen platform UI.
67
68         * html/HTMLMediaElement.cpp:
69         (WebCore::HTMLMediaElement::setCurrentTimeWithTolerance):
70         * html/HTMLMediaElement.h:
71         * platform/cocoa/PlaybackSessionModel.h:
72         * platform/cocoa/PlaybackSessionModelMediaElement.h:
73         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
74         (WebCore::PlaybackSessionModelMediaElement::seekToTime):
75         * platform/ios/WebAVPlayerController.mm:
76         (-[WebAVPlayerController seekToTime:]):
77         (-[WebAVPlayerController seekToTime:toleranceBefore:toleranceAfter:]):
78         (-[WebAVPlayerController seekByTimeInterval:]):
79         (-[WebAVPlayerController seekByTimeInterval:toleranceBefore:toleranceAfter:]):
80         (-[WebAVPlayerController seekToBeginning:]):
81         (-[WebAVPlayerController seekToEnd:]):
82         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
83         (VideoFullscreenControllerContext::seekToTime):
84
85 2017-10-26  Michael Catanzaro  <mcatanzaro@igalia.com>
86
87         Unreviewed, fix WPE build after r224074
88         https://bugs.webkit.org/show_bug.cgi?id=178892
89
90         * accessibility/wpe/AccessibilityObjectWPE.cpp:
91         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
92
93 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
94
95         When navigating back to a page, compositing layers may not use accelerated drawing
96         https://bugs.webkit.org/show_bug.cgi?id=178749
97         rdar://problem/35158946
98
99         Reviewed by Dean Jackson.
100
101         There were two issues with setting GraphicsLayerCA's "acceleratesDrawing" state which
102         occurred on back navigation, related to the ordering of style recalcs and layout.
103
104         First, at style recalc time, we created a RenderLayerCompositor but hadn't yet called
105         its cacheAcceleratedCompositingFlags(), so any layers created during style update
106         didn't get accelerated drawing. Fix by making cacheAcceleratedCompositingFlags() internal
107         to RenderLayerCompositor and calling it from willRecalcStyle() and updateCompositingLayers().
108
109         Secondly, GraphicsLayerCA::commitLayerChangesBeforeSublayers() needs to updateAcceleratesDrawing()
110         before updating tiles, so that new tiles fetch the right acceleratesDrawing state from
111         the TileController.
112
113         Test: compositing/accelerated-layers-after-back.html
114
115         * page/FrameView.cpp:
116         (WebCore::FrameView::updateCompositingLayersAfterLayout):
117         * platform/graphics/ca/GraphicsLayerCA.cpp:
118         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
119         * rendering/RenderLayerCompositor.cpp:
120         (WebCore::RenderLayerCompositor::willRecalcStyle):
121         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
122         (WebCore::RenderLayerCompositor::updateCompositingLayers):
123         * rendering/RenderLayerCompositor.h:
124
125 2017-10-26  Alex Christensen  <achristensen@webkit.org>
126
127         Fix Windows build
128         https://bugs.webkit.org/show_bug.cgi?id=178892
129
130         * accessibility/win/AccessibilityObjectWin.cpp:
131         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
132
133 2017-10-26  Alex Christensen  <achristensen@webkit.org>
134
135         Modernize AccessibilityObject.h
136         https://bugs.webkit.org/show_bug.cgi?id=178892
137
138         Reviewed by Tim Horton.
139
140         The enums in AccessibilityObject.h are causing naming collisions with unified builds.
141         This is what enum classes are for.
142         HashMaps of enum classes still need a few casts to/from int.
143         
144         I also made some RefPtr's Ref's, use some initializer lists instead of values in the constructor implementation, and indentation fixing.
145         
146         No change in behavior.
147
148         * accessibility/AXObjectCache.cpp:
149         (WebCore::AXComputedObjectAttributeCache::getIgnored const):
150         (WebCore::AXObjectCache::~AXObjectCache):
151         (WebCore::AXObjectCache::getOrCreate):
152         (WebCore::AXObjectCache::remove):
153         (WebCore::AXObjectCache::notificationPostTimerFired):
154         * accessibility/AXObjectCache.h:
155         (WebCore::AXComputedObjectAttributeCache::CachedAXObjectAttributes::CachedAXObjectAttributes):
156         (WebCore::AXComputedObjectAttributeCache::getIgnored const):
157         * accessibility/AccessibilityARIAGrid.cpp:
158         (WebCore::AccessibilityARIAGrid::addChildren):
159         * accessibility/AccessibilityARIAGridCell.cpp:
160         (WebCore::AccessibilityARIAGridCell::parentRowGroup const):
161         * accessibility/AccessibilityARIAGridRow.cpp:
162         (WebCore::AccessibilityARIAGridRow::headerObject):
163         * accessibility/AccessibilityAttachment.cpp:
164         (WebCore::AccessibilityAttachment::accessibilityText):
165         * accessibility/AccessibilityAttachment.h:
166         * accessibility/AccessibilityImageMapLink.cpp:
167         (WebCore::AccessibilityImageMapLink::roleValue const):
168         (WebCore::AccessibilityImageMapLink::accessibilityText):
169         * accessibility/AccessibilityLabel.cpp:
170         (WebCore::childrenContainOnlyStaticText):
171         * accessibility/AccessibilityLabel.h:
172         * accessibility/AccessibilityList.cpp:
173         (WebCore::AccessibilityList::isUnorderedList const):
174         (WebCore::AccessibilityList::isOrderedList const):
175         (WebCore::AccessibilityList::determineAccessibilityRole):
176         (WebCore::AccessibilityList::roleValue const):
177         * accessibility/AccessibilityListBox.cpp:
178         (WebCore::AccessibilityListBox::setSelectedChildren):
179         (WebCore::AccessibilityListBox::listBoxOptionAccessibilityObject const):
180         * accessibility/AccessibilityListBox.h:
181         * accessibility/AccessibilityListBoxOption.h:
182         * accessibility/AccessibilityMathMLElement.cpp:
183         (WebCore::AccessibilityMathMLElement::determineAccessibilityRole):
184         (WebCore::AccessibilityMathMLElement::isMathScriptObject const):
185         (WebCore::AccessibilityMathMLElement::isMathMultiscriptObject const):
186         * accessibility/AccessibilityMediaControls.cpp:
187         (WebCore::AccessibilityMediaControl::accessibilityText):
188         (WebCore::AccessibilityMediaControl::roleValue const):
189         * accessibility/AccessibilityMediaControls.h:
190         * accessibility/AccessibilityMenuList.cpp:
191         (WebCore::AccessibilityMenuList::addChildren):
192         * accessibility/AccessibilityMenuList.h:
193         * accessibility/AccessibilityMenuListOption.h:
194         * accessibility/AccessibilityMenuListPopup.cpp:
195         (WebCore::AccessibilityMenuListPopup::menuListOptionAccessibilityObject const):
196         * accessibility/AccessibilityMenuListPopup.h:
197         * accessibility/AccessibilityNodeObject.cpp:
198         (WebCore::AccessibilityNodeObject::AccessibilityNodeObject):
199         (WebCore::AccessibilityNodeObject::determineAccessibilityRole):
200         (WebCore::AccessibilityNodeObject::canHaveChildren const):
201         (WebCore::AccessibilityNodeObject::computeAccessibilityIsIgnored const):
202         (WebCore::AccessibilityNodeObject::isSearchField const):
203         (WebCore::AccessibilityNodeObject::isImage const):
204         (WebCore::AccessibilityNodeObject::isPasswordField const):
205         (WebCore::AccessibilityNodeObject::isInputImage const):
206         (WebCore::AccessibilityNodeObject::isProgressIndicator const):
207         (WebCore::AccessibilityNodeObject::isSlider const):
208         (WebCore::AccessibilityNodeObject::isMenuRelated const):
209         (WebCore::AccessibilityNodeObject::isMenu const):
210         (WebCore::AccessibilityNodeObject::isMenuBar const):
211         (WebCore::AccessibilityNodeObject::isMenuButton const):
212         (WebCore::AccessibilityNodeObject::isMenuItem const):
213         (WebCore::AccessibilityNodeObject::isEnabled const):
214         (WebCore::AccessibilityNodeObject::isChecked const):
215         (WebCore::AccessibilityNodeObject::supportsRequiredAttribute const):
216         (WebCore::AccessibilityNodeObject::headingLevel const):
217         (WebCore::AccessibilityNodeObject::isHeading const):
218         (WebCore::AccessibilityNodeObject::isLink const):
219         (WebCore::AccessibilityNodeObject::isGroup const):
220         (WebCore::AccessibilityNodeObject::selectedRadioButton):
221         (WebCore::AccessibilityNodeObject::checkboxOrRadioValue const):
222         (WebCore::AccessibilityNodeObject::actionElement const):
223         (WebCore::AccessibilityNodeObject::alterSliderValue):
224         (WebCore::AccessibilityNodeObject::isGenericFocusableElement const):
225         (WebCore::AccessibilityNodeObject::menuElementForMenuButton const):
226         (WebCore::AccessibilityNodeObject::menuItemElementForMenu const):
227         (WebCore::AccessibilityNodeObject::titleElementText const):
228         (WebCore::AccessibilityNodeObject::alternativeText const):
229         (WebCore::AccessibilityNodeObject::visibleText const):
230         (WebCore::AccessibilityNodeObject::helpText const):
231         (WebCore::AccessibilityNodeObject::accessibilityText):
232         (WebCore::AccessibilityNodeObject::ariaLabeledByText const):
233         (WebCore::AccessibilityNodeObject::accessibilityDescription const):
234         (WebCore::AccessibilityNodeObject::roleIgnoresTitle const):
235         (WebCore::AccessibilityNodeObject::hierarchicalLevel const):
236         (WebCore::AccessibilityNodeObject::title const):
237         (WebCore::AccessibilityNodeObject::text const):
238         (WebCore::AccessibilityNodeObject::stringValue const):
239         (WebCore::AccessibilityNodeObject::determineAriaRoleAttribute const):
240         (WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent const):
241         (WebCore::AccessibilityNodeObject::canSetSelectedAttribute const):
242         * accessibility/AccessibilityNodeObject.h:
243         * accessibility/AccessibilityObject.cpp:
244         (WebCore::AccessibilityObject::detach):
245         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
246         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
247         (WebCore::AccessibilityObject::isBlockquote const):
248         (WebCore::AccessibilityObject::isTextControl const):
249         (WebCore::AccessibilityObject::isARIATextControl const):
250         (WebCore::AccessibilityObject::isLandmark const):
251         (WebCore::AccessibilityObject::findMatchingObjects):
252         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const):
253         (WebCore::AccessibilityObject::selectText):
254         (WebCore::AccessibilityObject::isARIAInput):
255         (WebCore::AccessibilityObject::isARIAControl):
256         (WebCore::AccessibilityObject::isRangeControl const):
257         (WebCore::AccessibilityObject::visiblePositionForBounds const):
258         (WebCore::AccessibilityObject::supportsARIAReadOnly const):
259         (WebCore::AccessibilityObject::ariaReadOnlyValue const):
260         (WebCore::AccessibilityObject::headingElementForNode):
261         (WebCore::AccessibilityObject::ariaTreeRows):
262         (WebCore::AccessibilityObject::ariaTreeItemContent):
263         (WebCore::AccessibilityObject::ariaTreeItemDisclosedRows):
264         (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
265         (WebCore::AccessibilityObject::actionVerb const):
266         (WebCore::AccessibilityObject::ariaCurrentState const):
267         (WebCore::AccessibilityObject::ariaCurrentValue const):
268         (WebCore::AccessibilityObject::orientation const):
269         (WebCore::initializeRoleMap):
270         (WebCore::AccessibilityObject::ariaRoleToWebCoreRole):
271         (WebCore::AccessibilityObject::computedRoleString const):
272         (WebCore::AccessibilityObject::supportsPressAction const):
273         (WebCore::AccessibilityObject::sortDirection const):
274         (WebCore::AccessibilityObject::supportsExpanded const):
275         (WebCore::AccessibilityObject::isExpanded const):
276         (WebCore::AccessibilityObject::supportsChecked const):
277         (WebCore::AccessibilityObject::checkboxOrRadioValue const):
278         (WebCore::AccessibilityObject::scrollByPage const):
279         (WebCore::AccessibilityObject::lastKnownIsIgnoredValue):
280         (WebCore::AccessibilityObject::setLastKnownIsIgnoredValue):
281         (WebCore::AccessibilityObject::buttonRoleType const):
282         (WebCore::AccessibilityObject::isButton const):
283         (WebCore::AccessibilityObject::accessibilityIsIgnoredByDefault const):
284         (WebCore::AccessibilityObject::defaultObjectInclusion const):
285         (WebCore::AccessibilityObject::accessibilityIsIgnored const):
286         (WebCore::AccessibilityObject::isContainedByPasswordField const):
287         (WebCore::AccessibilityObject::AccessibilityObject): Deleted.
288         * accessibility/AccessibilityObject.h:
289         (WebCore::AccessibilityText::AccessibilityText):
290         (WebCore::AccessibilityIsIgnoredFromParentData::AccessibilityIsIgnoredFromParentData):
291         (WebCore::AccessibilityObject::isImageMap const):
292         (WebCore::AccessibilityObject::isWebArea const):
293         (WebCore::AccessibilityObject::isCheckbox const):
294         (WebCore::AccessibilityObject::isRadioButton const):
295         (WebCore::AccessibilityObject::isListBox const):
296         (WebCore::AccessibilityObject::isSpinButton const):
297         (WebCore::AccessibilityObject::isSwitch const):
298         (WebCore::AccessibilityObject::isToggleButton const):
299         (WebCore::AccessibilityObject::isTabList const):
300         (WebCore::AccessibilityObject::isTabItem const):
301         (WebCore::AccessibilityObject::isRadioGroup const):
302         (WebCore::AccessibilityObject::isComboBox const):
303         (WebCore::AccessibilityObject::isTree const):
304         (WebCore::AccessibilityObject::isTreeGrid const):
305         (WebCore::AccessibilityObject::isTreeItem const):
306         (WebCore::AccessibilityObject::isScrollbar const):
307         (WebCore::AccessibilityObject::isListItem const):
308         (WebCore::AccessibilityObject::isScrollView const):
309         (WebCore::AccessibilityObject::isCanvas const):
310         (WebCore::AccessibilityObject::isPopUpButton const):
311         (WebCore::AccessibilityObject::isColorWell const):
312         (WebCore::AccessibilityObject::isSplitter const):
313         (WebCore::AccessibilityObject::isToolbar const):
314         (WebCore::AccessibilityObject::isSummary const):
315         (WebCore::AccessibilityObject::isStaticText const):
316         (WebCore::AccessibilityObject::ariaRoleAttribute const):
317         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
318         * accessibility/AccessibilityProgressIndicator.h:
319         * accessibility/AccessibilityRenderObject.cpp:
320         (WebCore::AccessibilityRenderObject::parentObject const):
321         (WebCore::AccessibilityRenderObject::isAttachment const):
322         (WebCore::AccessibilityRenderObject::helpText const):
323         (WebCore::AccessibilityRenderObject::stringValue const):
324         (WebCore::AccessibilityRenderObject::addRadioButtonGroupChildren const):
325         (WebCore::AccessibilityRenderObject::addRadioButtonGroupMembers const):
326         (WebCore::AccessibilityRenderObject::linkedUIElements const):
327         (WebCore::AccessibilityRenderObject::isAllowedChildOfTree const):
328         (WebCore::objectInclusionFromAltText):
329         (WebCore::AccessibilityRenderObject::defaultObjectInclusion const):
330         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
331         (WebCore::AccessibilityRenderObject::selectedTextRange const):
332         (WebCore::AccessibilityRenderObject::isTabItemSelected const):
333         (WebCore::AccessibilityRenderObject::isFocused const):
334         (WebCore::AccessibilityRenderObject::setSelectedRows):
335         (WebCore::AccessibilityRenderObject::getDocumentLinks):
336         (WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant const):
337         (WebCore::AccessibilityRenderObject::handleAriaExpandedChanged):
338         (WebCore::AccessibilityRenderObject::supportsExpandedTextValue const):
339         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
340         (WebCore::AccessibilityRenderObject::orientation const):
341         (WebCore::AccessibilityRenderObject::inheritsPresentationalRole const):
342         (WebCore::AccessibilityRenderObject::ariaRoleHasPresentationalChildren const):
343         (WebCore::AccessibilityRenderObject::canSetExpandedAttribute const):
344         (WebCore::AccessibilityRenderObject::addImageMapChildren):
345         (WebCore::AccessibilityRenderObject::addTextFieldChildren):
346         (WebCore::AccessibilityRenderObject::updateRoleAfterChildrenCreation):
347         (WebCore::AccessibilityRenderObject::ariaLiveRegionAtomic const):
348         (WebCore::AccessibilityRenderObject::canHaveSelectedChildren const):
349         (WebCore::AccessibilityRenderObject::ariaListboxSelectedChildren):
350         (WebCore::AccessibilityRenderObject::selectedChildren):
351         (WebCore::AccessibilityRenderObject::visibleChildren):
352         (WebCore::AccessibilityRenderObject::tabChildren):
353         (WebCore::AccessibilityRenderObject::actionVerb const):
354         (WebCore::msaaRoleForRenderer):
355         (WebCore::AccessibilityRenderObject::roleValueForMSAA const):
356         * accessibility/AccessibilitySVGElement.cpp:
357         (WebCore::AccessibilitySVGElement::accessibilityText):
358         (WebCore::AccessibilitySVGElement::computeAccessibilityIsIgnored const):
359         (WebCore::AccessibilitySVGElement::inheritsPresentationalRole const):
360         (WebCore::AccessibilitySVGElement::determineAriaRoleAttribute const):
361         (WebCore::AccessibilitySVGElement::determineAccessibilityRole):
362         * accessibility/AccessibilitySVGRoot.h:
363         * accessibility/AccessibilityScrollView.cpp:
364         (WebCore::AccessibilityScrollView::scrollBar):
365         * accessibility/AccessibilityScrollView.h:
366         * accessibility/AccessibilityScrollbar.cpp:
367         (WebCore::AccessibilityScrollbar::orientation const):
368         * accessibility/AccessibilityScrollbar.h:
369         * accessibility/AccessibilitySlider.cpp:
370         (WebCore::AccessibilitySlider::orientation const):
371         (WebCore::AccessibilitySlider::addChildren):
372         * accessibility/AccessibilitySlider.h:
373         * accessibility/AccessibilitySpinButton.cpp:
374         (WebCore::AccessibilitySpinButton::addChildren):
375         * accessibility/AccessibilitySpinButton.h:
376         * accessibility/AccessibilityTable.cpp:
377         (WebCore::AccessibilityTable::hasARIARole const):
378         (WebCore::AccessibilityTable::addChildren):
379         (WebCore::AccessibilityTable::headerContainer):
380         (WebCore::AccessibilityTable::roleValue const):
381         (WebCore::AccessibilityTable::computeAccessibilityIsIgnored const):
382         (WebCore::AccessibilityTable::titleElementText const):
383         * accessibility/AccessibilityTableCell.cpp:
384         (WebCore::AccessibilityTableCell::computeAccessibilityIsIgnored const):
385         (WebCore::AccessibilityTableCell::determineAccessibilityRole):
386         * accessibility/AccessibilityTableColumn.cpp:
387         (WebCore::AccessibilityTableColumn::headerObject):
388         * accessibility/AccessibilityTableColumn.h:
389         * accessibility/AccessibilityTableHeaderContainer.h:
390         * accessibility/AccessibilityTableRow.cpp:
391         (WebCore::AccessibilityTableRow::determineAccessibilityRole):
392         (WebCore::AccessibilityTableRow::computeAccessibilityIsIgnored const):
393         * accessibility/AccessibilityTree.cpp:
394         (WebCore::AccessibilityTree::determineAccessibilityRole):
395         * accessibility/ios/AccessibilityObjectIOS.mm:
396         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
397         (WebCore::AccessibilityObject::isInputTypePopupButton const):
398         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
399         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
400         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
401         (-[WebAccessibilityObjectWrapper _accessibilityTreeAncestor]):
402         (-[WebAccessibilityObjectWrapper _accessibilityListAncestor]):
403         (-[WebAccessibilityObjectWrapper _accessibilityArticleAncestor]):
404         (-[WebAccessibilityObjectWrapper _accessibilityTraitsFromAncestors]):
405         (-[WebAccessibilityObjectWrapper _accessibilityTextEntryTraits]):
406         (-[WebAccessibilityObjectWrapper accessibilityTraits]):
407         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
408         (-[WebAccessibilityObjectWrapper stringValueShouldBeUsedInLabel]):
409         (-[WebAccessibilityObjectWrapper accessibilityLabel]):
410         (-[WebAccessibilityObjectWrapper accessibilityValue]):
411         (-[WebAccessibilityObjectWrapper accessibilityIsComboBox]):
412         (-[WebAccessibilityObjectWrapper containsUnnaturallySegmentedChildren]):
413         (-[WebAccessibilityObjectWrapper accessibilityLinkedElement]):
414         (-[WebAccessibilityObjectWrapper treeItemParentForObject:]):
415         (-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]):
416         (-[WebAccessibilityObjectWrapper accessibilitySortDirection]):
417         * accessibility/mac/AccessibilityObjectMac.mm:
418         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
419         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
420         (-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]):
421         (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
422         (-[WebAccessibilityObjectWrapperBase baseAccessibilityHelpText]):
423         (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
424         (createAccessibilitySearchKeyMap):
425         (accessibilitySearchKeyForString):
426         (accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):
427         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
428         (accessibilitySelectTextCriteriaForCriteriaParameterizedAttribute):
429         (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]):
430         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
431         (createAccessibilityRoleMap):
432         (roleValueToNSString):
433         (-[WebAccessibilityObjectWrapper role]):
434         (-[WebAccessibilityObjectWrapper subrole]):
435         (-[WebAccessibilityObjectWrapper roleDescription]):
436         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
437         (-[WebAccessibilityObjectWrapper accessibilityPerformShowMenuAction]):
438         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
439         * inspector/InspectorDOMAgent.cpp:
440         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
441
442 2017-10-26  Youenn Fablet  <youenn@apple.com>
443
444         importScripts in service worker should use ServiceWorkersMode::None
445         https://bugs.webkit.org/show_bug.cgi?id=178888
446
447         Reviewed by Chris Dumez.
448
449         Test: http/tests/workers/service/service-worker-importScript.html
450
451         Made sure ServiceWorkersMode::None is used for loading scripts in service workers as we do not support foreign fetch.
452
453         * workers/WorkerScriptLoader.cpp:
454         (WebCore::WorkerScriptLoader::loadSynchronously):
455
456 2017-10-26  Keith Miller  <keith_miller@apple.com>
457
458         Unreviewed, cleanup changelogs.
459
460 2017-10-26  Keith Miller  <keith_miller@apple.com>
461
462         Unreviewed, add deprecated declarations pragma to fix macosx.
463
464         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
465
466 2017-10-26  Andy Estes  <aestes@apple.com>
467
468         [Payment Request] Restrict API use to secure, same-origin frames
469         https://bugs.webkit.org/show_bug.cgi?id=178887
470
471         Reviewed by Tim Horton.
472
473         Reuse the access checks from Apple Pay to restrict PaymentRequest API usage to secure frames
474         in the same origin as the main frame.
475
476         Progresses active-document-cross-origin.https.sub.html and
477         active-document-same-origin.https.html from web-platform-tests. Regresses basic.https.html
478         since the allowpaymentrequest <iframe> attribute is not yet implemented.
479
480         * Modules/applepay/ApplePaySession.cpp:
481         (WebCore::ApplePaySession::create):
482         (WebCore::ApplePaySession::supportsVersion):
483         (WebCore::ApplePaySession::canMakePayments):
484         (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
485         (WebCore::ApplePaySession::openPaymentSetup):
486         (WebCore::isSecure): Deleted.
487         (WebCore::canCallApplePaySessionAPIs): Deleted.
488         * Modules/applepay/PaymentSession.cpp: Added.
489         (WebCore::isSecure):
490         (WebCore::PaymentSession::canCreateSession):
491         * Modules/applepay/PaymentSession.h:
492         * Modules/paymentrequest/PaymentHandler.cpp:
493         (WebCore::PaymentHandler::canCreateSession):
494         * Modules/paymentrequest/PaymentHandler.h:
495         * Modules/paymentrequest/PaymentRequest.cpp:
496         (WebCore::PaymentRequest::create):
497         * WebCore.xcodeproj/project.pbxproj:
498
499 2017-10-26  Youenn Fablet  <youenn@apple.com>
500
501         Add service worker handle fetch support for all subresource requests
502         https://bugs.webkit.org/show_bug.cgi?id=178769
503
504         Reviewed by Chris Dumez.
505
506         Test: http/tests/workers/service/image-fetch.html
507
508         Moving DocumentThreadableLoader logic to CachedResourceLoader to apply it for all resource loads.
509         Setting the selected service worker identifier for subresource only at the moment.
510
511         Testing is limited to images, future wpt tests should cover other subresource cases.
512
513         * loader/DocumentThreadableLoader.cpp:
514         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
515         * loader/cache/CachedResourceLoader.cpp:
516         (WebCore::CachedResourceLoader::prepareFetch):
517         * loader/cache/CachedResourceRequest.cpp:
518         (WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
519         * loader/cache/CachedResourceRequest.h:
520
521 2017-10-26  Eric Carlson  <eric.carlson@apple.com>
522
523         NowPlayingInfo should contain a unique identifier
524         https://bugs.webkit.org/show_bug.cgi?id=178872
525
526         Reviewed by Jer Noble.
527
528         Updated TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm.
529
530         * platform/audio/PlatformMediaSessionManager.h:
531         (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingInfoUniqueIdentifier const): New.
532
533         * platform/audio/ios/MediaSessionManagerIOS.h:
534         * platform/audio/ios/MediaSessionManagerIOS.mm:
535         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Ditto.
536
537         * platform/audio/mac/MediaSessionManagerMac.h:
538         * platform/audio/mac/MediaSessionManagerMac.mm:
539         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Ditto. Don't leak CFString.
540
541         * platform/mac/MediaRemoteSoftLink.cpp: Softlink kMRMediaRemoteNowPlayingInfoUniqueIdentifier.
542         * platform/mac/MediaRemoteSoftLink.h:
543
544 2017-10-26  Keith Miller  <keith_miller@apple.com>
545
546         Unreviewed, iOS build fix.
547
548         * SourcesMac.txt:
549         * WebCore.xcodeproj/project.pbxproj:
550
551 2017-10-26  Keith Miller  <keith_miller@apple.com>
552
553         Move Mac specific files to unified sources
554         https://bugs.webkit.org/show_bug.cgi?id=178883
555
556         Rubber-stamped by Tim Horton.
557
558         * SourcesCocoa.txt:
559         * SourcesMac.txt:
560         * WebCore.xcodeproj/project.pbxproj:
561
562 2017-10-26  Ryosuke Niwa  <rniwa@webkit.org>
563
564         DidMoveToNewDocumentAssertionScope shouldn't be necessary
565         https://bugs.webkit.org/show_bug.cgi?id=178836
566         <rdar://problem/35008876>
567
568         Reviewed by Antti Koivisto.
569
570         DidMoveToNewDocumentAssertionScope was introduced in r217972 to replace an existing assertion to make sure
571         Node::didMoveToNewDocument is always called by its overrides in Node's subclasses. However, we can ensure
572         better Node::didMoveToNewDocument is always called if we called it directly in Node::moveTreeToNewScope.
573
574         Because only subclasses of Element and ShadowRoot override Node::didMoveToNewDocument and we already have
575         a specialized code path to adopt a ShadowRoot to a new document, this refactoring eliminates the need for
576         having a virtual function on Node at all.
577
578         Hence this patch names Node::didMoveToNewDocument to Node::moveToNewDocument and makes it non-virtual,
579         splits ShadowRoot::didMoveToNewDocument into moveShadowRootToNewParentScope and moveShadowRootToNewDocument,
580         and removes DidMoveToNewDocumentAssertionScope completely.
581
582         No new tests since there should be no behavioral change.
583
584         * dom/Document.cpp:
585         (WebCore::Document::moveNodeIteratorsToNewDocumentSlowCase): Renamed from moveNodeIteratorsToNewDocument.
586         * dom/Document.h:
587         (WebCore::Document::moveNodeIteratorsToNewDocument): Inlined the check for emptiness of m_nodeIterators to
588         avoid keep calling moveNodeIteratorsToNewDocumentSlowCase on every single node getting moved.
589         * dom/Element.cpp:
590         (WebCore::Element::didMoveToNewDocument): Removed the call to Node::didMoveToNewDocument since this is the
591         base virtual function now.
592         * dom/Element.h:
593         * dom/Node.cpp:
594         (WebCore::DidMoveToNewDocumentAssertionScope::DidMoveToNewDocumentAssertionScope): Deleted.
595         (WebCore::DidMoveToNewDocumentAssertionScope::~DidMoveToNewDocumentAssertionScope): Deleted.
596         (WebCore::DidMoveToNewDocumentAssertionScope::didRecieveCall): Deleted.
597         (WebCore::moveNodeToNewDocument): Deleted.
598         (WebCore::Node::moveShadowTreeToNewDocument): Made this a member function of Node since it needs to call
599         moveNodeToNewDocument, which is private to Node.
600         (WebCore::Node::moveTreeToNewScope): Removed the release assert for the root node since  the same check
601         exists inside traverseSubtreeToUpdateTreeScope. Also removed the release assertion for checking that
602         node's old document matches the old document since document() simply calls treeScope().documentScope()
603         and we're already release-asserting that the old scope of a node matches the old scope we know of.
604         We release-assert that the old tree scope's document didn't change after the traversal instead. Finally,
605         replaced a bunch of RELEASE_ASSERT with RELEASE_ASSERT_WITH_SECURITY_IMPLICATION.
606         (WebCore::Node::moveNodeToNewDocument): Renamed from didMoveToNewDocument. Moved the code related to
607         mutation observers inside hasRareData() check, and moved the the code to move event listeners inside
608         eventTargetData() check both for clarity, and avoid doing the work for every single node being moved.
609         Finally, call the old didMoveToNewDocument when "this" is an Element.
610         * dom/Node.h:
611         * dom/ShadowRoot.cpp:
612         (WebCore::ShadowRoot::moveShadowRootToNewParentScope): Added. Extracted from didMoveToNewDocument.
613         (WebCore::ShadowRoot::moveShadowRootToNewDocument): Renamed from didMoveToNewDocument. We now
614         release-assert that parent tree scope's document matches the new document if any.
615         * dom/ShadowRoot.h:
616
617 2017-10-26  Youenn Fablet  <youenn@apple.com>
618
619         Implement ServiceWorkerContainer getRegistration
620         https://bugs.webkit.org/show_bug.cgi?id=178882
621
622         Reviewed by Chris Dumez.
623
624         Replace rejection promise by resolving the promise with a null value.
625         This helps in running WPT tests as WPT tests usually check for registered service workers before running tests.
626         For WTR, there should be no registered service worker anyway.
627
628         * workers/service/ServiceWorkerContainer.cpp:
629         (WebCore::ServiceWorkerContainer::getRegistration):
630         * workers/service/ServiceWorkerContainer.h:
631
632 2017-10-26  Dan Bernstein  <mitz@apple.com>
633
634         Account for Mail’s WebMessageDocument class being renamed
635         https://bugs.webkit.org/show_bug.cgi?id=178881
636
637         Reviewed by Sam Weinig.
638
639         * editing/cocoa/HTMLConverter.mm:
640         (_WebMessageDocumentClass): Look up the class by its new name. No longer look it up by the
641           old old name, because TOT WebKit isn’t going to be used by versions of Mail that have that name.
642
643 2017-10-26  Antoine Quint  <graouts@apple.com>
644
645         Remove FrameView::serviceScriptedAnimations and Document::serviceScriptedAnimations
646         https://bugs.webkit.org/show_bug.cgi?id=178879
647
648         Reviewed by Dean Jackson.
649
650         There are no call sites for FrameView::serviceScriptedAnimations() and that method is the
651         only call site for Document::serviceScriptedAnimations(), so both can go.
652
653         * dom/Document.cpp:
654         (WebCore::Document::serviceScriptedAnimations): Deleted.
655         * dom/Document.h:
656         * page/FrameView.cpp:
657         (WebCore::FrameView::serviceScriptedAnimations): Deleted.
658         * page/FrameView.h:
659
660 2017-10-26  Chris Dumez  <cdumez@apple.com>
661
662         Bring back SWContextManager abstraction in WebCore
663         https://bugs.webkit.org/show_bug.cgi?id=178876
664
665         Reviewed by Geoffrey Garen.
666
667         Bring back SWContextManager abstraction in WebCore. It was killed in <https://trac.webkit.org/changeset/223718> but
668         is actually useful when the ServiceWorker wants to message the storage process.
669
670         * Sources.txt:
671         * WebCore.xcodeproj/project.pbxproj:
672         * workers/service/context/SWContextManager.cpp: Added.
673         (WebCore::SWContextManager::singleton):
674         (WebCore::SWContextManager::setConnection):
675         (WebCore::SWContextManager::connection const):
676         (WebCore::SWContextManager::registerServiceWorkerThread):
677         (WebCore::SWContextManager::serviceWorkerThreadProxy const):
678         (WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
679         * workers/service/context/SWContextManager.h: Copied from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
680         (WebCore::SWContextManager::Connection::~Connection):
681
682 2017-10-26  Basuke Suzuki  <Basuke.Suzuki@sony.com>
683
684         [Curl] Rename CurlJobManager to CurlRequestScheduler
685         https://bugs.webkit.org/show_bug.cgi?id=178775
686
687         To match the meaning of the class.
688         It was originally meant to be more generic purpose, but as
689         other classes was introduced, the objective of the class is
690         now only to handle the life cycle of curl requests.
691
692         The delegate is also renamed to CurlRequestSchedulerClient.
693
694         Reviewed by Alex Christensen.
695
696         * platform/Curl.cmake:
697         * platform/network/curl/CurlDownload.cpp:
698         (WebCore::CurlDownload::~CurlDownload):
699         (WebCore::CurlDownload::willSendRequest):
700         * platform/network/curl/CurlDownload.h:
701         * platform/network/curl/CurlRequest.cpp:
702         (WebCore::CurlRequest::CurlRequest):
703         (WebCore::CurlRequest::start):
704         (WebCore::CurlRequest::startWithJobManager):
705         (WebCore::CurlRequest::cancel):
706         (WebCore::CurlRequest::callClient):
707         (WebCore::CurlRequest::didReceiveData):
708         (WebCore::CurlRequest::didCompleteTransfer):
709         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
710         (WebCore::CurlRequest::invokeDidReceiveResponse):
711         (WebCore::CurlRequest::completeDidReceiveResponse):
712         (WebCore::CurlRequest::pausedStatusChanged):
713         (WebCore::CurlRequest::callDelegate): Deleted.
714         * platform/network/curl/CurlRequest.h:
715         (WebCore::CurlRequest::create):
716         (WebCore::CurlRequest::setClient):
717         (WebCore::CurlRequest::setDelegate): Deleted.
718         * platform/network/curl/CurlRequestClient.h: Renamed from Source/WebCore/platform/network/curl/CurlRequestDelegate.h.
719         * platform/network/curl/CurlRequestScheduler.cpp: Renamed from Source/WebCore/platform/network/curl/CurlJobManager.cpp.
720         (WebCore::CurlJobList::startJobs):
721         (WebCore::CurlJobList::finishJobs):
722         (WebCore::CurlRequestScheduler::singleton):
723         (WebCore::CurlRequestScheduler::add):
724         (WebCore::CurlRequestScheduler::cancel):
725         (WebCore::CurlRequestScheduler::callOnWorkerThread):
726         (WebCore::CurlRequestScheduler::startThreadIfNeeded):
727         (WebCore::CurlRequestScheduler::stopThreadIfNoMoreJobRunning):
728         (WebCore::CurlRequestScheduler::stopThread):
729         (WebCore::CurlRequestScheduler::updateJobList):
730         (WebCore::CurlRequestScheduler::workerThread):
731         * platform/network/curl/CurlRequestScheduler.h: Renamed from Source/WebCore/platform/network/curl/CurlJobManager.h.
732         (WebCore::CurlRequestScheduler::~CurlRequestScheduler):
733         * platform/network/curl/CurlRequestSchedulerClient.h: Added.
734         (WebCore::CurlRequestSchedulerClient::~CurlRequestSchedulerClient):
735         * platform/network/curl/ResourceHandleCurlDelegate.cpp:
736         (WebCore::ResourceHandleCurlDelegate::~ResourceHandleCurlDelegate):
737         (WebCore::ResourceHandleCurlDelegate::setAuthentication):
738         (WebCore::ResourceHandleCurlDelegate::continueAfterWillSendRequest):
739         * platform/network/curl/ResourceHandleCurlDelegate.h:
740
741 2017-10-26  Antti Koivisto  <antti@apple.com>
742
743         Remove unnecessary whitespace invalidation logic from RenderTreeUpdater
744         https://bugs.webkit.org/show_bug.cgi?id=178786
745
746         Reviewed by Zalan Bujtas.
747
748         RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded is a somewhat complex
749         and confusing function for figuring out if some whitespace-only text node might need to have its
750         rendering status recomputed. However actually computing if a text renderer is needed is not expensive.
751         We can simply do it for all whitespace nodes after a sibling mutation.
752
753         This also removes a set that could have stale renderer pointers in it (they were never dereferenced).
754
755         * rendering/RenderBlock.cpp:
756         (WebCore::RenderBlock::addChildIgnoringContinuation):
757
758             Fix a display:contents bug exposed by this change. With display:contents a text renderer may have an anonymous
759             inline wrapper and we need to take it into account when the text renderer is the beforeChild.
760
761             Tested by imported/w3c/web-platform-tests/css/css-display-3/display-contents-state-change-001.html
762
763         * style/RenderTreeUpdater.cpp:
764         (WebCore::RenderTreeUpdater::updateRenderTree):
765
766             Call updateTextRenderer() for all whitespace-only text nodes after a change in siblings.
767             In normal update case it just figures out quickly (by calling textRendererIsNeeded)
768             that there are no changes and bails out.
769
770         (WebCore::RenderTreeUpdater::updateElementRenderer):
771         (WebCore::RenderTreeUpdater::updateTextRenderer):
772         (WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded): Deleted.
773
774             No longer needed. Just mark that there have been changes to siblings instead.
775
776         * style/RenderTreeUpdater.h:
777
778 2017-10-26  Myles C. Maxfield  <mmaxfield@apple.com>
779
780         Mark font palettes as in development
781         https://bugs.webkit.org/show_bug.cgi?id=178590
782
783         Unreviewed.
784
785         * features.json:
786
787 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
788
789         Unreviewed, rolling out r223984.
790
791         Caused LayoutTest assertion failures.
792
793         Reverted changeset:
794
795         "When navigating back to a page, compositing layers may not
796         use accelerated drawing"
797         https://bugs.webkit.org/show_bug.cgi?id=178749
798         https://trac.webkit.org/changeset/223984
799
800 2017-10-26  Youenn Fablet  <youenn@apple.com>
801
802         Add inspector logging for MediaElementSession autoplay
803         https://bugs.webkit.org/show_bug.cgi?id=178846
804
805         Reviewed by Eric Carlson.
806
807         No change of behavior.
808         Making use of pal Logger in MediaElementSession.
809         This new logging is limited to autoplay/playback for now.
810
811         * html/MediaElementSession.cpp:
812         (WebCore::MediaElementSession::MediaElementSession):
813         (WebCore::MediaElementSession::playbackPermitted const):
814         (WebCore::MediaElementSession::autoplayPermitted const):
815         (WebCore::MediaElementSession::willLog const):
816         (WebCore::MediaElementSession::logChannel const):
817         * html/MediaElementSession.h:
818
819 2017-10-26  Keith Miller  <keith_miller@apple.com>
820
821         Move ApplePay to unified sources
822         https://bugs.webkit.org/show_bug.cgi?id=178871
823
824         Rubber-stamped by Tim Horton.
825
826         Also, add some other missing files.
827
828         * SourcesCocoa.txt:
829         * WebCore.xcodeproj/project.pbxproj:
830
831 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
832
833         Unreviewed, rolling out r224019.
834
835         This change caused API test WebKit.MSEIsPlayingAudio to time
836         out.
837
838         Reverted changeset:
839
840         "XMLHttpRequest should not treat file URLs as same origin"
841         https://bugs.webkit.org/show_bug.cgi?id=178565
842         https://trac.webkit.org/changeset/224019
843
844 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
845
846         Unreviewed, rolling out r223994.
847
848         The LayoutTest for this change is failing.
849
850         Reverted changeset:
851
852         "Add service worker handle fetch support for all subresource
853         requests"
854         https://bugs.webkit.org/show_bug.cgi?id=178769
855         https://trac.webkit.org/changeset/223994
856
857 2017-10-26  Ryan Haddad  <ryanhaddad@apple.com>
858
859         Unreviewed, rolling out r223908.
860
861         Causes LayoutTest crashes with newer SDKs.
862
863         Reverted changeset:
864
865         "Adopt new secure coding APIs"
866         https://bugs.webkit.org/show_bug.cgi?id=178484
867         https://trac.webkit.org/changeset/223908
868
869 2017-10-25  Brent Fulgham  <bfulgham@apple.com>
870
871         XMLHttpRequest should not treat file URLs as same origin
872         https://bugs.webkit.org/show_bug.cgi?id=178565
873         <rdar://problem/11115901>
874
875         Reviewed by Ryosuke Niwa.
876
877         Do not treat file URLs as same-origin for XHR requests.
878
879         Test: fast/xmlhttprequest/xmlhttprequest-access-self-as-file.html
880
881         * loader/DocumentThreadableLoader.cpp:
882         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Use new helper method.
883         * page/SecurityOrigin.cpp:
884         (WebCore::SecurityOrigin::requestIsSameOrigin): New method to recognize same-origin
885         requests, with special handling for XHR.
886         * page/SecurityOrigin.h:
887
888 2017-10-26  Christopher Reid  <chris.reid@sony.com>
889
890         Remove scopeguard from platform
891         https://bugs.webkit.org/show_bug.cgi?id=178681
892
893         Reviewed by Brady Eidson.
894
895         Replacing platform/ScopeGuard with WTF::ScopeExit.
896         No new tests, no change in behavior.
897
898         * Modules/indexeddb/IDBRequest.cpp:
899         * Modules/indexeddb/IDBRequest.h:
900         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
901         * WebCore.xcodeproj/project.pbxproj:
902         * platform/FileSystem.cpp:
903         * platform/ScopeGuard.h: Removed.
904         * platform/network/BlobRegistryImpl.cpp:
905         * workers/service/ServiceWorkerContainer.cpp:
906
907 2017-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>
908
909         REGRESSION(r222090): [HarfBuzz] Arabic shaping is broken except for first word in line
910         https://bugs.webkit.org/show_bug.cgi?id=178625
911
912         Reviewed by Michael Catanzaro.
913
914         Once we find the first space, which has the COMMON script, we split the run, and the next ones keep using
915         COMMON instead of ARABIC because we don't update the current script on every loop iteration. This patch
916         simplifies the script handling by moving the code back to the loop and always breaking in case of different
917         scripts, correctly handling INHERITED and COMMON cases and updating the current script when needed.
918
919         Covered by existing tests. This improves several tests that have been rebaselined.
920
921         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
922         (WebCore::findNextRun):
923         (WebCore::scriptsAreCompatibleForCharacters): Deleted.
924
925 2017-10-26  Enrique Ocaña González  <eocanha@igalia.com>
926
927         [MSE][GStreamer] Fix hang on clearing/destroying AppendPipeline
928         https://bugs.webkit.org/show_bug.cgi?id=178819
929
930         Reviewed by Xabier Rodriguez-Calvar.
931
932         The deadlock may occur when UI thread tries to clear pipeline in
933         AppendPipeline::clearPlayerPrivate() while parser thread tries to change
934         pipeline state to pause holding the stream lock in
935         AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread()
936
937         This patch is authored by Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>
938
939         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
940         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
941         Return if there's no player private.
942
943 2017-10-26  Ryosuke Niwa  <rniwa@webkit.org>
944
945         Assert that no script is executed during style recalc
946         https://bugs.webkit.org/show_bug.cgi?id=178845
947         <rdar://problem/35106129>
948
949         Reviewed by Antti Koivisto.
950
951         This patch adds NoEventDispatchAssertion to Document::updateStyle and Document::updateStyleIfNeeded
952         to make sure we don't start mutating DOM in the middle of a style update.
953
954         Added NoEventDispatchAssertion::EventAllowedScope for various places in SVGUseElement to update its
955         shadow tree since that happens while updating the style.
956
957         No new tests since there should be no behavioral change.
958
959         * dom/Document.cpp:
960         (WebCore::Document::resolveStyle): Added NoEventDispatchAssertion while flushing pending stylesheets
961         and calling FrameView::willRecalcStyle, and while the style tree solver is in works. Also moved in
962         the code to update the selection and schedule to dispatch a fake mouse event into the same scope.
963         Also increment m_styleRecalcCount in the same code since post resolution callbacks could run author
964         scripts which in turn trigger another (recursive) style recalc.
965         (WebCore::Document::updateStyleIfNeeded): Put everything but the call to resolveStyle in a scope with
966         NoEventDispatchAssertion.
967         * dom/Element.cpp:
968         (WebCore::Element::cloneElementWithChildren): Added NoEventDispatchAssertion::EventAllowedScope to the
969         newly cloned element for SVG use element's shadow tree.
970         (WebCore::Element::cloneElementWithoutChildren): Ditto.
971         * dom/EventDispatcher.cpp:
972         (WebCore::EventDispatcher::dispatchEvent): Make the assertion more precise to workaround the fact SVG
973         use elements update its shadow tree in the middle of style updates. Also removed a redundant assertion
974         since the result of NoEventDispatchAssertion::isEventDispatchAllowedInSubtree cannot chance without
975         pushing or popoing the stack frame.
976         * svg/SVGUseElement.cpp:
977         (WebCore::SVGUseElement::clearShadowTree):
978         (WebCore::SVGUseElement::updateShadowTree): Added NoEventDispatchAssertion to the user-agent shadow root
979         of a SVG use element. Since this is a newly created shadow tree which hasn't been exposed to author
980         scripts, it's safe to mutate them during the style recalc even though it's not the best design.
981         (WebCore::SVGUseElement::cloneTarget const): Ditto.
982         (WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto.
983         (WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
984         (WebCore::SVGUseElement::transferEventListenersToShadowTree const):
985
986 2017-10-25  Keith Miller  <keith_miller@apple.com>
987
988         Move platform Cocoa sources to unified sources
989         https://bugs.webkit.org/show_bug.cgi?id=178851
990
991         Rubber-stamped by Tim Horton.
992
993         * SourcesCocoa.txt:
994         * WebCore.xcodeproj/project.pbxproj:
995
996 2017-10-25  Keith Miller  <keith_miller@apple.com>
997
998         Start moving Cocoa specific unified sources
999         https://bugs.webkit.org/show_bug.cgi?id=178850
1000
1001         Rubber-stamped by Tim Horton.
1002
1003         * PlatformMac.cmake:
1004         * SourcesCocoa.txt:
1005         * WebCore.xcodeproj/project.pbxproj:
1006
1007 2017-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1008
1009         [HarfBuzz] ComplexTextRun should initialize direction from the harfbuzz buffer
1010         https://bugs.webkit.org/show_bug.cgi?id=178788
1011
1012         Reviewed by Michael Catanzaro.
1013
1014         Instead of using the TextRun direction. If the TextRun is ltr, but the harfbuzz buffer is rtl, the character
1015         indexes will be swapped in m_coreTextIndices.
1016
1017         * platform/graphics/ComplexTextController.h:
1018         (WebCore::ComplexTextController::ComplexTextRun::create): Remove the ltr parameter.
1019         * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
1020         (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Initialize m_isLTR using hb_buffer_get_direction().
1021         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Do not pass ltr to ComplexTextRun::create().
1022
1023 2017-10-25  Keith Miller  <keith_miller@apple.com>
1024
1025         Move remaining platform independent sources to unified sources
1026         https://bugs.webkit.org/show_bug.cgi?id=178849
1027
1028         Rubber-stamped by Tim Horton.
1029
1030         * CMakeLists.txt:
1031         * Sources.txt:
1032         * WebCore.xcodeproj/project.pbxproj:
1033
1034 2017-10-25  Keith Miller  <keith_miller@apple.com>
1035
1036         Move plugins and rendering to unified sources
1037         https://bugs.webkit.org/show_bug.cgi?id=178848
1038
1039         Rubber-stamped by Tim Horton.
1040
1041         * CMakeLists.txt:
1042         * Sources.txt:
1043         * WebCore.xcodeproj/project.pbxproj:
1044
1045 2017-10-25  Keith Miller  <keith_miller@apple.com>
1046
1047         Unreviewed, add FEMorphology.cpp back to the regular build after r224003.
1048
1049         * WebCore.xcodeproj/project.pbxproj:
1050
1051 2017-10-25  Keith Miller  <keith_miller@apple.com>
1052
1053         Unreviewed, Windows build fix.
1054
1055         * Sources.txt:
1056
1057 2017-10-25  Devin Rousso  <webkit@devinrousso.com>
1058
1059         Web Inspector: provide a way to enable/disable event listeners
1060         https://bugs.webkit.org/show_bug.cgi?id=177451
1061         <rdar://problem/34994925>
1062
1063         Reviewed by Joseph Pecoraro.
1064
1065         Test: inspector/dom/setEventListenerDisabled.html
1066
1067         * dom/EventTarget.cpp:
1068         (WebCore::EventTarget::fireEventListeners):
1069         Add InspectorInstrumentation call to isEventListenerDisabled. If true, the event listener's
1070         callback will not be called.
1071
1072         * inspector/InspectorDOMAgent.h:
1073         * inspector/InspectorDOMAgent.cpp:
1074         (WebCore::InspectorDOMAgent::discardBindings):
1075         (WebCore::InspectorDOMAgent::getEventListenersForNode):
1076         (WebCore::InspectorDOMAgent::setEventListenerDisabled):
1077         (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1078         (WebCore::InspectorDOMAgent::willRemoveEventListener):
1079         (WebCore::InspectorDOMAgent::isEventListenerDisabled):
1080         Introduce a mapping of `EventListener*` to `InspectorEventListener`, a struct for uniquely
1081         identifying event listeners so they can be referenced from the frontend. We only add items
1082         to this mapping when `getEventListenersForNode` is called, as that is when EventListener
1083         data is sent to the frontend. This allows us to defer creating an Inspector "mirror" object
1084         for each EventListener until it is needed. Items are removed whenever an event listener is
1085         removed or when the document changes.
1086
1087         * inspector/InspectorInstrumentation.h:
1088         (WebCore::InspectorInstrumentation::isEventListenerDisabled):
1089         * inspector/InspectorInstrumentation.cpp:
1090         (WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
1091         (WebCore::InspectorInstrumentation::isEventListenerDisabledImpl):
1092         Pass additional parameters to InspectorDOMAgent so it can determine if the event listener
1093         actually exists. If not, don't dispatch an event to the frontend as nothing will change.
1094
1095 2017-10-25  Keith Miller  <keith_miller@apple.com>
1096
1097         Move Platform to unified sources.
1098         https://bugs.webkit.org/show_bug.cgi?id=178829
1099
1100         Rubber-stamped by Tim Horton.
1101
1102         * CMakeLists.txt:
1103         * Sources.txt:
1104         * WebCore.xcodeproj/project.pbxproj:
1105         * platform/Cursor.cpp:
1106         * platform/sql/SQLiteDatabase.h:
1107
1108 2017-10-25  Chris Dumez  <cdumez@apple.com>
1109
1110         messageEvent.source can also be a ServiceWorker
1111         https://bugs.webkit.org/show_bug.cgi?id=178839
1112
1113         Reviewed by Brady Eidson.
1114
1115         messageEvent.source can also be a ServiceWorker:
1116         - https://html.spec.whatwg.org/multipage/comms.html#messageeventsource
1117
1118         This enables calling postMessage() from a ServiceWorker via Bug 178794.
1119
1120         * dom/MessageEvent.cpp:
1121         (WebCore::MessageEvent::source const): Deleted.
1122         * dom/MessageEvent.h:
1123         * dom/MessageEvent.idl:
1124
1125 2017-10-25  Ryosuke Niwa  <rniwa@webkit.org>
1126
1127         Style::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor::createDocumentFromSource
1128         https://bugs.webkit.org/show_bug.cgi?id=178715
1129         <rdar://problem/35144665>
1130
1131         Reviewed by Brent Fulgham.
1132
1133         Apply XLS tranforms when a 0s timer fires or the document finishes parsing or loading whichever comes first
1134         instead of in the middle of collecting a list of stylesheets.
1135
1136         * dom/Document.cpp:
1137         (WebCore::Document::Document): Initialize the newly added timer.
1138         (WebCore::Document::implicitClose): Apply any pending XSLT before we fire load events since some of the event
1139         handlers may be expecting to see the document after XSLT had been applied.
1140         (WebCore::Document::scheduleToApplyXSLTransforms): Added.
1141         (WebCore::Document::applyPendingXSLTransformsNowIfScheduled): Added.
1142         (WebCore::Document::applyPendingXSLTransformsTimerFired): Added. Moved the logic to apply XSL transforms from
1143         Style::Scope::collectActiveStyleSheets, and merged applyXSLTransform into this function.
1144         (WebCore::Document::applyXSLTransform): Deleted.
1145         (WebCore::Document::finishedParsing): Apply XSLT right before updating the style. This is where used to apply
1146         inline XSLT and it happens much earlier than implicitClose.
1147         * dom/Document.h:
1148         * dom/ProcessingInstruction.cpp:
1149         (WebCore::ProcessingInstruction::checkStyleSheet): Schedule XSLT in the document instead of flushing pending
1150         stylesheets, which would have synchronously applied XSLT. We can't apply XSLT synchronously here because this
1151         function can be called from a non-script-resilient call stack.
1152         (WebCore::ProcessingInstruction::sheetLoaded): Ditto.
1153         * style/StyleScope.cpp:
1154         (WebCore::Style::Scope::collectXSLTransforms): Added.
1155         (WebCore::Style::Scope::collectActiveStyleSheets): Removed the code to apply XSLT. Skip ProcessingInstructions
1156         that applies XSLT. Also use RefPtr<StyleSheet> instead of a raw pointer to store StyleSheet.
1157         * style/StyleScope.h:
1158         * xml/parser/XMLDocumentParserLibxml2.cpp:
1159         (WebCore::XMLDocumentParser::doEnd): Apply any pending XSLTs synchronously here as the comment suggests.
1160
1161 2017-10-25  Devin Rousso  <webkit@devinrousso.com>
1162
1163         Web Inspector: Canvas Tab: starting a second recording doesn't show red titlebar if the first recording was empty
1164         https://bugs.webkit.org/show_bug.cgi?id=178805
1165         <rdar://problem/35176303>
1166
1167         Reviewed by Brian Burg.
1168
1169         No new tests, updated existing tests.
1170
1171         * inspector/InspectorCanvasAgent.cpp:
1172         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
1173         If the recording was stopped and had no data, reset the CallTracingActive flag to false.
1174
1175 2017-10-25  Keith Miller  <keith_miller@apple.com>
1176
1177         Move html to unified sources
1178         https://bugs.webkit.org/show_bug.cgi?id=178709
1179
1180         Reviewed by Alex Christensen.
1181
1182         * CMakeLists.txt:
1183         * Sources.txt:
1184         * WebCore.xcodeproj/project.pbxproj:
1185
1186 2017-10-25  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1187
1188         [Curl] Delete temporally downloaded file when it cancelled
1189         https://bugs.webkit.org/show_bug.cgi?id=134393
1190
1191         Reviewed by Alex Christensen.
1192
1193         * platform/network/curl/CurlRequest.cpp:
1194         (WebCore::CurlRequest::didCancelTransfer):
1195         (WebCore::CurlRequest::writeDataToDownloadFileIfEnabled):
1196         (WebCore::CurlRequest::closeDownloadFile):
1197         (WebCore::CurlRequest::cleanupDownloadFile):
1198         * platform/network/curl/CurlRequest.h:
1199
1200 2017-10-25  Youenn Fablet  <youenn@apple.com>
1201
1202         Add service worker handle fetch support for all subresource requests
1203         https://bugs.webkit.org/show_bug.cgi?id=178769
1204
1205         Reviewed by Chris Dumez.
1206
1207         Test: http/tests/workers/service/image-fetch.https.html
1208
1209         Moving DocumentThreadableLoader logic to CachedResourceLoader to apply it for all resource loads.
1210         Setting the selected service worker identifier for subresource only at the moment.
1211
1212         Testing is limited to images, future wpt tests should cover other subresource cases.
1213
1214         * loader/DocumentThreadableLoader.cpp:
1215         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
1216         * loader/cache/CachedResourceLoader.cpp:
1217         (WebCore::CachedResourceLoader::prepareFetch):
1218         * loader/cache/CachedResourceRequest.cpp:
1219         (WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
1220         * loader/cache/CachedResourceRequest.h:
1221
1222 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
1223
1224         Aliasing of text in CSS specs is blocky and ugly
1225         https://bugs.webkit.org/show_bug.cgi?id=174946
1226         rdar://problem/33594542
1227
1228         Reviewed by Dean Jackson.
1229
1230         The PaintedContentRequest relating to subpixel-antialiased text was failing to be
1231         satisfied if the text content in a composited layer was nested inside descendant
1232         RenderLayers, because RenderLayer::isVisuallyNonEmpty() returned early. If this
1233         function is passed a request, we can't return until we've satisfied the request
1234         (which triggers the checking of descendant layers).
1235
1236         Test: compositing/contents-format/subpixel-antialiased-nested-layer.html
1237
1238         * rendering/RenderLayer.cpp:
1239         (WebCore::RenderLayer::calculateClipRects const):
1240
1241 2017-10-25  Chris Dumez  <cdumez@apple.com>
1242
1243         Unreviewed, add missing copyright header to ServiceWorkerClientType.idl.
1244
1245         * workers/service/ServiceWorkerClientType.idl:
1246 =======
1247         * platform/Cursor.cpp: Previously, excluded on iOS now wrapped in #if
1248         * platform/sql/SQLiteDatabase.h: remove debugging data member from release builds.
1249 >>>>>>> build fixes
1250
1251 2017-10-25  Chris Dumez  <cdumez@apple.com>
1252
1253         Make toJS() do the right thing for ServiceWorkerClient
1254         https://bugs.webkit.org/show_bug.cgi?id=178816
1255
1256         Reviewed by Youenn Fablet.
1257
1258         Make toJS() do the right thing for ServiceWorkerClient. In particular,
1259         it needs to construct a JSServiceWorkerWindowClient wrapper if the
1260         implementation object is a ServiceWorkerWindowClient.
1261
1262         Also, ServiceWorkerClient does not need to be an ActiveDOMObject as
1263         it does not have any long-running tasks. Make it a ContextDestructionObject
1264         instead for now.
1265
1266         * CMakeLists.txt:
1267         * DerivedSources.make:
1268         * Sources.txt:
1269         * WebCore.xcodeproj/project.pbxproj:
1270         * workers/service/ServiceWorkerClient.cpp:
1271         (WebCore::ServiceWorkerClient::postMessage):
1272         * workers/service/ServiceWorkerClient.h:
1273         (WebCore::ServiceWorkerClient::create):
1274         * workers/service/ServiceWorkerClient.idl:
1275         * workers/service/ServiceWorkerClientType.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
1276         * workers/service/ServiceWorkerClientType.idl: Added.
1277         * workers/service/ServiceWorkerClients.h:
1278         * workers/service/ServiceWorkerClients.idl:
1279
1280 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
1281
1282         When navigating back to a page, compositing layers may not use accelerated drawing
1283         https://bugs.webkit.org/show_bug.cgi?id=178749
1284         rdar://problem/35158946
1285
1286         Reviewed by Dean Jackson.
1287
1288         There were two issues with setting GraphicsLayerCA's "acceleratesDrawing" state which
1289         occurred on back navigation, related to the ordering of style recalcs and layout.
1290
1291         First, at style recalc time, we created a RenderLayerCompositor but hadn't yet called
1292         its cacheAcceleratedCompositingFlags(), so any layers created during style update
1293         didn't get accelerated drawing. Fix by making cacheAcceleratedCompositingFlags() internal
1294         to RenderLayerCompositor and calling it from willRecalcStyle() and updateCompositingLayers().
1295
1296         Secondly, GraphicsLayerCA::commitLayerChangesBeforeSublayers() needs to updateAcceleratesDrawing()
1297         before updating tiles, so that new tiles fetch the right acceleratesDrawing state from
1298         the TileController.
1299
1300         Test: compositing/accelerated-layers-after-back.html
1301
1302         * page/FrameView.cpp:
1303         (WebCore::FrameView::updateCompositingLayersAfterLayout):
1304         * platform/graphics/ca/GraphicsLayerCA.cpp:
1305         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1306         * rendering/RenderLayerCompositor.cpp:
1307         (WebCore::RenderLayerCompositor::willRecalcStyle):
1308         (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
1309         (WebCore::RenderLayerCompositor::updateCompositingLayers):
1310         * rendering/RenderLayerCompositor.h:
1311
1312 2017-10-25  Youenn Fablet  <youenn@apple.com>
1313
1314         Enable ServiceWorker to fetch resources
1315         https://bugs.webkit.org/show_bug.cgi?id=178673
1316
1317         Reviewed by Brady Eidson.
1318
1319         Test: http/tests/workers/service/service-worker-fetch.html
1320
1321         Allow reusing of EmptyFrameLoaderClient for network loading in WebKit Service Worker environment.
1322         Allow overriding the creation of a document loader, pageID, frameID and sessionID getters.
1323
1324         Allow the possibility to create synthetic documents for all ports.
1325
1326         Beefing up ServiceWorkerThreadProxy as it owns a Document and a Page that do nothing but server
1327         the purpose of loading resources for a service worker thread.
1328
1329         * WebCore.xcodeproj/project.pbxproj:
1330         * loader/DocumentLoader.h:
1331         (WebCore::DocumentLoader::setResponse):
1332         * loader/EmptyClients.cpp:
1333         (WebCore::EmptyFrameLoaderClient::sessionID const):
1334         (WebCore::EmptyFrameLoaderClient::createNetworkingContext):
1335         (WebCore::createEmptyFrameNetworkingContext):
1336         * loader/EmptyClients.h:
1337         * loader/EmptyFrameLoaderClient.h: Added.
1338         * loader/FrameLoader.cpp:
1339         (WebCore::FrameLoader::initForSynthesizedDocument):
1340         * loader/FrameLoader.h:
1341         * loader/FrameLoaderClient.h:
1342         * workers/service/context/ServiceWorkerThread.cpp:
1343         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
1344         (WebCore::m_workerObjectProxy):
1345         * workers/service/context/ServiceWorkerThread.h:
1346         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1347         (WebCore::ServiceWorkerThreadProxy::create):
1348         (WebCore::createPageForServiceWorker):
1349         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
1350         (WebCore::ServiceWorkerThreadProxy::postTaskToLoader):
1351         * workers/service/context/ServiceWorkerThreadProxy.h:
1352         Test: http/tests/workers/service/service-worker-fetch.html
1353
1354 2017-10-25  Jer Noble  <jer.noble@apple.com>
1355
1356         UNPACK_FLIP_Y is broken for MSE-backed videos
1357         https://bugs.webkit.org/show_bug.cgi?id=178774
1358
1359         Reviewed by Dean Jackson.
1360
1361         The global GLSL variable gl_Position can apparently only be set once, and any modifications
1362         made after that initial set are ignored. So rather than implement flipping by changing
1363         gl_Position.y, flip the texture coordinates instead.
1364
1365         Drive-by fix: some of the constants used in VideoTextureCopierCV are not defined on older
1366         macOS versions, so make them optional.
1367
1368         Tests: fast/canvas/webgl/texImage2D-mse-flipY-false.html
1369                fast/canvas/webgl/texImage2D-mse-flipY-true.html
1370
1371         * platform/graphics/cv/VideoTextureCopierCV.cpp:
1372         (WebCore::transferFunctionFromString):
1373         (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
1374         * platform/cocoa/CoreVideoSoftLink.cpp:
1375         * platform/cocoa/CoreVideoSoftLink.h:
1376
1377 2017-10-25  Chris Dumez  <cdumez@apple.com>
1378
1379         [Service Worker] Add stubs for serviceWorkerClient.type
1380         https://bugs.webkit.org/show_bug.cgi?id=178812
1381
1382         Reviewed by Youenn Fablet.
1383
1384         Add stubs for serviceWorkerClient.type to match the latest specification:
1385         - https://w3c.github.io/ServiceWorker/#enumdef-clienttype
1386
1387         * CMakeLists.txt:
1388         * DerivedSources.make:
1389         * Sources.txt:
1390         * WebCore.xcodeproj/project.pbxproj:
1391         * workers/service/ServiceWorkerClient.cpp:
1392         (WebCore::ServiceWorkerClient::type const):
1393         * workers/service/ServiceWorkerClient.h:
1394         * workers/service/ServiceWorkerClient.idl:
1395         * workers/service/ServiceWorkerClientType.h: Added.
1396         * workers/service/ServiceWorkerClientType.idl: Added.
1397         * workers/service/ServiceWorkerClients.h:
1398         * workers/service/ServiceWorkerClients.idl:
1399
1400 2017-10-24  Keith Miller  <keith_miller@apple.com>
1401
1402         Move mathml and page to unified souces
1403         https://bugs.webkit.org/show_bug.cgi?id=178770
1404
1405         Rubber-stamped by Tim Horton.
1406
1407         * CMakeLists.txt:
1408         * Sources.txt:
1409         * WebCore.xcodeproj/project.pbxproj:
1410
1411 2017-10-25  Fujii Hironori  <Hironori.Fujii@sony.com>
1412
1413         fast/images/animated-gif-paint-after-animation.html flaky crash
1414         https://bugs.webkit.org/show_bug.cgi?id=178510
1415
1416         Reviewed by Said Abou-Hallawa.
1417
1418         ScalableImageDecoder was accessed from the main thread and the
1419         image decoding thread without a mutex.
1420
1421         No new tests because there is no behavior change.
1422
1423         * platform/image-decoders/ScalableImageDecoder.h: Add m_mutex. Lock the mutex in setData.
1424         * platform/image-decoders/ScalableImageDecoder.cpp:
1425         (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const): Lock the mutex.
1426         (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const): Ditto.
1427         (WebCore::ScalableImageDecoder::frameBytesAtIndex const): Ditto.
1428         (WebCore::ScalableImageDecoder::frameDurationAtIndex const): Ditto.
1429         (WebCore::ScalableImageDecoder::createFrameImageAtIndex): Ditto.
1430
1431 2017-10-25  Chris Dumez  <cdumez@apple.com>
1432
1433         Add support for unregistering a service worker
1434         https://bugs.webkit.org/show_bug.cgi?id=178735
1435
1436         Reviewed by Brady Eidson.
1437
1438         Add support for unregistering a service worker:
1439         - https://w3c.github.io/ServiceWorker/#navigator-service-worker-unregister
1440
1441         Test: http/tests/workers/service/basic-unregister.https.html
1442
1443         * workers/service/ServiceWorkerContainer.cpp:
1444         (WebCore::ServiceWorkerContainer::addRegistration):
1445         (WebCore::ServiceWorkerContainer::removeRegistration):
1446         (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
1447         * workers/service/ServiceWorkerContainer.h:
1448         * workers/service/ServiceWorkerJob.cpp:
1449         (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
1450         * workers/service/ServiceWorkerJob.h:
1451         * workers/service/ServiceWorkerJobClient.h:
1452         * workers/service/ServiceWorkerJobData.h:
1453         (WebCore::ServiceWorkerJobData::encode const):
1454         (WebCore::ServiceWorkerJobData::decode):
1455         * workers/service/ServiceWorkerJobType.h:
1456         * workers/service/ServiceWorkerRegistration.cpp:
1457         (WebCore::containerForScriptExecutionContext):
1458         (WebCore::ServiceWorkerRegistration::unregister):
1459         * workers/service/server/SWClientConnection.cpp:
1460         (WebCore::SWClientConnection::registrationJobResolvedInServer):
1461         (WebCore::SWClientConnection::unregistrationJobResolvedInServer):
1462         * workers/service/server/SWClientConnection.h:
1463         * workers/service/server/SWServer.cpp:
1464         (WebCore::SWServer::resolveRegistationJob):
1465         (WebCore::SWServer::resolveUnregistrationJob):
1466         * workers/service/server/SWServer.h:
1467         * workers/service/server/SWServerRegistration.cpp:
1468         (WebCore::SWServerRegistration::scriptContextStarted):
1469         (WebCore::SWServerRegistration::startNextJob):
1470         (WebCore::SWServerRegistration::runUnregisterJob):
1471         (WebCore::SWServerRegistration::resolveWithRegistrationOnMainThread):
1472         (WebCore::SWServerRegistration::resolveWithUnregistrationResultOnMainThread):
1473         (WebCore::SWServerRegistration::resolveCurrentRegistrationJob):
1474         (WebCore::SWServerRegistration::resolveCurrentUnregistrationJob):
1475         * workers/service/server/SWServerRegistration.h:
1476
1477 2017-10-25  Simon Fraser  <simon.fraser@apple.com>
1478
1479         MediaSessionManager* needs to catch Obj-C exceptions
1480         https://bugs.webkit.org/show_bug.cgi?id=178813
1481
1482         Reviewed by Tim Horton.
1483
1484         Wrap all calls out to Objective-C with BEGIN_BLOCK_OBJC_EXCEPTIONS/END_BLOCK_OBJC_EXCEPTIONS.
1485
1486         * platform/audio/ios/MediaSessionManagerIOS.mm:
1487         (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
1488         (WebCore::MediaSessionManageriOS::~MediaSessionManageriOS):
1489         (WebCore::MediaSessionManageriOS::hasWirelessTargetsAvailable):
1490         (WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
1491         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
1492         (WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
1493         (-[WebMediaSessionHelper allocateVolumeView]):
1494         (-[WebMediaSessionHelper initWithCallback:]):
1495         * platform/audio/mac/MediaSessionManagerMac.mm:
1496         (WebCore::MediaSessionManagerMac::updateNowPlayingInfo):
1497
1498 2017-10-25  Andy Estes  <aestes@apple.com>
1499
1500         [Payment Request] Implement the "user aborts the payment request" algorithm
1501         https://bugs.webkit.org/show_bug.cgi?id=178810
1502
1503         Reviewed by Tim Horton.
1504
1505         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1506         (WebCore::ApplePayPaymentHandler::didCancelPaymentSession):
1507         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
1508         * Modules/paymentrequest/PaymentRequest.cpp:
1509         (WebCore::PaymentRequest::cancel):
1510         * Modules/paymentrequest/PaymentRequest.h:
1511         * testing/MockPaymentCoordinator.cpp:
1512         (WebCore::MockPaymentCoordinator::cancelPayment):
1513         * testing/MockPaymentCoordinator.h:
1514         * testing/MockPaymentCoordinator.idl:
1515
1516 2017-10-25  Jer Noble  <jer.noble@apple.com>
1517
1518         Autoplay muted videos still stop playback of other streaming apps in the background
1519         https://bugs.webkit.org/show_bug.cgi?id=177920
1520
1521         Reviewed by Eric Carlson.
1522
1523         When creating a new <video> or <audio> element, the global AudioSession can sometimes have
1524         its sessionCategory() set to "MediaPlayback", even if the element does not yet have a
1525         source. This is because the constructor for the MediaElementSession is called before
1526         m_isPlayingToWirelessTarget is initialized, and so in the MediaElementSession constructor,
1527         the media element's m_isPlayingToWirelessTarget ivar is sometimes (uninitialized) true.
1528
1529         We could move the MediaElementSession ivar to the very end of the header, so it's
1530         initialized last, but that still leaves the possibility of the MediaElementSession et. all
1531         calling into the HTMLMediaElement before it's subclass's constructors have a chance to
1532         initialize their own ivars (much less their vtables). So instead, we'll create and set the
1533         MediaElementSession in a finishInitialization() method called from the HTMLVideoElement and
1534         HTMLAudioElement's create() factory methods.
1535
1536         * html/HTMLAudioElement.cpp:
1537         (WebCore::HTMLAudioElement::create):
1538         * html/HTMLMediaElement.cpp:
1539         (WebCore::HTMLMediaElement::HTMLMediaElement):
1540         (WebCore::HTMLMediaElement::finishInitialization):
1541         * html/HTMLMediaElement.h:
1542         * html/HTMLVideoElement.cpp:
1543         (WebCore::HTMLVideoElement::create):
1544
1545 2017-10-25  Javier Fernandez  <jfernandez@igalia.com>
1546
1547         [css-grid] Avoid clearing the overrideContainingBlockWidth if possible
1548         https://bugs.webkit.org/show_bug.cgi?id=178260
1549
1550         Reviewed by Sergio Villar Senin.
1551
1552         Since the intrinsic width computation uses the same logic than the
1553         track sizing algorithm we are clearing the overrideContainingBlockWidth
1554         of some grid items that are required to laid out them properly.
1555
1556         It's very uncommon that any intrinsic size computation isn't performed
1557         as part of a layout process. However, if it happens, once cleared the
1558         overrideContainingBlockWidth it may lead to an incorrect layout of the
1559         affected grid items.
1560
1561         This change is a defensive approach to avoid the issues caused by
1562         such off-layout preferred size requests, which may imply recomputing
1563         the grid container intrinsic size.
1564
1565         No new tests, because we are only removing some redundant logic.
1566
1567         * rendering/GridTrackSizingAlgorithm.cpp:
1568         (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
1569         (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
1570         (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
1571         (WebCore::GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild const):
1572         (WebCore::IndefiniteSizeStrategy::minLogicalWidthForChild const):
1573         (WebCore::DefiniteSizeStrategy::minLogicalWidthForChild const):
1574         * rendering/GridTrackSizingAlgorithm.h:
1575
1576 2017-10-25  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1577
1578         Unreviewed follow up changing one more enum value as discussed in the bug
1579         https://bugs.webkit.org/show_bug.cgi?id=177810
1580
1581         * platform/glib/LowPowerModeNotifierGLib.cpp:
1582         (WebCore::LowPowerModeNotifier::updateState): use NONE instead of DISCHARGING, to ensure
1583         it will build even with older upower.
1584
1585 2017-10-25  Zan Dobersek  <zdobersek@igalia.com>
1586
1587         Make SERVICE_WORKER feature buildable on GTK, WPE
1588         https://bugs.webkit.org/show_bug.cgi?id=178574
1589
1590         Reviewed by Carlos Garcia Campos.
1591
1592         * CMakeLists.txt: Add missing include paths and files to the build.
1593         * Sources.txt: Add missing files to the build.
1594         * WebCore.xcodeproj/project.pbxproj: Remove the JSDOMPromise.cpp and
1595         JSFetchEventCustom.cpp targets, they're now built via unified sources.
1596         * bindings/js/JSFetchEventCustom.cpp: Guard custom JSFetchEvent code
1597         with the ENABLE(SERVICE_WORKER) guards.
1598
1599 2017-10-24  Alejandro G. Castro  <alex@igalia.com>
1600
1601         Clean up gcc build warnings about reaching the end of a non void function for webrtc classes
1602         https://bugs.webkit.org/show_bug.cgi?id=178721
1603
1604         Reviewed by Youenn Fablet.
1605
1606         Assert when we reach those situations and return some value after that to avoid warning.
1607
1608         No new tests, this is a clean up.
1609
1610         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1611         (WebCore::sessionDescriptionType):
1612         (WebCore::signalingState):
1613         (WebCore::toRTCIceConnectionState):
1614         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1615         (WebCore::bundlePolicyfromConfiguration):
1616         (WebCore::iceTransportPolicyfromConfiguration):
1617
1618 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
1619
1620         RenderSVGModelObject::checkIntersection triggers layout
1621         https://bugs.webkit.org/show_bug.cgi?id=178710
1622
1623         Reviewed by Simon Fraser.
1624
1625         Fixed the bug that checkIntersection and checkEnclosure no longer updates the layout after r223882.
1626
1627         Test: svg/custom/check-intersection-basic.svg
1628
1629         * svg/SVGSVGElement.cpp:
1630         (WebCore::SVGSVGElement::collectIntersectionOrEnclosureList):
1631         (WebCore::SVGSVGElement::checkIntersection):
1632         (WebCore::SVGSVGElement::checkEnclosure):
1633         * svg/SVGSVGElement.h:
1634
1635 2017-10-24  Andy Estes  <aestes@apple.com>
1636
1637         [Apple Pay] Implement a paymentmethodselected event for PaymentRequest
1638         https://bugs.webkit.org/show_bug.cgi?id=178765
1639
1640         Reviewed by Tim Horton.
1641
1642         When the Apple Pay payment method changes, fire an applepaypaymentmethodchanged event on the
1643         PaymentRequest object. The event has a paymentMethod property and an updateWith() method
1644         which behaves identically to PaymentRequestUpdateEvent.updateWith().
1645
1646         Test: http/tests/ssl/applepay/ApplePayPaymentMethodUpdateEvent.https.html
1647
1648         * DerivedSources.make:
1649         * Modules/applepay/ApplePayPaymentMethod.idl:
1650         * Modules/applepay/ApplePayPaymentMethodSelectedEvent.h:
1651         * Modules/applepay/PaymentMethod.h:
1652         (WebCore::PaymentMethod::PaymentMethod): Deleted.
1653         (WebCore::PaymentMethod::pkPaymentMethod const): Deleted.
1654         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1655         (WebCore::ApplePayPaymentHandler::detailsUpdated):
1656         (WebCore::ApplePayPaymentHandler::paymentMethodUpdated):
1657         (WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):
1658         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
1659         * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.cpp: Added.
1660         (WebCore::ApplePayPaymentMethodUpdateEvent::ApplePayPaymentMethodUpdateEvent):
1661         (WebCore::ApplePayPaymentMethodUpdateEvent::eventInterface const):
1662         * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.h: Added.
1663         * Modules/applepay/paymentrequest/ApplePayPaymentMethodUpdateEvent.idl: Added.
1664         * Modules/paymentrequest/PaymentHandler.h:
1665         * Modules/paymentrequest/PaymentRequest.cpp:
1666         (WebCore::PaymentRequest::shippingAddressChanged):
1667         (WebCore::PaymentRequest::shippingOptionChanged):
1668         (WebCore::PaymentRequest::dispatchEvent):
1669         (WebCore::PaymentRequest::updateWith):
1670         (WebCore::PaymentRequest::settleDetailsPromise):
1671         (WebCore::PaymentRequest::dispatchUpdateEvent): Deleted.
1672         * Modules/paymentrequest/PaymentRequest.h:
1673         * Modules/paymentrequest/PaymentRequest.idl:
1674         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
1675         (WebCore::PaymentRequestUpdateEvent::updateWith):
1676         * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
1677         * WebCore.xcodeproj/project.pbxproj:
1678         * dom/EventNames.h:
1679         * dom/EventNames.in:
1680         * testing/MockPaymentCoordinator.cpp:
1681         (WebCore::MockPaymentCoordinator::changePaymentMethod):
1682         * testing/MockPaymentCoordinator.h:
1683         * testing/MockPaymentCoordinator.idl:
1684         * testing/MockPaymentMethod.h: Added.
1685
1686 2017-10-24  Youenn Fablet  <youenn@apple.com>
1687
1688         ServiceWorkerClientFetch should return an error that is not null in case of failure
1689         https://bugs.webkit.org/show_bug.cgi?id=178761
1690
1691         Reviewed by Geoffrey Garen.
1692
1693         Covered by existing tests.
1694
1695         As per spec, ServiceWorkerJob should not go through Service Worker Handle Fetch
1696         for fetching scripts.
1697
1698         * workers/WorkerScriptLoader.cpp:
1699         (WebCore::WorkerScriptLoader::loadAsynchronously):
1700         * workers/WorkerScriptLoaderClient.h:
1701         (WebCore::WorkerScriptLoaderClient::isServiceWorkerClient const):
1702         * workers/service/ServiceWorkerJob.h:
1703
1704 2017-10-24  Keith Miller  <keith_miller@apple.com>
1705
1706         Move inspector and loader to unified sources.
1707         https://bugs.webkit.org/show_bug.cgi?id=178760
1708
1709         Rubber-stamped by Tim Horton.
1710
1711         * CMakeLists.txt:
1712         * Sources.txt:
1713         * WebCore.xcodeproj/project.pbxproj:
1714
1715 2017-10-24  Alex Christensen  <achristensen@webkit.org>
1716
1717         Fix build after r223940
1718
1719         * inspector/WebConsoleAgent.cpp:
1720
1721 2017-10-24  Alex Christensen  <achristensen@webkit.org>
1722
1723         Fix Windows build after r223929.
1724         https://bugs.webkit.org/show_bug.cgi?id=177027
1725
1726         * inspector/WebConsoleAgent.cpp:
1727         (WebCore::WebConsoleAgent::getLoggingChannels):
1728         Always initialize the variable "level".  Visual studio was complaining about the possibility of not initializing it
1729         but this is only possible if logChannel->level is an invalid enum value.
1730
1731 2017-10-24  Alex Christensen  <achristensen@webkit.org>
1732
1733         Fix Windows build after r223925
1734         https://bugs.webkit.org/show_bug.cgi?id=178687
1735
1736         * html/ImageBitmap.cpp:
1737         (WebCore::interpolationQualityForResizeQuality):
1738         Visual Studio was complaining that not all control paths returned a value.
1739
1740 2017-10-24  Youenn Fablet  <youenn@apple.com>
1741
1742         Enable service worker to use cache storage api
1743         https://bugs.webkit.org/show_bug.cgi?id=178684
1744
1745         Reviewed by Brady Eidson.
1746
1747         Test: http/tests/workers/service/service-worker-cache-api.https.html
1748
1749         Updated WorkerLoaderProxy so that it can create a CacheStorageConnection.
1750         Update WorkerCacheStorageConnection to take benefit of that.
1751         This allows creating a CacheStorageConnection based on the page for regular workers and differently for Service Worker context.
1752
1753         Added ServiceWorkerThreadProxy as a proxy to ServiceWorkerThread.
1754         It is in particular responsible to do proxy for loading tasks.
1755         It implements cache API support for service worker by creating a dedicated CacheStorageConnection.
1756
1757         * Modules/cache/WorkerCacheStorageConnection.cpp:
1758         (WebCore::WorkerCacheStorageConnection::create):
1759         (WebCore::WorkerCacheStorageConnection::~WorkerCacheStorageConnection):
1760         (WebCore::WorkerCacheStorageConnection::doOpen):
1761         (WebCore::WorkerCacheStorageConnection::doRemove):
1762         (WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
1763         (WebCore::WorkerCacheStorageConnection::reference):
1764         (WebCore::WorkerCacheStorageConnection::dereference):
1765         (WebCore::WorkerCacheStorageConnection::doRetrieveRecords):
1766         (WebCore::WorkerCacheStorageConnection::doBatchDeleteOperation):
1767         (WebCore::WorkerCacheStorageConnection::doBatchPutOperation):
1768         * WebCore.xcodeproj/project.pbxproj:
1769         * workers/WorkerLoaderProxy.h:
1770         * workers/WorkerMessagingProxy.cpp:
1771         (WebCore::WorkerMessagingProxy::createCacheStorageConnection):
1772         * workers/WorkerMessagingProxy.h:
1773         * workers/service/context/ServiceWorkerThread.cpp:
1774         (WebCore::ServiceWorkerThread::ServiceWorkerThread):
1775         * workers/service/context/ServiceWorkerThread.h:
1776         * workers/service/context/ServiceWorkerThreadProxy.cpp: Added.
1777         (WebCore::ServiceWorkerThreadProxy::create):
1778         (WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
1779         (WebCore::ServiceWorkerThreadProxy::postTaskForModeToWorkerGlobalScope):
1780         (WebCore::ServiceWorkerThreadProxy::postTaskToLoader):
1781         (WebCore::ServiceWorkerThreadProxy::createCacheStorageConnection):
1782         * workers/service/context/ServiceWorkerThreadProxy.h: Added.
1783
1784 2017-10-24  Alex Christensen  <achristensen@webkit.org>
1785
1786         Optionally store entire ResourceRequest for ping loads
1787         https://bugs.webkit.org/show_bug.cgi?id=178756
1788
1789         Reviewed by Tim Horton.
1790
1791         No change in behavior.
1792         This uses less memory in the common loading case.
1793         This will be needed for moving appcache loading to the Networking Process.
1794         See https://bugs.webkit.org/show_bug.cgi?id=178540
1795
1796         * loader/cache/CachedResource.cpp:
1797         (WebCore::CachedResource::load):
1798         * loader/cache/CachedResource.h:
1799         (WebCore::CachedResource::setOriginalRequest):
1800         (WebCore::CachedResource::originalRequest const):
1801         (WebCore::CachedResource::setOriginalRequestHeaders): Deleted.
1802         * loader/cache/CachedResourceLoader.cpp:
1803         (WebCore::CachedResourceLoader::requestResource):
1804
1805 2017-10-24  Andy Estes  <aestes@apple.com>
1806
1807         [WebIDL] Support the ExportMacro attribute for dictionaries
1808         https://bugs.webkit.org/show_bug.cgi?id=178752
1809
1810         Reviewed by Sam Weinig.
1811
1812         * bindings/scripts/CodeGeneratorJS.pm:
1813         (GenerateDictionaryHeaderContent):
1814         * bindings/scripts/test/JS/JSTestStandaloneDictionary.h:
1815         * bindings/scripts/test/TestStandaloneDictionary.idl:
1816
1817 2017-10-24  Eric Carlson  <eric.carlson@apple.com>
1818
1819         Web Inspector: Enable WebKit logging configuration and display
1820         https://bugs.webkit.org/show_bug.cgi?id=177027
1821         <rdar://problem/33964767>
1822
1823         Reviewed by Joseph Pecoraro.
1824
1825         Test: inspector/console/webcore-logging.html
1826
1827         * dom/Document.cpp:
1828         (WebCore::Document::~Document): Stop observing the logger.
1829         (WebCore::Document::logger): Observe the logger.
1830         (WebCore::Document::didLogMessage): Forward logging messages to the inspector.
1831         * dom/Document.h:
1832
1833         * inspector/WebConsoleAgent.cpp:
1834         (WebCore::WebConsoleAgent::getLoggingChannels): New, return the state of log runtime channels.
1835         (WebCore::WebConsoleAgent::setLoggingChannelLevel): New, set the state of a channel.
1836         * inspector/WebConsoleAgent.h:
1837
1838         * platform/Logging.cpp:
1839         (WebCore::getLogChannel): New, get a log channel by name.
1840         * platform/Logging.h:
1841
1842 2017-10-24  Dean Jackson  <dino@apple.com>
1843
1844         Attempted build fix for Sierra.
1845
1846         * html/ImageBitmap.cpp:
1847         (WebCore::croppedSourceRectangleWithFormatting):
1848
1849 2017-10-24  Dean Jackson  <dino@apple.com>
1850
1851         Implement resizing options for ImageBitmap rendering
1852         https://bugs.webkit.org/show_bug.cgi?id=178687
1853         <rdar://problem/35135417>
1854
1855         Reviewed by Sam Weinig.
1856
1857         Implement many of the sizing options for createImageBitmap.
1858
1859         Test: http/wpt/2dcontext/imagebitmap/createImageBitmap-sizing.html
1860
1861         * html/ImageBitmap.cpp:
1862         (WebCore::croppedSourceRectangleWithFormatting):
1863
1864             Implement the first bit of the algorithm from
1865             the HTML specification.
1866
1867         (WebCore::outputSizeForSourceRectangle):
1868
1869             ... and then the second bit. Leave the rest in
1870             comments for now.
1871
1872         (WebCore::interpolationQualityForResizeQuality):
1873
1874             Helper function to map ImageBitmapOptions to
1875             GraphicsContext.
1876
1877         (WebCore::ImageBitmap::createPromise):
1878
1879             Implement more of the sizing algorithm.
1880
1881         * html/ImageBitmap.h: Origin tainting is defined to be false by default.
1882
1883 2017-10-24  Chris Dumez  <cdumez@apple.com>
1884
1885         Add initial implementation for serviceWorker.postMessage()
1886         https://bugs.webkit.org/show_bug.cgi?id=178534
1887
1888         Reviewed by Youenn Fablet.
1889
1890         Add initial implementation for serviceWorker.postMessage():
1891         - https://w3c.github.io/ServiceWorker/#service-worker-postmessage
1892
1893         Test: http/tests/workers/service/basic-ServiceWorker-postMessage.https.html
1894
1895         * CMakeLists.txt:
1896         * DerivedSources.make:
1897         * Sources.txt:
1898         * WebCore.xcodeproj/project.pbxproj:
1899         * bindings/js/JSBindingsAllInOne.cpp:
1900         * bindings/js/JSExtendableMessageEvent.cpp: Added.
1901         (WebCore::JSExtendableMessageEvent::data const):
1902         * bindings/js/WebCoreBuiltinNames.h:
1903         * dom/Document.h:
1904         * dom/EventNames.in:
1905         * dom/MessagePortChannel.h:
1906         * dom/ScriptExecutionContext.h:
1907         * workers/WorkerGlobalScope.h:
1908         * workers/service/ExtendableEvent.cpp:
1909         (WebCore::ExtendableEvent::ExtendableEvent):
1910         (WebCore::ExtendableEvent::~ExtendableEvent):
1911         * workers/service/ExtendableEvent.h:
1912         * workers/service/ExtendableMessageEvent.cpp: Added.
1913         (WebCore::ExtendableMessageEvent::create):
1914         (WebCore::ExtendableMessageEvent::ExtendableMessageEvent):
1915         (WebCore::ExtendableMessageEvent::~ExtendableMessageEvent):
1916         * workers/service/ExtendableMessageEvent.h: Added.
1917         * workers/service/ExtendableMessageEvent.idl: Added.
1918         * workers/service/ServiceWorker.cpp:
1919         (WebCore::ServiceWorker::ServiceWorker):
1920         (WebCore::ServiceWorker::postMessage):
1921         (WebCore::ServiceWorker::state const):
1922         (WebCore::ServiceWorker::scriptExecutionContext const):
1923         * workers/service/ServiceWorker.h:
1924         * workers/service/ServiceWorkerContainer.cpp:
1925         (WebCore::ServiceWorkerContainer::controller const):
1926         * workers/service/ServiceWorkerContainer.h:
1927         * workers/service/ServiceWorkerGlobalScope.cpp:
1928         (WebCore::ServiceWorkerGlobalScope::thread):
1929         * workers/service/ServiceWorkerGlobalScope.h:
1930         (isType):
1931         * workers/service/context/ServiceWorkerThread.cpp:
1932         (WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
1933         * workers/service/context/ServiceWorkerThread.h:
1934         * workers/service/server/SWClientConnection.h:
1935
1936 2017-10-24  Andy Estes  <aestes@apple.com>
1937
1938         [Payment Request] Implement the "PaymentRequest updated" algorithm
1939         https://bugs.webkit.org/show_bug.cgi?id=178689
1940
1941         Reviewed by Alex Christensen.
1942
1943         Implemented the "PaymentRequest updated" algorithm by firing shippingaddresschange and
1944         shippingoptionchange events at the right times and implementing
1945         PaymentRequestUpdateEvent.updateWith().
1946
1947         Tests: http/tests/paymentrequest/payment-request-change-shipping-address.https.html
1948                http/tests/paymentrequest/payment-request-change-shipping-option.https.html
1949                http/tests/paymentrequest/updateWith-method-pmi-handling.https.html
1950
1951         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1952         (WebCore::convertAndValidate): Added. Converts a PaymentDetailsInit to a
1953         ApplePaySessionPaymentRequest::TotalAndLineItems.
1954         (WebCore::ApplePayPaymentHandler::shippingAddressUpdated): Created a ShippingContactUpdate
1955         and passed it to PaymentCoordinator::completeShippingContactSelection().
1956         (WebCore::ApplePayPaymentHandler::shippingOptionUpdated): Created a ShippingMethodUpdate and
1957         passed it to PaymentCoordinator::completeShippingMethodSelection().
1958         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
1959         * Modules/paymentrequest/PaymentHandler.h:
1960         * Modules/paymentrequest/PaymentRequest.cpp:
1961         (WebCore::checkAndCanonicalizeDetails): Moved the logic for checking and canonicalizing a
1962         PaymentDetailsBase from PaymentRequest::create() to here.
1963         (WebCore::PaymentRequest::create): Called checkAndCanonicalizeDetails().
1964         (WebCore::PaymentRequest::abortWithException): Moved the body of stop() to here and
1965         parameterized the Exception with which to abort m_showPromise.
1966         (WebCore::PaymentRequest::stop): Called abortWithException() with an AbortError.
1967         (WebCore::PaymentRequest::shippingAddressChanged): Called dispatchUpdateEvent() with
1968         shippingaddresschangeEvent.
1969         (WebCore::PaymentRequest::shippingOptionChanged): Ditto with shippingoptionchangeEvent.
1970         (WebCore::PaymentRequest::dispatchUpdateEvent): Created a PaymentRequestUpdateEvent and
1971         dispatched it.
1972         (WebCore::PaymentRequest::updateWith): Added a settle handler to m_detailsPromise.
1973         (WebCore::PaymentRequest::settleDetailsPromise): Updated the PaymentRequest with the new
1974         details and called PaymentHandler::shippingAddressUpdated() or
1975         PaymentHandler::shippingOptionUpdated().
1976         * Modules/paymentrequest/PaymentRequest.h:
1977         * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
1978         (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
1979         (WebCore::PaymentRequestUpdateEvent::updateWith): Called PaymentRequest::updateWith().
1980         (WebCore::PaymentRequestUpdateEvent::eventInterface const): Returned
1981         PaymentRequestUpdateEventInterfaceType.
1982         * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
1983         * Modules/paymentrequest/PaymentRequestUpdateEvent.idl:
1984         * testing/MockPaymentCoordinator.cpp:
1985         (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
1986         (WebCore::MockPaymentCoordinator::openPaymentSetup):
1987         (WebCore::MockPaymentCoordinator::completeMerchantValidation): Stopped calling
1988         PaymentCoordinator::didAuthorizePayment().
1989         (WebCore::MockPaymentCoordinator::changeShippingOption): Called
1990         PaymentCoordinator::didSelectShippingMethod().
1991         (WebCore::MockPaymentCoordinator::acceptPayment): Called
1992         PaymentCoordinator::didAuthorizePayment().
1993         * testing/MockPaymentCoordinator.h:
1994         * testing/MockPaymentCoordinator.idl:
1995
1996 2017-10-24  Alex Christensen  <achristensen@webkit.org>
1997
1998         Apply custom header fields from WebsitePolicies to same-domain requests
1999         https://bugs.webkit.org/show_bug.cgi?id=178356
2000         <rdar://problem/31073436>
2001
2002         Reviewed by Brady Eidson.
2003
2004         Covered by new API tests.
2005
2006         * loader/cache/CachedResourceLoader.cpp:
2007         (WebCore::CachedResourceLoader::requestResource):
2008         * platform/network/ResourceRequestBase.cpp:
2009         (WebCore::ResourceRequestBase::setCachePolicy):
2010         (WebCore::ResourceRequestBase::setTimeoutInterval):
2011         (WebCore::ResourceRequestBase::setHTTPMethod):
2012         (WebCore::ResourceRequestBase::setHTTPHeaderField):
2013         (WebCore::ResourceRequestBase::clearHTTPAuthorization):
2014         (WebCore::ResourceRequestBase::clearHTTPContentType):
2015         (WebCore::ResourceRequestBase::clearHTTPReferrer):
2016         (WebCore::ResourceRequestBase::clearHTTPOrigin):
2017         (WebCore::ResourceRequestBase::clearHTTPUserAgent):
2018         (WebCore::ResourceRequestBase::clearHTTPAccept):
2019         (WebCore::ResourceRequestBase::clearHTTPAcceptEncoding):
2020         (WebCore::ResourceRequestBase::setResponseContentDispositionEncodingFallbackArray):
2021         (WebCore::ResourceRequestBase::setHTTPBody):
2022         (WebCore::ResourceRequestBase::setAllowCookies):
2023         (WebCore::ResourceRequestBase::setPriority):
2024         (WebCore::ResourceRequestBase::addHTTPHeaderFieldIfNotPresent):
2025         (WebCore::ResourceRequestBase::addHTTPHeaderField):
2026         (WebCore::ResourceRequestBase::setHTTPHeaderFields):
2027         If we only update the platform request when headers are added (or other changes) for HTTP requests,
2028         then the changes will not affect the NSURLRequest that is sent over IPC or visible to the API.
2029         This is necessary for these new tests to work, but it's also of growing importance since our
2030         introduction of WKURLSchemeHandler.
2031
2032 2017-10-24  Brent Fulgham  <bfulgham@apple.com>
2033
2034         Adopt new secure coding APIs
2035         https://bugs.webkit.org/show_bug.cgi?id=178484
2036         <rdar://problem/34837193>
2037
2038         Reviewed by Tim Horton.
2039
2040         Switch to new NSKeyed[Un]Archiver methods that active and use
2041         NSSecureCoding by default.
2042
2043         Most of the new API is wrapped in a set of convenience methods so we can
2044         build without the new API on older systems.
2045
2046         No change in behavior.
2047
2048         * editing/cocoa/EditorCocoa.mm:
2049         (WebCore::archivedDataForAttributedString): Use new convenience method
2050         to archive the string object.
2051         * loader/archive/cf/LegacyWebArchiveMac.mm:
2052         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Update to
2053         use secure coding where possible.
2054         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
2055         * platform/ios/PlatformPasteboardIOS.mm:
2056         (WebCore::PlatformPasteboard::write): Use new secure API.
2057         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.
2058         * testing/cocoa/WebArchiveDumpSupport.mm:
2059         (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to
2060         secure coding API where possible.
2061
2062 2017-10-24  Jeremy Jones  <jeremyj@apple.com>
2063
2064         HTMLMediaElement should iterate HTMLTrackElements consistently.
2065         https://bugs.webkit.org/show_bug.cgi?id=178423
2066         rdar://problem/35044967
2067
2068         Reviewed by Eric Carlson.
2069
2070         No new tests because no expected behavior change.
2071
2072         HTMLMediaElement iterates HTMLTrackElements as children in every place but one, where it iterates them
2073         as descendants. It should always iterate them as children.
2074
2075         * html/HTMLMediaElement.cpp:
2076         (WebCore::HTMLMediaElement::finishParsingChildren):
2077
2078 2017-10-24  Chris Dumez  <cdumez@apple.com>
2079
2080         SerializedScriptValue::deserialize() should take ports as a const Vector&
2081         https://bugs.webkit.org/show_bug.cgi?id=178727
2082
2083         Reviewed by Alex Christensen.
2084
2085         SerializedScriptValue::deserialize() should take ports as a const Vector&, not a Vector&.
2086         It does not modify the input vector.
2087
2088         * bindings/js/JSMessageEventCustom.cpp:
2089         (WebCore::JSMessageEvent::data const):
2090         * bindings/js/SerializedScriptValue.cpp:
2091         (WebCore::CloneDeserializer::deserialize):
2092         (WebCore::CloneDeserializer::CloneDeserializer):
2093         (WebCore::SerializedScriptValue::deserialize):
2094         * bindings/js/SerializedScriptValue.h:
2095
2096 2017-10-24  Konstantin Tokarev  <annulen@yandex.ru>
2097
2098         [MediaFoundation] Videos are always autoplaying for local files
2099         https://bugs.webkit.org/show_bug.cgi?id=178693
2100
2101         Patch by Doug Massay.
2102         Reviewed by Alex Christensen.
2103
2104         r199114 fixes autoplay issue only if starting session invokes
2105         buffering stage. However when local files are played, onBufferingStarted
2106         and onBufferingStopped are not called, and video is not paused.
2107
2108         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2109         (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
2110         (WebCore::MediaPlayerPrivateMediaFoundation::onSessionStarted):
2111         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
2112
2113 2017-10-24  Matt Lewis  <jlewis3@apple.com>
2114
2115         Unreviewed, rolling out r223889.
2116
2117         This caused multiple crashes on all platforms
2118
2119         Reverted changeset:
2120
2121         "Adopt new secure coding APIs"
2122         https://bugs.webkit.org/show_bug.cgi?id=178484
2123         https://trac.webkit.org/changeset/223889
2124
2125 2017-10-24  Antti Koivisto  <antti@apple.com>
2126
2127         Create inline wrappers for before/after pseudo elements that have display:contents
2128         https://bugs.webkit.org/show_bug.cgi?id=178722
2129
2130         Reviewed by Ryosuke Niwa.
2131
2132         We can handle before and after pseudo elements with display:contents by giving them
2133         inline renderers with style inherited from display:contents style. This removes
2134         need for complicated logic for this case and handles everything correctly.
2135
2136         This is a better approach and replaces the one taken in bug 178584.
2137         It also fixes two display:contents WPTs.
2138
2139         * dom/PseudoElement.h:
2140
2141             There is no need to track content renderers separately anymore. They always descendants of
2142             pseudo element's renderer (which is an inline wrapper in case of display:contents).
2143
2144         * rendering/style/RenderStyle.cpp:
2145         (WebCore::RenderStyle::copyContentFrom):
2146         * rendering/style/RenderStyle.h:
2147         * style/RenderTreeUpdaterGeneratedContent.cpp:
2148         (WebCore::createContentRenderers):
2149         (WebCore::updateStyleForContentRenderers):
2150         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
2151         (WebCore::removeAndDestroyContentRenderers): Deleted.
2152
2153             Since content renderers are now always descendants of the pseudo renderer
2154             there is no need for a separate destruction path.
2155
2156         * style/StyleTreeResolver.cpp:
2157         (WebCore::Style::TreeResolver::resolvePseudoStyle):
2158
2159             Create ElementUpdate with a style that will produce an inline wrapper.
2160
2161 2017-10-24  Wenson Hsieh  <wenson_hsieh@apple.com>
2162
2163         [iOS] MediaPlayer::isAvailable() takes ~150 ms during web process initialization
2164         https://bugs.webkit.org/show_bug.cgi?id=178713
2165         <rdar://problem/35115906>
2166
2167         Reviewed by Eric Carlson.
2168
2169         Loading AVFoundation should not be required to answer the question of MediaPlayer::isAvailable() on iOS, where
2170         both AVFoundation and CoreMedia frameworks should always exist. As such, we can bail early and return true to
2171         avoid always dynamically loading AVFoundation and CoreMedia.
2172
2173         * platform/graphics/MediaPlayer.cpp:
2174         (WebCore::MediaPlayer::isAvailable):
2175
2176 2017-10-24  Antoine Quint  <graouts@apple.com>
2177
2178         RenderThemeCocoa::mediaControlsFormattedStringForDuration may cause a crash due to unhandled Obj-C exception
2179         https://bugs.webkit.org/show_bug.cgi?id=178716
2180         <rdar://problem/35112900>
2181
2182         Reviewed by Dean Jackson.
2183
2184         * rendering/RenderThemeCocoa.mm:
2185         (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):
2186
2187 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
2188
2189         SizesAttributeParser::SizesAttributeParser triggers layout
2190         https://bugs.webkit.org/show_bug.cgi?id=178712
2191
2192         Reviewed by Antti Koivisto.
2193
2194         Revert r213711 as this change introduced an unwated synchronous layout inside Node::insertedIntoAncestor.
2195
2196         The test had been marked as timing out since r191379 and changed to failing expectation in r199225
2197         as the test result's error message changes from run to run.
2198
2199         Disabled Tests: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/environment-changes/viewport-change.html
2200                         had been marked failing since r199225, prior to which it was marked as timeout in r191379.
2201                         imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html
2202                         is now marked as flaky.
2203
2204         * css/parser/SizesAttributeParser.cpp:
2205         (WebCore::SizesAttributeParser::SizesAttributeParser):
2206
2207 2017-10-24  Keith Miller  <keith_miller@apple.com>
2208
2209         Unreviewed, fix internal iOS build.
2210
2211         * Sources.txt:
2212
2213 2017-10-24  Brent Fulgham  <bfulgham@apple.com>
2214
2215         Adopt new secure coding APIs
2216         https://bugs.webkit.org/show_bug.cgi?id=178484
2217         <rdar://problem/34837193>
2218
2219         Reviewed by Tim Horton.
2220
2221         Switch to new NSKeyed[Un]Archiver methods that active and use
2222         NSSecureCoding by default.
2223
2224         Most of the new API is wrapped in a set of convenience methods so we can
2225         build without the new API on older systems.
2226
2227         No change in behavior.
2228
2229         * editing/cocoa/EditorCocoa.mm:
2230         (WebCore::archivedDataForAttributedString): Use new convenience method
2231         to archive the string object.
2232         * loader/archive/cf/LegacyWebArchiveMac.mm:
2233         (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Update to
2234         use secure coding where possible.
2235         (WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto.
2236         * platform/ios/PlatformPasteboardIOS.mm:
2237         (WebCore::PlatformPasteboard::write): Use new secure API.
2238         (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): Ditto.
2239         * testing/cocoa/WebArchiveDumpSupport.mm:
2240         (WebCoreTestSupport::createCFURLResponseFromResponseData): Update to
2241         secure coding API where possible.
2242
2243 2017-10-24  Miguel Gomez  <magomez@igalia.com>
2244
2245         [GTK][X11] Windy.com shows always straight wind lines
2246         https://bugs.webkit.org/show_bug.cgi?id=176718
2247
2248         Reviewed by Carlos Garcia Campos.
2249
2250         WebGL's GL_LUMINANCE_ALPHA format is not available in OpenGL when using a version >= 3.2
2251         and a core profile. In that case, we need to replace it with GL_RG and swizzle the color
2252         components appropriately.
2253
2254         No new behavior.
2255
2256         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
2257         (WebCore::GraphicsContext3D::texImage2D):
2258         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2259         (WebCore::GraphicsContext3D::texSubImage2D):
2260
2261 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
2262
2263         DocumentOrderedMap::add should release assert that tree scopes match
2264         https://bugs.webkit.org/show_bug.cgi?id=178708
2265
2266         Reviewed by Antti Koivisto.
2267
2268         Assert that the tree scope of element matches the given tree scope instead of asserting that
2269         element is in tree scope, and replaced the use of RELEASE_ASSERT by the newly added
2270         RELEASE_ASSERT_WITH_SECURITY_IMPLICATION to clarify the semantics of these assertions.
2271
2272         Also removed now redudnant early exits which would never execute due to release assertions.
2273
2274         * dom/DocumentOrderedMap.cpp:
2275         (WebCore::DocumentOrderedMap::add):
2276         (WebCore::DocumentOrderedMap::remove):
2277         (WebCore::DocumentOrderedMap::get const):
2278
2279 2017-10-24  Michael Catanzaro  <mcatanzaro@igalia.com>
2280
2281         -Wsubobject-linkage warning in InspectorIndexedDBAgent.cpp
2282         https://bugs.webkit.org/show_bug.cgi?id=178698
2283
2284         Reviewed by Joseph Pecoraro.
2285
2286         * inspector/InspectorIndexedDBAgent.cpp:
2287
2288 2017-10-24  Antoine Quint  <graouts@apple.com>
2289
2290         [Web Animations] Add basic timing and target properties
2291         https://bugs.webkit.org/show_bug.cgi?id=178674
2292
2293         Reviewed by Dean Jackson.
2294
2295         We add three new interfaces to expose enough properties to establish basic timing properties,
2296         a start time and duration, and the target of an animation. The startTime property is set on
2297         the Animation object, the target is set on the KeyframeEffect set as the effect property on
2298         the Animation object, and the duration is set on the AnimationEffectTiming set on the effect.
2299
2300         Tests: webanimations/animation-effect-timing.html
2301                webanimations/animation-effect.html
2302                webanimations/animation-interface-effect-property.html
2303                webanimations/animation-interface-start-time-property.html
2304                webanimations/keyframe-effect-interface-timing-duration.html
2305                webanimations/keyframe-effect.html
2306
2307         * CMakeLists.txt:
2308         * DerivedSources.make:
2309         * Sources.txt:
2310         * WebCore.xcodeproj/project.pbxproj:
2311         * animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
2312         (WebCore::AnimationEffect::AnimationEffect):
2313         (WebCore::AnimationEffect::~AnimationEffect):
2314         * animation/AnimationEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
2315         (WebCore::AnimationEffect::isKeyframeEffect const):
2316         (WebCore::AnimationEffect::timing const):
2317         (WebCore::AnimationEffect::classType const):
2318         * animation/AnimationEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
2319         * animation/AnimationEffectTiming.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
2320         (WebCore::AnimationEffectTiming::create):
2321         (WebCore::AnimationEffectTiming::AnimationEffectTiming):
2322         (WebCore::AnimationEffectTiming::~AnimationEffectTiming):
2323         * animation/AnimationEffectTiming.h: Copied from Source/WebCore/animation/WebAnimation.h.
2324         * animation/AnimationEffectTiming.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
2325         * animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/WebAnimation.idl.
2326         (WebCore::KeyframeEffect::create):
2327         (WebCore::KeyframeEffect::KeyframeEffect):
2328         * animation/KeyframeEffect.h: Copied from Source/WebCore/animation/WebAnimation.h.
2329         * animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/WebAnimation.idl.
2330         * animation/WebAnimation.cpp:
2331         (WebCore::WebAnimation::setEffect):
2332         * animation/WebAnimation.h:
2333         * animation/WebAnimation.idl:
2334         * bindings/js/JSAnimationEffectCustom.cpp: Copied from Source/WebCore/animation/WebAnimation.cpp.
2335         (WebCore::toJSNewlyCreated):
2336         (WebCore::toJS):
2337         * bindings/js/WebCoreBuiltinNames.h:
2338
2339 2017-10-24  Ryosuke Niwa  <rniwa@webkit.org>
2340
2341         RenderSVGModelObject::checkIntersection triggers layout
2342         https://bugs.webkit.org/show_bug.cgi?id=178710
2343
2344         Reviewed by Antti Koivisto.
2345
2346         Don't trigger a layout inside getElementCTM. Update the layout upfront in getEnclosureList.
2347
2348         * rendering/svg/RenderSVGModelObject.cpp:
2349         (WebCore::getElementCTM):
2350         * svg/SVGSVGElement.cpp:
2351         (WebCore::SVGSVGElement::getEnclosureList):
2352
2353 2017-10-24  Nan Wang  <n_wang@apple.com>
2354
2355         AX: Crash at -[WebAccessibilityObjectWrapper _accessibilityMinValue] + 24
2356         https://bugs.webkit.org/show_bug.cgi?id=178697
2357
2358         Reviewed by Chris Fleizach.
2359
2360         When we are calling _accessibilityMinValue and _accessibilityMaxValue on iOS, 
2361         it might cause crash if the AX object has already been detached. Fixed this 
2362         by adding the necessary checks.
2363
2364         Test: accessibility/ios-simulator/slider-min-value-crash.html
2365
2366         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2367         (-[WebAccessibilityObjectWrapper _accessibilityMinValue]):
2368         (-[WebAccessibilityObjectWrapper _accessibilityMaxValue]):
2369
2370 2017-10-23  Keith Miller  <keith_miller@apple.com>
2371
2372         Unreviewed, restore unneeded all in ones.
2373
2374         * CMakeLists.txt:
2375
2376 2017-10-23  Commit Queue  <commit-queue@webkit.org>
2377
2378         Unreviewed, rolling out r223870 and r223871.
2379         https://bugs.webkit.org/show_bug.cgi?id=178702
2380
2381         broke the windows build (Requested by keith_miller on
2382         #webkit).
2383
2384         Reverted changesets:
2385
2386         "Add html, inspector, loader to unified sources"
2387         https://bugs.webkit.org/show_bug.cgi?id=178695
2388         https://trac.webkit.org/changeset/223870
2389
2390         "Unrievwed, fix windows build."
2391         https://trac.webkit.org/changeset/223871
2392
2393 2017-10-23  Michael Catanzaro  <mcatanzaro@igalia.com>
2394
2395         Unreviewed, attempt to fix initializeSupportedImageMIMETypes after r223860
2396         https://bugs.webkit.org/show_bug.cgi?id=178618
2397         <rdar://problem/35108852>
2398
2399         * platform/MIMETypeRegistry.cpp:
2400         (WebCore::initializeSupportedImageMIMETypes):
2401
2402 2017-10-23  Keith Miller  <keith_miller@apple.com>
2403
2404         Unrievwed, fix windows build.
2405
2406         * CMakeLists.txt:
2407
2408 2017-10-23  Keith Miller  <keith_miller@apple.com>
2409
2410         Add html, inspector, loader to unified sources
2411         https://bugs.webkit.org/show_bug.cgi?id=178695
2412
2413         Rubber-stamped by Tim Horton.
2414
2415         * CMakeLists.txt:
2416         * Sources.txt:
2417         * WebCore.xcodeproj/project.pbxproj:
2418
2419 2017-10-23  Joseph Pecoraro  <pecoraro@apple.com>
2420
2421         Web Inspector: Remove unused Console.setMonitoringXHREnabled
2422         https://bugs.webkit.org/show_bug.cgi?id=178617
2423
2424         Reviewed by Sam Weinig.
2425
2426         * inspector/InspectorInstrumentation.cpp:
2427         (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
2428         * inspector/InspectorInstrumentation.h:
2429         (WebCore::InspectorInstrumentation::didFinishXHRLoading):
2430         * inspector/WebConsoleAgent.cpp:
2431         (WebCore::WebConsoleAgent::setMonitoringXHREnabled): Deleted.
2432         (WebCore::WebConsoleAgent::didFinishXHRLoading): Deleted.
2433         * inspector/WebConsoleAgent.h:
2434         Remove XHR monitoring code.
2435
2436         * xml/XMLHttpRequest.h:
2437         * xml/XMLHttpRequest.cpp:
2438         (WebCore::XMLHttpRequest::send):
2439         (WebCore::XMLHttpRequest::didFinishLoading):
2440         (WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber): Deleted.
2441         * xml/XMLHttpRequest.idl:
2442         Remove now unused state on XHR and ExecState requirement for send().
2443
2444 2017-10-23  Keith Miller  <keith_miller@apple.com>
2445
2446         Add dom, editing, fileapi, and history to unified sources
2447         https://bugs.webkit.org/show_bug.cgi?id=178694
2448
2449         Rubber-stamped by Tim Horton.
2450
2451         * CMakeLists.txt:
2452         * Sources.txt:
2453         * WebCore.xcodeproj/project.pbxproj:
2454
2455 2017-10-23  Keith Miller  <keith_miller@apple.com>
2456
2457         Move bridge, contentextensions, crypto, and css to unified sources.
2458         https://bugs.webkit.org/show_bug.cgi?id=178691
2459
2460         Reviewed by Tim Horton.
2461
2462         * CMakeLists.txt:
2463         * Sources.txt:
2464         * WebCore.xcodeproj/project.pbxproj:
2465
2466 2017-10-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2467
2468         Unreviewed, fix the Windows build after r223860
2469
2470         UTIUtilities only exists on Cocoa platforms, so we need to guard it accordingly.
2471
2472         * platform/MIMETypeRegistry.cpp:
2473         (WebCore::initializeSupportedImageMIMETypes):
2474
2475 2017-10-23  Wenson Hsieh  <wenson_hsieh@apple.com>
2476
2477         [iOS] DocumentWriter::createDocument can spend ~100ms unnecessarily converting image UTIs to MIME types
2478         https://bugs.webkit.org/show_bug.cgi?id=178618
2479         <rdar://problem/35108852>
2480
2481         Reviewed by Said Abou-Hallawa.
2482
2483         Currently, in setting up a new Document, DocumentWriter::createDocument() always asks whether or not the
2484         Document should be a PDF document by calling MIMETypeRegistry::isPDFMIMEType(), which forces lazy initialization
2485         of every MIME type dictionary (e.g. image types, PDF types, JavaScript types, etc.). As evidenced by traces,
2486         this can be an expensive operation on certain devices.
2487
2488         This patch implements two optimizations. First, we refactor the initializeSupportedImageMIMETypes() helper to
2489         stop asking for MIMETypeForImageSourceType for each of the supported UTIs. This is because the known MIME types
2490         corresponding to these hard-coded UTI types is a fixed set anyways, so we can simply iterate over a constant
2491         array of MIME types and populate the supported image (and image resource) types. Also, add assertions to ensure
2492         that we keep allowed image MIME types in sync with allowed image UTIs.
2493
2494         The second optimization removes initializeMIMETypeRegistry() altogether in favor of calling just the
2495         initialize*MIMETypes() functions needed to ensure the information required. For instance, getPDFMIMETypes()
2496         currently calls initializeMIMETypeRegistry() if the pdfMIMETypes dictionary doesn't exist, when it really only
2497         needs to ensure that the pdfMIMETypes is initialized, for which initializePDFMIMETypes() is sufficient.
2498
2499         * platform/MIMETypeRegistry.cpp:
2500         (WebCore::initializeSupportedImageMIMETypes):
2501         (WebCore::initializeSupportedJavaScriptMIMETypes):
2502         (WebCore::initializePDFMIMETypes):
2503         (WebCore::initializeSupportedNonImageMimeTypes):
2504         (WebCore::initializeUnsupportedTextMIMETypes):
2505
2506         Move MIME type dictionary creation into initialize*MIMETypes() helpers. Additionally, remove
2507         initializePDFAndPostScriptMIMETypes, which is no longer necessary.
2508
2509         (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
2510         (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType):
2511         (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
2512         (WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType):
2513         (WebCore::MIMETypeRegistry::isUnsupportedTextMIMEType):
2514         (WebCore::MIMETypeRegistry::isPDFOrPostScriptMIMEType):
2515
2516         Tweak to check that the type isPDFMIMEType(), or that it's otherwise "application/postscript".
2517
2518         (WebCore::MIMETypeRegistry::isPDFMIMEType):
2519         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes):
2520         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes):
2521         (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes):
2522         (WebCore::MIMETypeRegistry::getPDFMIMETypes):
2523         (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes):
2524
2525         Call only the relevant MIME type initializers when needed.
2526
2527         (WebCore::initializePostScriptMIMETypes): Deleted.
2528         (WebCore::initializeMIMETypeRegistry): Deleted.
2529         (WebCore::MIMETypeRegistry::getPDFAndPostScriptMIMETypes): Deleted.
2530
2531         Remove an unused and unexported function.
2532
2533         * platform/MIMETypeRegistry.h:
2534
2535 2017-10-23  Andy Estes  <aestes@apple.com>
2536
2537         [Payment Request] Take the JSC API lock before creating the PaymentResponse.details object
2538         https://bugs.webkit.org/show_bug.cgi?id=178686
2539
2540         Reviewed by Keith Miller.
2541
2542         This fixes several flaky crashes in http/tests/paymentrequest/ after r223855.
2543
2544         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2545         (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
2546
2547 2017-10-23  Joseph Pecoraro  <pecoraro@apple.com>
2548
2549         Web Inspector: Please support HAR Export for network traffic
2550         https://bugs.webkit.org/show_bug.cgi?id=146692
2551         <rdar://problem/7463672>
2552
2553         Reviewed by Brian Burg.
2554
2555         Tests: http/tests/inspector/network/har/har-basic.html
2556                http/tests/inspector/network/har/har-page.html
2557
2558         * inspector/InspectorNetworkAgent.cpp:
2559         (WebCore::InspectorNetworkAgent::willSendRequest):
2560         Include the wall time when sending a request. This is needed for HAR to
2561         include a wall time, and can be used for Cookie expiration time calculation
2562         as well.
2563
2564 2017-10-23  Andy Estes  <aestes@apple.com>
2565
2566         [Payment Request] Resolve PaymentRequest.show()'s accept promise when a payment is authorized
2567         https://bugs.webkit.org/show_bug.cgi?id=178609
2568         <rdar://problem/33542813>
2569
2570         Reviewed by Alex Christensen.
2571
2572         This patch implements the logic for resolving PaymentRequest.show()'s accept promise when
2573         the user authorizes a payment, and implements PaymentResponse.complete().
2574
2575         Tests: http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html
2576                http/tests/paymentrequest/payment-response-complete-method.https.html
2577                http/tests/paymentrequest/payment-response-methodName-attribute.https.html
2578                http/tests/paymentrequest/payment-response-payerEmail-attribute.https.html
2579                http/tests/paymentrequest/payment-response-payerName-attribute.https.html
2580                http/tests/paymentrequest/payment-response-payerPhone-attribute.https.html
2581
2582         * DerivedSources.make:
2583         * Modules/applepay/ApplePayPaymentContact.h:
2584         * Modules/applepay/Payment.h:
2585         (WebCore::Payment::Payment): Deleted.
2586         (WebCore::Payment::pkPayment const): Deleted.
2587         * Modules/applepay/PaymentContact.h:
2588         (WebCore::PaymentContact::PaymentContact): Deleted.
2589         (WebCore::PaymentContact::pkContact const): Deleted.
2590         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
2591         (WebCore::convert):
2592         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2593         (WebCore::ApplePayPaymentHandler::hasActiveSession):
2594         (WebCore::ApplePayPaymentHandler::ApplePayPaymentHandler):
2595         (WebCore::ApplePayPaymentHandler::document):
2596         (WebCore::ApplePayPaymentHandler::paymentCoordinator):
2597         (WebCore::ApplePayPaymentHandler::convertData):
2598         (WebCore::ApplePayPaymentHandler::show):
2599         (WebCore::ApplePayPaymentHandler::hide):
2600         (WebCore::ApplePayPaymentHandler::canMakePayment):
2601         (WebCore::ApplePayPaymentHandler::complete):
2602         (WebCore::convert):
2603         (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
2604         (WebCore::ApplePayPaymentHandler::didSelectShippingMethod):
2605         (WebCore::ApplePayPaymentHandler::didSelectShippingContact):
2606         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
2607         * Modules/paymentrequest/PaymentAddress.h:
2608         * Modules/paymentrequest/PaymentAddress.idl:
2609         * Modules/paymentrequest/PaymentHandler.cpp:
2610         (WebCore::PaymentHandler::create):
2611         * Modules/paymentrequest/PaymentHandler.h:
2612         * Modules/paymentrequest/PaymentRequest.cpp:
2613         (WebCore::PaymentRequest::show):
2614         (WebCore::PaymentRequest::stop):
2615         (WebCore::PaymentRequest::canMakePayment):
2616         (WebCore::PaymentRequest::canSuspendForDocumentSuspension const):
2617         (WebCore::PaymentRequest::shippingAddressChanged):
2618         (WebCore::PaymentRequest::shippingOptionChanged):
2619         (WebCore::PaymentRequest::accept):
2620         (WebCore::PaymentRequest::complete):
2621         * Modules/paymentrequest/PaymentRequest.h:
2622         * Modules/paymentrequest/PaymentResponse.cpp:
2623         (WebCore::PaymentResponse::PaymentResponse):
2624         (WebCore::PaymentResponse::complete):
2625         * Modules/paymentrequest/PaymentResponse.h:
2626         * WebCore.xcodeproj/project.pbxproj:
2627         * testing/Internals.cpp:
2628         (WebCore::Internals::Internals):
2629         (WebCore::Internals::mockPaymentCoordinator const):
2630         * testing/Internals.h:
2631         * testing/Internals.idl:
2632         * testing/MockPayment.h: Added.
2633         * testing/MockPaymentAddress.h: Added.
2634         * testing/MockPaymentAddress.idl: Added.
2635         * testing/MockPaymentContact.h: Added.
2636         * testing/MockPaymentCoordinator.cpp:
2637         (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
2638         (WebCore::MockPaymentCoordinator::openPaymentSetup):
2639         (WebCore::dispatchIfShowing):
2640         (WebCore::MockPaymentCoordinator::showPaymentUI):
2641         (WebCore::MockPaymentCoordinator::completeMerchantValidation):
2642         (WebCore::MockPaymentCoordinator::completePaymentSession):
2643         (WebCore::MockPaymentCoordinator::abortPaymentSession):
2644         (WebCore::MockPaymentCoordinator::cancelPaymentSession):
2645         (WebCore::MockPaymentCoordinator::paymentCoordinatorDestroyed):
2646         * testing/MockPaymentCoordinator.h:
2647         * testing/MockPaymentCoordinator.idl: Added.
2648
2649 2017-10-23  Dean Jackson  <dino@apple.com>
2650
2651         Attempt to stop iOS Simulator tests from failing because
2652         we don't support Accelerated ImageBuffer.
2653
2654         * html/ImageBitmap.cpp:
2655
2656 2017-10-23  Zalan Bujtas  <zalan@apple.com>
2657
2658         [FrameView::layout cleanup] Make m_subtreeLayoutRoot weak.
2659         https://bugs.webkit.org/show_bug.cgi?id=178621
2660         <rdar://problem/35110321>
2661
2662         Reviewed by Simon Fraser.
2663
2664         This patch turn m_subtreeLayoutRoot into a weak pointer to handle both the optional and the mutation cases.
2665
2666         Covered by existing cases.
2667
2668         * page/FrameView.cpp:
2669         (WebCore::FrameView::reset):
2670         (WebCore::FrameView::willDestroyRenderTree):
2671         (WebCore::FrameView::didDestroyRenderTree):
2672         (WebCore::FrameView::calculateScrollbarModesForLayout):
2673         (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
2674         (WebCore::FrameView::canPerformLayout const):
2675         (WebCore::FrameView::layout): WeakPtr<RenderElement> protects us from recursive layouts triggering UAF on layoutRoot.
2676         (WebCore::FrameView::convertSubtreeLayoutToFullLayout):
2677         (WebCore::FrameView::scheduleRelayout):
2678         (WebCore::FrameView::scheduleRelayoutOfSubtree):
2679         (WebCore::FrameView::needsLayout const):
2680         (WebCore::FrameView::autoSizeIfEnabled):
2681         * page/FrameView.h:
2682
2683 2017-10-23  Keith Miller  <keith_miller@apple.com>
2684
2685         Unreviewed, fix windows build.
2686
2687         * CMakeLists.txt:
2688
2689 2017-10-23  Keith Miller  <keith_miller@apple.com>
2690
2691         Move shared accessibility and animiations files to unified sources.
2692         https://bugs.webkit.org/show_bug.cgi?id=178677
2693
2694         Reviewed by Tim Horton.
2695
2696         * Sources.txt:
2697         * WebCore.xcodeproj/project.pbxproj:
2698
2699 2017-10-23  Chris Dumez  <cdumez@apple.com>
2700
2701         Drop confusing Event::dispatched() method
2702         https://bugs.webkit.org/show_bug.cgi?id=178670
2703
2704         Reviewed by Youenn Fablet.
2705
2706         Drop confusing Event::dispatched() method. What the call sites want to do is check
2707         that the Event's "dispatch" flag is set:
2708         - https://dom.spec.whatwg.org/#dispatch-flag
2709
2710         This flag gets set at the beginning of dispatchEvent() and unset at the end of
2711         dispatchEvent():
2712         - https://dom.spec.whatwg.org/#ref-for-dispatch-flag③
2713
2714         See as an example event.initEvent():
2715         - https://dom.spec.whatwg.org/#dom-event-initevent
2716
2717         The right way to check the Event's "dispatch" flag is the Event::isBeingDispatched()
2718         method, so use this instead. One side effect of this change is that it is now
2719         possible to call the init*Event() method on events that have already been dispatched
2720         in order to dispatch them again, as per the specification.
2721
2722         Test: fast/events/initEvent-after-dispatching.html
2723
2724         * dom/CompositionEvent.cpp:
2725         (WebCore::CompositionEvent::initCompositionEvent):
2726         * dom/DeviceMotionEvent.cpp:
2727         (WebCore::DeviceMotionEvent::initDeviceMotionEvent):
2728         * dom/DeviceOrientationEvent.cpp:
2729         (WebCore::DeviceOrientationEvent::initDeviceOrientationEvent):
2730         * dom/Event.h:
2731         * dom/HashChangeEvent.h:
2732         * dom/KeyboardEvent.cpp:
2733         (WebCore::KeyboardEvent::initKeyboardEvent):
2734         * dom/MessageEvent.cpp:
2735         (WebCore::MessageEvent::initMessageEvent):
2736         * dom/MouseEvent.cpp:
2737         (WebCore::MouseEvent::initMouseEvent):
2738         * dom/OverflowEvent.cpp:
2739         (WebCore::OverflowEvent::initOverflowEvent):
2740         * dom/TextEvent.cpp:
2741         (WebCore::TextEvent::initTextEvent):
2742         * dom/TouchEvent.cpp:
2743         (WebCore::TouchEvent::initTouchEvent):
2744         * dom/UIEvent.cpp:
2745         (WebCore::UIEvent::initUIEvent):
2746         * dom/WheelEvent.cpp:
2747         (WebCore::WheelEvent::initWheelEvent):
2748         * storage/StorageEvent.cpp:
2749         (WebCore::StorageEvent::initStorageEvent):
2750
2751 2017-10-23  Antti Koivisto  <antti@apple.com>
2752
2753         Remember previous child renderer during render tree update
2754         https://bugs.webkit.org/show_bug.cgi?id=178659
2755
2756         Reviewed by Zalan Bujtas.
2757
2758         We shouldn't need to recompute the previous renderer, we know it already.
2759
2760         * style/RenderTreePosition.cpp:
2761         (WebCore::RenderTreePosition::previousSiblingRenderer const): Deleted.
2762
2763             No longer needed. This was also subtly wrong as doesn't take display:contents into account.
2764
2765         * style/RenderTreePosition.h:
2766         * style/RenderTreeUpdater.cpp:
2767         (WebCore::RenderTreeUpdater::updateRenderTree):
2768         (WebCore::RenderTreeUpdater::textRendererIsNeeded):
2769
2770             Use the saved previous renderer.
2771
2772         (WebCore::RenderTreeUpdater::updateTextRenderer):
2773         (WebCore::RenderTreeUpdater::storePreviousRenderer):
2774
2775             Save the previous renderere as we walk the tree.
2776
2777         (WebCore::textRendererIsNeeded): Deleted.
2778         * style/RenderTreeUpdater.h:
2779
2780 2017-10-23  Keith Miller  <keith_miller@apple.com>
2781
2782         Add Shared Modules files to the unified source build.
2783         https://bugs.webkit.org/show_bug.cgi?id=178675
2784
2785         Reviewed by Tim Horton.
2786
2787         This patch all the Modules sources files shared across all ports to
2788         unified sources.
2789
2790         * CMakeLists.txt:
2791         * Sources.txt:
2792         * WebCore.xcodeproj/project.pbxproj:
2793
2794 2017-10-22  Dean Jackson  <dino@apple.com>
2795
2796         Implement drawImage(ImageBitmap) on 2d canvas
2797         https://bugs.webkit.org/show_bug.cgi?id=178653
2798         <rdar://problem/35104360>
2799
2800         Reviewed by Antoine Quint.
2801
2802         Implement CanvasRenderingContext2D::drawImage with ImageBitmap.
2803         It's probably not going to be a very common operation, but
2804         it importantly allows us to test the ImageBitmap creation
2805         code.
2806
2807         Test: http/wpt/2dcontext/imagebitmap/drawImage-ImageBitmap.html
2808
2809         * html/ImageBitmap.cpp:
2810         (WebCore::taintsOrigin): New helper function to determine if a
2811         CachedImage would provide a clean origin.
2812         (WebCore::ImageBitmap::createPromise): Set the flag that records
2813         if this ImageBitmap has a clean origin.
2814         * html/ImageBitmap.h:
2815         (WebCore::ImageBitmap::buffer): Exposes the ImageBuffer backing
2816         store, allowing access to the data for drawing.
2817         (WebCore::ImageBitmap::originClean const): Is this ImageBitmap
2818         going to taint a destination.
2819         * html/canvas/CanvasRenderingContext.cpp:
2820         (WebCore::CanvasRenderingContext::wouldTaintOrigin): Implement
2821         the ImageBitmap version of this template function.
2822         * html/canvas/CanvasRenderingContext.h:
2823         * html/canvas/CanvasRenderingContext2D.cpp:
2824         (WebCore::CanvasRenderingContext2D::drawImage): Implement the
2825         actual drawing of an ImageBitmap.
2826
2827 2017-10-23  Daniel Bates  <dabates@apple.com>
2828
2829         Unreviewed, rolling out r223699.
2830
2831         Caused regressions with right-to-left text selection and
2832         painting of markers in flipped writing mode and in overlapping
2833         lines. Will investigate offline.
2834
2835         Reverted changeset:
2836
2837         "Share logic in InlineTextBox to compute selection rect"
2838         https://bugs.webkit.org/show_bug.cgi?id=178232
2839         https://trac.webkit.org/changeset/223699
2840
2841 2017-10-23  Youenn Fablet  <youenn@apple.com>
2842
2843         Create a Fetch event when ServiceWorker has to handle a fetch
2844         https://bugs.webkit.org/show_bug.cgi?id=178491
2845
2846         Reviewed by Chris Dumez.
2847
2848         Covered by existing test.
2849
2850         Updating FetchEvent to pass a FetchResponse* within its onResponse callback.
2851         Making it a CompletionHandler.
2852         Fixing a check on respondWith to ensure that event is dispatched when respondWith is called.
2853
2854         Adding ServiceWorkerFetch class to handle the creation of the fetch event, waiting for the fetch event to be responded
2855         and processing when fetch event is responded.
2856         ServiceWorkerFetchTask takes a client to which will be sent the response body or the error.
2857         WebKit implementation of it will be to send the related IPC message back to the WebProcess that made the fetch request.
2858
2859         Adding a method to ServiceWorkerThread to create the fetch event on worker thread and dispatch on the global scope.
2860
2861         * WebCore.xcodeproj/project.pbxproj:
2862         * platform/network/ResourceResponseBase.h:
2863         * testing/Internals.cpp:
2864         (WebCore::Internals::waitForFetchEventToFinish):
2865         * workers/service/FetchEvent.cpp:
2866         (WebCore::FetchEvent::~FetchEvent):
2867         (WebCore::FetchEvent::respondWith):
2868         (WebCore::FetchEvent::onResponse):
2869         (WebCore::FetchEvent::respondWithError):
2870         (WebCore::FetchEvent::processResponse):
2871         (WebCore::FetchEvent::promiseIsSettled):
2872         * workers/service/FetchEvent.h:
2873         * workers/service/context/ServiceWorkerFetch.cpp: Added.
2874         (WebCore::ServiceWorkerFetch::dispatchFetchTask):
2875         (WebCore::ServiceWorkerFetch::processResponse):
2876         * workers/service/context/ServiceWorkerFetch.h: Added.
2877         * workers/service/context/ServiceWorkerThread.cpp:
2878         (WebCore::m_workerObjectProxy):
2879         (WebCore::ServiceWorkerThread::dispatchFetchEvent):
2880         * workers/service/context/ServiceWorkerThread.h:
2881
2882 2017-10-23  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2883
2884         [Curl] Fix authentication related bugs
2885         https://bugs.webkit.org/show_bug.cgi?id=178652
2886
2887         Reviewed by Alex Christensen.
2888
2889         * platform/network/curl/AuthenticationChallengeCurl.cpp:
2890         (WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
2891         * platform/network/curl/CurlContext.cpp:
2892         (WebCore::CurlHandle::setHttpAuthUserPass):
2893         * platform/network/curl/CurlRequest.cpp:
2894         (WebCore::CurlRequest::setUserPass):
2895         (WebCore::CurlRequest::setupTransfer):
2896         (WebCore::CurlRequest::didReceiveHeader):
2897         * platform/network/curl/CurlRequest.h:
2898
2899 2017-10-23  Matt Lewis  <jlewis3@apple.com>
2900
2901         Unreviewed, rolling out r223820.
2902
2903         This caused a build break on Windows.
2904
2905         Reverted changeset:
2906
2907         "Web Inspector: Remove unused Console.setMonitoringXHREnabled"
2908         https://bugs.webkit.org/show_bug.cgi?id=178617
2909         https://trac.webkit.org/changeset/223820
2910
2911 2017-10-23  Zalan Bujtas  <zalan@apple.com>
2912
2913         Call FrameView::scheduleSelectionUpdate when selection needs repainting after layout instead of setting the RenderView dirty.
2914         https://bugs.webkit.org/show_bug.cgi?id=178651
2915         <rdar://problem/35117448>
2916
2917         Reviewed by Antti Koivisto.
2918
2919         Calling setNeedsLayout() on the RenderView to trigger selection update is problematic in 2 different ways:
2920         1. marking the root renderer dirty does not trigger layout (this is very specific to the root,
2921         other renderers do trigger layout). It means that it works as long as someone else schedules a layout.
2922         2. when a subtree layout is already scheduled and we mark the root renderer dirty, the root gets stuck with
2923         the dirty flag (since the entry point for the subsequent layout is a descendant of the root and not the root itself).
2924
2925         This patch addresses these issues by scheduling/converting subtree layout when needed.  
2926
2927         Covered by fast/dynamic/remove-invisible-node-inside-selection.html/remove-node-inside-selection.html
2928
2929         * editing/FrameSelection.cpp:
2930         (WebCore::FrameSelection::respondToNodeModification):
2931         * page/FrameView.cpp:
2932         (WebCore::FrameView::scheduleSelectionUpdate):
2933         * page/FrameView.h:
2934
2935 2017-10-23  Miguel Gomez  <magomez@igalia.com>
2936
2937         [TexMap] Remove GraphicsContext3D usage from TextureMapperShaderProgram
2938         https://bugs.webkit.org/show_bug.cgi?id=175425
2939
2940         Reviewed by Žan Doberšek.
2941
2942         Remove usage of the GraphicsContext3D class in TextureMapperShaderProgram.
2943         Direct OpenGL API calls, types and constants are used instead.
2944
2945         By removing GraphicsContext3D, we don't use ANGLE anymore to perform the
2946         shader adaptation to the used OpenGL/GLES2 version, so we need to do that
2947         inside TextureMapperShaderProgram. The main changes required for this are
2948         adding the #version directive and use in/out to define input/output parameters
2949         when using OpenGL >= 3.2, and defining the default precision only when using
2950         GLES2.
2951
2952         Besides that, now that VideoTextureCopierGStreamer doesn't have its own
2953         GraphicsContext3D, we need to add a VAO to it when using OpenGL >= 3.2.
2954
2955         Based on a previous patch by Žan Doberšek <zdobersek@igalia.com>.
2956
2957         No behavior change.
2958
2959         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.cpp:
2960         (WebCore::VideoTextureCopierGStreamer::VideoTextureCopierGStreamer):
2961         (WebCore::VideoTextureCopierGStreamer::~VideoTextureCopierGStreamer):
2962         (WebCore::VideoTextureCopierGStreamer::copyVideoTextureToPlatformTexture):
2963         * platform/graphics/gstreamer/VideoTextureCopierGStreamer.h:
2964         * platform/graphics/texmap/TextureMapperGL.cpp:
2965         (WebCore::TextureMapperGLData::getShaderProgram):
2966         (WebCore::prepareFilterProgram):
2967         (WebCore::TextureMapperGL::drawTexture):
2968         (WebCore::TextureMapperGL::drawFiltered):
2969         * platform/graphics/texmap/TextureMapperShaderProgram.cpp:
2970         (WebCore::TextureMapperShaderProgram::create):
2971         (WebCore::getShaderLog):
2972         (WebCore::getProgramLog):
2973         (WebCore::TextureMapperShaderProgram::TextureMapperShaderProgram):
2974         (WebCore::TextureMapperShaderProgram::~TextureMapperShaderProgram):
2975         (WebCore::TextureMapperShaderProgram::setMatrix):
2976         (WebCore::TextureMapperShaderProgram::getLocation):
2977         * platform/graphics/texmap/TextureMapperShaderProgram.h:
2978         (WebCore::TextureMapperShaderProgram::programID const):
2979
2980 2017-10-22  Sam Weinig  <sam@webkit.org>
2981
2982         [Settings] Replace current Settings generation with template file based approach
2983         https://bugs.webkit.org/show_bug.cgi?id=178634
2984
2985         Reviewed by Joseph Pecoraro.
2986
2987         This replaces the recently added python based Settings generation with a generator
2988         built in ruby, so we can take advantage of ERB for templating. The result has much
2989         of the logic in the templates and as a result feels much easier to follow and cleaner.
2990
2991         Since I was moving things to ruby, I took the opertunity to switch the Settings definition
2992         file from our .in format to yaml, which is quite a bit easier to read.
2993
2994         * CMakeLists.txt:
2995         * DerivedSources.make:
2996         * Scripts/GenerateSettings: Removed.
2997         * Scripts/GenerateSettings.py: Removed.
2998         * Scripts/GenerateSettings.rb: Added.
2999         * Scripts/GenerateSettings/GenerateInternalSettingsHeaderFile.py: Removed.
3000         * Scripts/GenerateSettings/GenerateInternalSettingsIDLFile.py: Removed.
3001         * Scripts/GenerateSettings/GenerateInternalSettingsImplementationFile.py: Removed.
3002         * Scripts/GenerateSettings/GenerateSettings.py: Removed.
3003         * Scripts/GenerateSettings/GenerateSettingsHeaderFile.py: Removed.
3004         * Scripts/GenerateSettings/GenerateSettingsImplementationFile.py: Removed.
3005         * Scripts/GenerateSettings/Settings.py: Removed.
3006         * Scripts/GenerateSettings/__init__.py: Removed.
3007         * Scripts/SettingsTemplates: Added.
3008         * Scripts/SettingsTemplates/InternalSettingsGenerated.cpp.erb: Added.
3009         * Scripts/SettingsTemplates/InternalSettingsGenerated.h.erb: Added.
3010         * Scripts/SettingsTemplates/InternalSettingsGenerated.idl.erb: Added.
3011         * Scripts/SettingsTemplates/Settings.cpp.erb: Added.
3012         * Scripts/SettingsTemplates/Settings.h.erb: Added.
3013         * WebCore.xcodeproj/project.pbxproj:
3014         * WebCoreMacros.cmake:
3015         * page/Settings.in: Removed.
3016         * page/Settings.yaml: Added.
3017
3018 2017-10-22  Joseph Pecoraro  <pecoraro@apple.com>
3019
3020         REGRESSION(r219675): Web Inspector: CommandLineAPI getEventListeners does not work
3021         https://bugs.webkit.org/show_bug.cgi?id=178650
3022         <rdar://problem/35116347>
3023
3024         Reviewed by Sam Weinig.
3025
3026         Test: inspector/console/command-line-api-getEventListeners.html
3027
3028         * inspector/CommandLineAPIHost.cpp:
3029         (WebCore::listenerEntriesFromListenerInfo):
3030         Fix typo.
3031
3032         (WebCore::CommandLineAPIHost::getEventListeners):
3033         Fix incorrect early return.
3034
3035         * inspector/CommandLineAPIHost.h:
3036         * inspector/CommandLineAPIHost.idl:
3037         Add more attributes about the listener. These new attributes match output from Chrome.
3038
3039 2017-10-22  Antoine Quint  <graouts@apple.com>
3040
3041         [Web Animations] Add animations to the timeline
3042         https://bugs.webkit.org/show_bug.cgi?id=178643
3043
3044         Reviewed by Dean Jackson.
3045
3046         If a timeline is provided as a parameter to the Animation constructor,
3047         add it to the timeline, and remove it when the object is destroyed.
3048
3049         We also start the basic mechanism to dump the contents of a timeline
3050         as text for testing purposes, currently only logging the number of
3051         animations in a timeline and just logging the class name for animation
3052         themselves.
3053
3054         Test: webanimations/animation-creation-addition.html
3055
3056         * animation/AnimationTimeline.cpp:
3057         (WebCore::AnimationTimeline::description):
3058         * animation/AnimationTimeline.h:
3059         * animation/AnimationTimeline.idl:
3060         * animation/WebAnimation.cpp:
3061         (WebCore::WebAnimation::create):
3062         (WebCore::WebAnimation::~WebAnimation):
3063         (WebCore::WebAnimation::description):
3064         * animation/WebAnimation.h:
3065         * testing/Internals.cpp:
3066         (WebCore::Internals::timelineDescription):
3067         * testing/Internals.h:
3068         * testing/Internals.idl:
3069
3070 2017-10-21  Zalan Bujtas  <zalan@apple.com>
3071
3072         [FrameView::layout cleanup] Drop allowSubtree parameter
3073         https://bugs.webkit.org/show_bug.cgi?id=178623
3074         <rdar://problem/35111012>
3075
3076         Reviewed by Sam Weinig.
3077
3078         This flag is only set through ::forceLayout(). Let's just convert the subtree layout
3079         to full layout right before calling ::layout().
3080
3081         No change in functionality.
3082
3083         * page/FrameView.cpp:
3084         (WebCore::FrameView::handleLayoutWithFrameFlatteningIfNeeded):
3085         (WebCore::FrameView::layout):
3086         (WebCore::FrameView::startLayoutAtMainFrameViewIfNeeded):
3087         (WebCore::FrameView::forceLayout):
3088         * page/FrameView.h:
3089
3090 2017-10-21  Joseph Pecoraro  <pecoraro@apple.com>
3091
3092         Web Inspector: Remove unused Console.setMonitoringXHREnabled
3093         https://bugs.webkit.org/show_bug.cgi?id=178617
3094
3095         Reviewed by Sam Weinig.
3096
3097         * inspector/InspectorInstrumentation.cpp:
3098         (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
3099         * inspector/InspectorInstrumentation.h:
3100         (WebCore::InspectorInstrumentation::didFinishXHRLoading):
3101         * inspector/WebConsoleAgent.cpp:
3102         (WebCore::WebConsoleAgent::setMonitoringXHREnabled): Deleted.
3103         (WebCore::WebConsoleAgent::didFinishXHRLoading): Deleted.
3104         * inspector/WebConsoleAgent.h:
3105         Remove XHR monitoring code.
3106
3107         * xml/XMLHttpRequest.h:
3108         * xml/XMLHttpRequest.cpp:
3109         (WebCore::XMLHttpRequest::send):
3110         (WebCore::XMLHttpRequest::didFinishLoading):
3111         (WebCore::XMLHttpRequest::setLastSendLineAndColumnNumber): Deleted.
3112         * xml/XMLHttpRequest.idl:
3113         Remove now unused state on XHR and ExecState requirement for send().
3114
3115 2017-10-21  Dean Jackson  <dino@apple.com>
3116
3117         createImageBitmap with basic HTMLImageElement
3118         https://bugs.webkit.org/show_bug.cgi?id=178619
3119         <rdar://problem/35104118>
3120
3121         Reviewed by Antoine Quint.
3122
3123         Implement the basic infrastructure for creating
3124         an ImageBitmap from an HTMLImageElement.
3125
3126         Test: http/wpt/2dcontext/imagebitmap/createImageBitmap.html
3127
3128         * html/ImageBitmap.cpp:
3129         (WebCore::ImageBitmap::createPromise): Create the image buffer
3130         and draw the image into its backing store.
3131         * html/ImageBitmap.h:
3132
3133 2017-10-21  Antoine Quint  <graouts@apple.com>
3134
3135         [Web Animations] Add bindings to unified sources
3136         https://bugs.webkit.org/show_bug.cgi?id=178620
3137
3138         Reviewed by Dean Jackson.
3139
3140         Removing the Web Animations bindings from the WebCore target and adding them to the unified sources list instead.
3141
3142         * Sources.txt:
3143         * WebCore.xcodeproj/project.pbxproj:
3144
3145 2017-10-21  Tim Horton  <timothy_horton@apple.com>
3146
3147         Fix the Mac CMake build
3148
3149         * PlatformMac.cmake:
3150
3151 2017-10-21  Antti Koivisto  <antti@apple.com>
3152
3153         Support ::before/::after pseudo elements with display:contents
3154         https://bugs.webkit.org/show_bug.cgi?id=178584
3155
3156         Reviewed by Ryosuke Niwa.
3157
3158         This is cases like
3159
3160         ::before { display:contents; content:'foo' }
3161
3162         * css/StyleResolver.cpp:
3163         (WebCore::StyleResolver::adjustDisplayContentsStyle): Added.
3164
3165             Allow display:contents on pseudo elements.
3166             Factor into function.
3167
3168         (WebCore::StyleResolver::adjustRenderStyle):
3169         * dom/PseudoElement.h:
3170
3171             Add a weak vector of content renderers.
3172
3173         * style/RenderTreePosition.h:
3174         (WebCore::RenderTreePosition::moveToLastChild):
3175
3176             Add a way to set a valid render tree position without a node.
3177
3178         * style/RenderTreeUpdaterGeneratedContent.cpp:
3179         (WebCore::createContentRenderers):
3180
3181             Take RenderTreePosition.
3182
3183         (WebCore::updateStyleForContentRenderers):
3184
3185             Update based on the content renderer vector instead of doing a tree walk.
3186
3187         (WebCore::removeAndDestroyContentRenderers):
3188
3189             Helper for destroying content renderers.
3190
3191         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
3192
3193             In the normal case create a render tree position for the pseudo element renderer and
3194             use RenderTreePosition::moveToLastChild to make it a valid position. (The existing
3195             RenderTreePosition interface didn't have way to move to positions in anonymous boxes)
3196
3197             In the case of a non box generating display:contents pseudo element, use the current
3198             render tree position instead.
3199
3200             Ensure that pseudo element renderers are destroyed before creating the new ones since in
3201             display:contents case they are not descendants of the pseudo renderer and don't get cleared
3202             automatically.
3203
3204 2017-10-20  Zalan Bujtas  <zalan@apple.com>
3205
3206         [FrameView::layout cleanup] Use SetForScope to ensure layout state correctness
3207         https://bugs.webkit.org/show_bug.cgi?id=178604
3208         <rdar://problem/35101890>
3209
3210         Reviewed by Simon Fraser.
3211
3212         SetForScope guarantees state correctness even with nested layouts. This is a lot less
3213         error prone than resetting the state value after each potential recursive call.
3214
3215         Covered by existing tests.
3216
3217         * page/FrameView.cpp:
3218         (WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange): This layout state does
3219         not look too useful.
3220         (WebCore::FrameView::layout):
3221         * page/FrameView.h: While performPostLayoutTasks() is somewhat special since it can either be sync or async,
3222         so painting should be allowed in both cases.
3223
3224 2017-10-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
3225
3226         SVGPathElement should cache the built-up Path of its non animating pathByteStream()
3227         https://bugs.webkit.org/show_bug.cgi?id=178248
3228
3229         Reviewed by Simon Fraser.
3230
3231         Instead of creating a Path object from the non animating pathByteStream()
3232         every time we need to updatePathFromPathElement(), the Path object can be
3233         cached once it is created and used for later calls.
3234
3235         * html/canvas/Path2D.h: buildPathFromString() now returns a Path.
3236
3237         * platform/graphics/Path.h:
3238         * platform/graphics/cairo/PathCairo.cpp:
3239         (WebCore::Path::Path):
3240         (WebCore::Path::operator=):
3241         * platform/graphics/cg/PathCG.cpp:
3242         (WebCore::Path::Path):
3243         (WebCore::Path::operator=):
3244         * platform/graphics/win/PathDirect2D.cpp:
3245         (WebCore::Path::Path):
3246         (WebCore::Path::operator=):
3247         Define the move constructor and the move assignment operator for the the
3248         Path class so a statement like "Path path = buildPathFromString()" won't 
3249         go through the copy constructor and the copy assignment operator.
3250
3251         * rendering/style/BasicShapes.cpp:
3252         (WebCore::SVGPathTranslatedByteStream::path const):
3253         * rendering/svg/RenderSVGResourceClipper.cpp:
3254         (WebCore::RenderSVGResourceClipper::pathOnlyClipping):
3255         * rendering/svg/RenderSVGShape.cpp:
3256         (WebCore::RenderSVGShape::updateShapeFromElement):
3257         * rendering/svg/RenderSVGTextPath.cpp:
3258         (WebCore::RenderSVGTextPath::layoutPath const):
3259         * rendering/svg/SVGPathData.cpp:
3260         (WebCore::pathFromCircleElement):
3261         (WebCore::pathFromEllipseElement):
3262         (WebCore::pathFromLineElement):
3263         (WebCore::pathFromPathElement):
3264         (WebCore::pathFromPolygonElement):
3265         (WebCore::pathFromPolylineElement):
3266         (WebCore::pathFromRectElement):
3267         (WebCore::pathFromGraphicsElement):
3268         (WebCore::updatePathFromCircleElement): Deleted.
3269         (WebCore::updatePathFromEllipseElement): Deleted.
3270         (WebCore::updatePathFromLineElement): Deleted.
3271         (WebCore::updatePathFromPathElement): Deleted.
3272         (WebCore::updatePathFromPolygonElement): Deleted.
3273         (WebCore::updatePathFromPolylineElement): Deleted.
3274         (WebCore::updatePathFromRectElement): Deleted.
3275         (WebCore::updatePathFromGraphicsElement): Deleted.
3276         * rendering/svg/SVGPathData.h:
3277         * svg/SVGAnimateMotionElement.cpp:
3278         (WebCore::SVGAnimateMotionElement::parseAttribute):
3279         (WebCore::SVGAnimateMotionElement::updateAnimationPath):
3280         * svg/SVGGraphicsElement.cpp:
3281         (WebCore::SVGGraphicsElement::toClipPath):
3282         * svg/SVGGraphicsElement.h:
3283         Rename updatePathFromElement() to pathFromGraphicsElement().
3284
3285         * svg/SVGPathElement.cpp:
3286         (WebCore::SVGPathElement::parseAttribute): Clear the cache when
3287         m_pathByteStream changes.
3288         (WebCore::SVGPathElement::pathForByteStream const): Caches the m_cachedPath
3289         if it is null.
3290         (WebCore::SVGPathElement::pathSegListChanged): Clear the cache when
3291         m_pathByteStream changes.
3292
3293         * svg/SVGPathElement.h:
3294         * svg/SVGPathUtilities.cpp:
3295         (WebCore::buildPathFromString):
3296         (WebCore::buildPathFromByteStream):
3297         * svg/SVGPathUtilities.h:
3298         Make thes buildPathFromString() and buildPathFromByteStream() return Paths.
3299
3300         * svg/SVGUseElement.cpp:
3301         (WebCore::SVGUseElement::toClipPath):
3302         * svg/SVGUseElement.h:
3303         Make these toClipPath() return Path.
3304
3305 2017-10-20  Ryosuke Niwa  <rniwa@webkit.org>
3306
3307         Rename insertedInto and removedFrom to insertedIntoAncestor and removedFromAncestor
3308         https://bugs.webkit.org/show_bug.cgi?id=178605
3309
3310         Reviewed by Andy Estes.
3311
3312         Renamed insertedInto and removedFrom to insertedIntoAncestor and removedFromAncestor respectively
3313         to make it clear that these functions can be called even when node's immediate parent didn't change.
3314
3315         * dom/ContainerNodeAlgorithms.cpp:
3316         (WebCore::notifyNodeInsertedIntoDocument):
3317         (WebCore::notifyNodeInsertedIntoTree):
3318         (WebCore::notifyNodeRemovedFromDocument):
3319         (WebCore::notifyNodeRemovedFromTree):
3320         (WebCore::notifyChildNodeRemoved):
3321         * dom/ContainerNodeAlgorithms.h:
3322         * dom/Element.cpp:
3323         (WebCore::Element::insertedIntoAncestor): Renamed from insertedInto.
3324         (WebCore::Element::removedFromAncestor): Renamed from removedFrom.
3325         * dom/Element.h:
3326         * dom/Node.cpp:
3327         (WebCore::Node::insertedIntoAncestor): 
3328         (WebCore::Node::removedFromAncestor):
3329         (WebCore::Node::removedFrom): Deleted.
3330         * dom/Node.h:
3331         * dom/ProcessingInstruction.cpp:
3332         (WebCore::ProcessingInstruction::insertedIntoAncestor): Renamed from insertedInto.
3333         (WebCore::ProcessingInstruction::removedFromAncestor): Renamed from removedFrom.
3334         * dom/ProcessingInstruction.h:
3335         * dom/ScriptElement.h:
3336         (WebCore::ScriptElement::insertedIntoAncestor const): Renamed from insertedInto.
3337         * dom/ShadowRoot.cpp:
3338         (WebCore::ShadowRoot::insertedIntoAncestor): Renamed from insertedInto.
3339         (WebCore::ShadowRoot::removedFromAncestor): Renamed from removedFrom.
3340         * dom/ShadowRoot.h:
3341         * html/FormAssociatedElement.cpp:
3342         (WebCore::FormAssociatedElement::insertedIntoAncestor): Renamed from insertedInto.
3343         (WebCore::FormAssociatedElement::removedFromAncestor): Renamed from removedFrom.
3344         * html/FormAssociatedElement.h:
3345         * html/HTMLBaseElement.cpp:
3346         (WebCore::HTMLBaseElement::insertedIntoAncestor): Renamed from insertedInto.
3347         (WebCore::HTMLBaseElement::removedFromAncestor): Renamed from removedFrom.
3348         * html/HTMLBaseElement.h:
3349         * html/HTMLBodyElement.cpp:
3350         (WebCore::HTMLBodyElement::insertedIntoAncestor): Renamed from insertedInto.
3351         * html/HTMLBodyElement.h:
3352         * html/HTMLFormControlElement.cpp:
3353         (WebCore::HTMLFormControlElement::insertedIntoAncestor): Renamed from insertedInto.
3354         (WebCore::HTMLFormControlElement::removedFromAncestor): Renamed from removedFrom.
3355         * html/HTMLFormControlElement.h:
3356         * html/HTMLFormControlElementWithState.cpp:
3357         (WebCore::HTMLFormControlElementWithState::insertedIntoAncestor): Renamed from insertedInto.
3358         (WebCore::HTMLFormControlElementWithState::removedFromAncestor): Renamed from removedFrom.
3359         * html/HTMLFormControlElementWithState.h:
3360         * html/HTMLFormElement.cpp:
3361         (WebCore::HTMLFormElement::insertedIntoAncestor): Renamed from insertedInto.
3362         (WebCore::HTMLFormElement::removedFromAncestor): Renamed from removedFrom.
3363         * html/HTMLFormElement.h:
3364         * html/HTMLFrameElementBase.cpp:
3365         (WebCore::HTMLFrameElementBase::insertedIntoAncestor): Renamed from insertedInto.
3366         * html/HTMLFrameElementBase.h:
3367         * html/HTMLFrameSetElement.cpp:
3368         (WebCore::HTMLFrameSetElement::insertedIntoAncestor): Renamed from insertedInto.
3369         (WebCore::HTMLFrameSetElement::removedFromAncestor): Renamed from removedFrom.
3370         * html/HTMLFrameSetElement.h:
3371         * html/HTMLImageElement.cpp:
3372         (WebCore::HTMLImageElement::insertedIntoAncestor): Renamed from insertedInto.
3373         (WebCore::HTMLImageElement::removedFromAncestor): Renamed from removedFrom.
3374         * html/HTMLImageElement.h:
3375         * html/HTMLInputElement.cpp:
3376         (WebCore::HTMLInputElement::insertedIntoAncestor): Renamed from insertedInto.
3377         (WebCore::HTMLInputElement::removedFromAncestor): Renamed from removedFrom.
3378         * html/HTMLInputElement.h:
3379         * html/HTMLLinkElement.cpp:
3380         (WebCore::HTMLLinkElement::insertedIntoAncestor): Renamed from insertedInto.
3381         (WebCore::HTMLLinkElement::removedFromAncestor): Renamed from removedFrom.
3382         * html/HTMLLinkElement.h:
3383         * html/HTMLMapElement.cpp:
3384         (WebCore::HTMLMapElement::insertedIntoAncestor): Renamed from insertedInto.
3385         (WebCore::HTMLMapElement::removedFromAncestor): Renamed from removedFrom.
3386         * html/HTMLMapElement.h:
3387         * html/HTMLMediaElement.cpp:
3388         (WebCore::HTMLMediaElement::insertedIntoAncestor): Renamed from insertedInto.
3389         (WebCore::HTMLMediaElement::removedFromAncestor): Renamed from removedFrom.
3390         * html/HTMLMediaElement.h:
3391         * html/HTMLMetaElement.cpp:
3392         (WebCore::HTMLMetaElement::insertedIntoAncestor): Renamed from insertedInto.
3393         * html/HTMLMetaElement.h:
3394         * html/HTMLObjectElement.cpp:
3395         (WebCore::HTMLObjectElement::insertedIntoAncestor): Renamed from insertedInto.
3396         (WebCore::HTMLObjectElement::removedFromAncestor): Renamed from removedFrom.
3397         * html/HTMLObjectElement.h:
3398         * html/HTMLOptionElement.cpp:
3399         (WebCore::HTMLOptionElement::insertedIntoAncestor): Renamed from insertedInto.
3400         * html/HTMLOptionElement.h:
3401         * html/HTMLScriptElement.cpp:
3402         (WebCore::HTMLScriptElement::insertedIntoAncestor): Renamed from insertedInto.
3403         * html/HTMLScriptElement.h:
3404         * html/HTMLSelectElement.cpp:
3405         (WebCore::HTMLSelectElement::insertedIntoAncestor): Renamed from insertedInto.
3406         * html/HTMLSelectElement.h:
3407         * html/HTMLSlotElement.cpp:
3408         (WebCore::HTMLSlotElement::insertedIntoAncestor): Renamed from insertedInto.
3409         (WebCore::HTMLSlotElement::removedFromAncestor): Renamed from removedFrom.
3410         * html/HTMLSlotElement.h:
3411         * html/HTMLSourceElement.cpp:
3412         (WebCore::HTMLSourceElement::insertedIntoAncestor): Renamed from insertedInto.
3413         (WebCore::HTMLSourceElement::removedFromAncestor): Renamed from removedFrom.
3414         * html/HTMLSourceElement.h:
3415         * html/HTMLStyleElement.cpp:
3416         (WebCore::HTMLStyleElement::insertedIntoAncestor): Renamed from insertedInto.
3417         (WebCore::HTMLStyleElement::removedFromAncestor): Renamed from removedFrom.
3418         * html/HTMLStyleElement.h:
3419         * html/HTMLTextFormControlElement.cpp:
3420         (WebCore::HTMLTextFormControlElement::insertedIntoAncestor): Renamed from insertedInto.
3421         * html/HTMLTextFormControlElement.h:
3422         * html/HTMLTitleElement.cpp:
3423         (WebCore::HTMLTitleElement::insertedIntoAncestor): Renamed from insertedInto.
3424         (WebCore::HTMLTitleElement::removedFromAncestor): Renamed from removedFrom.
3425         * html/HTMLTitleElement.h:
3426         * html/HTMLTrackElement.cpp:
3427         (WebCore::HTMLTrackElement::insertedIntoAncestor): Renamed from insertedInto.
3428         (WebCore::HTMLTrackElement::removedFromAncestor): Renamed from removedFrom.
3429         * html/HTMLTrackElement.h:
3430         * svg/SVGElement.cpp:
3431         (WebCore::SVGElement::removedFromAncestor): Renamed from removedFrom.
3432         (WebCore::SVGElement::insertedIntoAncestor): Renamed from insertedInto.
3433         (WebCore::SVGElement::updateRelativeLengthsInformation):
3434         * svg/SVGElement.h:
3435         * svg/SVGFEImageElement.cpp:
3436         (WebCore::SVGFEImageElement::insertedIntoAncestor): Renamed from insertedInto.
3437         (WebCore::SVGFEImageElement::removedFromAncestor): Renamed from removedFrom.
3438         * svg/SVGFEImageElement.h:
3439         * svg/SVGFontFaceElement.cpp:
3440         (WebCore::SVGFontFaceElement::insertedIntoAncestor): Renamed from insertedInto.
3441         (WebCore::SVGFontFaceElement::removedFromAncestor): Renamed from removedFrom.
3442         * svg/SVGFontFaceElement.h:
3443         * svg/SVGFontFaceUriElement.cpp:
3444         (WebCore::SVGFontFaceUriElement::insertedIntoAncestor): Renamed from insertedInto.