Unreviewed clean-up after r219323
[WebKit.git] / Source / WebCore / ChangeLog
1 2017-07-11  Alex Christensen  <achristensen@webkit.org>
2
3         SharedBuffer::size should return a size_t
4         https://bugs.webkit.org/show_bug.cgi?id=174328
5
6         Reviewed by Andreas Kling.
7
8         No change in behaviour.
9
10         * html/FTPDirectoryDocument.cpp:
11         (WebCore::createTemplateDocumentData):
12         * loader/ContentFilter.cpp:
13         (WebCore::ContentFilter::handleProvisionalLoadFailure):
14         * loader/ResourceLoader.cpp:
15         (WebCore::ResourceLoader::loadDataURL):
16         * loader/ResourceLoader.h:
17         * loader/appcache/ApplicationCacheStorage.cpp:
18         (WebCore::ApplicationCacheStorage::store):
19         * loader/cache/CachedScript.cpp:
20         (WebCore::CachedScript::script):
21         * platform/SharedBuffer.cpp:
22         (WebCore::SharedBuffer::tryCreateArrayBuffer):
23         * platform/SharedBuffer.h:
24
25 2017-07-11  Per Arne Vollan  <pvollan@apple.com>
26
27         [Win] Build error when building WebCore from WebCore.proj project file.
28         https://bugs.webkit.org/show_bug.cgi?id=174330
29
30         Reviewed by Brent Fulgham.
31
32         The CMake variable PAL_DIR should be set in the project file.
33
34         * WebCore.vcxproj/WebCore.proj:
35
36 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
37
38         [SVG] Leak in SVGAnimatedListPropertyTearOff
39         https://bugs.webkit.org/show_bug.cgi?id=172545
40
41         Reviewed by Said Abou-Hallawa.
42
43         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
44         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
45         reference to SVGAnimatedProperty.
46
47         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
48         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
49         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
50         is going to be added to. This effectively creates a reference cycle between the
51         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
52
53         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
54
55         * svg/properties/SVGAnimatedListPropertyTearOff.h:
56
57 2017-07-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
58
59         [GTK] Spin buttons on input type number appear over the value itself for small widths
60         https://bugs.webkit.org/show_bug.cgi?id=173572
61
62         Reviewed by Carlos Garcia Campos.
63
64         When drawing the spin buttons, override the width of the input
65         element to increment it with the width of the spin button.
66         This ensures that we don't end up covering the input values with
67         the spin buttons.
68
69         Do this also for user controlled styles, because most web authors
70         won't test how their site renders on WebKitGTK+, and they will
71         assume spin buttons in the order of 13 pixels wide (that is what
72         most browsers use), but the GTK+ spin button is much wider (66 pixels).
73
74         Test: platform/gtk/fast/forms/number/number-size-spinbutton-nocover.html
75
76         * rendering/RenderTheme.cpp:
77         (WebCore::RenderTheme::adjustStyle):
78         * rendering/RenderThemeGtk.cpp:
79         (WebCore::RenderThemeGtk::adjustTextFieldStyle): Call the theme's adjustTextFieldStyle() also for user controlled styles.
80         (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
81
82 2017-07-11  Youenn Fablet  <youenn@apple.com>
83
84         We should do ICE candidate filtering at the Document level
85         https://bugs.webkit.org/show_bug.cgi?id=173861
86         <rdar://problem/33122058>
87
88         Reviewed by Eric Carlson.
89
90         Tests: http/tests/webrtc/filtering-ice-candidate-cross-origin-frame.html
91                http/tests/webrtc/filtering-ice-candidate-same-origin-frame.html
92                http/tests/webrtc/filtering-ice-candidate-same-origin-frame2.html
93                webrtc/filtering-ice-candidate-after-reload.html
94
95         Making UserMediaRequest disable the ICE candidate filtering for the page RTCController.
96         All RTCPeerConnection of the page that are created on a document that are same-origin as the top document
97         are now registered to the RTCController.
98         This allows disabling filtering to only these RTCPeerConnection.
99
100         The page keeps the default ICE candidate filtering policy.
101         This policy allows disabling ICE candidate filtering for all RTCPeerConnection.
102
103         When the top document is changing, the RTCController filtering policy is reset
104         and its list of RTCPeerConnection is emptied.
105
106         Internals no longer disables ICE candidate filtering by default.
107         This allows finer grained testing.
108         ICE candidate filtering is disabled for tests including testharnessreport.js
109         to enable web-platform-tests to run without modifications.
110
111         * Modules/mediastream/RTCController.cpp:
112         (WebCore::RTCController::reset):
113         * Modules/mediastream/RTCController.h:
114         * Modules/mediastream/UserMediaRequest.cpp:
115         (WebCore::UserMediaRequest::allow):
116         * page/Frame.cpp:
117         (WebCore::Frame::setDocument):
118         * page/Page.cpp:
119         (WebCore::Page::disableICECandidateFiltering):
120         * page/Page.h:
121         (WebCore::Page::shouldEnableICECandidateFilteringByDefault):
122         (WebCore::Page::disableICECandidateFiltering): Deleted.
123         (WebCore::Page::enableICECandidateFiltering): Deleted.
124         (WebCore::Page::isICECandidateFilteringEnabled): Deleted.
125         * testing/Internals.cpp:
126         (WebCore::Internals::Internals):
127         (WebCore::Internals::setICECandidateFiltering):
128         (WebCore::Internals::setEnumeratingAllNetworkInterfacesEnabled):
129         (WebCore::Internals::isICECandidateFilteringEnabled): Deleted.
130         * testing/Internals.h:
131         * testing/Internals.idl:
132
133 2017-07-11  Sergio Villar Senin  <svillar@igalia.com>
134
135         Unreviewed, rolling out r219325.
136
137         The test is still flaky
138
139         Reverted changeset:
140
141         "[SVG] Leak in SVGAnimatedListPropertyTearOff"
142         https://bugs.webkit.org/show_bug.cgi?id=172545
143         http://trac.webkit.org/changeset/219325
144
145 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
146
147         [SVG] Leak in SVGAnimatedListPropertyTearOff
148         https://bugs.webkit.org/show_bug.cgi?id=172545
149
150         Reviewed by Said Abou-Hallawa.
151
152         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
153         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
154         reference to SVGAnimatedProperty.
155
156         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
157         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
158         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
159         is going to be added to. This effectively creates a reference cycle between the
160         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
161
162         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
163
164         * svg/properties/SVGAnimatedListPropertyTearOff.h:
165
166 2017-07-10  Simon Fraser  <simon.fraser@apple.com>
167
168         [WK2 iOS] REGRESSION (r216803) During momentum scroll, getBoundingClientRect returns wrong coordinates (missing images on pinterest, elle.com and many other sites)
169         https://bugs.webkit.org/show_bug.cgi?id=174286
170         rdar://problem/32864180
171
172         Reviewed by Dean Jackson.
173
174         r216803 made getBoundingClientRects relative to the layout viewport, but when scrolling we
175         only update that on stable viewport updates (at the end of the scroll). This meant that during
176         unstable updates, getBoundingClientRects() used a "frozen" viewport origin so things on-screen
177         would appear to be off-screen, causing sites to fail to dynamically load images etc. when
178         scrolling.
179
180         Fix by pushing an optional "unstable" layout viewport rect onto FrameView, which gets used by
181         FrameView::documentToClientOffset(). This is cleared when we do a stable update.
182
183         This is a short-term solution. Longer term, I would prefer to always call setLayoutViewportOverrideRect(),
184         but fix the scrolling tree logic to work correctly in this case.
185
186         Add a bit more scrolling logging.
187
188         Test: fast/visual-viewport/ios/get-bounding-client-rect-unstable.html
189
190         * page/FrameView.cpp:
191         (WebCore::FrameView::setUnstableLayoutViewportRect):
192         (WebCore::FrameView::documentToClientOffset):
193         * page/FrameView.h:
194         * page/scrolling/AsyncScrollingCoordinator.cpp:
195         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
196         * page/scrolling/ScrollingStateFixedNode.cpp:
197         (WebCore::ScrollingStateFixedNode::updateConstraints):
198         (WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect):
199
200 2017-07-10  John Wilander  <wilander@apple.com>
201
202         Resource Load Statistics: Prune statistics in orders of importance
203         https://bugs.webkit.org/show_bug.cgi?id=174215
204         <rdar://problem/33164403>
205
206         Reviewed by Chris Dumez.
207
208         Test: http/tests/loading/resourceLoadStatistics/prune-statistics.html
209
210         * loader/ResourceLoadObserver.cpp:
211         (WebCore::reduceTimeResolution):
212         (WebCore::ResourceLoadObserver::logFrameNavigation):
213         (WebCore::ResourceLoadObserver::logSubresourceLoading):
214         (WebCore::ResourceLoadObserver::logWebSocketLoading):
215         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
216             Now all set the new statistics field lastSeen.
217         * loader/ResourceLoadStatistics.cpp:
218         (WebCore::ResourceLoadStatistics::encode):
219         (WebCore::ResourceLoadStatistics::decode):
220         (WebCore::ResourceLoadStatistics::toString):
221         (WebCore::ResourceLoadStatistics::merge):
222             Handling of the new statistics field lastSeen.
223         * loader/ResourceLoadStatistics.h:
224
225 2017-07-10  Devin Rousso  <drousso@apple.com>
226
227         Web Inspector: Highlight matching CSS canvas clients when hovering contexts in the Resources tab
228         https://bugs.webkit.org/show_bug.cgi?id=174279
229
230         Reviewed by Matt Baker.
231
232         Test: inspector/dom/highlightNodeList.html
233
234         * inspector/InspectorDOMAgent.h:
235         * inspector/InspectorDOMAgent.cpp:
236         (WebCore::InspectorDOMAgent::highlightNodeList):
237
238 2017-07-10  Javier Fernandez  <jfernandez@igalia.com>
239
240         [css-align][css-flex][css-grid] 'auto' values of align-self and justify-self must not be resolved
241         https://bugs.webkit.org/show_bug.cgi?id=172707
242
243         Reviewed by Antti Koivisto.
244
245         The CSS Box Alignment specification has been changed recently so that
246         now all the propeties have the specificed value as computed value. The
247         rationale of this change are at the associated W3C github issue [1].
248
249         This change implies that we don't need to execute the StyleAdjuter
250         logic we implemented specifically for supporting 'auto' values
251         resolution for computed style. We can live now with resolution at
252         layout time only.
253
254         [1] https://github.com/w3c/csswg-drafts/issues/440
255
256         No new tests, just updating the already defined tests.
257
258         * css/CSSComputedStyleDeclaration.cpp:
259         (WebCore::ComputedStyleExtractor::propertyValue):
260         * css/StyleResolver.cpp:
261         (WebCore::StyleResolver::adjustRenderStyle): Removed
262         * css/StyleResolver.h:
263         * html/shadow/TextControlInnerElements.cpp:
264         (WebCore::TextControlInnerElement::resolveCustomStyle):
265         * rendering/RenderBox.cpp:
266         (WebCore::RenderBox::columnFlexItemHasStretchAlignment):
267         (WebCore::RenderBox::hasStretchedLogicalWidth):
268         * rendering/RenderFlexibleBox.cpp:
269         (WebCore::RenderFlexibleBox::styleDidChange): Added
270         (WebCore::RenderFlexibleBox::alignmentForChild):
271         * rendering/RenderFlexibleBox.h:
272
273 2017-07-10  Wenson Hsieh  <wenson_hsieh@apple.com>
274
275         [WK2] Ignore touch events that interrupt platform-driven momentum scrolling
276         https://bugs.webkit.org/show_bug.cgi?id=174300
277         <rdar://problem/33030639>
278
279         Reviewed by Simon Fraser.
280
281         See Source/WebKit2/ChangeLog for more detail.
282
283         Tests: fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-mainframe.html
284                fast/events/ios/no-touch-events-when-stopping-momentum-scroll-in-overflow.html
285                fast/events/ios/touch-events-during-scroll-deceleration-in-overflow.html
286
287         * page/scrolling/ScrollingTree.h:
288         (WebCore::ScrollingTree::scrollingTreeNodeDidEndPanGesture):
289
290 2017-07-10  Jeremy Jones  <jeremyj@apple.com>
291
292         Captions and subtitles not showing up in picture-in-picture for MSE content
293         https://bugs.webkit.org/show_bug.cgi?id=174317
294         rdar://problem/33188591
295
296         Reviewed by Eric Carlson.
297
298         Reverts a regression created by r218403.
299
300         * html/shadow/MediaControlElements.cpp:
301         (WebCore::MediaControlTextTrackContainerElement::updateTextTrackRepresentation):
302
303 2017-07-10  Per Arne Vollan  <pvollan@apple.com>
304
305         [Win] Link error when building WTF from WTF.proj project file.
306         https://bugs.webkit.org/show_bug.cgi?id=174316
307         <rdar://problem/33178200>
308
309         Reviewed by Brent Fulgham.
310
311         WTF_CPU_X86 cmake variable needs to be set for link libraries directories to be correct.
312
313         * WebCore.vcxproj/WebCore.proj:
314
315 2017-07-10  Jeremy Jones  <jeremyj@apple.com>
316
317         media element handle adding source immediately before src.
318         https://bugs.webkit.org/show_bug.cgi?id=174284
319         rdar://problem/33115439
320
321         Reviewed by David Kilzer.
322
323         Test: media/video-source-before-src.html
324
325         Adding a source causes a selectMediaResource block to be enqueued.
326         If dataLoadingPermitted prevents creating the m_player but sets the srcAttr, then
327         the enqueued selectMediaResource will be in a bad state, with a srcAttr but no m_player.
328
329         This fix prevents selectMediaResource from being called, if data loading is not permitted
330         when adding a source element, to match how it prevents player creation when setting srcAttr.
331
332         This fix also adds a debug assert to catch the problem earlier and adds an early return to
333         prevent the crash in release builds.
334
335         * html/HTMLMediaElement.cpp:
336         (WebCore::HTMLMediaElement::selectMediaResource):
337         (WebCore::HTMLMediaElement::sourceWasAdded):
338
339 2017-07-10  Megan Gardner  <megan_gardner@apple.com>
340
341         Add location to NavigationActionData
342         https://bugs.webkit.org/show_bug.cgi?id=174233
343         <rdar://problem/29165518>
344
345         Reviewed by Simon Fraser.
346         
347         Add the root view location of a tap to a NavigationAction to vend to Safari.
348
349         Test: small enough change to not be tested alone.
350
351         * dom/MouseRelatedEvent.cpp:
352         (WebCore::MouseRelatedEvent::absoluteLocationConvertedToRootView):
353         * dom/MouseRelatedEvent.h:
354
355 2017-07-10  Sam Weinig  <sam@webkit.org>
356
357         [WebIDL] Move plugin object customization into the generator
358         https://bugs.webkit.org/show_bug.cgi?id=174238
359
360         Reviewed by Chris Dumez.
361
362         - Added [Plugin] extended attribute to forward the necessary hooks
363           for get/set/delete to the plugin code.
364         - Removed [CustomNamedSetter] and replaced it's remaining uses
365           [CustomPut] (formally called [CustomPutFunction]).
366         - Renamed [CustomNamedGetterOnPrototype] to [CustomPutOnPrototype]
367           because that is actually what it does.
368         - Removed [CustomGetOwnPropertySlotByIndex] and made 
369           [CustomGetOwnPropertySlot] imply it, as the other custom hooks
370           do.
371         - Renamed [CustomEnumerateProperty] to [CustomGetOwnPropertyNames]
372           to conform with other attribute names.
373         - Renamed [CustomCall] to [CustomGetCallData] to conform with other 
374           attribute names.
375
376         * CMakeLists.txt:
377         * WebCore.xcodeproj/project.pbxproj:
378         * bindings/js/JSBindingsAllInOne.cpp:
379         * bindings/js/JSHTMLAppletElementCustom.cpp: Removed.
380         * bindings/js/JSHTMLEmbedElementCustom.cpp: Removed.
381         * bindings/js/JSHTMLObjectElementCustom.cpp: Removed.
382         Remove custom bindings.
383
384         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
385         (WebCore::putCommon):
386         (WebCore::JSCSSStyleDeclaration::put):
387         (WebCore::JSCSSStyleDeclaration::putByIndex):
388         (WebCore::JSCSSStyleDeclaration::putDelegate): Deleted.
389         Use [CustomPut] rather than [CustomNamedSetter] to allow us
390         to get rid of [CustomNamedSetter]. Reuse put delegate as
391         common code to share between put and putByIndex.
392
393         * bindings/js/JSLocationCustom.cpp:
394         (WebCore::getOwnPropertySlotCommon):
395         (WebCore::JSLocation::getOwnPropertySlot):
396         (WebCore::JSLocation::getOwnPropertySlotByIndex):
397         Replace [CustomGetOwnPropertySlotAndDescriptor] with [CustomGetOwnPropertySlot]
398         which is more clear and reduces the number of variants of this hook override
399         we need.
400
401         (WebCore::putCommon):
402         (WebCore::JSLocation::put):
403         (WebCore::JSLocation::putByIndex):
404         Use [CustomPut] rather than [CustomNamedSetter] to allow us
405         to get rid of [CustomNamedSetter]. Reuse put delegate as
406         common code to share between put and putByIndex.
407
408         (WebCore::JSLocationPrototype::put):
409         [CustomPutOnPrototype] (which weirdly used incorrectly be called 
410         [CustomNamedGetterOnPrototype]) now works like [CustomPut] meaning
411         you need to call Base.
412
413         * bindings/js/JSPluginElementFunctions.cpp:
414         (WebCore::pluginElementPropertyGetter):
415         (WebCore::pluginElementCustomGetOwnPropertySlot):
416         (WebCore::pluginElementCustomPut):
417         * bindings/js/JSPluginElementFunctions.h:
418         (WebCore::pluginElementCustomGetOwnPropertySlot): Deleted.
419         Remove templatized pluginElementCustomGetOwnPropertySlot, which was 
420         completely unnecessary and merge its functionality into the out of
421         line overload. Remove pluginElementPropertyGetter from the header,
422         since it is only used in implementation, and unify the naming and
423         argument position (JSHTMLElement* comes first) of the hooks.
424
425         * bindings/scripts/CodeGeneratorJS.pm:
426         (GenerateIndexedGetter):
427         (GenerateNamedGetter):
428         (GenerateGetOwnPropertySlot):
429         (GenerateGetOwnPropertySlotByIndex):
430         (GenerateGetOwnPropertyNames):
431         (GeneratePut):
432         (GeneratePutByIndex):
433         (GenerateDeleteProperty):
434         (GenerateDeletePropertyByIndex):
435         (GenerateNamedDeleterDefinition):
436         (InstanceOverridesGetOwnPropertySlot):
437         (InstanceOverridesGetOwnPropertyNames):
438         (InstanceOverridesPut):
439         (InstanceOverridesDeleteProperty):
440         (GenerateHeader):
441         (GenerateImplementation):
442         (GenerateGetCallData):
443         (GeneratePluginCall):
444         (GenerateLegacyCallerDefinitions):
445         (GenerateLegacyCallerDefinition):
446         (GeneratePrototypeDeclaration):
447         (InstanceOverridesGetCallData):
448         (HeaderNeedsPrototypeDeclaration):
449         - Add support for [Plugin]
450         - Remove support for [CustomNamedSetter]
451         - Replace [CustomGetOwnPropertySlotByIndex] with [CustomGetOwnPropertySlot]
452         - Replace [CustomEnumerateProperty] with [CustomGetOwnPropertyNames]
453         - Replace [CustomPutFunction] with [CustomPut].
454         - Make subroutine names more consistent (remove a few Definition suffixes)
455
456         * bindings/scripts/IDLAttributes.json:
457         Update for new / removed attributes.
458
459         * bindings/scripts/test/JS/JSTestInterface.cpp:
460         * bindings/scripts/test/JS/JSTestInterface.h:
461         * bindings/scripts/test/JS/JSTestPluginInterface.cpp: Added.
462         * bindings/scripts/test/JS/JSTestPluginInterface.h: Added.
463         * bindings/scripts/test/TestInterface.idl:
464         * bindings/scripts/test/TestPluginInterface.idl: Added.
465         Update / add tests.
466
467         * css/CSSStyleDeclaration.idl:
468         * html/HTMLAppletElement.idl:
469         * html/HTMLEmbedElement.idl:
470         * html/HTMLObjectElement.idl:
471         * page/DOMWindow.idl:
472         * page/Location.idl:
473         * storage/Storage.idl:
474         Update for new / renamed attributes.
475
476 2017-07-03  Brian Burg  <bburg@apple.com>
477
478         Web Replay: remove some unused code
479         https://bugs.webkit.org/show_bug.cgi?id=173903
480
481         Rubber-stamped by Joseph Pecoraro.
482
483         * CMakeLists.txt:
484         * Configurations/FeatureDefines.xcconfig:
485         * DerivedSources.make:
486         * PlatformMac.cmake:
487         * WebCore.xcodeproj/project.pbxproj:
488         * dom/Document.cpp:
489         (WebCore::Document::Document):
490         (WebCore::Document::lastModified):
491         (WebCore::Document::inputCursor): Deleted.
492         (WebCore::Document::setInputCursor): Deleted.
493         * dom/Document.h:
494         * inspector/InspectorController.cpp:
495         (WebCore::InspectorController::InspectorController):
496         * inspector/InspectorInstrumentation.cpp:
497         (WebCore::InspectorInstrumentation::willDispatchEventImpl):
498         (WebCore::InspectorInstrumentation::willDispatchEventOnWindowImpl):
499         (WebCore::InspectorInstrumentation::frameDetachedFromParentImpl):
500         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
501         (WebCore::InspectorInstrumentation::sessionCreatedImpl): Deleted.
502         (WebCore::InspectorInstrumentation::sessionLoadedImpl): Deleted.
503         (WebCore::InspectorInstrumentation::sessionModifiedImpl): Deleted.
504         (WebCore::InspectorInstrumentation::segmentCreatedImpl): Deleted.
505         (WebCore::InspectorInstrumentation::segmentCompletedImpl): Deleted.
506         (WebCore::InspectorInstrumentation::segmentLoadedImpl): Deleted.
507         (WebCore::InspectorInstrumentation::segmentUnloadedImpl): Deleted.
508         (WebCore::InspectorInstrumentation::captureStartedImpl): Deleted.
509         (WebCore::InspectorInstrumentation::captureStoppedImpl): Deleted.
510         (WebCore::InspectorInstrumentation::playbackStartedImpl): Deleted.
511         (WebCore::InspectorInstrumentation::playbackPausedImpl): Deleted.
512         (WebCore::InspectorInstrumentation::playbackHitPositionImpl): Deleted.
513         (WebCore::InspectorInstrumentation::playbackFinishedImpl): Deleted.
514         (WebCore::InspectorInstrumentation::replayAgentEnabled): Deleted.
515         * inspector/InspectorInstrumentation.h:
516         (WebCore::InspectorInstrumentation::sessionCreated): Deleted.
517         (WebCore::InspectorInstrumentation::sessionLoaded): Deleted.
518         (WebCore::InspectorInstrumentation::sessionModified): Deleted.
519         (WebCore::InspectorInstrumentation::segmentCreated): Deleted.
520         (WebCore::InspectorInstrumentation::segmentCompleted): Deleted.
521         (WebCore::InspectorInstrumentation::segmentLoaded): Deleted.
522         (WebCore::InspectorInstrumentation::segmentUnloaded): Deleted.
523         (WebCore::InspectorInstrumentation::captureStarted): Deleted.
524         (WebCore::InspectorInstrumentation::captureStopped): Deleted.
525         (WebCore::InspectorInstrumentation::playbackStarted): Deleted.
526         (WebCore::InspectorInstrumentation::playbackPaused): Deleted.
527         (WebCore::InspectorInstrumentation::playbackFinished): Deleted.
528         (WebCore::InspectorInstrumentation::playbackHitPosition): Deleted.
529         * inspector/InspectorReplayAgent.cpp: Removed.
530         * inspector/InspectorReplayAgent.h: Removed.
531         * inspector/InstrumentingAgents.cpp:
532         (WebCore::InstrumentingAgents::reset):
533         * inspector/InstrumentingAgents.h:
534         (WebCore::InstrumentingAgents::inspectorReplayAgent): Deleted.
535         (WebCore::InstrumentingAgents::setInspectorReplayAgent): Deleted.
536         * page/EventHandler.h:
537         * page/Page.cpp:
538         (WebCore::Page::Page):
539         * page/Page.h:
540         (WebCore::Page::replayController): Deleted.
541         * page/scrolling/ScrollingCoordinator.cpp:
542         (WebCore::ScrollingCoordinator::synchronousScrollingReasons):
543         (WebCore::ScrollingCoordinator::replaySessionStateDidChange): Deleted.
544         * page/scrolling/ScrollingCoordinator.h:
545         * platform/Logging.h:
546         * plugins/DOMMimeTypeArray.cpp:
547         (WebCore::DOMMimeTypeArray::getPluginData):
548         * plugins/DOMPluginArray.cpp:
549         (WebCore::DOMPluginArray::pluginData):
550         * replay/AllReplayInputs.h: Removed.
551         * replay/CapturingInputCursor.cpp: Removed.
552         * replay/CapturingInputCursor.h: Removed.
553         * replay/EventLoopInput.cpp: Removed.
554         * replay/EventLoopInput.h: Removed.
555         * replay/EventLoopInputDispatcher.cpp: Removed.
556         * replay/EventLoopInputDispatcher.h: Removed.
557         * replay/FunctorInputCursor.h: Removed.
558         * replay/MemoizedDOMResult.cpp: Removed.
559         * replay/MemoizedDOMResult.h: Removed.
560         * replay/ReplayController.cpp: Removed.
561         * replay/ReplayController.h: Removed.
562         * replay/ReplayInputCreationMethods.cpp: Removed.
563         * replay/ReplayInputDispatchMethods.cpp: Removed.
564         * replay/ReplaySession.cpp: Removed.
565         * replay/ReplaySession.h: Removed.
566         * replay/ReplaySessionSegment.cpp: Removed.
567         * replay/ReplaySessionSegment.h: Removed.
568         * replay/ReplayingInputCursor.cpp: Removed.
569         * replay/ReplayingInputCursor.h: Removed.
570         * replay/SegmentedInputStorage.cpp: Removed.
571         * replay/SegmentedInputStorage.h: Removed.
572         * replay/SerializationMethods.cpp: Removed.
573         * replay/SerializationMethods.h: Removed.
574         * replay/WebInputs.json: Removed.
575
576 2017-07-10  Brady Eidson  <beidson@apple.com>
577
578         Cleanup lifetime issues of UniqueIDBDatabase and IDBBackingStore.
579         <rdar://problem/32908525> and https://bugs.webkit.org/show_bug.cgi?id=174244
580
581         Reviewed by David Kilzer and Alex Christensen. 
582
583         No targeted test possible, implicitly covered by all IDB tests.
584
585         The original idea behind UniqueIDBDatabase lifetime was that they are ThreadSafeRefCounted and
586         we take protector Refs when any operation that needs it alive is in flight.
587         
588         This added variability to their lifetime which made it difficult to enforce a few different 
589         design invariants, namely:
590             - UniqueIBDDatabase objects are always created and destroyed only on the main thread.
591             - IDBBackingStore objects are always created and destroyed only on the database thread.
592         
593         This patch removes the ref counting and instead ties UniqueIDBDatabase lifetime to a
594         std::unique_ptr that is owned by the IDBServer.
595         
596         Whenever any operations on the UniqueIDBDatabase are in flight it is kept alive by virtue
597         of that unique_ptr in the IDBServer. Once a UniqueIDBDatabase is completely done with all of
598         its work, the following happens:
599             - On the main thread the IDBServer removes the unique_ptr owning the UniqueIDBDatabase
600               from its map.
601             - It hands the unique_ptr to the UniqueIDBDatabase itself, which schedules one final 
602               database thread task.
603             - That database thread task is to destroy the IDBBackingStore, kill its message queues,
604               and then message back to the main thread for one final task.
605             - That main thread task is to release the unique_ptr, resulting in destruction of the
606               UniqueIDBDatabase object.
607         
608         This is safe, predictable, solves the lifetime issues that r218516 originally tried to solve,
609         and solves the lifetime issues that r218516 introduced.
610
611         (This patch also adds many more assertions to cover various design invariants throughout the
612         lifecycle of a particular UniqueIDBDatabase)
613
614         ASSERT that IDBBackingStores are only ever created and destroyed on the background thread:
615         * Modules/indexeddb/server/IDBBackingStore.h:
616         (WebCore::IDBServer::IDBBackingStore::~IDBBackingStore):
617         (WebCore::IDBServer::IDBBackingStore::IDBBackingStore):
618         
619         Transition UniqueIDBDatabase ownership from a RefPtr to a std::unique_ptr:
620         * Modules/indexeddb/server/IDBServer.cpp:
621         (WebCore::IDBServer::IDBServer::getOrCreateUniqueIDBDatabase):
622         (WebCore::IDBServer::IDBServer::closeAndTakeUniqueIDBDatabase):
623         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
624         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
625         (WebCore::IDBServer::IDBServer::closeUniqueIDBDatabase): Deleted.
626         * Modules/indexeddb/server/IDBServer.h:
627         
628         Make all the other changes mentioned above:
629         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
630         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase): Bulk up on ASSERTs
631         (WebCore::IDBServer::UniqueIDBDatabase::openDatabaseConnection): 
632         (WebCore::IDBServer::UniqueIDBDatabase::performUnconditionalDeleteBackingStore):
633         (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
634         (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose):
635         (WebCore::IDBServer::UniqueIDBDatabase::didShutdownForClose):
636         (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore):
637         (WebCore::IDBServer::UniqueIDBDatabase::handleCurrentOperation):
638         (WebCore::IDBServer::UniqueIDBDatabase::performIterateCursor):
639         (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor):
640         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
641         (WebCore::IDBServer::UniqueIDBDatabase::activateTransactionInBackingStore):
642         (WebCore::IDBServer::UniqueIDBDatabase::transactionCompleted):
643         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTask):
644         (WebCore::IDBServer::UniqueIDBDatabase::postDatabaseTaskReply):
645         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask):
646         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply):
647         (WebCore::IDBServer::UniqueIDBDatabase::maybeFinishHardClose):
648         (WebCore::IDBServer::UniqueIDBDatabase::isDoneWithHardClose):
649         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
650         (WebCore::IDBServer::UniqueIDBDatabase::didPerformUnconditionalDeleteBackingStore): Deleted.
651         * Modules/indexeddb/server/UniqueIDBDatabase.h:
652         (WebCore::IDBServer::UniqueIDBDatabase::create): Deleted.
653
654 2017-07-10  Chris Dumez  <cdumez@apple.com>
655
656         Further WebResourceLoadStatisticsStore / ResourceLoadStatisticsStore clean up
657         https://bugs.webkit.org/show_bug.cgi?id=174301
658
659         Reviewed by Brent Fulgham.
660
661         Moved some generic file system utility functions down to platform's FileSystem.h.
662
663         * platform/FileSystem.cpp:
664         (WebCore::openAndLockFile):
665         (WebCore::unlockAndCloseFile):
666         * platform/FileSystem.h:
667
668 2017-07-10  Andreas Kling  <akling@apple.com>
669
670         REGRESSION(r210226): Keyboard-focused element not preserved when navigating back through page cache, causing multiple elements to have focus
671         https://bugs.webkit.org/show_bug.cgi?id=174302
672         <rdar://problem/33204273>
673
674         Reviewed by Antti Koivisto.
675
676         Don't clear the active/hovered/focused elements when destroying the render tree,
677         since we might need to reconstruct it later, and would like to remember which
678         elements those were.
679
680         Only the focused state actually stuck when going in and out of the page cache,
681         but this patch removes all the element pointer clearing for consistency.
682
683         Test: fast/history/page-cache-element-state-focused.html
684
685         * dom/Document.cpp:
686         (WebCore::Document::destroyRenderTree):
687
688 2017-07-10  Daniel Bates  <dabates@apple.com>
689
690         REGRESSION (r218616): Cannot build WebCore for macOS 10.12 with macOS 10.13 SDK
691         https://bugs.webkit.org/show_bug.cgi?id=173939
692
693         Reviewed by Dan Bernstein.
694
695         (The code in this change was either suggested or written by Dan Bernstein with a very
696         minor adjustment to get it to build).
697
698         Allow WebCore to link even though CTFontCreatePhysicalFontForCharactersWithLanguage() is
699         undefined when building against the macOS 10.13 SDK targeting macOS 10.12. Let the dynamic
700         linker resolve the undefined symbol.
701
702         For completeness the SPI CTFontCreatePhysicalFontForCharactersWithLanguage() was removed
703         from the macOS 10.13 SDK.
704
705         * Configurations/WebCore.xcconfig: Tell the linker that CTFontCreatePhysicalFontForCharactersWithLanguage()
706         can be undefined when building against macOS 10.13 or later SDK.
707         * platform/spi/cocoa/CoreTextSPI.h: Annotate CTFontCreatePhysicalFontForCharactersWithLanguage()
708         with its availability information.
709
710 2017-07-10  Zalan Bujtas  <zalan@apple.com>
711
712         Block of text is missing in iBooks sample books.
713         https://bugs.webkit.org/show_bug.cgi?id=174295
714         <rdar://problem/32955620>
715
716         Reviewed by Antti Koivisto.
717
718         In the simple line layout context, translating y coordinate to a line index is
719         normally just a (y / line height) operation. However in case of strut offsets (pagination)
720         we need to take these extra paddings into account while resolving the line index.
721         This patch fixes the boundary checking for a given line by using the font size only
722         when the font is taller than the line.
723
724         * rendering/SimpleLineLayoutResolver.cpp:
725         (WebCore::SimpleLineLayout::RunResolver::adjustLineIndexForStruts):
726
727 2017-07-10  Carlos Garcia Campos  <cgarcia@igalia.com>
728
729         [SOUP] SoupCookieJar is never released (resulting in sqlite temp files lying around)
730         https://bugs.webkit.org/show_bug.cgi?id=166029
731
732         Reviewed by Michael Catanzaro.
733
734         Add clearSoupNetworkSessionAndCookieStorage() to clear the SoupNetworkSession and cookie storage of the main
735         network session, ensuring the cookies database is properly closed.
736
737         * platform/network/NetworkStorageSession.h:
738         * platform/network/soup/NetworkStorageSessionSoup.cpp:
739         (WebCore::NetworkStorageSession::clearSoupNetworkSessionAndCookieStorage):
740
741 2017-07-10  Carlos Garcia Campos  <cgarcia@igalia.com>
742
743         Move make-js-file-arrays.py from WebCore to JavaScriptCore
744         https://bugs.webkit.org/show_bug.cgi?id=174024
745
746         Reviewed by Michael Catanzaro.
747
748         * CMakeLists.txt: Explicitly add files generated by MAKE_JS_FILE_ARRAYS to the build, since the macro no longer
749         does it.
750         * DerivedSources.make: Updated to use make-js-file-arrays.py from JavaScriptCore. It's no longer needed to set
751         PYTHON_PATH to find jsmin.py.
752
753 2017-07-10  Charlie Turner  <cturner@igalia.com>
754
755         [GTK] http/tests/media/video-redirect.html is failing
756         https://bugs.webkit.org/show_bug.cgi?id=174260
757
758         Reviewed by Carlos Garcia Campos.
759
760         Make sure we're testing new URLs within the same security origin.
761
762         Covered by existing tests.
763
764         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
765         (WebCore::convertToInternalProtocol): Factor out setting our
766         internal URL schema.
767         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Use the
768         refactored helper.
769         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Use
770         refactored helper to ensure both URLs have the same origin.
771
772 2017-07-08  John Wilander  <wilander@apple.com>
773
774         Resource Load Statistics: User interaction should always go to top document
775         https://bugs.webkit.org/show_bug.cgi?id=174120
776         <rdar://problem/33117899>
777
778         Reviewed by Chris Dumez.
779
780         Test: http/tests/loading/resourceLoadStatistics/user-interaction-in-cross-origin-sub-frame.html
781
782         * dom/UserGestureIndicator.cpp:
783         (WebCore::UserGestureIndicator::UserGestureIndicator):
784             Now logs user interaction for the top document.
785         * loader/ResourceLoadObserver.cpp:
786         (WebCore::ResourceLoadObserver::setThrottledObserverNotifications):
787             Test infrastructure.
788         (WebCore::ResourceLoadObserver::setNotificationCallback):
789             Callback now takes a ResourceLoadObserver::NotificationType.
790         (WebCore::ResourceLoadObserver::logFrameNavigation):
791             Submits the configured ResourceLoadObserver::NotificationType.
792         (WebCore::ResourceLoadObserver::logSubresourceLoading):
793             Submits the configured ResourceLoadObserver::NotificationType.
794         (WebCore::ResourceLoadObserver::logWebSocketLoading):
795             Submits the configured ResourceLoadObserver::NotificationType.
796         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
797             Submits the configured ResourceLoadObserver::NotificationType.
798         * loader/ResourceLoadObserver.h:
799         * testing/Internals.cpp:
800         (WebCore::Internals::resetToConsistentState):
801             Resets to throttled notifications.
802         (WebCore::Internals::setResourceLoadStatisticsThrottledObserverNotifications):
803             Test infrastructure.
804         * testing/Internals.h:
805         * testing/Internals.idl:
806             Added internals.setResourceLoadStatisticsThrottledObserverNotifications().
807
808 2017-07-09  Brady Eidson  <beidson@apple.com>
809
810         Remove some obsolete WebKitVersionChecks.
811         https://bugs.webkit.org/show_bug.cgi?id=174294
812
813         Reviewed by Dan Bernstein.
814
815         No new tests (No change to testable behavior)
816
817         * dom/ScriptExecutionContext.cpp:
818         (WebCore::ScriptExecutionContext::dispatchErrorEvent):
819         
820         * page/Settings.in:
821         
822         * platform/RuntimeApplicationChecks.h:
823         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
824         (WebCore::IOSApplication::isOkCupid): Deleted.
825         (WebCore::IOSApplication::isFacebook): Deleted.
826         
827         * rendering/RenderBox.cpp:
828         (WebCore::RenderBox::layoutOverflowRectForPropagation):
829
830 2017-07-08  Brady Eidson  <beidson@apple.com>
831
832         Remove some obsolete RuntimeApplicationChecks.
833         https://bugs.webkit.org/show_bug.cgi?id=174293
834
835         Reviewed by Dan Bernstein.
836
837         No new tests (No change to testable behavior)
838
839         * html/HTMLObjectElement.cpp:
840         (WebCore::HTMLObjectElement::parametersForPlugin):
841         (WebCore::shouldNotPerformURLAdjustment): Deleted.
842
843         * platform/RuntimeApplicationChecks.h:
844         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
845         (WebCore::IOSApplication::isDaijisenDictionary): Deleted.
846         (WebCore::IOSApplication::isNASAHD): Deleted.
847         (WebCore::IOSApplication::isTheEconomistOnIphone): Deleted.
848
849         * platform/ios/wak/WebCoreThread.h:
850         * platform/ios/wak/WebCoreThread.mm:
851         (StartWebThread):
852         (WebThreadSetDelegateSourceRunLoopMode): Deleted.
853
854 2017-07-08  Basuke Suzuki  <Basuke.Suzuki@sony.com>
855
856         [Curl] Safe access and life cycle management of bare Curl handle
857         by wrapping with C++ class
858         https://bugs.webkit.org/show_bug.cgi?id=174002
859
860         Reviewed by Alex Christensen.
861
862         * platform/network/ResourceHandle.h:
863         * platform/network/ResourceHandleInternal.h:
864         * platform/network/curl/CookieJarCurl.cpp:
865         (WebCore::setCookiesFromDOM):
866         (WebCore::cookiesForSession):
867         * platform/network/curl/CurlContext.cpp:
868         (WebCore::CurlContext::CurlContext):
869         (WebCore::CurlContext::~CurlContext):
870         (WebCore::CurlContext::initCookieSession):
871         (WebCore::CurlShareHandle::CurlShareHandle):
872         (WebCore::CurlShareHandle::~CurlShareHandle):
873         (WebCore::CurlShareHandle::lockCallback):
874         (WebCore::CurlShareHandle::unlockCallback):
875         (WebCore::CurlShareHandle::mutexFor):
876         (WebCore::CurlMultiHandle::CurlMultiHandle):
877         (WebCore::CurlMultiHandle::~CurlMultiHandle):
878         (WebCore::CurlMultiHandle::addHandle):
879         (WebCore::CurlMultiHandle::removeHandle):
880         (WebCore::CurlMultiHandle::getFdSet):
881         (WebCore::CurlMultiHandle::perform):
882         (WebCore::CurlMultiHandle::readInfo):
883         (WebCore::CurlHandle::CurlHandle):
884         (WebCore::CurlHandle::~CurlHandle):
885         (WebCore::CurlHandle::perform):
886         (WebCore::CurlHandle::pause):
887         (WebCore::CurlHandle::enableShareHandle):
888         (WebCore::CurlHandle::setPrivateData):
889         (WebCore::CurlHandle::setUrl):
890         (WebCore::CurlHandle::clearUrl):
891         (WebCore::CurlHandle::clearRequestHeaders):
892         (WebCore::CurlHandle::appendRequestHeader):
893         (WebCore::CurlHandle::enableRequestHeaders):
894         (WebCore::CurlHandle::enableHttpGetRequest):
895         (WebCore::CurlHandle::enableHttpHeadRequest):
896         (WebCore::CurlHandle::enableHttpPostRequest):
897         (WebCore::CurlHandle::setPostFields):
898         (WebCore::CurlHandle::setPostFieldLarge):
899         (WebCore::CurlHandle::enableHttpPutRequest):
900         (WebCore::CurlHandle::setInFileSizeLarge):
901         (WebCore::CurlHandle::setHttpCustomRequest):
902         (WebCore::CurlHandle::enableAcceptEncoding):
903         (WebCore::CurlHandle::enableAllowedProtocols):
904         (WebCore::CurlHandle::enableFollowLocation):
905         (WebCore::CurlHandle::enableAutoReferer):
906         (WebCore::CurlHandle::enableHttpAuthentication):
907         (WebCore::CurlHandle::setHttpAuthUserPass):
908         (WebCore::CurlHandle::enableCAInfoIfExists):
909         (WebCore::CurlHandle::setSslVerifyPeer):
910         (WebCore::CurlHandle::setSslVerifyHost):
911         (WebCore::CurlHandle::setSslCert):
912         (WebCore::CurlHandle::setSslCertType):
913         (WebCore::CurlHandle::setSslKeyPassword):
914         (WebCore::CurlHandle::enableCookieJarIfExists):
915         (WebCore::CurlHandle::setCookieList):
916         (WebCore::CurlHandle::getCookieList):
917         (WebCore::CurlHandle::clearCookieList):
918         (WebCore::CurlHandle::enableProxyIfExists):
919         (WebCore::CurlHandle::enableTimeout):
920         (WebCore::CurlHandle::setHeaderCallbackFunction):
921         (WebCore::CurlHandle::setWriteCallbackFunction):
922         (WebCore::CurlHandle::setReadCallbackFunction):
923         (WebCore::CurlHandle::setSslCtxCallbackFunction):
924         (WebCore::CurlHandle::getEffectiveURL):
925         (WebCore::CurlHandle::getPrimaryPort):
926         (WebCore::CurlHandle::getResponseCode):
927         (WebCore::CurlHandle::getContentLenghtDownload):
928         (WebCore::CurlHandle::getHttpAuthAvail):
929         (WebCore::CurlHandle::getTimes):
930         (WebCore::CurlHandle::maxCurlOffT):
931         (WebCore::CurlHandle::expectedSizeOfCurlOffT):
932         (WebCore::CurlHandle::enableVerboseIfUsed):
933         (WebCore::CurlHandle::enableStdErrIfUsed):
934         (WebCore::CurlContext::getEffectiveURL): Deleted.
935         (WebCore::CurlContext::createMultiHandle): Deleted.
936         (WebCore::CurlContext::mutexFor): Deleted.
937         (WebCore::CurlContext::lock): Deleted.
938         (WebCore::CurlContext::unlock): Deleted.
939         * platform/network/curl/CurlContext.h:
940         (WebCore::CurlGlobal::CurlGlobal):
941         (WebCore::CurlGlobal::~CurlGlobal):
942         (WebCore::CurlShareHandle::handle):
943         (WebCore::CurlContext::shareHandle):
944         (WebCore::CurlHandle::handle):
945         (WebCore::CurlHandle::url):
946         (WebCore::CurlContext::curlShareHandle): Deleted.
947         * platform/network/curl/CurlDownload.cpp:
948         (WebCore::CurlDownload::~CurlDownload):
949         (WebCore::CurlDownload::init):
950         (WebCore::CurlDownload::start):
951         (WebCore::CurlDownload::cancel):
952         (WebCore::CurlDownload::getUrl):
953         (WebCore::CurlDownload::addHeaders):
954         (WebCore::CurlDownload::didReceiveHeader):
955         (WebCore::CurlDownload::writeCallback):
956         * platform/network/curl/CurlDownload.h:
957         * platform/network/curl/CurlJobManager.cpp:
958         (WebCore::CurlJobManager::CurlJobManager):
959         (WebCore::CurlJobManager::~CurlJobManager):
960         (WebCore::CurlJobManager::addToCurl):
961         (WebCore::CurlJobManager::removeFromCurl):
962         (WebCore::CurlJobManager::workerThread):
963         * platform/network/curl/CurlJobManager.h:
964         (WebCore::CurlJobManager::getMultiHandle): Deleted.
965         * platform/network/curl/ResourceHandleCurl.cpp:
966         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
967         (WebCore::ResourceHandle::platformSetDefersLoading):
968         (WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
969         (WebCore::ResourceHandle::receivedCredential):
970         (WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
971         (WebCore::calculateWebTimingInformations):
972         (WebCore::handleLocalReceiveResponse):
973         (WebCore::writeCallback):
974         (WebCore::getProtectionSpace):
975         (WebCore::headerCallback):
976         (WebCore::readCallback):
977         (WebCore::setupFormData):
978         (WebCore::ResourceHandle::setupPUT):
979         (WebCore::ResourceHandle::setupPOST):
980         (WebCore::ResourceHandle::dispatchSynchronousJob):
981         (WebCore::ResourceHandle::applyAuthentication):
982         (WebCore::ResourceHandle::initialize):
983         (WebCore::ResourceHandle::handleCurlMsg):
984         * platform/network/curl/ResourceHandleManager.cpp:
985         (WebCore::ResourceHandleManager::ResourceHandleManager):
986         (WebCore::ResourceHandleManager::~ResourceHandleManager):
987         (WebCore::ResourceHandleManager::downloadTimerCallback):
988         (WebCore::ResourceHandleManager::removeFromCurl):
989         (WebCore::ResourceHandleManager::startJob):
990         * platform/network/curl/ResourceHandleManager.h:
991         * platform/network/curl/SSLHandle.cpp:
992         (WebCore::setSSLClientCertificate):
993         (WebCore::certVerifyCallback):
994         (WebCore::setSSLVerifyOptions):
995
996 2017-07-08  Antoine Quint  <graouts@apple.com>
997
998         REGRESSION: "visibility:hidden" does not hide play button for video elements
999         https://bugs.webkit.org/show_bug.cgi?id=174258
1000         <rdar://problem/33181452>
1001
1002         Reviewed by Dean Jackson.
1003
1004         In order to not have most styles from the page affect the shadow root, we set "all: initial" on the
1005         media controls container. However, we need to still make the "visibility" property inherit from its
1006         host such that "visibility: hidden" on the host won't be overridden by setting the property back to
1007         its initial value, which is "visible".
1008
1009         Test: media/modern-media-controls/css/visibility-hidden.html
1010
1011         * Modules/modern-media-controls/controls/media-controls.css:
1012         (.media-controls-container):
1013
1014 2017-07-08  Yusuke Suzuki  <utatane.tea@gmail.com>
1015
1016         Drop NOSNIFF compile flag
1017         https://bugs.webkit.org/show_bug.cgi?id=174289
1018
1019         Reviewed by Michael Catanzaro.
1020
1021         * Configurations/FeatureDefines.xcconfig:
1022         * css/StyleSheetContents.cpp:
1023         (WebCore::StyleSheetContents::parseAuthorStyleSheet):
1024         (WebCore::StyleSheetContents::notifyLoadedSheet):
1025         * dom/LoadableClassicScript.cpp:
1026         (WebCore::LoadableClassicScript::notifyFinished):
1027         * loader/cache/CachedCSSStyleSheet.cpp:
1028         (WebCore::CachedCSSStyleSheet::mimeTypeAllowedByNosniff):
1029         (WebCore::CachedCSSStyleSheet::canUseSheet):
1030         * loader/cache/CachedCSSStyleSheet.h:
1031         * platform/network/HTTPParsers.cpp:
1032         (WebCore::parseContentTypeOptionsHeader):
1033         * platform/network/HTTPParsers.h:
1034         * platform/network/ResourceResponseBase.cpp:
1035         (WebCore::isScriptAllowedByNosniff):
1036         * platform/network/ResourceResponseBase.h:
1037         * workers/WorkerScriptLoader.cpp:
1038         (WebCore::WorkerScriptLoader::didReceiveResponse):
1039
1040 2017-07-07  Brent Fulgham  <bfulgham@apple.com>
1041
1042         [WK2] Use a rolling 30-day uptime for processing statistics
1043         https://bugs.webkit.org/show_bug.cgi?id=174235
1044         <rdar://problem/33164381>
1045
1046         Reviewed by Chris Dumez.
1047
1048         Add a KeyedDecoder specialization for Deque.
1049
1050         * platform/KeyedCoding.h:
1051         (WebCore::KeyedDecoder::decodeObjects):
1052
1053 2017-07-07  Daniel Bates  <dabates@apple.com>
1054
1055         [AppCache] Ignore fallback entries whose namespace is not prefixed with manifest path
1056         https://bugs.webkit.org/show_bug.cgi?id=174273
1057         <rdar://problem/33011682>
1058
1059         Reviewed by Brent Fulgham.
1060
1061         As per <https://html.spec.whatwg.org/multipage/offline.html#parsing-cache-manifests> (07/06/2017)
1062         we should ignore fallback entires whose fallback namespace URL is not prefixed with
1063         the manifest path. For now we only apply this policy when the manifest is served with
1064         a non-standard Content-Type to minimize web compatibility risk.
1065
1066         Test: http/tests/appcache/fallback-namespace-outside-manifest-path.html
1067
1068         * loader/appcache/ApplicationCacheGroup.cpp:
1069         (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): Pass the MIME type of the manifest.
1070         * loader/appcache/ManifestParser.cpp:
1071         (WebCore::manifestPath): Computes the manifest path from a manifest URL.
1072         (WebCore::parseManifest): Modified to take the MIME type of the manifest. If the MIME type is
1073         non-standard (i.e. not text/cached-manifest) then skip fallback entries whose namespace is not
1074         prefixed with the manifest path. Otherwise, process fallback entries as we do now. Also cleaned
1075         up the code a bit while I was here, including renaming a local variable to be more descriptive
1076         and using a const character array for the manifest signature to avoid the need to document the
1077         length of the manifest signature in a comment.
1078         * loader/appcache/ManifestParser.h:
1079
1080 2017-07-07  Wenson Hsieh  <wenson_hsieh@apple.com>
1081
1082         [iOS DnD] For cross-app drags, 'drop' event handlers are never invoked if dataTransfer.dropEffect is not set while dragging
1083         https://bugs.webkit.org/show_bug.cgi?id=174219
1084         <rdar://problem/32083177>
1085
1086         Reviewed by Ryosuke Niwa.
1087
1088         Currently, in DragController.cpp, defaultOperationForDrag maps a drag source operation mask of
1089         DragOperationGeneric to DragOperationMove across all platforms. However, on iOS, where cross-app drag moves do
1090         not trigger a drop, this means drop handlers won't fire unless the dropEffect is explicitly set to copy.
1091
1092         To fix this, we introduce DragController::platformGenericDragOperation(), which returns DragOperationCopy on iOS
1093         and DragOperationMove (the existing behavior) elsewhere. defaultOperationForDrag then maps a drag source
1094         operation mask of DragOperationGeneric to platformGenericDragOperation().
1095
1096         Tests:  DataInteractionTests.ExternalSourceHTMLToUploadArea
1097                 DataInteractionTests.ExternalSourceImageAndHTMLToUploadArea
1098                 DataInteractionTests.ExternalSourceMoveOperationNotAllowed
1099
1100         * page/DragController.cpp:
1101         (WebCore::DragController::platformGenericDragOperation):
1102         (WebCore::defaultOperationForDrag):
1103         * page/DragController.h:
1104         * page/mac/DragControllerMac.mm:
1105         (WebCore::DragController::platformGenericDragOperation):
1106
1107 2017-07-07  Devin Rousso  <drousso@apple.com>
1108
1109         Web Inspector: Show all elements currently using a given CSS Canvas
1110         https://bugs.webkit.org/show_bug.cgi?id=173965
1111
1112         Reviewed by Joseph Pecoraro.
1113
1114         Test: inspector/canvas/css-canvas-clients.html
1115
1116         * css/CSSImageGeneratorValue.cpp:
1117         (WebCore::CSSImageGeneratorValue::addClient):
1118         (WebCore::CSSImageGeneratorValue::removeClient):
1119         * css/CSSImageGeneratorValue.h:
1120         (WebCore::CSSImageGeneratorValue::clients):
1121         * html/HTMLCanvasElement.cpp:
1122         (WebCore::HTMLCanvasElement::addObserver):
1123         (WebCore::HTMLCanvasElement::removeObserver):
1124         (WebCore::HTMLCanvasElement::cssCanvasClients):
1125         Each time an observer is added/removed for a given HTMLCanvasElement, send an event to the
1126         inspector frontend that the CSS canvas client nodes have changed. Additionally, anytime a
1127         client/use is added/removed from one of the observing CSSCanvasValue, fire the same event.
1128
1129         * css/CSSCanvasValue.h:
1130         (isType):
1131         * html/HTMLCanvasElement.h:
1132         (WebCore::CanvasObserver::isCSSCanvasValueObserver):
1133         Allows type traits to distinguish CanvasObserver from CSSCanvasValue::CanvasObserverProxy.
1134
1135         * inspector/InspectorCanvasAgent.h:
1136         * inspector/InspectorCanvasAgent.cpp:
1137         (WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
1138         (WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
1139         * inspector/InspectorInstrumentation.h:
1140         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodes):
1141         * inspector/InspectorInstrumentation.cpp:
1142         (WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl):
1143         Notify the frontend that the list of client nodes has changed for the given canvas. Let the
1144         frontend request the actual list of node IDs when it needs, possibly at a later time.
1145
1146 2017-07-07  Jer Noble  <jer.noble@apple.com>
1147
1148         AVPlayer can continue to be active after released by MediaPlayerPrivateAVFoundationObjC.
1149         https://bugs.webkit.org/show_bug.cgi?id=174264
1150
1151         Reviewed by Eric Carlson.
1152
1153         If the AVPlayer is retained (by an autorelease pool, or internally by other objects in
1154         AVFoundation), releasing the AVPlayer is not enough to cancel loading or playback. So before
1155         releasing the AVPlayer, make sure to disassociate the current AVPlayerItem, which should
1156         cancel all activity in the AVPlayer.
1157
1158         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1159         (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad):
1160
1161 2017-07-07  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1162
1163         [Curl] Remove data url handler for async load
1164         https://bugs.webkit.org/show_bug.cgi?id=174263
1165
1166         data url is handled by ResourceLoader. No need for specific handling
1167         in platform dependent layer.
1168
1169         Reviewed by Alex Christensen.
1170
1171         * platform/network/curl/ResourceHandleManager.cpp:
1172         (WebCore::ResourceHandleManager::startJob):
1173
1174 2017-07-07  Matt Lewis  <jlewis3@apple.com>
1175
1176         Unreviewed, rolling out r219257.
1177
1178         The test added in the revision was still extreamly flaky on
1179         all testers.
1180
1181         Reverted changeset:
1182
1183         "[SVG] Leak in SVGAnimatedListPropertyTearOff"
1184         https://bugs.webkit.org/show_bug.cgi?id=172545
1185         http://trac.webkit.org/changeset/219257
1186
1187 2017-07-07  Commit Queue  <commit-queue@webkit.org>
1188
1189         Unreviewed, rolling out r219238, r219239, and r219241.
1190         https://bugs.webkit.org/show_bug.cgi?id=174265
1191
1192         "fast/workers/dedicated-worker-lifecycle.html is flaky"
1193         (Requested by yusukesuzuki on #webkit).
1194
1195         Reverted changesets:
1196
1197         "[WTF] Implement WTF::ThreadGroup"
1198         https://bugs.webkit.org/show_bug.cgi?id=174081
1199         http://trac.webkit.org/changeset/219238
1200
1201         "Unreviewed, build fix after r219238"
1202         https://bugs.webkit.org/show_bug.cgi?id=174081
1203         http://trac.webkit.org/changeset/219239
1204
1205         "Unreviewed, CLoop build fix after r219238"
1206         https://bugs.webkit.org/show_bug.cgi?id=174081
1207         http://trac.webkit.org/changeset/219241
1208
1209 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
1210
1211         [SVG] Leak in SVGAnimatedListPropertyTearOff
1212         https://bugs.webkit.org/show_bug.cgi?id=172545
1213
1214         Reviewed by Said Abou-Hallawa.
1215
1216         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
1217         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
1218         reference to SVGAnimatedProperty.
1219
1220         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
1221         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
1222         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
1223         is going to be added to. This effectively creates a reference cycle between the
1224         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
1225
1226         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
1227
1228         * svg/properties/SVGAnimatedListPropertyTearOff.h:
1229
1230 2017-07-07  Charlie Turner  <cturner@igalia.com>
1231
1232         [GStreamer] vid.me videos do not play
1233         https://bugs.webkit.org/show_bug.cgi?id=172240
1234
1235         Reviewed by Xabier Rodriguez-Calvar.
1236
1237         In r142251, code to hide the WK HTTP source elements from elsewhere in
1238         the pipeline was removed. This has the nasty side-effect of
1239         auto-plugging the WK HTTP source into things it really should not be
1240         used in, especially the adaptive streaming demuxers. The reasons this
1241         is bad are documented in several places on Bugzilla, see the parent
1242         bug report for more details. The high-level issue is that the WK HTTP
1243         source and its use of WebCore is not thread-safe. Although work has
1244         been recently done to improve this situation, it's still not perfect.
1245
1246         Another issue is the interface hlsdemux expects its HTTP source to
1247         implement, specifically seeking in READY.
1248
1249         This does rely on HTTP context sharing being available in GStreamer,
1250         upstream bug is here:
1251         https://bugzilla.gnome.org/show_bug.cgi?id=761099. The failing case
1252         can be demonstrated with
1253         https://github.com/thiagoss/adaptive-test-server but manual testing on
1254         popular video hosting sites, including vid.me, shows that this doesn't
1255         bite us at the moment, just something else to fix in the future.
1256
1257         There are some QoS issues with the adaptive streaming code in
1258         GStreamer, but it seems much better to offer a below par QoS in lieu
1259         of crashing/livelocking when playing certain streams, and issues can be
1260         raised upstream when they arise.
1261
1262         This patch does take us further away from the future goal of having all
1263         networking operations go through the network process, but in return it
1264         solves some nasty crashes and livelocks that have been irritating
1265         users for some time. With the pressure off on this issue, work can be
1266         planned to consider how to make the WK HTTP source a better citizen
1267         inside the GStreamer pipeline when we migrate the netcode to go
1268         through the network process.
1269
1270         A new test is added to check that the single file HLS playlists
1271         (new in version 4) can be played, which was the primary cause of
1272         this bug report.
1273
1274         Test: http/tests/media/hls/range-request.html
1275
1276         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1277         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Perform
1278         some trickery to make sure that we only ever fetch URLs handed to
1279         us by WebCore. Any further URLs discovered inside the pipeline
1280         will not get WKWS auto-plugged, since they'll be plain https?
1281         schemas.
1282         (WebCore::MediaPlayerPrivateGStreamer::load): Refactor to use the
1283         setPlaybinURL helper method.
1284         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Ditto.
1285         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add
1286         the setPlaybinURL helper method.
1287         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
1288         (webKitWebSrcGetProtocols): Only advertise webkit+https?, this
1289         ensures we won't get auto-plugged by pipeline elements asking for
1290         an element to fetch https? resources (like adaptive demuxers).
1291         (convertPlaybinURI): Undo the trick when another element asks us
1292         for our URI.
1293
1294 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
1295
1296         [WTF] Implement WTF::ThreadGroup
1297         https://bugs.webkit.org/show_bug.cgi?id=174081
1298
1299         Reviewed by Mark Lam.
1300
1301         * page/ResourceUsageThread.h:
1302
1303 2017-07-06  Yusuke Suzuki  <utatane.tea@gmail.com>
1304
1305         [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
1306         https://bugs.webkit.org/show_bug.cgi?id=174150
1307
1308         Reviewed by Mark Lam.
1309
1310         * Modules/mediacontrols/MediaControlsHost.cpp:
1311         (WebCore::MediaControlsHost::captionDisplayMode):
1312         * Modules/mediastream/RTCDataChannel.cpp:
1313         (WebCore::RTCDataChannel::binaryType):
1314         * accessibility/AXObjectCache.cpp:
1315         (WebCore::createFromRenderer):
1316         * accessibility/AccessibilityMediaControls.cpp:
1317         (WebCore::AccessibilityMediaControl::controlTypeName):
1318         * accessibility/AccessibilityObject.cpp:
1319         (WebCore::AccessibilityObject::language):
1320         (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
1321         (WebCore::AccessibilityObject::actionVerb):
1322         (WebCore::AccessibilityObject::getAttribute):
1323         (WebCore::AccessibilityObject::placeholderValue):
1324         * accessibility/AccessibilityObject.h:
1325         (WebCore::AccessibilityObject::accessKey):
1326         (WebCore::AccessibilityObject::ariaLiveRegionRelevant):
1327         * accessibility/AccessibilityRenderObject.cpp:
1328         (WebCore::AccessibilityRenderObject::accessKey):
1329         (WebCore::AccessibilityRenderObject::actionVerb):
1330         * bindings/js/JSCustomElementInterface.cpp:
1331         (WebCore::JSCustomElementInterface::constructElementWithFallback):
1332         * bindings/js/JSCustomElementRegistryCustom.cpp:
1333         (WebCore::JSCustomElementRegistry::define):
1334         * bindings/scripts/CodeGeneratorJS.pm:
1335         (GenerateDefaultValue):
1336         * bindings/scripts/test/JS/JSTestObj.cpp:
1337         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringBody):
1338         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNullBody):
1339         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyStringBody):
1340         * css/CSSPageRule.cpp:
1341         (WebCore::CSSPageRule::selectorText):
1342         * css/CSSPrimitiveValue.cpp:
1343         (WebCore::valueName):
1344         * css/CSSSelector.cpp:
1345         (WebCore::simpleSelectorSpecificityInternal):
1346         (WebCore::CSSSelector::specificityForPage):
1347         (WebCore::CSSSelector::RareData::RareData):
1348         * css/CSSSelector.h:
1349         (WebCore::CSSSelector::argument):
1350         * css/CSSSelectorList.cpp:
1351         (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
1352         * css/PageRuleCollector.cpp:
1353         (WebCore::checkPageSelectorComponents):
1354         * css/RuleSet.cpp:
1355         (WebCore::computeMatchBasedOnRuleHash):
1356         (WebCore::RuleSet::addRule):
1357         * css/SelectorChecker.cpp:
1358         (WebCore::tagMatches):
1359         * css/SelectorFilter.cpp:
1360         (WebCore::collectDescendantSelectorIdentifierHashes):
1361         * css/StyleBuilderConverter.h:
1362         (WebCore::StyleBuilderConverter::convertStringOrAuto):
1363         (WebCore::StyleBuilderConverter::convertStringOrNone):
1364         * css/StyleBuilderCustom.h:
1365         (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
1366         (WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
1367         (WebCore::StyleBuilderCustom::applyValueContent):
1368         (WebCore::StyleBuilderCustom::applyValueAlt):
1369         * css/StyleSheetContents.cpp:
1370         (WebCore::StyleSheetContents::StyleSheetContents):
1371         (WebCore::StyleSheetContents::namespaceURIFromPrefix):
1372         * css/makeprop.pl:
1373         * css/parser/CSSParserImpl.cpp:
1374         (WebCore::CSSParserImpl::parsePageSelector):
1375         * css/parser/CSSSelectorParser.cpp:
1376         (WebCore::CSSSelectorParser::consumeCompoundSelector):
1377         (WebCore::CSSSelectorParser::consumeName):
1378         (WebCore::CSSSelectorParser::consumeAttribute):
1379         (WebCore::CSSSelectorParser::defaultNamespace):
1380         (WebCore::CSSSelectorParser::determineNamespace):
1381         (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
1382         * cssjit/SelectorCompiler.cpp:
1383         (WebCore::SelectorCompiler::attributeNameTestingRequiresNamespaceRegister):
1384         (WebCore::SelectorCompiler::equalTagNames):
1385         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
1386         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
1387         * dom/Attr.cpp:
1388         (WebCore::Attr::setPrefix):
1389         (WebCore::Attr::attachToElement):
1390         * dom/Attribute.h:
1391         (WebCore::Attribute::nameMatchesFilter):
1392         * dom/ConstantPropertyMap.cpp:
1393         (WebCore::ConstantPropertyMap::nameForProperty):
1394         * dom/ContainerNode.cpp:
1395         (WebCore::ContainerNode::getElementsByTagName):
1396         (WebCore::ContainerNode::getElementsByTagNameNS):
1397         * dom/CustomElementReactionQueue.cpp:
1398         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
1399         * dom/DatasetDOMStringMap.cpp:
1400         (WebCore::convertPropertyNameToAttributeName):
1401         * dom/Document.cpp:
1402         (WebCore::createUpgradeCandidateElement):
1403         (WebCore::Document::createElementForBindings):
1404         (WebCore::Document::importNode):
1405         (WebCore::Document::hasValidNamespaceForElements):
1406         (WebCore::Document::processBaseElement):
1407         (WebCore::Document::dir):
1408         (WebCore::Document::bgColor):
1409         (WebCore::Document::fgColor):
1410         (WebCore::Document::alinkColor):
1411         (WebCore::Document::linkColorForBindings):
1412         (WebCore::Document::vlinkColor):
1413         * dom/Document.h:
1414         * dom/Element.cpp:
1415         (WebCore::Element::setBooleanAttribute):
1416         (WebCore::Element::synchronizeAttribute):
1417         (WebCore::Element::getAttribute):
1418         (WebCore::Element::getAttributeNS):
1419         (WebCore::Element::setAttribute):
1420         (WebCore::Element::parserSetAttributes):
1421         (WebCore::Element::didMoveToNewDocument):
1422         (WebCore::Element::setPrefix):
1423         (WebCore::Element::insertedInto):
1424         (WebCore::Element::removedFrom):
1425         (WebCore::Element::removeAttributeInternal):
1426         (WebCore::Element::addAttributeInternal):
1427         (WebCore::Element::removeAttributeNS):
1428         (WebCore::Element::getAttributeNodeNS):
1429         (WebCore::Element::hasAttributeNS):
1430         (WebCore::Element::computeInheritedLanguage):
1431         (WebCore::Element::updateNameForDocument):
1432         (WebCore::Element::updateIdForDocument):
1433         (WebCore::Element::didAddAttribute):
1434         (WebCore::Element::didRemoveAttribute):
1435         (WebCore::Element::cloneAttributesFromElement):
1436         * dom/Element.h:
1437         (WebCore::Element::attributeWithoutSynchronization):
1438         (WebCore::Element::idForStyleResolution):
1439         (WebCore::Element::getIdAttribute):
1440         (WebCore::Element::getNameAttribute):
1441         * dom/EventTarget.cpp:
1442         (WebCore::legacyType):
1443         * dom/MutationRecord.h:
1444         (WebCore::MutationRecord::attributeName):
1445         (WebCore::MutationRecord::attributeNamespace):
1446         * dom/NamedNodeMap.cpp:
1447         (WebCore::NamedNodeMap::removeNamedItemNS):
1448         * dom/Node.cpp:
1449         (WebCore::Node::prefix):
1450         (WebCore::Node::localName):
1451         (WebCore::Node::namespaceURI):
1452         (WebCore::Node::checkSetPrefix):
1453         (WebCore::locateDefaultNamespace):
1454         (WebCore::Node::isDefaultNamespace):
1455         (WebCore::Node::lookupNamespaceURI):
1456         (WebCore::locateNamespacePrefix):
1457         (WebCore::Node::lookupPrefix):
1458         * dom/NodeRareData.h:
1459         (WebCore::NodeListsNodeData::addCachedTagCollectionNS):
1460         (WebCore::NodeListsNodeData::addCachedCollection):
1461         (WebCore::NodeListsNodeData::cachedCollection):
1462         (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
1463         (WebCore::NodeListsNodeData::removeCachedTagCollectionNS):
1464         (WebCore::NodeListsNodeData::removeCachedCollection):
1465         * dom/PseudoElement.cpp:
1466         (WebCore::pseudoElementTagName):
1467         * dom/QualifiedName.cpp:
1468         (WebCore::QualifiedName::init):
1469         (WebCore::nullQName):
1470         (WebCore::createQualifiedName):
1471         * dom/QualifiedName.h:
1472         (WebCore::QualifiedName::hasPrefix):
1473         * dom/SelectorQuery.cpp:
1474         (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
1475         * dom/SlotAssignment.cpp:
1476         (WebCore::slotNameFromAttributeValue):
1477         * dom/SlotAssignment.h:
1478         (WebCore::SlotAssignment::defaultSlotName):
1479         (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost):
1480         (WebCore::ShadowRoot::didChangeDefaultSlot):
1481         * dom/TagCollection.cpp:
1482         (WebCore::TagCollection::TagCollection):
1483         (WebCore::HTMLTagCollection::HTMLTagCollection):
1484         * dom/TagCollection.h:
1485         (WebCore::TagCollectionNS::elementMatches):
1486         * dom/make_names.pl:
1487         (printNamesCppFile):
1488         (printDefinitions):
1489         (printFactoryCppFile):
1490         * editing/CompositeEditCommand.cpp:
1491         (WebCore::CompositeEditCommand::removeNodeAttribute):
1492         * editing/Editing.cpp:
1493         (WebCore::createHTMLElement):
1494         * editing/MarkupAccumulator.cpp:
1495         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
1496         (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
1497         (WebCore::MarkupAccumulator::shouldAddNamespaceAttribute):
1498         (WebCore::MarkupAccumulator::appendNamespace):
1499         (WebCore::MarkupAccumulator::appendOpenTag):
1500         (WebCore::MarkupAccumulator::appendAttribute):
1501         * editing/gtk/EditorGtk.cpp:
1502         (WebCore::elementURL):
1503         * editing/markup.cpp:
1504         (WebCore::AttributeChange::AttributeChange):
1505         * html/Autocapitalize.cpp:
1506         (WebCore::stringForAutocapitalizeType):
1507         * html/Autofill.cpp:
1508         (WebCore::AutofillData::createFromHTMLFormControlElement):
1509         * html/DOMTokenList.h:
1510         (WebCore::DOMTokenList::item):
1511         * html/FormAssociatedElement.cpp:
1512         (WebCore::FormAssociatedElement::name):
1513         * html/HTMLButtonElement.cpp:
1514         (WebCore::HTMLButtonElement::formControlType):
1515         * html/HTMLDetailsElement.cpp:
1516         (WebCore::HTMLDetailsElement::toggleOpen):
1517         * html/HTMLDocument.cpp:
1518         (WebCore::HTMLDocument::isCaseSensitiveAttribute):
1519         * html/HTMLElement.cpp:
1520         (WebCore::HTMLElement::eventNameForEventHandlerAttribute):
1521         (WebCore::toValidDirValue):
1522         * html/HTMLImageElement.cpp:
1523         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
1524         * html/HTMLInputElement.cpp:
1525         (WebCore::HTMLInputElement::name):
1526         (WebCore::HTMLInputElement::updateType):
1527         * html/HTMLMediaElement.cpp:
1528         (WebCore::HTMLMediaElement::doesHaveAttribute):
1529         * html/HTMLOptionElement.cpp:
1530         (WebCore::HTMLOptionElement::createForJSConstructor):
1531         * html/HTMLParamElement.cpp:
1532         (WebCore::HTMLParamElement::name):
1533         * html/HTMLSelectElement.cpp:
1534         (WebCore::HTMLSelectElement::setMultiple):
1535         * html/HTMLTableCellElement.cpp:
1536         (WebCore::HTMLTableCellElement::scope):
1537         * html/HTMLTrackElement.cpp:
1538         (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute):
1539         * html/LabelableElement.cpp:
1540         (WebCore::LabelableElement::labels):
1541         * html/LabelsNodeList.cpp:
1542         (WebCore::LabelsNodeList::~LabelsNodeList):
1543         * html/MediaController.cpp:
1544         (MediaController::playbackState):
1545         (eventNameForReadyState):
1546         * html/MediaDocument.cpp:
1547         (WebCore::MediaDocumentParser::createDocumentStructure):
1548         * html/parser/AtomicHTMLToken.h:
1549         (WebCore::AtomicHTMLToken::initializeAttributes):
1550         * html/parser/HTMLConstructionSite.cpp:
1551         (WebCore::HTMLConstructionSite::createElement):
1552         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
1553         * html/parser/HTMLParserIdioms.cpp:
1554         (WebCore::stripLeadingAndTrailingHTMLSpaces):
1555         (WebCore::parseHTMLHashNameReference):
1556         * html/parser/HTMLTreeBuilder.cpp:
1557         (WebCore::createForeignAttributesMap):
1558         * html/track/InbandTextTrack.cpp:
1559         (WebCore::InbandTextTrack::InbandTextTrack):
1560         * html/track/LoadableTextTrack.cpp:
1561         (WebCore::LoadableTextTrack::id):
1562         * html/track/TextTrack.cpp:
1563         (WebCore::TextTrack::captionMenuOffItem):
1564         (WebCore::TextTrack::captionMenuAutomaticItem):
1565         * html/track/TrackBase.cpp:
1566         (WebCore::MediaTrackBase::setKindInternal):
1567         * html/track/VTTRegion.cpp:
1568         (WebCore::VTTRegion::scroll):
1569         * html/track/WebVTTElement.cpp:
1570         (WebCore::nodeTypeToTagName):
1571         * html/track/WebVTTElement.h:
1572         * html/track/WebVTTToken.h:
1573         (WebCore::WebVTTToken::StartTag):
1574         * loader/FrameLoader.cpp:
1575         (WebCore::FrameLoader::clear):
1576         * loader/FrameLoader.h:
1577         * loader/ImageLoader.cpp:
1578         (WebCore::ImageLoader::clearFailedLoadURL):
1579         * loader/NavigationAction.h:
1580         * loader/PolicyChecker.cpp:
1581         (WebCore::PolicyChecker::checkNavigationPolicy):
1582         * page/DOMWindow.cpp:
1583         (WebCore::DOMWindow::showModalDialog):
1584         * page/EventHandler.cpp:
1585         (WebCore::eventNameForTouchPointState):
1586         * page/FrameTree.cpp:
1587         (WebCore::FrameTree::setName):
1588         (WebCore::FrameTree::clearName):
1589         * page/Page.cpp:
1590         (WebCore::Page::groupName):
1591         * platform/graphics/ComplexTextController.cpp:
1592         (WebCore::ComplexTextController::offsetForPosition):
1593         * platform/graphics/FontCache.cpp:
1594         (WebCore::FontCache::alternateFamilyName):
1595         * platform/graphics/FontDescription.h:
1596         (WebCore::FontCascadeDescription::initialLocale):
1597         * platform/graphics/FontGenericFamilies.cpp:
1598         (WebCore::genericFontFamilyForScript):
1599         * platform/graphics/InbandTextTrackPrivate.h:
1600         (WebCore::InbandTextTrackPrivate::inBandMetadataTrackDispatchType):
1601         * platform/graphics/TrackPrivateBase.h:
1602         (WebCore::TrackPrivateBase::id):
1603         (WebCore::TrackPrivateBase::label):
1604         (WebCore::TrackPrivateBase::language):
1605         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
1606         (WebCore::AVTrackPrivateAVFObjCImpl::id):
1607         (WebCore::AVTrackPrivateAVFObjCImpl::label):
1608         (WebCore::AVTrackPrivateAVFObjCImpl::language):
1609         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
1610         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
1611         (WebCore::InbandTextTrackPrivateAVCF::label):
1612         (WebCore::InbandTextTrackPrivateAVCF::language):
1613         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
1614         (WebCore::InbandTextTrackPrivateLegacyAVCF::label):
1615         (WebCore::InbandTextTrackPrivateLegacyAVCF::language):
1616         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
1617         (WebCore::InbandTextTrackPrivateAVFObjC::label):
1618         (WebCore::InbandTextTrackPrivateAVFObjC::language):
1619         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
1620         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label):
1621         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::language):
1622         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1623         (WebCore::metadataType):
1624         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
1625         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1626         (WebCore::FontCache::platformAlternateFamilyName):
1627         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
1628         (WebCore::FontCascadeDescription::effectiveFamilyAt):
1629         * platform/graphics/freetype/FontCacheFreeType.cpp:
1630         (WebCore::FontCache::platformAlternateFamilyName):
1631         * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
1632         (WebCore::InbandMetadataTextTrackPrivateGStreamer::create):
1633         * platform/graphics/win/FontCacheWin.cpp:
1634         (WebCore::FontCache::platformAlternateFamilyName):
1635         * platform/mediastream/AudioTrackPrivateMediaStream.h:
1636         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
1637         (WebCore::RealtimeMediaSourceSettings::facingMode):
1638         * platform/mediastream/VideoTrackPrivateMediaStream.h:
1639         * rendering/HitTestResult.cpp:
1640         (WebCore::HitTestResult::linkSuggestedFilename):
1641         * rendering/InlineTextBox.cpp:
1642         (WebCore::InlineTextBox::paint):
1643         * rendering/RenderListItem.cpp:
1644         (WebCore::RenderListItem::markerText):
1645         * rendering/RenderText.cpp:
1646         (WebCore::RenderText::previousOffset):
1647         (WebCore::RenderText::nextOffset):
1648         * rendering/RenderTreeAsText.cpp:
1649         (WebCore::RenderTreeAsText::writeRenderObject):
1650         * rendering/TextPainter.cpp:
1651         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
1652         * rendering/style/RenderStyle.cpp:
1653         (WebCore::RenderStyle::textEmphasisMarkString):
1654         * rendering/style/RenderStyle.h:
1655         (WebCore::RenderStyle::initialHyphenationString):
1656         (WebCore::RenderStyle::initialTextEmphasisCustomMark):
1657         (WebCore::RenderStyle::initialContentAltText):
1658         (WebCore::RenderStyle::initialLineGrid):
1659         (WebCore::RenderStyle::initialFlowThread):
1660         (WebCore::RenderStyle::initialRegionThread):
1661         * style/StyleScope.cpp:
1662         (WebCore::Style::Scope::collectActiveStyleSheets):
1663         * svg/SVGElement.cpp:
1664         (WebCore::SVGElement::getPresentationAttribute):
1665         * svg/SVGElement.h:
1666         (WebCore::SVGAttributeHashTranslator::hash):
1667         * svg/SVGUseElement.cpp:
1668         (WebCore::SVGUseElement::transferSizeAttributesToTargetClone):
1669         * svg/animation/SVGSMILElement.cpp:
1670         (WebCore::SVGSMILElement::constructAttributeName):
1671         * testing/MockCDMFactory.cpp:
1672         (WebCore::MockCDMInstance::requestLicense):
1673         * xml/XMLErrors.cpp:
1674         (WebCore::createXHTMLParserErrorHeader):
1675         * xml/XPathStep.cpp:
1676         (WebCore::XPath::nodeMatchesBasicTest):
1677         (WebCore::XPath::Step::nodesInAxis):
1678         * xml/parser/XMLDocumentParserLibxml2.cpp:
1679         (WebCore::XMLDocumentParser::XMLDocumentParser):
1680         (WebCore::handleNamespaceAttributes):
1681         (WebCore::handleElementAttributes):
1682
1683 2017-07-06  Chris Dumez  <cdumez@apple.com>
1684
1685         Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver
1686         https://bugs.webkit.org/show_bug.cgi?id=174234
1687
1688         Reviewed by Brent Fulgham.
1689
1690         Drop unnecessary uses of targetStatistics.dataRecordsRemoved in ResourceLoadObserver. It is
1691         always 0 since this member is only initialized later on, in the UIProcess.
1692
1693         * loader/ResourceLoadObserver.cpp:
1694         (WebCore::ResourceLoadObserver::logFrameNavigation):
1695         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1696         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1697
1698 2017-07-06  Yoav Weiss  <yoav@yoav.ws>
1699
1700         [preload] Avoid reflecting "video" and "audio" when they are not supported `as` value
1701         https://bugs.webkit.org/show_bug.cgi?id=174199
1702
1703         Reviewed by Youenn Fablet.
1704
1705         No new tests as video/audio is supported in tests. I tested this manually.
1706
1707         * html/HTMLLinkElement.cpp:
1708         (WebCore::HTMLLinkElement::as): Make sure "video" and "audio" will not be reflected when they are not supported.
1709
1710 2017-07-06  Chris Dumez  <cdumez@apple.com>
1711
1712         Drop unused ResourceLoadStatistics members
1713         https://bugs.webkit.org/show_bug.cgi?id=174226
1714
1715         Reviewed by Brent Fulgham.
1716
1717         * loader/ResourceLoadObserver.cpp:
1718         (WebCore::ResourceLoadObserver::logFrameNavigation):
1719         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1720         (WebCore::ResourceLoadObserver::logWebSocketLoading):
1721         (WebCore::ResourceLoadObserver::isPrevalentResource): Deleted.
1722         * loader/ResourceLoadObserver.h:
1723         * loader/ResourceLoadStatistics.cpp:
1724         (WebCore::ResourceLoadStatistics::encode):
1725         (WebCore::ResourceLoadStatistics::decode):
1726         (WebCore::ResourceLoadStatistics::toString):
1727         (WebCore::ResourceLoadStatistics::merge):
1728         * loader/ResourceLoadStatistics.h:
1729
1730 2017-07-06  Youenn Fablet  <youenn@apple.com>
1731
1732         Rendering of WebRTC audio in AudioSampleDataSource may trigger crackles
1733         https://bugs.webkit.org/show_bug.cgi?id=174223
1734
1735         Reviewed by Eric Carlson.
1736
1737         We try reading too quickly and need to back off a little bit if we do not enough data.
1738         This only affects real audio and not web audio, hence validated through manual testing only.
1739
1740         * platform/audio/mac/AudioSampleDataSource.mm:
1741         (WebCore::AudioSampleDataSource::pullSamplesInternal):
1742
1743 2017-07-06  Sam Weinig  <sam@webkit.org>
1744
1745         [WebIDL] Remove custom bindings for WebGL code dealing with WebGL extensions
1746         https://bugs.webkit.org/show_bug.cgi?id=174186
1747
1748         Reviewed by Alex Christensen.
1749
1750         * CMakeLists.txt:
1751         * WebCore.xcodeproj/project.pbxproj:
1752         Update files. Categorize some of the remaining custom bindings into groups.
1753
1754         * bindings/IDLTypes.h:
1755         Add a IDLWebGLExtension type, to model the special WebGLExtension type. In
1756         the future, WebGLExtension can probably be replaced by a Variant.
1757         
1758         * bindings/js/JSDOMConvertWebGL.cpp: Added.
1759         Move WebGLAny's convertToJSValue and add a convertToJSValue for WebGLExtension.
1760
1761         * bindings/js/JSDOMConvertWebGL.h:
1762         (WebCore::convertToJSValue):
1763         Since WebGLExtension is a wrapper type, we need both a pointer and reference variant
1764         of the conversion.
1765
1766         (WebCore::JSConverter<IDLWebGLExtension>::convert):
1767         Added.
1768
1769         * bindings/js/JSWebGL2RenderingContextCustom.cpp:
1770         (WebCore::toJS): Deleted.
1771         (WebCore::JSWebGL2RenderingContext::getExtension): Deleted.
1772         Remove custom operation and converter.
1773
1774         * bindings/js/JSWebGLRenderingContextCustom.cpp:
1775         (WebCore::toJS): Deleted.
1776         (WebCore::JSWebGLRenderingContext::getExtension): Deleted.
1777         Remove custom operation and converter.
1778
1779         * bindings/scripts/CodeGeneratorJS.pm:
1780         (AddToIncludesForIDLType):
1781         (NativeToJSValueDOMConvertNeedsState):
1782         (NativeToJSValueDOMConvertNeedsGlobalObject):
1783         Add support for IDLWebGLExtension.
1784
1785         * html/canvas/WebGLAny.cpp: Removed.
1786         * html/canvas/WebGLAny.h:
1787         Moved convertToJSValue to the bindings where it belongs.
1788
1789         * html/canvas/WebGLRenderingContextBase.idl:
1790         Annotate getExtension with [OverrideIDLType=IDLWebGLExtension].
1791
1792 2017-07-06  Joseph Pecoraro  <pecoraro@apple.com>
1793
1794         [Cocoa] CTParagraphStyle leak under WebCore::LinkImageLayout::LinkImageLayout
1795         https://bugs.webkit.org/show_bug.cgi?id=174228
1796
1797         Reviewed by Andreas Kling.
1798
1799         * platform/mac/DragImageMac.mm:
1800         (WebCore::LinkImageLayout::LinkImageLayout):
1801
1802 2017-07-06  Myles C. Maxfield  <mmaxfield@apple.com>
1803
1804         [Cocoa] Improve performance of font lookups
1805         https://bugs.webkit.org/show_bug.cgi?id=173960
1806         <rdar://problem/31996891>
1807
1808         Reviewed by Darin Adler.
1809
1810         Looking up kCTFontPostScriptNameAttribute is faster than kCTFontNameAttribute.
1811
1812         No new tests because there is no behavior change.
1813
1814         * platform/spi/cocoa/CoreTextSPI.h:
1815         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1816         (WebCore::FontDatabase::fontForPostScriptName):
1817
1818 2017-07-06  Myles C. Maxfield  <mmaxfield@apple.com>
1819
1820         REGRESSION(r216944): Font loads can cause Chinese characters to draw as .notdef
1821         https://bugs.webkit.org/show_bug.cgi?id=173962
1822         <rdar://problem/32925318>
1823
1824         Reviewed by Simon Fraser.
1825
1826         Previously, there was no signalling between our font loading code
1827         which determined whether or not a font should be invisible (because
1828         its in the middle of loading) and our system fallback code which
1829         created fonts when we fall off the end of the fallback list. Because
1830         of this, we were doing two things wrong:
1831
1832         1. When we started downloading a font, we would try to use a fallback
1833         font. However, if the fallback font didn't suppor the character we're
1834         trying to render, we would just bail and draw .notdef
1835         2. Even if we continued down the fallback list, and fell of the end,
1836         we wouldn't realize that the system fallback font should also be drawn
1837         as invisible.
1838
1839         This patch solves these two problems by:
1840         1. Performing a search to find the best (local) fallback font with
1841         which to fall systemFallbackFontForCharacter(). This way, if you say
1842         "font-family: 'RemoteFont', 'Helvetica'" we will use Helvetica as
1843         the lookup to ask the system to search for.
1844         2. Give the Font class an accessor which can create a duplicate, but
1845         invisible font. Give FontCascadeFonts::glyphDataForVariant() the
1846         correct tracking to know when to use this invisible duplicate.
1847
1848         Tests: fast/text/font-loading-system-fallback.html
1849                http/tests/webfont/font-loading-system-fallback-visibility.html
1850
1851         * platform/graphics/Font.cpp:
1852         (WebCore::Font::invisibleFont):
1853         * platform/graphics/Font.h:
1854         * platform/graphics/FontCascadeFonts.cpp:
1855         (WebCore::findBestFallbackFont):
1856         (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
1857         (WebCore::FontCascadeFonts::glyphDataForVariant):
1858         * platform/graphics/FontCascadeFonts.h:
1859
1860 2017-07-06  Chris Dumez  <cdumez@apple.com>
1861
1862         FileMonitor should not be ref counted
1863         https://bugs.webkit.org/show_bug.cgi?id=174166
1864
1865         Reviewed by Brent Fulgham.
1866
1867         Update FileMonitor to no longer be refcounted. It was previously easy to leak it
1868         because the object would ref itself in various lambdas. The client would have to
1869         explicitely call FileMonitor::stopMonitoring() which was fragile.
1870
1871         This patch also simplifies the code and API a bit since no longer actually
1872         requires startMonitoring() / stopMonitoring() API.
1873
1874         No new tests, covered by API tests.
1875
1876         * platform/FileMonitor.cpp:
1877         (WebCore::FileMonitor::FileMonitor):
1878         (WebCore::FileMonitor::~FileMonitor):
1879         (WebCore::FileMonitor::create): Deleted.
1880         (WebCore::FileMonitor::startMonitoring): Deleted.
1881         (WebCore::FileMonitor::stopMonitoring): Deleted.
1882         * platform/FileMonitor.h:
1883         * platform/cocoa/FileMonitorCocoa.mm:
1884         (WebCore::FileMonitor::FileMonitor):
1885         (WebCore::FileMonitor::~FileMonitor):
1886         (WebCore::FileMonitor::startMonitoring): Deleted.
1887         (WebCore::FileMonitor::stopMonitoring): Deleted.
1888
1889 2017-07-06  Matt Rajca  <mrajca@apple.com>
1890
1891         Fix build with VIDEO support disabled.
1892         https://bugs.webkit.org/show_bug.cgi?id=174217
1893
1894         Unreviewed build fix.
1895
1896         * page/Page.cpp:
1897
1898 2017-07-06  Matt Lewis  <jlewis3@apple.com>
1899
1900         Unreviewed, rolling out r219193.
1901
1902         The tests added with this revision were extreamly flaky on all
1903         platforms.
1904
1905         Reverted changeset:
1906
1907         "[SVG] Leak in SVGAnimatedListPropertyTearOff"
1908         https://bugs.webkit.org/show_bug.cgi?id=172545
1909         http://trac.webkit.org/changeset/219193
1910
1911 2017-07-06  Zalan Bujtas  <zalan@apple.com>
1912
1913         Use WTFLogAlways for debug logging so that it shows up in device system logs
1914         https://bugs.webkit.org/show_bug.cgi?id=173450
1915
1916         Reviewed by Simon Fraser.
1917
1918         If you want to showRenderTree() on-device, the result doesn't show in system log so you can't see it.
1919         Switch to WTFLogAlways to fix this, for showRenderTree and its dependencies.
1920         
1921         * platform/text/TextStream.cpp:
1922         (WebCore::writeIndent):
1923         * rendering/InlineBox.cpp:
1924         (WebCore::InlineBox::showLineTreeAndMark):
1925         (WebCore::InlineBox::showLineBox):
1926         * rendering/InlineBox.h:
1927         * rendering/InlineFlowBox.cpp:
1928         (WebCore::InlineFlowBox::showLineTreeAndMark):
1929         * rendering/InlineFlowBox.h:
1930         * rendering/InlineTextBox.cpp:
1931         (WebCore::InlineTextBox::showLineBox):
1932         * rendering/InlineTextBox.h:
1933         * rendering/RenderBlockFlow.cpp:
1934         (WebCore::RenderBlockFlow::showLineTreeAndMark):
1935         * rendering/RenderBlockFlow.h:
1936         * rendering/RenderObject.cpp:
1937         (WebCore::showRenderTreeLegend):
1938         (WebCore::RenderObject::showRenderTreeForThis):
1939         (WebCore::RenderObject::showLineTreeForThis):
1940         (WebCore::RenderObject::showRegionsInformation):
1941         (WebCore::RenderObject::showRenderObject):
1942         (WebCore::RenderObject::showRenderSubTreeAndMark):
1943         * rendering/RenderObject.h:
1944         * rendering/SimpleLineLayoutFunctions.cpp:
1945         (WebCore::SimpleLineLayout::printPrefix):
1946         (WebCore::SimpleLineLayout::showLineLayoutForFlow):
1947         * rendering/SimpleLineLayoutFunctions.h:
1948
1949 2017-07-06  Myles C. Maxfield  <mmaxfield@apple.com>
1950
1951         Unify FontCascadeFonts::glyphDataForVariant() and FontCascadeFonts::glyphDataForNormalVariant()
1952         https://bugs.webkit.org/show_bug.cgi?id=174213
1953
1954         Reviewed by Zalan Bujtas.
1955
1956         They have almost identical code. This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=173962
1957
1958         No new tests because there is no behavior change.
1959
1960         * platform/graphics/FontCascadeFonts.cpp:
1961         (WebCore::FontCascadeFonts::glyphDataForVariant):
1962         (WebCore::FontCascadeFonts::glyphDataForCharacter):
1963         (WebCore::FontCascadeFonts::glyphDataForNormalVariant): Deleted.
1964         * platform/graphics/FontCascadeFonts.h:
1965
1966 2017-07-06  Don Olmstead  <don.olmstead@sony.com>
1967
1968         [PAL] Move KillRing into PAL
1969         https://bugs.webkit.org/show_bug.cgi?id=173900
1970
1971         Reviewed by Myles C. Maxfield.
1972
1973         No new tests. No change in functionality.
1974
1975         * Configurations/WebCore.xcconfig:
1976         * PlatformGTK.cmake:
1977         * PlatformMac.cmake:
1978         * PlatformWPE.cmake:
1979         * PlatformWin.cmake:
1980         * WebCore.xcodeproj/project.pbxproj:
1981         * editing/Editor.cpp:
1982         (WebCore::Editor::Editor):
1983         * editing/Editor.h:
1984         (WebCore::Editor::killRing):
1985         * editing/EditorCommand.cpp:
1986
1987 2017-07-06  Devin Rousso  <drousso@apple.com>
1988
1989         Web Inspector: Support getting the content of WebGL/WebGL2 contexts
1990         https://bugs.webkit.org/show_bug.cgi?id=173569
1991         <rdar://problem/33112420>
1992
1993         Reviewed by Joseph Pecoraro.
1994
1995         Tests: inspector/canvas/requestContent-2d.html
1996                inspector/canvas/requestContent-webgl.html
1997                inspector/canvas/requestContent-webgl2.html
1998
1999         * html/canvas/WebGLRenderingContextBase.cpp:
2000         (WebCore::WebGLRenderingContextBase::clearIfComposited):
2001         * html/canvas/WebGLRenderingContextBase.h:
2002         (WebCore::WebGLRenderingContextBase::preventBufferClearForInspector):
2003         (WebCore::WebGLRenderingContextBase::setPreventBufferClearForInspector):
2004         Add a flag that will prevent the context buffer from being cleared, allowing it to be copied
2005         within a toDataURL call. This is currently only used by InspectorCanvasAgent::requestContent.
2006
2007         * inspector/InspectorCanvasAgent.cpp:
2008         (WebCore::InspectorCanvasAgent::requestContent):
2009         Since toDataURL attempts to force the canvas to redraw, we can preserve the buffer after it
2010         finishes drawing so that it can be copied, instead of it normally being swapped out.
2011
2012 2017-07-06  Chris Dumez  <cdumez@apple.com>
2013
2014         Move ResourceLoadObserver notification throttling logic from WebProcess class to ResourceLoadObserver
2015         https://bugs.webkit.org/show_bug.cgi?id=174194
2016
2017         Reviewed by Brent Fulgham.
2018
2019         Move ResourceLoadObserver notification throttling logic from WebProcess class to
2020         ResourceLoadObserver. This makes more sense and decreases the complexity of the
2021         WebProcess class.
2022
2023         * loader/ResourceLoadObserver.cpp:
2024         (WebCore::ResourceLoadObserver::setNotificationCallback):
2025         (WebCore::ResourceLoadObserver::ResourceLoadObserver):
2026         (WebCore::ResourceLoadObserver::logFrameNavigation):
2027         (WebCore::ResourceLoadObserver::logSubresourceLoading):
2028         (WebCore::ResourceLoadObserver::logWebSocketLoading):
2029         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2030         (WebCore::ResourceLoadObserver::scheduleNotificationIfNeeded):
2031         (WebCore::ResourceLoadObserver::notificationTimerFired):
2032         * loader/ResourceLoadObserver.h:
2033
2034 2017-07-06  Said Abou-Hallawa  <sabouhallawa@apple.com>
2035
2036         REGRESSION(r208511): RenderImageResourceStyleImage should not assume image() won't return null if its m_cachedImage is valid
2037         https://bugs.webkit.org/show_bug.cgi?id=174168
2038
2039         Reviewed by Simon Fraser.
2040
2041         RenderImageResourceStyleImage::image() may return a null pointer even if
2042         its m_cachedImage is not null. The revision r208511, changed the function
2043         RenderImageResourceStyleImage::shutdown() so it calls Image::stopAnimation().
2044         But this change assumes that if m_cachedImage is not null then image() will
2045         return a valid pointer. This is not true because StyleCachedImage::isPending()
2046         can return true and hence, RenderImageResourceStyleImage::image() will return
2047         a null pointer.
2048
2049         * rendering/RenderImageResourceStyleImage.cpp:
2050         (WebCore::RenderImageResourceStyleImage::image): Like what RenderImageResource
2051         does, return Image::nullImage() if m_styleImage->isPending().
2052
2053 2017-07-06  Commit Queue  <commit-queue@webkit.org>
2054
2055         Unreviewed, rolling out r219201.
2056         https://bugs.webkit.org/show_bug.cgi?id=174211
2057
2058         "Causes crashes on Release builds and API tests" (Requested by
2059         ddkilzer on #webkit).
2060
2061         Reverted changeset:
2062
2063         "Add release assert to explore crash for
2064         <rdar://problem/32908525>"
2065         http://trac.webkit.org/changeset/219201
2066
2067 2017-07-06  Commit Queue  <commit-queue@webkit.org>
2068
2069         Unreviewed, rolling out r219194.
2070         https://bugs.webkit.org/show_bug.cgi?id=174207
2071
2072         it broke some layout tests (Requested by clopez on #webkit).
2073
2074         Reverted changeset:
2075
2076         "[GStreamer] vid.me videos do not play"
2077         https://bugs.webkit.org/show_bug.cgi?id=172240
2078         http://trac.webkit.org/changeset/219194
2079
2080 2017-07-06  David Kilzer  <ddkilzer@apple.com>
2081
2082         Add release assert to explore crash for <rdar://problem/32908525>
2083
2084         Reviewed by Brady Eidson.
2085
2086         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2087         (WebCore::IDBServer::UniqueIDBDatabase::~UniqueIDBDatabase): Add
2088         release assert to catch cases when the IDBBackingStore is not
2089         deleted before the UniqueIDBDatabase is destroyed.  The
2090         IDBBackingStore should always be released on the database
2091         thread.
2092
2093 2017-07-06  Matt Lewis  <jlewis3@apple.com>
2094
2095         Unreviewed, rolling out r219178.
2096
2097         This caused a consistent failure with the API test
2098         StringBuilderTest.ToAtomicStringOnEmpty on all Debug testers.
2099
2100         Reverted changeset:
2101
2102         "[WTF] Clean up StringStatics.cpp by using
2103         LazyNeverDestroyed<> for Atoms"
2104         https://bugs.webkit.org/show_bug.cgi?id=174150
2105         http://trac.webkit.org/changeset/219178
2106
2107 2017-07-06  Charlie Turner  <cturner@igalia.com>
2108
2109         [GStreamer] vid.me videos do not play
2110         https://bugs.webkit.org/show_bug.cgi?id=172240
2111
2112         Reviewed by Xabier Rodriguez-Calvar.
2113
2114         In r142251, code to hide the WK HTTP source elements from elsewhere in
2115         the pipeline was removed. This has the nasty side-effect of
2116         auto-plugging the WK HTTP source into things it really should not be
2117         used in, especially the adaptive streaming demuxers. The reasons this
2118         is bad are documented in several places on Bugzilla, see the parent
2119         bug report for more details. The high-level issue is that the WK HTTP
2120         source and its use of WebCore is not thread-safe. Although work has
2121         been recently done to improve this situation, it's still not perfect.
2122
2123         Another issue is the interface hlsdemux expects its HTTP source to
2124         implement, specifically seeking in READY.
2125
2126         This does rely on HTTP context sharing being available in GStreamer,
2127         upstream bug is here:
2128         https://bugzilla.gnome.org/show_bug.cgi?id=761099. The failing case
2129         can be demonstrated with
2130         https://github.com/thiagoss/adaptive-test-server but manual testing on
2131         popular video hosting sites, including vid.me, shows that this doesn't
2132         bite us at the moment, just something else to fix in the future.
2133
2134         There are some QoS issues with the adaptive streaming code in
2135         GStreamer, but it seems much better to offer a below par QoS in lieu
2136         of crashing/livelocking when playing certain streams, and issues can be
2137         raised upstream when they arise.
2138
2139         This patch does take us further away from the future goal of having all
2140         networking operations go through the network process, but in return it
2141         solves some nasty crashes and livelocks that have been irritating
2142         users for some time. With the pressure off on this issue, work can be
2143         planned to consider how to make the WK HTTP source a better citizen
2144         inside the GStreamer pipeline when we migrate the netcode to go
2145         through the network process.
2146
2147         A new test is added to check that the single file HLS playlists
2148         (new in version 4) can be played, which was the primary cause of
2149         this bug report.
2150
2151         Test: http/tests/media/hls/range-request.html
2152
2153         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2154         (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): Perform
2155         some trickery to make sure that we only ever fetch URLs handed to
2156         us by WebCore. Any further URLs discovered inside the pipeline
2157         will not get WKWS auto-plugged, since they'll be plain https?
2158         schemas.
2159         (WebCore::MediaPlayerPrivateGStreamer::load): Refactor to use the
2160         setPlaybinURL helper method.
2161         (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): Ditto.
2162         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add
2163         the setPlaybinURL helper method.
2164         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2165         (webKitWebSrcGetProtocols): Only advertise webkit+https?, this
2166         ensures we won't get auto-plugged by pipeline elements asking for
2167         an element to fetch https? resources (like adaptive demuxers).
2168         (convertPlaybinURI): Undo the trick when another element asks us
2169         for our URI.
2170
2171 2017-05-24  Sergio Villar Senin  <svillar@igalia.com>
2172
2173         [SVG] Leak in SVGAnimatedListPropertyTearOff
2174         https://bugs.webkit.org/show_bug.cgi?id=172545
2175
2176         Reviewed by Said Abou-Hallawa.
2177
2178         SVGAnimatedListPropertyTearOff maintains a vector m_wrappers with references to
2179         SVGPropertyTraits<PropertyType>::ListItemTearOff. Apart from that SVGPropertyTearOff has a
2180         reference to SVGAnimatedProperty.
2181
2182         When SVGListProperty::getItemValuesAndWrappers() is called, it creates a
2183         SVGPropertyTraits<PropertyType>::ListItemTearOff pointing to the same SVGAnimatedProperty (a
2184         SVGAnimatedListPropertyTearOff) which stores the m_wrappers vector where the ListItemTearOff
2185         is going to be added to. This effectively creates a reference cycle between the
2186         SVGAnimatedListPropertyTearOff and all the ListItemTearOff it stores in m_wrappers.
2187
2188         We should detach those wrappers in propertyWillBeDeleted() in order to break the cycle.
2189
2190         * svg/properties/SVGAnimatedListPropertyTearOff.h:
2191
2192 2017-07-05  Don Olmstead  <don.olmstead@sony.com>
2193
2194         [WTF] Move SoftLinking.h into WTF
2195         https://bugs.webkit.org/show_bug.cgi?id=174000
2196
2197         Reviewed by Alex Christensen.
2198
2199         No new tests. No change in functionality
2200
2201         * Modules/applepay/PaymentRequest.cpp:
2202         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
2203         * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm:
2204         * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
2205         * WebCore.xcodeproj/project.pbxproj:
2206         * editing/cocoa/EditorCocoa.mm:
2207         * editing/cocoa/HTMLConverter.mm:
2208         * editing/ios/EditorIOS.mm:
2209         * page/CaptionUserPreferencesMediaAF.cpp:
2210         * page/cocoa/SettingsCocoa.mm:
2211         * page/ios/UserAgentIOS.mm:
2212         * page/mac/ServicesOverlayController.mm:
2213         * platform/audio/ios/AudioDestinationIOS.cpp:
2214         * platform/audio/ios/AudioFileReaderIOS.cpp:
2215         * platform/audio/ios/AudioSessionIOS.mm:
2216         * platform/audio/ios/MediaSessionManagerIOS.mm:
2217         * platform/cf/CoreMediaSoftLink.cpp:
2218         * platform/cf/CoreMediaSoftLink.h:
2219         * platform/cf/MediaAccessibilitySoftLink.cpp:
2220         * platform/cf/MediaAccessibilitySoftLink.h:
2221         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
2222         * platform/cocoa/CoreVideoSoftLink.cpp:
2223         * platform/cocoa/CoreVideoSoftLink.h:
2224         * platform/cocoa/DataDetectorsCoreSoftLink.h:
2225         * platform/cocoa/NetworkExtensionContentFilter.mm:
2226         * platform/cocoa/ParentalControlsContentFilter.mm:
2227         * platform/cocoa/TelephoneNumberDetectorCocoa.cpp:
2228         * platform/cocoa/VideoToolboxSoftLink.cpp:
2229         * platform/cocoa/VideoToolboxSoftLink.h:
2230         * platform/cocoa/WebPlaybackSessionModelMediaElement.mm:
2231         * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
2232         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
2233         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
2234         * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
2235         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2236         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
2237         * platform/graphics/avfoundation/cf/AVFoundationCFSoftLinking.h:
2238         * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp:
2239         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
2240         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
2241         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
2242         * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
2243         * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
2244         * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
2245         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
2246         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
2247         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
2248         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2249         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2250         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2251         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2252         * platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
2253         * platform/graphics/cocoa/FontCascadeCocoa.mm:
2254         * platform/graphics/cocoa/FontFamilySpecificationCoreText.cpp:
2255         * platform/graphics/cv/PixelBufferConformerCV.cpp:
2256         * platform/graphics/ios/FontCacheIOS.mm:
2257         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
2258         * platform/graphics/mac/FontCacheMac.mm:
2259         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2260         * platform/graphics/mac/MediaTimeQTKit.mm:
2261         * platform/graphics/mac/PDFDocumentImageMac.mm:
2262         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
2263         * platform/ios/DragImageIOS.mm:
2264         * platform/ios/PlatformPasteboardIOS.mm:
2265         * platform/ios/PlatformScreenIOS.mm:
2266         * platform/ios/PlatformSpeechSynthesizerIOS.mm:
2267         * platform/ios/QuickLookSoftLink.h:
2268         * platform/ios/QuickLookSoftLink.mm:
2269         * platform/ios/RemoteCommandListenerIOS.mm:
2270         * platform/ios/ThemeIOS.mm:
2271         * platform/ios/ValidationBubbleIOS.mm:
2272         * platform/ios/WebCoreMotionManager.mm:
2273         * platform/ios/WebItemProviderPasteboard.mm:
2274         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2275         * platform/mac/DragImageMac.mm:
2276         * platform/mac/MediaRemoteSoftLink.cpp:
2277         * platform/mac/MediaRemoteSoftLink.h:
2278         * platform/mac/SerializedPlatformRepresentationMac.mm:
2279         * platform/mac/WebPlaybackControlsManager.mm:
2280         * platform/mac/WebVideoFullscreenController.mm:
2281         * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
2282         * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm:
2283         * platform/mediastream/libwebrtc/H264VideoToolBoxEncoder.mm:
2284         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
2285         * platform/network/cf/CookieJarCFNet.cpp:
2286         * platform/network/ios/NetworkStateNotifierIOS.mm:
2287         * platform/network/ios/PreviewConverter.mm:
2288         * platform/network/mac/BlobDataFileReferenceMac.mm:
2289         * platform/spi/cocoa/AVKitSPI.h:
2290         (-[AVTouchBarPlaybackControlsControlling NS_ENUM]): Deleted.
2291         * platform/spi/cocoa/NSAttributedStringSPI.h:
2292         * platform/spi/ios/DataDetectorsUISPI.h:
2293         * platform/spi/mac/AVFoundationSPI.h:
2294         * platform/spi/mac/DataDetectorsSPI.h:
2295         * platform/spi/mac/LookupSPI.h:
2296         * platform/spi/mac/TUCallSPI.h:
2297         * platform/win/ScrollbarThemeWin.cpp:
2298         * rendering/RenderThemeCocoa.mm:
2299         * rendering/RenderThemeIOS.mm:
2300         * rendering/RenderThemeWin.cpp:
2301         * testing/Internals.mm:
2302         * xml/XSLStyleSheetLibxslt.cpp:
2303         * xml/XSLTExtensions.cpp:
2304         * xml/XSLTProcessorLibxslt.cpp:
2305         * xml/XSLTUnicodeSort.cpp:
2306
2307 2017-07-05  Zalan Bujtas  <zalan@apple.com>
2308
2309         REGRESSION: Stack overflow in RenderBlockFlow::layoutBlock after increasing the font size to max in some RTL vertical books.
2310         https://bugs.webkit.org/show_bug.cgi?id=174144
2311         <rdar://problem/32781038>
2312
2313         Reviewed by Simon Fraser.
2314
2315         We set the start/end margin on the ruby renderer to support overhanging content. The margins ensure that
2316         adjacent boxes on the line are placed properly respecting the overhanging content.
2317         The line breaking algorithm also takes this value into account as it affects the line's available width.
2318         We need to reset this value before laying out the lines, otherwise we might end up using this value on the line twice;
2319         first as the renderer's margins (as the result of the previous layout) and second as the renderer's overhanging value.
2320         Since this is not strictly part of the renderer's layout context (i.e. we set them during the line layout and not at
2321         RenderRubyRun::layout) we can't rely on the ruby's layout logic to reset them.
2322
2323         Test: fast/ruby/ruby-overhang-margin-crash.html
2324
2325         * rendering/RenderBlockLineLayout.cpp:
2326         (WebCore::RenderBlockFlow::layoutLineBoxes):
2327
2328 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2329
2330         Upgrade GCC baseline
2331         https://bugs.webkit.org/show_bug.cgi?id=174155
2332
2333         Reviewed by Michael Catanzaro.
2334
2335         Remove workaround for old GCC.
2336
2337         * CMakeLists.txt:
2338
2339 2017-07-05  Chris Dumez  <cdumez@apple.com>
2340
2341         Unreviewed attempt to fix iOS build after r219177.
2342
2343         * page/ios/UserAgentIOS.mm:
2344         * platform/spi/ios/UIKitSPI.h:
2345
2346 2017-07-05  Chris Dumez  <cdumez@apple.com>
2347
2348         Unreviewed attempt to fix iOS build after r219177.
2349
2350         * page/ios/UserAgentIOS.mm:
2351         * platform/spi/ios/UIKitSPI.h:
2352
2353 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2354
2355         Use std::lock_guard instead of std::unique_lock if move semantics and try_lock is not necessary
2356         https://bugs.webkit.org/show_bug.cgi?id=174148
2357
2358         Reviewed by Mark Lam.
2359
2360         * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
2361         (WebCore::AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC):
2362
2363 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2364
2365         [WTF] Clean up StringStatics.cpp by using LazyNeverDestroyed<> for Atoms
2366         https://bugs.webkit.org/show_bug.cgi?id=174150
2367
2368         Reviewed by Mark Lam.
2369
2370         * Modules/mediacontrols/MediaControlsHost.cpp:
2371         (WebCore::MediaControlsHost::captionDisplayMode):
2372         * Modules/mediastream/RTCDataChannel.cpp:
2373         (WebCore::RTCDataChannel::binaryType):
2374         * accessibility/AXObjectCache.cpp:
2375         (WebCore::createFromRenderer):
2376         * accessibility/AccessibilityMediaControls.cpp:
2377         (WebCore::AccessibilityMediaControl::controlTypeName):
2378         * accessibility/AccessibilityObject.cpp:
2379         (WebCore::AccessibilityObject::language):
2380         (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
2381         (WebCore::AccessibilityObject::actionVerb):
2382         (WebCore::AccessibilityObject::getAttribute):
2383         (WebCore::AccessibilityObject::placeholderValue):
2384         * accessibility/AccessibilityObject.h:
2385         (WebCore::AccessibilityObject::accessKey):
2386         (WebCore::AccessibilityObject::ariaLiveRegionRelevant):
2387         * accessibility/AccessibilityRenderObject.cpp:
2388         (WebCore::AccessibilityRenderObject::accessKey):
2389         (WebCore::AccessibilityRenderObject::actionVerb):
2390         * bindings/js/JSCustomElementInterface.cpp:
2391         (WebCore::JSCustomElementInterface::constructElementWithFallback):
2392         * bindings/js/JSCustomElementRegistryCustom.cpp:
2393         (WebCore::JSCustomElementRegistry::define):
2394         * bindings/scripts/CodeGeneratorJS.pm:
2395         (GenerateDefaultValue):
2396         * bindings/scripts/test/JS/JSTestObj.cpp:
2397         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringBody):
2398         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsNullBody):
2399         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalAtomicStringIsEmptyStringBody):
2400         * css/CSSPageRule.cpp:
2401         (WebCore::CSSPageRule::selectorText):
2402         * css/CSSPrimitiveValue.cpp:
2403         (WebCore::valueName):
2404         * css/CSSSelector.cpp:
2405         (WebCore::simpleSelectorSpecificityInternal):
2406         (WebCore::CSSSelector::specificityForPage):
2407         (WebCore::CSSSelector::RareData::RareData):
2408         * css/CSSSelector.h:
2409         (WebCore::CSSSelector::argument):
2410         * css/CSSSelectorList.cpp:
2411         (WebCore::SelectorNeedsNamespaceResolutionFunctor::operator()):
2412         * css/PageRuleCollector.cpp:
2413         (WebCore::checkPageSelectorComponents):
2414         * css/RuleSet.cpp:
2415         (WebCore::computeMatchBasedOnRuleHash):
2416         (WebCore::RuleSet::addRule):
2417         * css/SelectorChecker.cpp:
2418         (WebCore::tagMatches):
2419         * css/SelectorFilter.cpp:
2420         (WebCore::collectDescendantSelectorIdentifierHashes):
2421         * css/StyleBuilderConverter.h:
2422         (WebCore::StyleBuilderConverter::convertStringOrAuto):
2423         (WebCore::StyleBuilderConverter::convertStringOrNone):
2424         * css/StyleBuilderCustom.h:
2425         (WebCore::StyleBuilderCustom::applyValueWebkitLocale):
2426         (WebCore::StyleBuilderCustom::applyValueWebkitTextEmphasisStyle):
2427         (WebCore::StyleBuilderCustom::applyValueContent):
2428         (WebCore::StyleBuilderCustom::applyValueAlt):
2429         * css/StyleSheetContents.cpp:
2430         (WebCore::StyleSheetContents::StyleSheetContents):
2431         (WebCore::StyleSheetContents::namespaceURIFromPrefix):
2432         * css/makeprop.pl:
2433         * css/parser/CSSParserImpl.cpp:
2434         (WebCore::CSSParserImpl::parsePageSelector):
2435         * css/parser/CSSSelectorParser.cpp:
2436         (WebCore::CSSSelectorParser::consumeCompoundSelector):
2437         (WebCore::CSSSelectorParser::consumeName):
2438         (WebCore::CSSSelectorParser::consumeAttribute):
2439         (WebCore::CSSSelectorParser::defaultNamespace):
2440         (WebCore::CSSSelectorParser::determineNamespace):
2441         (WebCore::CSSSelectorParser::prependTypeSelectorIfNeeded):
2442         * cssjit/SelectorCompiler.cpp:
2443         (WebCore::SelectorCompiler::attributeNameTestingRequiresNamespaceRegister):
2444         (WebCore::SelectorCompiler::equalTagNames):
2445         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeMatching):
2446         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasTagName):
2447         * dom/Attr.cpp:
2448         (WebCore::Attr::setPrefix):
2449         (WebCore::Attr::attachToElement):
2450         * dom/Attribute.h:
2451         (WebCore::Attribute::nameMatchesFilter):
2452         * dom/ConstantPropertyMap.cpp:
2453         (WebCore::ConstantPropertyMap::nameForProperty):
2454         * dom/ContainerNode.cpp:
2455         (WebCore::ContainerNode::getElementsByTagName):
2456         (WebCore::ContainerNode::getElementsByTagNameNS):
2457         * dom/CustomElementReactionQueue.cpp:
2458         (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions):
2459         * dom/DatasetDOMStringMap.cpp:
2460         (WebCore::convertPropertyNameToAttributeName):
2461         * dom/Document.cpp:
2462         (WebCore::createUpgradeCandidateElement):
2463         (WebCore::Document::createElementForBindings):
2464         (WebCore::Document::importNode):
2465         (WebCore::Document::hasValidNamespaceForElements):
2466         (WebCore::Document::processBaseElement):
2467         (WebCore::Document::dir):
2468         (WebCore::Document::bgColor):
2469         (WebCore::Document::fgColor):
2470         (WebCore::Document::alinkColor):
2471         (WebCore::Document::linkColorForBindings):
2472         (WebCore::Document::vlinkColor):
2473         * dom/Document.h:
2474         * dom/Element.cpp:
2475         (WebCore::Element::setBooleanAttribute):
2476         (WebCore::Element::synchronizeAttribute):
2477         (WebCore::Element::getAttribute):
2478         (WebCore::Element::getAttributeNS):
2479         (WebCore::Element::setAttribute):
2480         (WebCore::Element::parserSetAttributes):
2481         (WebCore::Element::didMoveToNewDocument):
2482         (WebCore::Element::setPrefix):
2483         (WebCore::Element::insertedInto):
2484         (WebCore::Element::removedFrom):
2485         (WebCore::Element::removeAttributeInternal):
2486         (WebCore::Element::addAttributeInternal):
2487         (WebCore::Element::removeAttributeNS):
2488         (WebCore::Element::getAttributeNodeNS):
2489         (WebCore::Element::hasAttributeNS):
2490         (WebCore::Element::computeInheritedLanguage):
2491         (WebCore::Element::updateNameForDocument):
2492         (WebCore::Element::updateIdForDocument):
2493         (WebCore::Element::didAddAttribute):
2494         (WebCore::Element::didRemoveAttribute):
2495         (WebCore::Element::cloneAttributesFromElement):
2496         * dom/Element.h:
2497         (WebCore::Element::attributeWithoutSynchronization):
2498         (WebCore::Element::idForStyleResolution):
2499         (WebCore::Element::getIdAttribute):
2500         (WebCore::Element::getNameAttribute):
2501         * dom/EventTarget.cpp:
2502         (WebCore::legacyType):
2503         * dom/MutationRecord.h:
2504         (WebCore::MutationRecord::attributeName):
2505         (WebCore::MutationRecord::attributeNamespace):
2506         * dom/NamedNodeMap.cpp:
2507         (WebCore::NamedNodeMap::removeNamedItemNS):
2508         * dom/Node.cpp:
2509         (WebCore::Node::prefix):
2510         (WebCore::Node::localName):
2511         (WebCore::Node::namespaceURI):
2512         (WebCore::Node::checkSetPrefix):
2513         (WebCore::locateDefaultNamespace):
2514         (WebCore::Node::isDefaultNamespace):
2515         (WebCore::Node::lookupNamespaceURI):
2516         (WebCore::locateNamespacePrefix):
2517         (WebCore::Node::lookupPrefix):
2518         * dom/NodeRareData.h:
2519         (WebCore::NodeListsNodeData::addCachedTagCollectionNS):
2520         (WebCore::NodeListsNodeData::addCachedCollection):
2521         (WebCore::NodeListsNodeData::cachedCollection):
2522         (WebCore::NodeListsNodeData::removeCacheWithAtomicName):
2523         (WebCore::NodeListsNodeData::removeCachedTagCollectionNS):
2524         (WebCore::NodeListsNodeData::removeCachedCollection):
2525         * dom/PseudoElement.cpp:
2526         (WebCore::pseudoElementTagName):
2527         * dom/QualifiedName.cpp:
2528         (WebCore::QualifiedName::init):
2529         (WebCore::nullQName):
2530         (WebCore::createQualifiedName):
2531         * dom/QualifiedName.h:
2532         (WebCore::QualifiedName::hasPrefix):
2533         * dom/SelectorQuery.cpp:
2534         (WebCore::SelectorDataList::executeSingleTagNameSelectorData):
2535         * dom/SlotAssignment.cpp:
2536         (WebCore::slotNameFromAttributeValue):
2537         * dom/SlotAssignment.h:
2538         (WebCore::SlotAssignment::defaultSlotName):
2539         (WebCore::ShadowRoot::didRemoveAllChildrenOfShadowHost):
2540         (WebCore::ShadowRoot::didChangeDefaultSlot):
2541         * dom/TagCollection.cpp:
2542         (WebCore::TagCollection::TagCollection):
2543         (WebCore::HTMLTagCollection::HTMLTagCollection):
2544         * dom/TagCollection.h:
2545         (WebCore::TagCollectionNS::elementMatches):
2546         * dom/make_names.pl:
2547         (printNamesCppFile):
2548         (printDefinitions):
2549         (printFactoryCppFile):
2550         * editing/CompositeEditCommand.cpp:
2551         (WebCore::CompositeEditCommand::removeNodeAttribute):
2552         * editing/Editing.cpp:
2553         (WebCore::createHTMLElement):
2554         * editing/MarkupAccumulator.cpp:
2555         (WebCore::MarkupAccumulator::serializeNodesWithNamespaces):
2556         (WebCore::MarkupAccumulator::shouldAddNamespaceElement):
2557         (WebCore::MarkupAccumulator::shouldAddNamespaceAttribute):
2558         (WebCore::MarkupAccumulator::appendNamespace):
2559         (WebCore::MarkupAccumulator::appendOpenTag):
2560         (WebCore::MarkupAccumulator::appendAttribute):
2561         * editing/gtk/EditorGtk.cpp:
2562         (WebCore::elementURL):
2563         * editing/markup.cpp:
2564         (WebCore::AttributeChange::AttributeChange):
2565         * html/Autocapitalize.cpp:
2566         (WebCore::stringForAutocapitalizeType):
2567         * html/Autofill.cpp:
2568         (WebCore::AutofillData::createFromHTMLFormControlElement):
2569         * html/DOMTokenList.h:
2570         (WebCore::DOMTokenList::item):
2571         * html/FormAssociatedElement.cpp:
2572         (WebCore::FormAssociatedElement::name):
2573         * html/HTMLButtonElement.cpp:
2574         (WebCore::HTMLButtonElement::formControlType):
2575         * html/HTMLDetailsElement.cpp:
2576         (WebCore::HTMLDetailsElement::toggleOpen):
2577         * html/HTMLDocument.cpp:
2578         (WebCore::HTMLDocument::isCaseSensitiveAttribute):
2579         * html/HTMLElement.cpp:
2580         (WebCore::HTMLElement::eventNameForEventHandlerAttribute):
2581         (WebCore::toValidDirValue):
2582         * html/HTMLImageElement.cpp:
2583         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
2584         * html/HTMLInputElement.cpp:
2585         (WebCore::HTMLInputElement::name):
2586         (WebCore::HTMLInputElement::updateType):
2587         * html/HTMLMediaElement.cpp:
2588         (WebCore::HTMLMediaElement::doesHaveAttribute):
2589         * html/HTMLOptionElement.cpp:
2590         (WebCore::HTMLOptionElement::createForJSConstructor):
2591         * html/HTMLParamElement.cpp:
2592         (WebCore::HTMLParamElement::name):
2593         * html/HTMLSelectElement.cpp:
2594         (WebCore::HTMLSelectElement::setMultiple):
2595         * html/HTMLTableCellElement.cpp:
2596         (WebCore::HTMLTableCellElement::scope):
2597         * html/HTMLTrackElement.cpp:
2598         (WebCore::HTMLTrackElement::mediaElementCrossOriginAttribute):
2599         * html/LabelableElement.cpp:
2600         (WebCore::LabelableElement::labels):
2601         * html/LabelsNodeList.cpp:
2602         (WebCore::LabelsNodeList::~LabelsNodeList):
2603         * html/MediaController.cpp:
2604         (MediaController::playbackState):
2605         (eventNameForReadyState):
2606         * html/MediaDocument.cpp:
2607         (WebCore::MediaDocumentParser::createDocumentStructure):
2608         * html/parser/AtomicHTMLToken.h:
2609         (WebCore::AtomicHTMLToken::initializeAttributes):
2610         * html/parser/HTMLConstructionSite.cpp:
2611         (WebCore::HTMLConstructionSite::createElement):
2612         (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface):
2613         * html/parser/HTMLParserIdioms.cpp:
2614         (WebCore::stripLeadingAndTrailingHTMLSpaces):
2615         (WebCore::parseHTMLHashNameReference):
2616         * html/parser/HTMLTreeBuilder.cpp:
2617         (WebCore::createForeignAttributesMap):
2618         * html/track/InbandTextTrack.cpp:
2619         (WebCore::InbandTextTrack::InbandTextTrack):
2620         * html/track/LoadableTextTrack.cpp:
2621         (WebCore::LoadableTextTrack::id):
2622         * html/track/TextTrack.cpp:
2623         (WebCore::TextTrack::captionMenuOffItem):
2624         (WebCore::TextTrack::captionMenuAutomaticItem):
2625         * html/track/TrackBase.cpp:
2626         (WebCore::MediaTrackBase::setKindInternal):
2627         * html/track/VTTRegion.cpp:
2628         (WebCore::VTTRegion::scroll):
2629         * html/track/WebVTTElement.cpp:
2630         (WebCore::nodeTypeToTagName):
2631         * html/track/WebVTTElement.h:
2632         * html/track/WebVTTToken.h:
2633         (WebCore::WebVTTToken::StartTag):
2634         * loader/FrameLoader.cpp:
2635         (WebCore::FrameLoader::clear):
2636         * loader/FrameLoader.h:
2637         * loader/ImageLoader.cpp:
2638         (WebCore::ImageLoader::clearFailedLoadURL):
2639         * loader/NavigationAction.h:
2640         * loader/PolicyChecker.cpp:
2641         (WebCore::PolicyChecker::checkNavigationPolicy):
2642         * page/DOMWindow.cpp:
2643         (WebCore::DOMWindow::showModalDialog):
2644         * page/EventHandler.cpp:
2645         (WebCore::eventNameForTouchPointState):
2646         * page/FrameTree.cpp:
2647         (WebCore::FrameTree::setName):
2648         (WebCore::FrameTree::clearName):
2649         * page/Page.cpp:
2650         (WebCore::Page::groupName):
2651         * platform/graphics/ComplexTextController.cpp:
2652         (WebCore::ComplexTextController::offsetForPosition):
2653         * platform/graphics/FontCache.cpp:
2654         (WebCore::FontCache::alternateFamilyName):
2655         * platform/graphics/FontDescription.h:
2656         (WebCore::FontCascadeDescription::initialLocale):
2657         * platform/graphics/FontGenericFamilies.cpp:
2658         (WebCore::genericFontFamilyForScript):
2659         * platform/graphics/InbandTextTrackPrivate.h:
2660         (WebCore::InbandTextTrackPrivate::inBandMetadataTrackDispatchType):
2661         * platform/graphics/TrackPrivateBase.h:
2662         (WebCore::TrackPrivateBase::id):
2663         (WebCore::TrackPrivateBase::label):
2664         (WebCore::TrackPrivateBase::language):
2665         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
2666         (WebCore::AVTrackPrivateAVFObjCImpl::id):
2667         (WebCore::AVTrackPrivateAVFObjCImpl::label):
2668         (WebCore::AVTrackPrivateAVFObjCImpl::language):
2669         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h:
2670         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
2671         (WebCore::InbandTextTrackPrivateAVCF::label):
2672         (WebCore::InbandTextTrackPrivateAVCF::language):
2673         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp:
2674         (WebCore::InbandTextTrackPrivateLegacyAVCF::label):
2675         (WebCore::InbandTextTrackPrivateLegacyAVCF::language):
2676         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm:
2677         (WebCore::InbandTextTrackPrivateAVFObjC::label):
2678         (WebCore::InbandTextTrackPrivateAVFObjC::language):
2679         * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm:
2680         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::label):
2681         (WebCore::InbandTextTrackPrivateLegacyAVFObjC::language):
2682         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2683         (WebCore::metadataType):
2684         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive):
2685         * platform/graphics/cocoa/FontCacheCoreText.cpp:
2686         (WebCore::FontCache::platformAlternateFamilyName):
2687         * platform/graphics/cocoa/FontDescriptionCocoa.cpp:
2688         (WebCore::FontCascadeDescription::effectiveFamilyAt):
2689         * platform/graphics/freetype/FontCacheFreeType.cpp:
2690         (WebCore::FontCache::platformAlternateFamilyName):
2691         * platform/graphics/gstreamer/InbandMetadataTextTrackPrivateGStreamer.h:
2692         (WebCore::InbandMetadataTextTrackPrivateGStreamer::create):
2693         * platform/graphics/win/FontCacheWin.cpp:
2694         (WebCore::FontCache::platformAlternateFamilyName):
2695         * platform/mediastream/AudioTrackPrivateMediaStream.h:
2696         * platform/mediastream/RealtimeMediaSourceSettings.cpp:
2697         (WebCore::RealtimeMediaSourceSettings::facingMode):
2698         * platform/mediastream/VideoTrackPrivateMediaStream.h:
2699         * rendering/HitTestResult.cpp:
2700         (WebCore::HitTestResult::linkSuggestedFilename):
2701         * rendering/InlineTextBox.cpp:
2702         (WebCore::InlineTextBox::paint):
2703         * rendering/RenderListItem.cpp:
2704         (WebCore::RenderListItem::markerText):
2705         * rendering/RenderText.cpp:
2706         (WebCore::RenderText::previousOffset):
2707         (WebCore::RenderText::nextOffset):
2708         * rendering/RenderTreeAsText.cpp:
2709         (WebCore::RenderTreeAsText::writeRenderObject):
2710         * rendering/TextPainter.cpp:
2711         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded):
2712         * rendering/style/RenderStyle.cpp:
2713         (WebCore::RenderStyle::textEmphasisMarkString):
2714         * rendering/style/RenderStyle.h:
2715         (WebCore::RenderStyle::initialHyphenationString):
2716         (WebCore::RenderStyle::initialTextEmphasisCustomMark):
2717         (WebCore::RenderStyle::initialContentAltText):
2718         (WebCore::RenderStyle::initialLineGrid):
2719         (WebCore::RenderStyle::initialFlowThread):
2720         (WebCore::RenderStyle::initialRegionThread):
2721         * style/StyleScope.cpp:
2722         (WebCore::Style::Scope::collectActiveStyleSheets):
2723         * svg/SVGElement.cpp:
2724         (WebCore::SVGElement::getPresentationAttribute):
2725         * svg/SVGElement.h:
2726         (WebCore::SVGAttributeHashTranslator::hash):
2727         * svg/SVGUseElement.cpp:
2728         (WebCore::SVGUseElement::transferSizeAttributesToTargetClone):
2729         * svg/animation/SVGSMILElement.cpp:
2730         (WebCore::SVGSMILElement::constructAttributeName):
2731         * testing/MockCDMFactory.cpp:
2732         (WebCore::MockCDMInstance::requestLicense):
2733         * xml/XMLErrors.cpp:
2734         (WebCore::createXHTMLParserErrorHeader):
2735         * xml/XPathStep.cpp:
2736         (WebCore::XPath::nodeMatchesBasicTest):
2737         (WebCore::XPath::Step::nodesInAxis):
2738         * xml/parser/XMLDocumentParserLibxml2.cpp:
2739         (WebCore::XMLDocumentParser::XMLDocumentParser):
2740         (WebCore::handleNamespaceAttributes):
2741         (WebCore::handleElementAttributes):
2742
2743 2017-07-05  Chris Dumez  <cdumez@apple.com>
2744
2745         [iOS] User agent string incorrectly says "iPhone" instead of "iPad" on newer iPads
2746         https://bugs.webkit.org/show_bug.cgi?id=174182
2747         <rdar://problem/32868369>
2748
2749         Reviewed by Tim Horton.
2750
2751         In deviceNameForUserAgent() on iOS, we were forcefully returning "iPhone" if
2752         [UIApplication _isClassic] returns true. Update check to return "iPad" if
2753         [UIApplication _isClassic] returns true but [UIApplication _classMode] returns
2754         UIApplicationSceneClassicModeOriginalPad.
2755
2756         * page/ios/UserAgentIOS.mm:
2757         (WebCore::isClassicPad):
2758         (WebCore::isClassicPhone):
2759         (WebCore::osNameForUserAgent):
2760         (WebCore::deviceNameForUserAgent):
2761         * platform/spi/ios/UIKitSPI.h:
2762
2763 2017-07-05  Yusuke Suzuki  <utatane.tea@gmail.com>
2764
2765         WTF::Thread should have the threads stack bounds.
2766         https://bugs.webkit.org/show_bug.cgi?id=173975
2767
2768         Reviewed by Keith Miller.
2769
2770         When creating WebThread, we first allocate WebCore::ThreadGlobalData in UI thread
2771         and share it with WebThread.
2772         The problem is that WebCore::ThreadGlobalData has CachedResourceRequestInitiators.
2773         It allocates AtomicString, which requires WTFThreadData.
2774
2775         Before this patch, it was OK because WTFThreadData does not touch threading related
2776         things except for ThreadSpecific<>. However, after this patch, it touches
2777         WTF::Thread::current() which requires WTF::initializeThreading().
2778
2779         In this patch, we call WTF::initializeThreading() before allocating WebCore::ThreadGlobalData.
2780         And we also call AtomicString::init() before calling WebCore::ThreadGlobalData since
2781         WebCore::ThreadGlobalData allocates AtomicString.
2782
2783         This fixes crashes in the iOS web threading environment (UIWebView).
2784
2785         * platform/ios/wak/WebCoreThread.mm:
2786         (StartWebThread):
2787
2788 2017-07-05  Myles C. Maxfield  <mmaxfield@apple.com>
2789
2790         CSSFontStyleValue::isItalic seems a bit bogus.
2791         https://bugs.webkit.org/show_bug.cgi?id=174149
2792
2793         Reviewed by Tim Horton.
2794
2795         Simple typo.
2796
2797         Test: editing/execCommand/italicizeByCharacter-normal.html
2798
2799         * css/CSSFontStyleValue.h:
2800
2801 2017-07-05  Brady Eidson  <beidson@apple.com>
2802
2803         Allow navigations in subframes to get a ShouldOpenExternalURLsPolicy of "ShouldAllow".
2804         <rdar://problem/22485589> and https://bugs.webkit.org/show_bug.cgi?id=174178
2805
2806         Reviewed by Alex Christensen.
2807
2808         Test: loader/navigation-policy/should-open-external-urls/subframe-navigated-programatically-by-main-frame.html
2809
2810         This patch introduces a new flag to FrameLoadRequest to track when it is known with certainty that a 
2811         FrameLoadRequest originates from the main frame.
2812         
2813         Later, when calculating the final ShouldOpenExternalURLsPolicy, main frames navigating iframes get to propagate
2814         their permissions to the iframe.
2815         
2816         * bindings/js/CommonVM.cpp:
2817         (WebCore::lexicalFrameFromCommonVM): Helper to grab the current frame associated with the current JS callstack.
2818         * bindings/js/CommonVM.h:
2819
2820         * inspector/InspectorFrontendClientLocal.cpp:
2821         (WebCore::InspectorFrontendClientLocal::openInNewTab):
2822
2823         * inspector/InspectorPageAgent.cpp:
2824         (WebCore::InspectorPageAgent::navigate):
2825
2826         Add the new flag to FrameLoadRequest (and force almost everybody to explicitly include the flag):
2827         * loader/FrameLoadRequest.cpp:
2828         (WebCore::FrameLoadRequest::FrameLoadRequest):
2829         * loader/FrameLoadRequest.h:
2830         (WebCore::FrameLoadRequest::FrameLoadRequest):
2831         (WebCore::FrameLoadRequest::navigationInitiatedByMainFrame):
2832
2833         * loader/FrameLoader.cpp:
2834         (WebCore::FrameLoader::urlSelected):
2835         (WebCore::FrameLoader::loadURLIntoChildFrame):
2836         (WebCore::shouldOpenExternalURLsPolicyToApply): Helper that takes the new flag into account when deciding
2837           what the final ShouldOpenExternalURLsPolicy will be.
2838         (WebCore::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
2839         (WebCore::FrameLoader::loadURL):
2840         (WebCore::FrameLoader::load):
2841         (WebCore::FrameLoader::loadWithNavigationAction):
2842         (WebCore::FrameLoader::reloadWithOverrideEncoding):
2843         (WebCore::FrameLoader::reload):
2844         (WebCore::FrameLoader::loadPostRequest):
2845         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
2846         (WebCore::FrameLoader::loadDifferentDocumentItem):
2847         (WebCore::createWindow):
2848         (WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader): Deleted.
2849         * loader/FrameLoader.h:
2850
2851         * loader/FrameLoaderTypes.h:
2852
2853         * loader/NavigationAction.h:
2854         (WebCore::NavigationAction::navigationInitiatedByMainFrame):
2855         * loader/NavigationScheduler.cpp:
2856         (WebCore::ScheduledNavigation::ScheduledNavigation): Grab the "initiating frame" at the time the 
2857           ScheduledNavigation is created, as it dictates the policy we decide later.
2858         (WebCore::ScheduledNavigation::navigationInitiatedByMainFrame):
2859         (WebCore::NavigationScheduler::scheduleLocationChange):
2860
2861         * page/ContextMenuController.cpp:
2862         (WebCore::openNewWindow):
2863         (WebCore::ContextMenuController::contextMenuItemSelected):
2864
2865         * page/DOMWindow.cpp:
2866         (WebCore::DOMWindow::createWindow):
2867
2868 2017-07-05  Simon Fraser  <simon.fraser@apple.com>
2869
2870         Another build fix, for Mac.
2871
2872         * platform/graphics/cocoa/IOSurface.mm:
2873         (WebCore::IOSurface::surfaceID):
2874
2875 2017-07-05  Simon Fraser  <simon.fraser@apple.com>
2876
2877         Further attempts to fix the iOS public SDK build.
2878
2879         * platform/graphics/cocoa/IOSurface.mm:
2880         (WebCore::IOSurface::surfaceID):
2881         * platform/spi/cocoa/IOSurfaceSPI.h:
2882
2883 2017-07-05  Don Olmstead  <don.olmstead@sony.com>
2884
2885         [WinCairo] Consolidate CMake code related to CURL
2886         https://bugs.webkit.org/show_bug.cgi?id=170860
2887
2888         Reviewed by Alex Christensen.
2889
2890         No new tests. No change in functionality.
2891
2892         * PlatformWinCairo.cmake:
2893         * platform/Curl.cmake: Added.
2894
2895 2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>
2896
2897         Remove copy of ICU headers from WebKit
2898         https://bugs.webkit.org/show_bug.cgi?id=116407
2899
2900         Reviewed by Alex Christensen.
2901
2902         Use WTF's copy of ICU headers.
2903
2904         No new tests because there is no behavior change.
2905
2906         * Configurations/WebCore.xcconfig:
2907         * icu/unicode/bytestream.h: Removed.
2908         * icu/unicode/localpointer.h: Removed.
2909         * icu/unicode/parseerr.h: Removed.
2910         * icu/unicode/platform.h: Removed.
2911         * icu/unicode/ptypes.h: Removed.
2912         * icu/unicode/putil.h: Removed.
2913         * icu/unicode/rep.h: Removed.
2914         * icu/unicode/std_string.h: Removed.
2915         * icu/unicode/strenum.h: Removed.
2916         * icu/unicode/stringpiece.h: Removed.
2917         * icu/unicode/ubrk.h: Removed.
2918         * icu/unicode/uchar.h: Removed.
2919         * icu/unicode/ucnv.h: Removed.
2920         * icu/unicode/ucnv_err.h: Removed.
2921         * icu/unicode/ucol.h: Removed.
2922         * icu/unicode/uconfig.h: Removed.
2923         * icu/unicode/ucurr.h: Removed.
2924         * icu/unicode/uenum.h: Removed.
2925         * icu/unicode/uiter.h: Removed.
2926         * icu/unicode/uloc.h: Removed.
2927         * icu/unicode/umachine.h: Removed.
2928         * icu/unicode/unistr.h: Removed.
2929         * icu/unicode/unorm.h: Removed.
2930         * icu/unicode/unorm2.h: Removed.
2931         * icu/unicode/uobject.h: Removed.
2932         * icu/unicode/urename.h: Removed.
2933         * icu/unicode/uscript.h: Removed.
2934         * icu/unicode/uset.h: Removed.
2935         * icu/unicode/ustring.h: Removed.
2936         * icu/unicode/utext.h: Removed.
2937         * icu/unicode/utf.h: Removed.
2938         * icu/unicode/utf16.h: Removed.
2939         * icu/unicode/utf8.h: Removed.
2940         * icu/unicode/utf_old.h: Removed.
2941         * icu/unicode/utypes.h: Removed.
2942         * icu/unicode/uvernum.h: Removed.
2943         * icu/unicode/uversion.h: Removed.
2944         * platform/graphics/FontCache.h:
2945         (WebCore::FontDescriptionKey::makeFlagsKey):
2946
2947 2017-07-05  Wenson Hsieh  <wenson_hsieh@apple.com>
2948
2949         When dragging a selection, clearing the selection in dragstart should not crash the web process
2950         https://bugs.webkit.org/show_bug.cgi?id=174142
2951         <rdar://problem/33067501>
2952
2953         Reviewed by Tim Horton.
2954
2955         Currenly, if the page clears the current selection after dragging starts on selected content, the web process
2956         will crash while attempting to write pasteboard data for a nonexistent selection. This patch adds a trivial
2957         check for this case, bailing if no DHTML dragging data was specified by the page during a selection drag and the
2958         selection has been cleared.
2959
2960         Also removes some unused code for estimating the bounds of the current selection. On iOS, dragging was actually
2961         crashing earlier, in this codepath. However, this information isn't even used anymore, since the drag anchor
2962         point is no longer necessary on iOS.
2963
2964         Test: DataInteractionTests.DoNotCrashWhenSelectionIsClearedInDragStart
2965
2966         * page/DragController.cpp:
2967         (WebCore::DragController::startDrag):
2968
2969 2017-07-05  Simon Fraser  <simon.fraser@apple.com>
2970
2971         Try to fix iOS 10.3 public SDK builds.
2972
2973         * platform/spi/cocoa/IOSurfaceSPI.h:
2974
2975 2017-07-05  Zalan Bujtas  <zalan@apple.com>
2976
2977         REGRESSION (r217522): "Show My Relationship" link in familysearch.org does not work.
2978         https://bugs.webkit.org/show_bug.cgi?id=174070
2979         <rdar://problem/32940653>
2980
2981         Reviewed by Simon Fraser.
2982
2983         Decouple in- and out-of-flow computed position values. Now we match blink's implementation on
2984         in-flow values.
2985         This also fixes the flickering content while scrolling on hbr.org.  
2986
2987         Covered by existing test cases.
2988
2989         * css/CSSComputedStyleDeclaration.cpp:
2990         (WebCore::positionOffsetValue):
2991
2992 2017-07-05  Devin Rousso  <drousso@apple.com>
2993
2994         Web Inspector: Allow users to log any tracked canvas context
2995         https://bugs.webkit.org/show_bug.cgi?id=173397
2996         <rdar://problem/33111581>
2997
2998         Reviewed by Joseph Pecoraro.
2999
3000         Tests: inspector/canvas/resolveCanvasContext-2d.html
3001                inspector/canvas/resolveCanvasContext-webgl.html
3002                inspector/canvas/resolveCanvasContext-webgl2.html
3003                inspector/canvas/resolveCanvasContext-webgpu.html
3004
3005         * inspector/InspectorCanvasAgent.h:
3006         * inspector/InspectorCanvasAgent.cpp:
3007         (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
3008         (WebCore::contextAsScriptValue):
3009         (WebCore::InspectorCanvasAgent::resolveCanvasContext):
3010
3011 2017-07-05  Emilio Cobos Álvarez  <ecobos@igalia.com>
3012
3013         Style sharing check for fullscreen element seems bogus.
3014         https://bugs.webkit.org/show_bug.cgi?id=160196
3015
3016         Reviewed by Antti Koivisto.
3017
3018         No new tests (no easy way to test this reliably).
3019
3020         * style/StyleSharingResolver.cpp:
3021         (WebCore::Style::SharingResolver::canShareStyleWithElement):
3022
3023 2017-07-05  Simon Fraser  <simon.fraser@apple.com>
3024
3025         Add a logging channel for IOSurface allocations
3026         https://bugs.webkit.org/show_bug.cgi?id=174167
3027
3028         Reviewed by Tim Horton.
3029
3030         Add an "IOSurface" log channel, make IOSurface TextStream-loggable, and log cached
3031         and new IOSurface allocations. Do some namespace-related cleanup.
3032
3033         * platform/Logging.h:
3034         * platform/graphics/cocoa/IOSurface.h:
3035         * platform/graphics/cocoa/IOSurface.mm:
3036         (WebCore::WebCore::IOSurface::create):
3037         (WebCore::WebCore::IOSurface::surfaceID):
3038         (WebCore::operator<<):
3039
3040 2017-07-05  Antti Koivisto  <antti@apple.com>
3041
3042         Low memory notification shouldn't cause style recalc
3043         https://bugs.webkit.org/show_bug.cgi?id=173574
3044         <rdar://problem/32616997>
3045
3046         Reviewed by Andreas Kling.
3047
3048         Patch mostly by Myles.
3049
3050         When we receive a low memory warning, we clear the style resolver. Previously, we were using
3051         this as an opportunity to also purge the CSSFontSelector. However, purging the font selector
3052         is wasteful, since the exact same set of CSSFontFace objects will be recreated as soon as the
3053         CSSFontSelector is recreated. It's also harmful because this purge operation causes fonts to
3054         be removed from the document's working set, and therefore triggers a relayout. Instead, this
3055         call should be softened to only delete any transitory caches the CSSFontSelector owns.
3056
3057         We can simply delay the rebuild of the CSSFontSelector to
3058         StyleResolver::appendAuthorStyleSheets(), when it's really needed. This way, we can sidestep
3059         this whole problem.
3060
3061         There's also an added benefit: Now, buildStarted() doesn't have to be idempotent, so we can
3062         enforce a stricter calling sequence with ASSERT()s.
3063
3064         * css/CSSFontFaceSet.cpp:
3065         (WebCore::CSSFontFaceSet::emptyCaches):
3066         * css/CSSFontFaceSet.h:
3067         * css/CSSFontSelector.cpp:
3068         (WebCore::CSSFontSelector::emptyCaches):
3069
3070             Add a separate function to clear font selector caches.
3071
3072         (WebCore::CSSFontSelector::buildStarted):
3073         (WebCore::CSSFontSelector::buildCompleted):
3074         (WebCore::CSSFontSelector::addFontFaceRule):
3075         (WebCore::CSSFontSelector::fontModified):
3076
3077             No need to invalidate while building.
3078
3079         (WebCore::CSSFontSelector::fontRangesForFamily):
3080         * css/CSSFontSelector.h:
3081         * css/StyleResolver.cpp:
3082         (WebCore::StyleResolver::StyleResolver):
3083         (WebCore::StyleResolver::addCurrentSVGFontFaceRules):
3084
3085             Factor into a function from the constructor.
3086
3087         (WebCore::StyleResolver::appendAuthorStyleSheets):
3088
3089             Font selector build is now started and finished by StyleScope.
3090
3091         * css/StyleResolver.h:
3092         * dom/Document.cpp:
3093         (WebCore::Document::resolveStyle):
3094
3095             Call FrameView::styleDidChange() to update any custom scrollbars.
3096             This bug was hidden by spurious style recalcs, tested by fast/css/scrollbar-dynamic-style-change.html
3097
3098         (WebCore::Document::userAgentShadowTreeStyleResolver):
3099         (WebCore::Document::didClearStyleResolver):
3100
3101             Don't start the font selector rebuild after clearing the resolver. It would cause style recalc trashing.
3102             Instead the build starts when the new resolver is constructed.
3103
3104         * page/MemoryRelease.cpp:
3105         (WebCore::releaseCriticalMemory):
3106
3107             Release font selector caches.
3108
3109         * style/StyleScope.cpp:
3110         (WebCore::Style::Scope::resolver):
3111
3112 2017-07-05  Brent Fulgham  <bfulgham@apple.com>
3113
3114         [WK2] Prevent ResourceLoadStatistics from triggering a cascade of read/write events
3115         https://bugs.webkit.org/show_bug.cgi?id=174062\
3116         <rdar://problem/33086744>
3117
3118         Reviewed by Chris Dumez.
3119
3120         Treat DISPATCH_VNODE_DELETE, DISPATCH_VNODE_RENAME, and DISPATCH_VNODE_REVOKE as equivalent
3121         "file is unavailable" events, and act as though the file was deleted. Don't listen for
3122         DISPATCH_VNODE_EXTEND, since we always get a DISPATCH_VNODE_WRITE as well, and we only
3123         want to read once.
3124
3125         Finally, add some logging to support future investigations.
3126
3127         * platform/FileMonitor.h:
3128         (WebCore::FileMonitor::platformMonitor): Expose dispatch_source_t for logging purposes.
3129         * platform/cocoa/FileMonitorCocoa.mm:
3130         (WebCore::FileMonitor::startMonitoring): Add logging.
3131         (WebCore::FileMonitor::stopMonitoring): Ditto.
3132
3133 2017-07-05  Jonathan Bedard  <jbedard@apple.com>
3134
3135         Add WebKitPrivateFrameworkStubs for iOS 11
3136         https://bugs.webkit.org/show_bug.cgi?id=173988
3137
3138         Reviewed by David Kilzer.
3139
3140         * Configurations/WebCore.xcconfig: iphoneos and iphonesimulator should use the
3141         same directory for private framework stubs.
3142
3143 2017-07-05  Emilio Cobos Álvarez  <ecobos@igalia.com>
3144
3145         Don't resolve an extra computed style for getComputedStyle in a display: none subtree.
3146         https://bugs.webkit.org/show_bug.cgi?id=174145
3147
3148         Before this, we were also resolving the first ancestor's style as
3149         inheriting from itself, which felt pretty wrong (though I think it's
3150         not observable).
3151
3152         Reviewed by Antti Koivisto.
3153
3154         No new tests (non-observable behavior).
3155
3156         * dom/Element.cpp:
3157         (WebCore::Element::resolveComputedStyle):
3158
3159 2017-07-05  Frederic Wang  <fwang@igalia.com>
3160
3161         Move ScrolledContentsLayer property to ScrollingStateScrollingNode
3162         https://bugs.webkit.org/show_bug.cgi?id=174134
3163
3164         Reviewed by Simon Fraser.
3165
3166         ScrollingStateFrameScrollingNode and ScrollingStateOverflowScrollingNode both use a
3167         ScrolledContentsLayer property for the same purpose. This commit moves that property into
3168         their parent class ScrollingStateScrollingNode, so that more code is shared between the two
3169         classes. This will also help the refactoring in bug 174130.
3170
3171         No new tests, only dumped tree may change a bit.
3172
3173         * page/scrolling/ScrollingStateFrameScrollingNode.cpp: Remove scrolled contents layer.
3174         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
3175         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
3176         (WebCore::ScrollingStateFrameScrollingNode::setScrolledContentsLayer): Deleted.
3177         * page/scrolling/ScrollingStateFrameScrollingNode.h: Ditto.
3178         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp: Ditto.
3179         (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode):
3180         (WebCore::ScrollingStateOverflowScrollingNode::dumpProperties):
3181         (WebCore::ScrollingStateOverflowScrollingNode::setScrolledContentsLayer): Deleted.
3182         * page/scrolling/ScrollingStateOverflowScrollingNode.h: Ditto.
3183         (): Deleted.
3184         (WebCore::ScrollingStateOverflowScrollingNode::scrolledContentsLayer): Deleted.
3185         * page/scrolling/ScrollingStateScrollingNode.cpp: Add scrolled contents layer.
3186         (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
3187         (WebCore::ScrollingStateScrollingNode::setScrolledContentsLayer):
3188         (WebCore::ScrollingStateScrollingNode::dumpProperties): Use the label from the overflow class
3189         which is different from the frame class. The dumping order may change a bit too.
3190         * page/scrolling/ScrollingStateScrollingNode.h: Add ScrolledContentsLayer to the enum and
3191         scrolled contents layer.
3192         (WebCore::ScrollingStateScrollingNode::scrolledContentsLayer):
3193         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
3194         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren): Adjust enum value
3195         to use ScrollingStateScrollingNode::ScrolledContentsLayer.
3196
3197 2017-07-05  Emilio Cobos Álvarez  <ecobos@igalia.com>
3198
3199         ProcessingInstruction::clearExistingCachedSheet doesn't really exist.
3200         https://bugs.webkit.org/show_bug.cgi?id=174146
3201
3202         Reviewed by Chris Dumez.
3203
3204         No new tests (no functionality change).
3205
3206         * dom/ProcessingInstruction.h: Remove dead declaration.
3207
3208 2017-07-05  Matt Lewis  <jlewis3@apple.com>
3209
3210         Unreviewed, rolling out r219128.
3211
3212         Spoke with engineer who originally submitted, Patch for APi
3213         test to follow.
3214
3215         Reverted changeset:
3216
3217         "Unreviewed, rolling out r219070."
3218         https://bugs.webkit.org/show_bug.cgi?id=174082
3219         http://trac.webkit.org/changeset/219128
3220
3221 2017-07-05  Matt Lewis  <jlewis3@apple.com>
3222
3223         Unreviewed, rolling out r219070.
3224
3225         This revision caused consistent failures of the API test
3226         UIPasteboardTests.DoNotPastePlainTextAsURL on iOS.
3227
3228         Reverted changeset:
3229
3230         "Pasting single words copied to UIPasteboard inserts URLs in
3231         editable areas"
3232         https://bugs.webkit.org/show_bug.cgi?id=174082
3233         http://trac.webkit.org/changeset/219070
3234
3235 2017-07-05  Youenn Fablet  <youenn@apple.com>
3236
3237         Receiving tracks should be ended when peer connection is being closed
3238         https://bugs.webkit.org/show_bug.cgi?id=174109
3239
3240         Reviewed by Eric Carlson.
3241
3242         Test: webrtc/peer-connection-track-end.html
3243
3244         As per https://www.w3.org/TR/webrtc/#dom-rtcpeerconnection-close, tracks should be ended when peer connection is closed.
3245         Also updating transceiver stopped state.
3246
3247         * Modules/mediastream/RTCPeerConnection.cpp:
3248         (WebCore::RTCPeerConnection::doClose):
3249         * Modules/mediastream/RTCRtpReceiver.cpp:
3250         (WebCore::RTCRtpReceiver::stop):
3251         * Modules/mediastream/RTCRtpReceiver.h:
3252
3253 2017-07-04  Said Abou-Hallawa  <sabouhallawa@apple.com>
3254
3255         Unreviewed, review follow-up after r218961
3256
3257         * platform/graphics/BitmapImage.cpp:
3258         (WebCore::BitmapImage::updateFromSettings):
3259
3260 2017-07-04  Antti Koivisto  <antti@apple.com>
3261
3262         RenderThemeCocoa::mediaControlsFormattedStringForDuration is leaking NSDateComponentsFormatters
3263         https://bugs.webkit.org/show_bug.cgi?id=174138
3264
3265         Reviewed by Ryosuke Niwa.
3266
3267         Saw a random spin here during media playback. Looks like we are leaking.
3268
3269         * rendering/RenderThemeCocoa.h:
3270         * rendering/RenderThemeCocoa.mm:
3271         (WebCore::RenderThemeCocoa::mediaControlsFormattedStringForDuration):
3272
3273             Reuse NSDateComponentsFormatter.
3274
3275 2017-07-04  Antti Koivisto  <antti@apple.com>
3276
3277         FrameView should not set RenderView::logicalWidth directly for printing
3278         https://bugs.webkit.org/show_bug.cgi?id=174135
3279
3280         Reviewed by Zalan Bujtas.
3281
3282         Renderer logicalWidth should be set by layout. Direct override by RenderView when printing means
3283         that we don't layout children in all cases when the width changes. This is currently mostly hidden
3284         by spurious layouts but causes problems when trying to fix other things that reduces those.
3285
3286         * page/FrameView.cpp:
3287         (WebCore::FrameView::forceLayoutForPagination):
3288
3289             Instead of calling setLogicalWidth directly call the new setPageLogicalSize that sets both the width
3290             and the height uniformly.
3291
3292         * rendering/RenderView.cpp:
3293         (WebCore::RenderView::updateLogicalWidth):
3294
3295             Use pageLogicalSize->width() in printing state instead of skipping the logical width update entirely.
3296             This ensures that the layout will progress to children when the page logical width changes.
3297
3298         (WebCore::RenderView::initializeLayoutState):
3299         (WebCore::RenderView::layout):
3300         (WebCore::RenderView::pageOrViewLogicalHeight):
3301         (WebCore::RenderView::setPageLogicalSize):
3302         * rendering/RenderView.h:
3303
3304             Replace the existing m_pageLogicalHeight with std::optional m_pageLogicalSize.
3305
3306 2017-07-04  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3307
3308         [EME] Solve a couple of compiler warnings
3309         https://bugs.webkit.org/show_bug.cgi?id=174020
3310
3311         Reviewed by Michael Catanzaro.
3312
3313         * Modules/encryptedmedia/CDM.cpp:
3314         (WebCore::CDM::isPersistentType): Added default return and
3315         assertion.
3316         * Modules/encryptedmedia/MediaKeySession.cpp:
3317         (WebCore::MediaKeySession::updateKeyStatuses): This warning was
3318         already solved but I think adding an assertion for the default
3319         case can help catch errors in the future.
3320
3321 2017-07-04  Joseph Pecoraro  <pecoraro@apple.com>
3322
3323         Cleanup some StringBuilder use
3324         https://bugs.webkit.org/show_bug.cgi?id=174118
3325
3326         Reviewed by Andreas Kling.
3327
3328         * Modules/mediastream/PeerConnectionBackend.cpp:
3329         (WebCore::filterICECandidate):
3330         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
3331         * contentextensions/ContentExtension.cpp:
3332         (WebCore::ContentExtensions::ContentExtension::compileGlobalDisplayNoneStyleSheet):
3333         * css/CSSFontStyleRangeValue.cpp:
3334         (WebCore::CSSFontStyleRangeValue::customCSSText):
3335         * css/CSSFontStyleValue.cpp:
3336         (WebCore::CSSFontStyleValue::customCSSText):
3337         * css/CSSGridAutoRepeatValue.cpp:
3338         (WebCore::CSSGridAutoRepeatValue::customCSSText):
3339         * css/parser/CSSParser.cpp:
3340         (WebCore::CSSParser::parseFontFaceDescriptor):
3341         * dom/Attr.cpp:
3342         * html/canvas/WebGPURenderingContext.cpp:
3343         * html/parser/HTMLParserIdioms.cpp:
3344         * platform/network/ParsedContentType.cpp:
3345         * platform/network/cocoa/CookieCocoa.mm:
3346         * platform/text/mac/LocaleMac.mm:
3347         * xml/XMLHttpRequest.cpp:
3348         (WebCore::XMLHttpRequest::getAllResponseHeaders):
3349
3350 2017-07-03  Andreas Kling  <akling@apple.com>
3351
3352         Null RenderLayer* deref in FrameView::adjustTiledBackingCoverage()
3353         https://bugs.webkit.org/show_bug.cgi?id=174106
3354         <rdar://problem/33085838>
3355
3356         Reviewed by Tim Horton.
3357
3358         I haven't been able to reproduce this crash locally, but I have seen
3359         video of someone who can, so here's a null check for the RenderView::layer()
3360         which could be null if we're called between RenderView construction
3361         and the first callback to RenderLayerModelObject::styleDidChange().
3362
3363         * page/FrameView.cpp:
3364         (WebCore::FrameView::adjustTiledBackingCoverage):
3365
3366 2017-07-03  Matt Rajca  <mrajca@apple.com>
3367
3368         Add/remove appropriate media element behavior restrictions when updateWebsitePolicies is called
3369         https://bugs.webkit.org/show_bug.cgi?id=174103
3370
3371         Reviewed by Alex Christensen.
3372
3373         Test: Added API test.
3374
3375         Added support for updating rate change behavior restrictions on media elements that have already
3376         been created.
3377
3378         * html/HTMLMediaElement.cpp:
3379         (WebCore::HTMLMediaElement::updateRateChangeRestrictions):
3380         * html/HTMLMediaElement.h:
3381         * page/Page.cpp:
3382         (WebCore::Page::updateMediaElementRateChangeRestrictions):
3383         * page/Page.h:
3384
3385 2017-07-03  Matt Lewis  <jlewis3@apple.com>
3386
3387         Unreviewed, rolling out r219103.
3388
3389         Caused multiple build failures.
3390
3391         Reverted changeset:
3392
3393         "Remove copy of ICU headers from WebKit"
3394         https://bugs.webkit.org/show_bug.cgi?id=116407
3395         http://trac.webkit.org/changeset/219103
3396
3397 2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>
3398
3399         Remove copy of ICU headers from WebKit
3400         https://bugs.webkit.org/show_bug.cgi?id=116407
3401
3402         Reviewed by Alex Christensen.
3403
3404         Use WTF's copy of ICU headers.
3405
3406         No new tests because there is no behavior change.
3407
3408         * Configurations/WebCore.xcconfig:
3409         * icu/unicode/bytestream.h: Removed.
3410         * icu/unicode/localpointer.h: Removed.
3411         * icu/unicode/parseerr.h: Removed.
3412         * icu/unicode/platform.h: Removed.
3413         * icu/unicode/ptypes.h: Removed.
3414         * icu/unicode/putil.h: Removed.
3415         * icu/unicode/rep.h: Removed.
3416         * icu/unicode/std_string.h: Removed.
3417         * icu/unicode/strenum.h: Removed.
3418         * icu/unicode/stringpiece.h: Removed.
3419         * icu/unicode/ubrk.h: Removed.
3420         * icu/unicode/uchar.h: Removed.
3421         * icu/unicode/ucnv.h: Removed.
3422         * icu/unicode/ucnv_err.h: Removed.
3423         * icu/unicode/ucol.h: Removed.
3424         * icu/unicode/uconfig.h: Removed.
3425         * icu/unicode/ucurr.h: Removed.
3426         * icu/unicode/uenum.h: Removed.
3427         * icu/unicode/uiter.h: Removed.
3428         * icu/unicode/uloc.h: Removed.
3429         * icu/unicode/umachine.h: Removed.
3430         * icu/unicode/unistr.h: Removed.
3431         * icu/unicode/unorm.h: Removed.
3432         * icu/unicode/unorm2.h: Removed.
3433         * icu/unicode/uobject.h: Removed.
3434         * icu/unicode/urename.h: Removed.
3435         * icu/unicode/uscript.h: Removed.
3436         * icu/unicode/uset.h: Removed.
3437         * icu/unicode/ustring.h: Removed.
3438         * icu/unicode/utext.h: Removed.
3439         * icu/unicode/utf.h: Removed.
3440         * icu/unicode/utf16.h: Removed.
3441         * icu/unicode/utf8.h: Removed.
3442         * icu/unicode/utf_old.h: Removed.
3443         * icu/unicode/utypes.h: Removed.
3444         * icu/unicode/uvernum.h: Removed.
3445         * icu/unicode/uversion.h: Removed.
3446
3447 2017-07-03  Myles C. Maxfield  <mmaxfield@apple.com>
3448
3449         REGRESSION(Variation Fonts): Specifying Skia by PostScript name does not yield the expected result
3450         https://bugs.webkit.org/show_bug.cgi?id=174079
3451         <rdar://problem/33040854>
3452
3453         Reviewed by Alex Christensen.
3454
3455         Because Skia is a variation font, its PostScript name contains values to apply to its variation
3456         axes. However, WebKit's variation code was overwriting these intrinsive values with ones specified
3457         by CSS. Therefore, the intrinsic ones were being ignored. The solution is just to pass a flag from
3458         the lookup code to the variations code describing if the font was created via a PostScript name,
3459         and to not apply the CSS properties to it if it was.
3460
3461         Test: fast/text/variations/skia-postscript-name.html
3462
3463         * platform/graphics/FontCache.h:
3464         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3465         (WebCore::preparePlatformFont):
3466         (WebCore::platformFontLookupWithFamily):
3467         (WebCore::fontWithFamily):
3468
3469 2017-07-03  Brady Eidson  <beidson@apple.com>
3470
3471         Switch all WebKit API related to favicons from WebIconDatabase over to new WebCore::IconLoader mechanism.
3472         https://bugs.webkit.org/show_bug.cgi?id=174073
3473
3474         Reviewed by Andy Estes.
3475
3476         Covered by existing API test.
3477
3478         * loader/DocumentLoader.cpp:
3479         (WebCore::DocumentLoader::startIconLoading):
3480         * loader/EmptyClients.cpp:
3481         * loader/FrameLoaderClient.h:
3482
3483 2017-07-03  Sam Weinig  <sam@webkit.org>
3484
3485         [WebIDL] Remove more unnecessary uses of the preprocessor in idl files
3486         https://bugs.webkit.org/show_bug.cgi?id=174083
3487
3488         Reviewed by Alex Christensen.
3489
3490         Purge as much preprocessor use as possible.
3491
3492         * Configurations/FeatureDefines.xcconfig:
3493         Add ENABLE_NAVIGATOR_STANDALONE.
3494
3495         * animation/Animatable.idl:
3496         Remove unnecessary check for LANGUAGE_OBJECTIVE_C. We no longer generate those bindings.
3497
3498         * html/MediaError.idl:
3499         Use [Conditional] rather than the preprocessor.
3500
3501         * page/Navigator.idl:
3502         Use [Conditional] rather than the preprocessor with the new ENABLE_NAVIGATOR_STANDALONE.
3503
3504         * testing/Internals.cpp:
3505         * testing/Internals.h:
3506         Expose setQuickLookPassword on all platforms, as it doesn't hurt since it is only for testing,
3507         but make the implementation do nothing.
3508
3509         * testing/Internals.idl:
3510         Use [Conditional] rather than the preprocessor.
3511
3512 2017-07-03  Daewoong Jang  <daewoong.jang@navercorp.com>
3513
3514         [Curl] Fix compilation errors
3515         https://bugs.webkit.org/show_bug.cgi?id=174085
3516
3517         Reviewed by Alex Christensen.
3518
3519         * platform/network/curl/CurlContext.cpp:
3520         (WebCore::Curl