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