[ContentChangeObserver] Move observing logic from Document::updateStyleIfNeeded to...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2019-02-26  Zalan Bujtas  <zalan@apple.com>
2
3         [ContentChangeObserver] Move observing logic from Document::updateStyleIfNeeded to ContentChangeObserver
4         https://bugs.webkit.org/show_bug.cgi?id=195032
5         <rdar://problem/48388063>
6
7         Reviewed by Tim Horton.
8
9         This might eventually turn into a regular start/stop content observing call.
10
11         * dom/Document.cpp:
12         (WebCore::Document::updateStyleIfNeeded):
13         * page/ios/ContentChangeObserver.h:
14         * page/ios/ContentChangeObserver.mm:
15         (WebCore::ContentChangeObserver::startObservingStyleResolve):
16         (WebCore::ContentChangeObserver::stopObservingStyleResolve):
17
18 2019-02-26  Zalan Bujtas  <zalan@apple.com>
19
20         [ContentChangeObserver] Move CheckForVisibilityChange to ContentChangeObserver class
21         https://bugs.webkit.org/show_bug.cgi?id=195035
22         <rdar://problem/48389123>
23
24         Reviewed by Tim Horton.
25
26         Visibility checking logic belongs to ContentChangeObserver.
27
28         * page/ios/ContentChangeObserver.h:
29         * page/ios/ContentChangeObserver.mm:
30         (WebCore::elementImplicitVisibility):
31         (WebCore::ContentChangeObserver::StyleChange::StyleChange):
32         (WebCore::ContentChangeObserver::StyleChange::~StyleChange):
33         * rendering/updating/RenderTreeUpdater.cpp:
34         (WebCore::RenderTreeUpdater::updateElementRenderer):
35         (WebCore::elementImplicitVisibility): Deleted.
36         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange): Deleted.
37         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange): Deleted.
38
39 2019-02-26  Philippe Normand  <pnormand@igalia.com>
40
41         [EGL] Runtime support for RGB565 pixel layout
42         https://bugs.webkit.org/show_bug.cgi?id=194817
43
44         Reviewed by Carlos Garcia Campos.
45
46         Currently our graphics pipeline always relies on a ARGB8888 (32
47         bpp) pixel configuration. On some low-end (old) embedded platforms
48         the graphics driver is sometimes optimized for 16 bpp
49         configurations, such as RGB565. On those platforms the application
50         can now set the WEBKIT_EGL_PIXEL_LAYOUT environment variable to
51         "RGB565" to adjust to the best pixel configuration supported by
52         the screen and graphics driver.
53
54         * platform/graphics/egl/GLContextEGL.cpp:
55         (WebCore::GLContextEGL::getEGLConfig):
56
57 2019-02-26  Philippe Normand  <pnormand@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
58
59         [WPE] Add API for webview background color configuration
60         https://bugs.webkit.org/show_bug.cgi?id=192305
61
62         Reviewed by Michael Catanzaro.
63
64         Adapt the FrameView API to allow a default non-white background color.
65
66         * page/Frame.cpp:
67         (WebCore::Frame::createView): Replace isTransparent argument with a background color one.
68         * page/Frame.h:
69         * page/FrameView.cpp:
70         (WebCore::FrameView::recalculateBaseBackgroundColor): Use Color::transparent if m_isTransparent is true.
71         (WebCore::FrameView::updateBackgroundRecursively): Allow the fallback background color to be non-white, this is
72         used only in non-dark-mode-css build configurations.
73         * page/FrameView.h:
74         * testing/Internals.cpp:
75         (WebCore::Internals::setViewIsTransparent): Use Color::transparent if transparent is true.
76
77 2019-02-25  Yongjun Zhang  <yongjun_zhang@apple.com>
78
79         scalableNativeWebpageParameters() is not preserved on new page navigation.
80         https://bugs.webkit.org/show_bug.cgi?id=194892
81         <rdar://problem/47538280>
82
83         If a page's current default viewport configuration is scalableNativeWebpageParameters due to
84         the fact that m_canIgnoreScalingConstraints is true, loading a new page should preserve this
85         configuration until we derive the right values from viewport meta-tag.
86
87         Reviewed by Wenson Hsieh.
88
89         Test: fast/viewport/ios/viewport-shrink-to-fit-on-new-navigation.html
90
91         * page/ViewportConfiguration.cpp:
92         (WebCore::ViewportConfiguration::canOverrideConfigurationParameters const): Use fixedNativeWebpageParameters().
93         (WebCore::ViewportConfiguration::updateDefaultConfiguration): Use nativeWebpageParameters.
94         (WebCore::ViewportConfiguration::nativeWebpageParameters): Return the appropriate default configuration
95             based on m_canIgnoreScalingConstraints and shouldIgnoreMinimumEffectiveDeviceWidth().
96         (WebCore::ViewportConfiguration::fixedNativeWebpageParameters): Renamed from nativeWebpageParameters()
97         (WebCore::ViewportConfiguration::scalableNativeWebpageParameters): Use fixedNativeWebpageParameters.
98         * page/ViewportConfiguration.h: Make nativeWebpageParameters() an instance method and change the old
99             static method to fixedNativeWebpageParameters which better reflects the actual behavior.
100
101 2019-02-25  Zalan Bujtas  <zalan@apple.com>
102
103         [ContentChangeObserver] Move observing logic from DOMWindow::clearTimeout to ContentChangeObserver
104         https://bugs.webkit.org/show_bug.cgi?id=194988
105         <rdar://problem/48343040>
106
107         Reviewed by Tim Horton.
108
109         ContentChangeObserver::removeDOMTimer takes care of the canceled timer removal.
110
111         * page/DOMWindow.cpp:
112         (WebCore::DOMWindow::clearTimeout):
113         * page/ios/ContentChangeObserver.h:
114         * page/ios/ContentChangeObserver.mm:
115         (WebCore::ContentChangeObserver::startObservingDOMTimer):
116         (WebCore::ContentChangeObserver::stopObservingDOMTimer):
117         (WebCore::ContentChangeObserver::removeDOMTimer):
118
119 2019-02-25  Zalan Bujtas  <zalan@apple.com>
120
121         [ContentChangeObserver] Move observing logic from DOMTimer to ContentChangeObserver
122         https://bugs.webkit.org/show_bug.cgi?id=194987
123         <rdar://problem/48342910>
124
125         Reviewed by Tim Horton.
126
127         Content obvservation logic should all move to the ContentChangeObserver class.
128
129         * page/DOMTimer.cpp:
130         (WebCore::DOMTimer::install):
131         (WebCore::DOMTimer::fired):
132         * page/Page.cpp:
133         (WebCore::Page::Page):
134         * page/Page.h:
135         (WebCore::Page::contentChangeObserver):
136         * page/ios/ContentChangeObserver.h:
137         * page/ios/ContentChangeObserver.mm:
138         (WebCore::ContentChangeObserver::ContentChangeObserver):
139         (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded):
140         (WebCore::ContentChangeObserver::startObservingDOMTimer):
141         (WebCore::ContentChangeObserver::stopObservingDOMTimer):
142         (WebCore::ContentChangeObserver::containsObservedDOMTimer):
143         (WebCore::ContentChangeObserver::addObservedDOMTimer):
144         (WebCore::ContentChangeObserver::removeObservedDOMTimer):
145
146 2019-02-25  John Wilander  <wilander@apple.com>
147
148         Introduce and adopt new class RegistrableDomain for eTLD+1
149         https://bugs.webkit.org/show_bug.cgi?id=194791
150         <rdar://problem/48179240>
151
152         Reviewed by Alex Christensen, Fujii Hironori, and Brent Fulgham.
153
154         A new API test was added. Plenty of existing layout tests under
155         http/tests/resourceLoadStatistics/ and http/tests/storageAccess/ test the code.
156
157         This patch introduces and adopts a new class called WebCore::RegistrableDomain
158         which represents a domain's eTLD+1 (effective top level domain plus one) and is
159         the basis for the term "site," as in same-site. Other popular names include
160         high-level domain, primary domain, and top privately controlled/owned domain.
161         Effective top level domains are enumerated on the Public Suffix List
162         (https://publicsuffix.org).
163
164         This class just uses the full domain for when the Public Suffix List cannot help
165         finding the registrable domain and for WebKit ports that haven't enabled
166         PUBLIC_SUFFIX_LIST. It also uses the string "nullOrigin" as a representation
167         for the null or unique origin (this matches how these origins were handled
168         before).
169
170         The implementation is a wrapper around a String and the functions and class
171         members that now make use of this new class used to handle regular String
172         objects which didn't help much in terms of type safety or guarantees that the
173         string had already been converted to an eTLD+1.
174
175         We've at least two bad bugs in the Storage Access API because of confusion
176         between a URL's eTLD+1 and its host. The usage of WebCore::RegistrableDomain
177         will prohibit such bugs in the future.
178
179         Partitioning in WebKit also uses eTLD+1 to a large extent. I plan to adopt
180         WebCore::RegistrableDomain for partitioning in a later patch.
181
182         This patch also enhances parameter naming by:
183         - Removing parts that refer to "primary" as in primaryDomain.
184         - Replacing references to "TopPrivatelyControlledDomain" with "RegistrableDomain."
185         - Replacing references to "TopPrivatelyOwnedDomain" with "RegistrableDomain."
186         - Using the term "domain" consistently instead of e.g. "host."
187
188         * WebCore.xcodeproj/project.pbxproj:
189         * dom/Document.cpp:
190         (WebCore::Document::hasRequestedPageSpecificStorageAccessWithUserInteraction):
191         (WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction):
192         * dom/Document.h:
193         * html/HTMLAnchorElement.cpp:
194         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
195         * html/HTMLMediaElement.cpp:
196         (WebCore::HTMLMediaElement::mediaSessionTitle const):
197         * loader/AdClickAttribution.cpp:
198         (WebCore::AdClickAttribution::url const):
199         (WebCore::AdClickAttribution::referrer const):
200         (WebCore::AdClickAttribution::toString const):
201         * loader/AdClickAttribution.h:
202         (WebCore::AdClickAttribution::Source::Source):
203         (WebCore::AdClickAttribution::Source::matches const):
204         (WebCore::AdClickAttribution::Source::deleteValue):
205         (WebCore::AdClickAttribution::Destination::Destination):
206         (WebCore::AdClickAttribution::Destination::matches const):
207         (WebCore::AdClickAttribution::Destination::deleteValue):
208         * loader/ResourceLoadObserver.cpp:
209         (WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback):
210         (WebCore::ResourceLoadObserver::setLogUserInteractionNotificationCallback):
211         (WebCore::ResourceLoadObserver::setLogWebSocketLoadingNotificationCallback):
212         (WebCore::ResourceLoadObserver::setLogSubresourceLoadingNotificationCallback):
213         (WebCore::ResourceLoadObserver::setLogSubresourceRedirectNotificationCallback):
214         (WebCore::ResourceLoadObserver::logSubresourceLoading):
215         (WebCore::ResourceLoadObserver::logWebSocketLoading):
216         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
217         (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener):
218         (WebCore::ResourceLoadObserver::logFontLoad):
219         (WebCore::ResourceLoadObserver::logCanvasRead):
220         (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure):
221         (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed):
222         (WebCore::ResourceLoadObserver::logScreenAPIAccessed):
223         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForRegistrableDomain):
224         (WebCore::ResourceLoadObserver::statisticsForOrigin):
225         (WebCore::primaryDomain): Deleted.
226         (WebCore::ResourceLoadObserver::ensureResourceStatisticsForPrimaryDomain): Deleted.
227         * loader/ResourceLoadObserver.h:
228         * loader/ResourceLoadStatistics.cpp:
229         (WebCore::ResourceLoadStatistics::encode const):
230         (WebCore::ResourceLoadStatistics::decode):
231         (WebCore::ResourceLoadStatistics::toString const):
232         (WebCore::ResourceLoadStatistics::merge):
233         (WebCore::ResourceLoadStatistics::primaryDomain): Deleted.
234         * loader/ResourceLoadStatistics.h:
235         (WebCore::ResourceLoadStatistics::ResourceLoadStatistics):
236         * page/Page.cpp:
237         (WebCore::Page::logNavigation):
238         (WebCore::Page::mainFrameLoadStarted):
239         * page/Page.h:
240         * page/PerformanceMonitor.cpp:
241         (WebCore::reportPageOverPostLoadResourceThreshold):
242         * platform/RegistrableDomain.h: Added.
243         (WebCore::RegistrableDomain::RegistrableDomain):
244         (WebCore::RegistrableDomain::isEmpty const):
245         (WebCore::RegistrableDomain::string const):
246         (WebCore::RegistrableDomain::operator!= const):
247         (WebCore::RegistrableDomain::operator== const):
248         (WebCore::RegistrableDomain::matches const):
249         (WebCore::RegistrableDomain::isolatedCopy const):
250         (WebCore::RegistrableDomain::isHashTableDeletedValue const):
251         (WebCore::RegistrableDomain::hash const):
252         (WebCore::RegistrableDomain::RegistrableDomainHash::hash):
253         (WebCore::RegistrableDomain::RegistrableDomainHash::equal):
254         (WebCore::RegistrableDomain::encode const):
255         (WebCore::RegistrableDomain::decode):
256         * platform/network/NetworkStorageSession.cpp:
257         (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const):
258         (WebCore::NetworkStorageSession::shouldBlockCookies const):
259         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
260         (WebCore::NetworkStorageSession::removePrevalentDomains):
261         (WebCore::NetworkStorageSession::hasStorageAccess const):
262         (WebCore::NetworkStorageSession::getAllStorageAccessEntries const):
263         (WebCore::NetworkStorageSession::grantStorageAccess):
264         (WebCore::getPartitioningDomain): Deleted.
265         * platform/network/NetworkStorageSession.h:
266
267 2019-02-25  Chris Fleizach  <cfleizach@apple.com>
268
269         AX: <footer> HTML5 tag not reading as ARIA Landmark to VoiceOver
270         https://bugs.webkit.org/show_bug.cgi?id=190138
271         <rdar://problem/44907695>
272
273         Reviewed by Joanmarie Diggs.
274
275         Make sure that footer elements use the right role depending on their context.
276         If scoped to body, they become contentinfo. Otherwise they are just delineated by
277         a footer subrole.
278
279         * accessibility/AccessibilityObject.cpp:
280         (WebCore::AccessibilityObject::isLandmark const):
281         * accessibility/AccessibilityRenderObject.cpp:
282         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored const):
283         (WebCore::AccessibilityRenderObject::isDescendantOfElementType const):
284         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
285         * accessibility/AccessibilityRenderObject.h:
286         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
287         (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
288         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
289         (-[WebAccessibilityObjectWrapper subrole]):
290
291 2019-02-25  Sihui Liu  <sihui_liu@apple.com>
292
293         IndexedDB: IDBDatabase and IDBTransaction are leaked in layout tests
294         https://bugs.webkit.org/show_bug.cgi?id=194709
295
296         Reviewed by Geoffrey Garen.
297
298         When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so 
299         IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle. 
300  
301         Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle
302         between IDBOpenDBRequest and IDBTransaction.
303
304         Test: storage/indexeddb/IDBObject-leak.html
305
306         * Modules/indexeddb/IDBDatabase.cpp:
307         (WebCore::IDBDatabase::connectionToServerLost):
308         * Modules/indexeddb/IDBTransaction.cpp:
309         (WebCore::IDBTransaction::IDBTransaction):
310         (WebCore::IDBTransaction::~IDBTransaction):
311         (WebCore::IDBTransaction::connectionClosedFromServer):
312         * Modules/indexeddb/IDBTransaction.h:
313         * testing/Internals.cpp:
314         (WebCore::Internals::numberOfIDBTransactions const):
315         * testing/Internals.h:
316         * testing/Internals.idl:
317
318 2019-02-25  Zalan Bujtas  <zalan@apple.com>
319
320         Add missing stream parameter. Unreviewed.
321
322         * page/DOMTimer.cpp:
323         (WebCore::DOMTimer::fired):
324
325 2019-02-25  Zalan Bujtas  <zalan@apple.com>
326
327         Unreviewed build fix after r242032.
328
329         * page/DOMTimer.cpp:
330         (WebCore::DOMTimer::install):
331
332 2019-02-20  Darin Adler  <darin@apple.com>
333
334         Incorrect use of String::foldCase for font family names
335         https://bugs.webkit.org/show_bug.cgi?id=194895
336
337         Reviewed by Myles C. Maxfield.
338
339         * platform/graphics/FontCascadeDescription.cpp:
340         (WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing): Use
341         familyNamesAreEqual instead of calling convertToASCIILowercase directly.
342         (WebCore::FontCascadeDescription::familyNamesAreEqual): Use AtomicString's
343         operator== when we want case sensitive family name comparisons. This is a special
344         case to accomodate CoreText, which uses "."-prefix names for internal fonts that
345         are treated case sensitively. (Ideally webpages would not use these fonts at all.)
346         (WebCore::FontCascadeDescription::familyNameHash): Use AtomicString's existingHash
347         when we want case sensitive family name hashing.
348         (WebCore::FontCascadeDescription::foldedFamilyName): Take a String instead of an
349         AtomicString so we can use this at an additional call site. Converting from an
350         AtomicString to a String if free and automatic at the existing call sites. Use
351         convertToASCIILowercase instead of foldCase for three reasons: 1) Other functions
352         here are folding only ASCII case by using ASCIICaseInsensitiveHash, and this one
353         must be consistent. 2) this is considerably faster, and 3) font family names don't
354         need arbitrary Unicode case folding, it's only A-Z that should be folded.
355         * platform/graphics/FontCascadeDescription.h: Take a String instead of AtomicString
356         in the foldedFamilyName function.
357
358         * platform/graphics/cocoa/FontCacheCoreText.cpp:
359         (WebCore::FontDatabase::collectionForFamily): Instead of calling foldCase, use
360         FontCascadeDescription::foldedFamilyName to correctly fold font family names.
361
362 2019-02-25  Charlie Turner  <cturner@igalia.com>
363
364         [EME][GStreamer] Replace caps field loop with gst_structure_remove_fields
365         https://bugs.webkit.org/show_bug.cgi?id=194992
366
367         Reviewed by Xabier Rodriguez-Calvar.
368
369         Refactoring, no new tests.
370
371         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
372         (transformCaps): Simplify the code a little. The idea to use this
373         utility function came from a review upstream here:
374         https://gitlab.freedesktop.org/gstreamer/gst-devtools/merge_requests/67
375
376 2019-02-25  Alicia Boya García  <aboya@igalia.com>
377
378         [MSE][GStreamer] Batch player duration updates
379         https://bugs.webkit.org/show_bug.cgi?id=194220
380
381         Reviewed by Xabier Rodriguez-Calvar.
382
383         This saves up a ton of CPU cycles doing layout unnecessarily when all
384         the appended frames extend the duration of the movie, like in
385         YTTV 2018 59.DASHLatencyVP9.
386
387         This patch is an optimization that introduces no new behavior.
388
389         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
390         (WebCore::AppendPipeline::consumeAppsinkAvailableSamples):
391         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
392         (WebCore::MediaPlayerPrivateGStreamerMSE::blockDurationChanges):
393         (WebCore::MediaPlayerPrivateGStreamerMSE::unblockDurationChanges):
394         (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
395         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
396
397 2019-02-25  Miguel Gomez  <magomez@igalia.com>
398
399         [WPE] Add support for holepunch using an external video player
400         https://bugs.webkit.org/show_bug.cgi?id=194899
401
402         Reviewed by Xabier Rodriguez-Calvar.
403
404         Implement the holepunch feature to allow playback using an external player. This creates
405         a new dummy MediaPlayerPrivateHolePunch that accepts only the type "video/holepunch", and
406         whose goal is to just draw a transparent rectangle in the position where the video should be.
407         This can be used to allow a player placed on a lower plane than the browser to become visible.
408
409         Added ManualTest wpe/video-player-holepunch-external.html to test the feature.
410
411         * PlatformWPE.cmake:
412         * platform/HolePunch.cmake: Added.
413         * platform/graphics/MediaPlayer.cpp:
414         (WebCore::buildMediaEnginesVector):
415         * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp: Added.
416         (WebCore::MediaPlayerPrivateHolePunch::MediaPlayerPrivateHolePunch):
417         (WebCore::MediaPlayerPrivateHolePunch::~MediaPlayerPrivateHolePunch):
418         (WebCore::MediaPlayerPrivateHolePunch::platformLayer const):
419         (WebCore::MediaPlayerPrivateHolePunch::naturalSize const):
420         (WebCore::MediaPlayerPrivateHolePunch::pushNextHolePunchBuffer):
421         (WebCore::MediaPlayerPrivateHolePunch::swapBuffersIfNeeded):
422         (WebCore::MediaPlayerPrivateHolePunch::proxy const):
423         (WebCore::mimeTypeCache):
424         (WebCore::MediaPlayerPrivateHolePunch::getSupportedTypes):
425         (WebCore::MediaPlayerPrivateHolePunch::supportsType):
426         (WebCore::MediaPlayerPrivateHolePunch::registerMediaEngine):
427         (WebCore::MediaPlayerPrivateHolePunch::notifyReadyState):
428         * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h: Added.
429         * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
430         (WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
431
432 2019-02-24  Zalan Bujtas  <zalan@apple.com>
433
434         Introduce ContentChangeObserver class
435         https://bugs.webkit.org/show_bug.cgi?id=194977
436         <rdar://problem/48338115>
437
438         Reviewed by Simon Fraser.
439
440         This patch is about piping through all the related WK* calls. 
441
442         * SourcesCocoa.txt:
443         * WebCore.xcodeproj/project.pbxproj:
444         * dom/Document.cpp:
445         (WebCore::Document::scheduleStyleRecalc):
446         (WebCore::Document::updateStyleIfNeeded):
447         (WebCore::Document::platformSuspendOrStopActiveDOMObjects):
448         * loader/FrameLoader.cpp:
449         * page/DOMTimer.cpp:
450         (WebCore::DOMTimer::install):
451         (WebCore::DOMTimer::fired):
452         * page/DOMWindow.cpp:
453         (WebCore::DOMWindow::clearTimeout):
454         * page/Frame.cpp:
455         (WebCore::Frame::willDetachPage):
456         * page/Page.h:
457         (WebCore::Page::contentChangeObserver):
458         * page/ios/EventHandlerIOS.mm:
459         (WebCore::EventHandler::mouseMoved):
460         * rendering/updating/RenderTreeUpdater.cpp:
461         (WebCore::RenderTreeUpdater::updateElementRenderer):
462         (WebCore::CheckForVisibilityChange::CheckForVisibilityChange):
463         (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange):
464
465 2019-02-24  Simon Fraser  <simon.fraser@apple.com>
466
467         Migrate from "fixedPositionRect" to "layoutViewport" in the scrolling tree
468         https://bugs.webkit.org/show_bug.cgi?id=194984
469
470         Reviewed by Sam Weinig.
471
472         Rename "fixedPositionRect" to "layoutViewport" in scrolling tree code.
473
474         Remove ScrollingTree::fixedPositionRect() which was only used on iOS, to fetch the
475         current layout viewport rect. Instead, set the layout viewport on the root
476         node in ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling().
477
478         * page/scrolling/ScrollingTree.cpp:
479         (WebCore::ScrollingTree::mainFrameViewportChangedViaDelegatedScrolling):
480         (WebCore::ScrollingTree::viewportChangedViaDelegatedScrolling): Deleted.
481         * page/scrolling/ScrollingTree.h:
482         * page/scrolling/ScrollingTreeFrameHostingNode.cpp:
483         (WebCore::ScrollingTreeFrameHostingNode::updateLayersAfterAncestorChange):
484         * page/scrolling/ScrollingTreeFrameHostingNode.h:
485         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
486         * page/scrolling/ScrollingTreeNode.h:
487         * page/scrolling/ScrollingTreeScrollingNode.cpp:
488         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterAncestorChange):
489         * page/scrolling/ScrollingTreeScrollingNode.h:
490         * page/scrolling/cocoa/ScrollingTreeFixedNode.h:
491         * page/scrolling/cocoa/ScrollingTreeFixedNode.mm:
492         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
493         * page/scrolling/cocoa/ScrollingTreeStickyNode.h:
494         * page/scrolling/cocoa/ScrollingTreeStickyNode.mm:
495         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
496         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
497         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
498         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
499         (WebCore::ScrollingTreeOverflowScrollingNodeMac::updateLayersAfterAncestorChange):
500         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollLayerPosition):
501
502 2019-02-24  Devin Rousso  <drousso@apple.com>
503
504         Web Inspector: Change the InspectorOverlay to use native rather than canvas
505         https://bugs.webkit.org/show_bug.cgi?id=105023
506         <rdar://problem/13443692>
507
508         Reviewed by Brian Burg.
509
510         Should be no change in observed functionality.
511
512         * inspector/InspectorOverlay.h:
513         * inspector/InspectorOverlay.cpp:
514         (WebCore::truncateWithEllipsis): Added.
515         (WebCore::localPointToRootPoint): Added.
516         (WebCore::contentsQuadToCoordinateSystem):
517         (WebCore::effectiveElementForNode): Added.
518         (WebCore::quadToPath): Added.
519         (WebCore::drawOutlinedQuadWithClip): Added.
520         (WebCore::drawOutlinedQuad): Added.
521         (WebCore::drawFragmentHighlight): Added.
522         (WebCore::drawShapeHighlight): Added.
523         (WebCore::InspectorOverlay::paint):
524         (WebCore::InspectorOverlay::setIndicating):
525         (WebCore::InspectorOverlay::shouldShowOverlay const):
526         (WebCore::InspectorOverlay::update):
527         (WebCore::InspectorOverlay::setShowPaintRects): Added.
528         (WebCore::InspectorOverlay::showPaintRect):
529         (WebCore::InspectorOverlay::updatePaintRectsTimerFired):
530         (WebCore::InspectorOverlay::drawNodeHighlight):
531         (WebCore::InspectorOverlay::drawQuadHighlight):
532         (WebCore::InspectorOverlay::drawPaintRects):
533         (WebCore::InspectorOverlay::drawBounds): Added.
534         (WebCore::InspectorOverlay::drawRulers):
535         (WebCore::InspectorOverlay::drawElementTitle): Added.
536         (WebCore::contentsQuadToPage): Deleted.
537         (WebCore::InspectorOverlay::setPausedInDebuggerMessage): Deleted.
538         (WebCore::buildObjectForPoint): Deleted.
539         (WebCore::buildObjectForRect): Deleted.
540         (WebCore::buildArrayForQuad): Deleted.
541         (WebCore::buildObjectForHighlight): Deleted.
542         (WebCore::buildObjectForSize): Deleted.
543         (WebCore::InspectorOverlay::setShowingPaintRects): Deleted.
544         (WebCore::buildArrayForRendererFragments): Deleted.
545         (WebCore::localPointToRoot): Deleted.
546         (WebCore::appendPathCommandAndPoints): Deleted.
547         (WebCore::appendPathSegment): Deleted.
548         (WebCore::buildObjectForShapeOutside): Deleted.
549         (WebCore::buildObjectForElementData): Deleted.
550         (WebCore::InspectorOverlay::buildHighlightObjectForNode const): Deleted.
551         (WebCore::InspectorOverlay::buildObjectForHighlightedNodes const): Deleted.
552         (WebCore::InspectorOverlay::drawPausedInDebuggerMessage): Deleted.
553         (WebCore::InspectorOverlay::overlayPage): Deleted.
554         (WebCore::InspectorOverlay::forcePaint): Deleted.
555         (WebCore::InspectorOverlay::reset): Deleted.
556         (WebCore::evaluateCommandInOverlay): Deleted.
557         (WebCore::InspectorOverlay::evaluateInOverlay): Deleted.
558         (WebCore::InspectorOverlay::freePage): Deleted.
559
560         * inspector/agents/InspectorPageAgent.cpp:
561         (WebCore::InspectorPageAgent::disable):
562         (WebCore::InspectorPageAgent::setShowPaintRects):
563         Drive-by: rename `setShowingPaintRects` to better match the protocol.
564
565         * inspector/agents/page/PageDebuggerAgent.h:
566         * inspector/agents/page/PageDebuggerAgent.cpp:
567         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
568         (WebCore::PageDebuggerAgent::setOverlayMessage): Deleted.
569         Remove `Debugger.setOverlayMessage` command as it hasn't been used and is no longer supported.
570
571         * inspector/InspectorController.h:
572         * inspector/InspectorController.cpp:
573         (WebCore::InspectorController::createLazyAgents):
574         (WebCore::InspectorController::disconnectFrontend):
575         (WebCore::InspectorController::disconnectAllFrontends):
576         (WebCore::InspectorController::buildObjectForHighlightedNodes const): Deleted.
577
578         * testing/Internals.h:
579         * testing/Internals.idl:
580         * testing/Internals.cpp:
581         (WebCore::Internals::inspectorHighlightObject): Deleted.
582
583         * inspector/InspectorOverlayPage.css: Removed.
584         * inspector/InspectorOverlayPage.html: Removed.
585         * inspector/InspectorOverlayPage.js: Removed.
586
587         * CMakeLists.txt:
588         * DerivedSources-input.xcfilelist:
589         * DerivedSources-output.xcfilelist:
590         * DerivedSources.make:
591         * WebCore.xcodeproj/project.pbxproj:
592
593 2019-02-20  Darin Adler  <darin@apple.com>
594
595         Finish removing String::format
596         https://bugs.webkit.org/show_bug.cgi?id=194893
597
598         Reviewed by Daniel Bates.
599
600         * dom/Document.cpp:
601         (WebCore::Document::lastModified const): Use makeString and pad.
602         * html/FTPDirectoryDocument.cpp:
603         (WebCore::processFileDateString): Ditto.
604
605         * mathml/MathMLElement.cpp:
606         (WebCore::convertToPercentageIfNeeded): Use makeString and FormattedNumber.
607
608         * page/cocoa/ResourceUsageOverlayCocoa.mm:
609         (WebCore::ResourceUsageOverlay::platformDraw): Use makeString and pad.
610
611         * page/linux/ResourceUsageOverlayLinux.cpp:
612         (WebCore::cpuUsageString): Use makeString, FormattedNumber, and pad.
613         (WebCore::gcTimerString): Use String::number.
614
615         * platform/DateComponents.cpp:
616         (WebCore::DateComponents::toStringForTime const): Use makeString and pad.
617         (WebCore::DateComponents::toString const): Ditto.
618
619         * platform/LocalizedStrings.cpp: Removed comment that mentioned String::format,
620         and that was also inaccurate.
621
622         * platform/audio/HRTFElevation.cpp:
623         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
624         Use makeString and pad.
625         * platform/mock/MockRealtimeVideoSource.cpp:
626         (WebCore::MockRealtimeVideoSource::drawText): Ditto.
627         * rendering/RenderLayerCompositor.cpp:
628         (WebCore::RenderLayerCompositor::logLayerInfo): Ditto.
629         * rendering/RenderTheme.cpp:
630         (WebCore::RenderTheme::formatMediaControlsTime const): Ditto.
631
632 2019-02-24  Michael Catanzaro  <mcatanzaro@igalia.com>
633
634         [WPE][GTK] Remove user agent quirk for washingtonpost.com
635         https://bugs.webkit.org/show_bug.cgi?id=194981
636
637         Reviewed by Žan Doberšek.
638
639         Remove user agent quirk for washingtonpost.com because we support JPEG 2000 now.
640
641         * platform/UserAgentQuirks.cpp:
642         (WebCore::urlRequiresChromeBrowser):
643
644 2019-02-23  Simon Fraser  <simon.fraser@apple.com>
645
646         Remove remnants of iOS WK1 scrolling tree code
647         https://bugs.webkit.org/show_bug.cgi?id=194980
648
649         Reviewed by Sam Weinig.
650
651         Remove ScrollingTreeIOS and ScrollingCoordinatorIOS which were never instantiated,
652         to reduce maintenance costs and simplify.
653
654         Merge ScrollingTreeFrameScrollingNodeIOS into ScrollingTreeFrameScrollingNodeRemoteIOS
655         since that was the only concrete subclass, removing code which never applies to iOS WK2
656         (e.g. the synchronous scrolling code path).
657
658         * SourcesCocoa.txt:
659         * WebCore.xcodeproj/project.pbxproj:
660         * page/FrameView.h:
661         * page/scrolling/ScrollingCoordinator.cpp:
662         * page/scrolling/ScrollingTree.h:
663         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
664         * page/scrolling/ScrollingTreeNode.h:
665         * page/scrolling/ScrollingTreeScrollingNode.cpp:
666         (WebCore::ScrollingTreeScrollingNode::handleWheelEvent):
667         * page/scrolling/ScrollingTreeScrollingNode.h:
668         (WebCore::ScrollingTreeScrollingNode::updateLayersAfterDelegatedScroll): Deleted.
669         (WebCore::ScrollingTreeScrollingNode::scrollableAreaSize const): Deleted.
670         (WebCore::ScrollingTreeScrollingNode::totalContentsSize const): Deleted.
671         (WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsets const): Deleted.
672         (WebCore::ScrollingTreeScrollingNode::verticalSnapOffsets const): Deleted.
673         (WebCore::ScrollingTreeScrollingNode::horizontalSnapOffsetRanges const): Deleted.
674         (WebCore::ScrollingTreeScrollingNode::verticalSnapOffsetRanges const): Deleted.
675         (WebCore::ScrollingTreeScrollingNode::currentHorizontalSnapPointIndex const): Deleted.
676         (WebCore::ScrollingTreeScrollingNode::currentVerticalSnapPointIndex const): Deleted.
677         (WebCore::ScrollingTreeScrollingNode::setCurrentHorizontalSnapPointIndex): Deleted.
678         (WebCore::ScrollingTreeScrollingNode::setCurrentVerticalSnapPointIndex): Deleted.
679         (WebCore::ScrollingTreeScrollingNode::useDarkAppearanceForScrollbars const): Deleted.
680         (WebCore::ScrollingTreeScrollingNode::lastCommittedScrollPosition const): Deleted.
681         (WebCore::ScrollingTreeScrollingNode::reachableContentsSize const): Deleted.
682         (WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const): Deleted.
683         (WebCore::ScrollingTreeScrollingNode::scrollOrigin const): Deleted.
684         (WebCore::ScrollingTreeScrollingNode::totalContentsSizeForRubberBand const): Deleted.
685         (WebCore::ScrollingTreeScrollingNode::setTotalContentsSizeForRubberBand): Deleted.
686         (WebCore::ScrollingTreeScrollingNode::horizontalScrollElasticity const): Deleted.
687         (WebCore::ScrollingTreeScrollingNode::verticalScrollElasticity const): Deleted.
688         (WebCore::ScrollingTreeScrollingNode::hasEnabledHorizontalScrollbar const): Deleted.
689         (WebCore::ScrollingTreeScrollingNode::hasEnabledVerticalScrollbar const): Deleted.
690         (WebCore::ScrollingTreeScrollingNode::canHaveScrollbars const): Deleted.
691         (WebCore::ScrollingTreeScrollingNode::expectsWheelEventTestTrigger const): Deleted.
692         (WebCore::ScrollingTreeScrollingNode::scrollContainerLayer const): Deleted.
693         (WebCore::ScrollingTreeScrollingNode::scrolledContentsLayer const): Deleted.
694         * page/scrolling/ios/ScrollingCoordinatorIOS.h: Removed.
695         * page/scrolling/ios/ScrollingCoordinatorIOS.mm: Removed.
696         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: Removed.
697         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Removed.
698         * page/scrolling/ios/ScrollingTreeIOS.cpp: Removed.
699         * page/scrolling/ios/ScrollingTreeIOS.h: Removed.
700         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
701         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
702
703 2019-02-23  Justin Fan  <justin_fan@apple.com>
704
705         [WebGPU] Buffer updates part 1: async mapping functions, unmap, and destroy
706         https://bugs.webkit.org/show_bug.cgi?id=194665
707
708         Reviewed by Dean Jackson.
709
710         Test: map-write-buffers.html. Other tests updated to match new API.
711
712         * Modules/webgpu/WebGPUBindGroupDescriptor.cpp: Added.
713         (WebCore::validateBufferBindingType): Ensure buffer binding usages match the binding type.
714         (WebCore::WebGPUBindGroupDescriptor::asGPUBindGroupDescriptor const): Logic moved out from WebGPUDevice.cpp.
715         * Modules/webgpu/WebGPUBindGroupDescriptor.h:
716         * Modules/webgpu/WebGPUBuffer.cpp: Added GPUBuffer functionality.
717         (WebCore::WebGPUBuffer::create):
718         (WebCore::WebGPUBuffer::WebGPUBuffer):
719         (WebCore::WebGPUBuffer::mapReadAsync):
720         (WebCore::WebGPUBuffer::mapWriteAsync):
721         (WebCore::WebGPUBuffer::unmap):
722         (WebCore::WebGPUBuffer::destroy):
723         (WebCore::WebGPUBuffer::rejectOrRegisterPromiseCallback): Register a mapping request on the GPUBuffer, if valid.
724         * Modules/webgpu/WebGPUBuffer.h:
725         (WebCore::WebGPUBuffer::buffer const):
726         (WebCore::WebGPUBuffer::mapping const): Deleted.
727         * Modules/webgpu/WebGPUBuffer.idl: Update to latest API and enable every function except setSubData.
728         * Modules/webgpu/WebGPUCommandBuffer.cpp:
729         (WebCore::WebGPUCommandBuffer::beginRenderPass): Renamed descriptor conversion method.
730         * Modules/webgpu/WebGPUDevice.cpp:
731         (WebCore::WebGPUDevice::createBuffer const): Update to non-nullable return type.
732         (WebCore::WebGPUDevice::createBindGroup const): Move descriptor validation logic to descriptor implementation.
733         * Modules/webgpu/WebGPUDevice.h:
734         * Modules/webgpu/WebGPURenderPassDescriptor.cpp:
735         (WebCore::WebGPURenderPassDescriptor::asGPURenderPassDescriptor const): Renamed from validateAndConvertToGPUVersion.
736         * Modules/webgpu/WebGPURenderPassEncoder.cpp:
737         (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Add validation for submitted buffers.
738         * platform/graphics/gpu/GPUBuffer.cpp: Added.
739         (WebCore::GPUBuffer::PendingMappingCallback::PendingMappingCallback): New struct for retaining a reference to mapping callbacks.
740         * platform/graphics/gpu/GPUBuffer.h: Add functionality to retain callbacks and usage bits.
741         (WebCore::GPUBuffer::isVertex const):
742         (WebCore::GPUBuffer::isUniform const):
743         (WebCore::GPUBuffer::isStorage const):
744         (WebCore::GPUBuffer::isReadOnly const):
745         (WebCore::GPUBuffer::PendingMapPromise::create):
746         (WebCore::GPUBuffer::isMappable const):
747         (WebCore::GPUBuffer::isMapWriteable const):
748         (WebCore::GPUBuffer::isMapReadable const):
749         (WebCore::GPUBuffer::mapping const): Deleted.
750         * platform/graphics/gpu/GPUBufferUsage.h: enum class cannot be logical ORed together.
751         * platform/graphics/gpu/GPUDevice.cpp:
752         (WebCore::GPUDevice::tryCreateBuffer const): Renamed from createBuffer. 
753         (WebCore::GPUDevice::createBuffer const): Deleted.
754         * platform/graphics/gpu/GPUDevice.h:
755         * platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
756         (WebCore::GPUBuffer::tryCreateSharedBuffer): Attempt to create a MTLBuffer with shared memory.
757         (WebCore::GPUBuffer::tryCreate): No longer use Gigacage-allocated memory for MTLBuffer.
758         (WebCore::GPUBuffer::GPUBuffer):
759         (WebCore::GPUBuffer::~GPUBuffer):
760         (WebCore::GPUBuffer::registerMappingCallback): Register the provided callback to be executed when the staging buffer can be safely exposed.
761         (WebCore::GPUBuffer::stagingBufferForRead): Prepare the arrayBuffer for reading and run the mapping callback.
762         (WebCore::GPUBuffer::stagingBufferForWrite): Ditto, but for writing.
763         (WebCore::GPUBuffer::unmap): If needed, copy the staging ArrayBuffer to the MTLBuffer. Unregister any mapping callback.
764         (WebCore::GPUBuffer::destroy): Stub implementation for now. Frees the MTLBuffer as soon as possible.
765         (WebCore::GPUBuffer::create): Deleted.
766         * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm:
767         (WebCore::GPUProgrammablePassEncoder::setResourceAsBufferOnEncoder): Ensure only read-only GPUBuffers are used as read-only on the GPU.
768
769         Add symbols for new files:
770         * Sources.txt:
771         * WebCore.xcodeproj/project.pbxproj:
772
773 2019-02-23  Keith Miller  <keith_miller@apple.com>
774
775         Add new mac target numbers
776         https://bugs.webkit.org/show_bug.cgi?id=194955
777
778         Reviewed by Tim Horton.
779
780         * Configurations/Base.xcconfig:
781         * Configurations/DebugRelease.xcconfig:
782
783 2019-02-23  chris fleizach  <cfleizach@apple.com>
784
785         AX: WebKit is incorrectly mapping the <meter> element to progressbar
786         https://bugs.webkit.org/show_bug.cgi?id=164051
787         <rdar://problem/29055615>
788
789         Reviewed by Joanmarie Diggs.
790
791         Add a specific role for meter and map that to the appropriate mac role. 
792
793         * accessibility/AccessibilityNodeObject.cpp:
794         (WebCore::AccessibilityNodeObject::canHaveChildren const):
795         (WebCore::AccessibilityNodeObject::isProgressIndicator const):
796         * accessibility/AccessibilityObject.cpp:
797         (WebCore::AccessibilityObject::accessibleNameDerivesFromContent const):
798         (WebCore::AccessibilityObject::isRangeControl const):
799         (WebCore::AccessibilityObject::computedRoleString const):
800         * accessibility/AccessibilityObjectInterface.h:
801         * accessibility/AccessibilityProgressIndicator.cpp:
802         (WebCore::AccessibilityProgressIndicator::roleValue const):
803         * accessibility/AccessibilityProgressIndicator.h:
804         * accessibility/AccessibilityRenderObject.cpp:
805         (WebCore::AccessibilityRenderObject::shouldFocusActiveDescendant const):
806         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
807         (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
808         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
809         (createAccessibilityRoleMap):
810
811 2019-02-22  Ryosuke Niwa  <rniwa@webkit.org>
812
813         Crash in SWServerJobQueue::runNextJobSynchronously
814         https://bugs.webkit.org/show_bug.cgi?id=194974
815
816         Reviewed by Geoffrey Garen.
817
818         We suspect the crash is happening due to m_jobQueue being empty in runNextJobSynchronously
819         or there is a timer heap corruption again :(
820
821         Exit early when m_jobQueue is empty. Also add a debug assert that this should never happen
822         but convert an existing release assert to a debug assert since this appears to be hitting
823         too frequently in wild.
824
825         * workers/service/server/SWServerJobQueue.cpp:
826         (WebCore::SWServerJobQueue::runNextJobSynchronously):
827
828 2019-02-22  Simon Fraser  <simon.fraser@apple.com>
829
830         Clean up the setScrollPosition/setScrollPositionWithoutContentEdgeConstraints confusion in the scrolling tree nodes
831         https://bugs.webkit.org/show_bug.cgi?id=194968
832
833         Reviewed by Antti Koivisto.
834
835         Having both setScrollPosition() and setScrollPositionWithoutContentEdgeConstraints() is confusing because
836         you can't tell which is the bottleneck. So add a 'clamp' parameter to setScrollPosition() and merge them.
837
838         ScrollingTreeFrameScrollingNodeMac::setScrollPosition() replicates a bit of code but future cleanups will
839         reduce that.
840
841         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
842         (WebCore::ScrollingTreeFrameScrollingNode::setScrollPosition): Deleted. This was the same as the base class method.
843         * page/scrolling/ScrollingTreeFrameScrollingNode.h:
844         * page/scrolling/ScrollingTreeScrollingNode.cpp:
845         (WebCore::ScrollingTreeScrollingNode::setScrollPosition):
846         (WebCore::ScrollingTreeScrollingNode::clampScrollPosition const):
847         (WebCore::ScrollingTreeScrollingNode::scrollBy):
848         (WebCore::ScrollingTreeScrollingNode::setScrollPositionWithoutContentEdgeConstraints): Deleted.
849         (WebCore::ScrollingTreeScrollingNode::scrollByWithoutContentEdgeConstraints): Deleted.
850         * page/scrolling/ScrollingTreeScrollingNode.h:
851         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
852         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
853         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPosition):
854         (WebCore::ScrollingTreeFrameScrollingNodeIOS::setScrollPositionWithoutContentEdgeConstraints): Deleted. Did nothing.
855         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
856         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
857         (WebCore::ScrollingTreeFrameScrollingNodeMac::commitStateBeforeChildren):
858         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent):
859         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPosition):
860         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted.
861         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.h:
862         * page/scrolling/mac/ScrollingTreeOverflowScrollingNodeMac.mm:
863         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPosition):
864         (WebCore::ScrollingTreeOverflowScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints): Deleted.
865         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
866         (WebCore::ScrollingTreeScrollingNodeDelegateMac::immediateScrollByWithoutContentEdgeConstraints):
867         * platform/PlatformWheelEvent.h:
868         (WebCore::PlatformWheelEvent::delta const):
869         * platform/ScrollTypes.h:
870
871 2019-02-22  Eric Liang  <ericliang@apple.com>
872
873         AX: Treat AXChildrenInNavigationOrder as AXChildren before adding support for aria-flowto
874         https://bugs.webkit.org/show_bug.cgi?id=194923
875
876         Reviewed by Chris Fleizach.
877
878         Added AXChildrenInNavigationOrder attribute that returns the same array as from AXChildren. It prevents AppKit from reordering elements from the fallback AXChildren attribute.
879
880         Test: accessibility/mac/children-in-navigation-order-returns-children.html
881
882         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
883         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
884
885 2019-02-22  Tim Horton  <timothy_horton@apple.com>
886
887         ProcessSwap.PageOverlayLayerPersistence fails on iOS and in debug builds
888         https://bugs.webkit.org/show_bug.cgi?id=194963
889
890         Reviewed by Dean Jackson.
891
892         Tested by existing failing API test.
893
894         * page/Page.cpp:
895         (WebCore::Page::installedPageOverlaysChanged): Deleted.
896         * page/Page.h:
897         (WebCore::Page::pageOverlayController):
898         * page/PageOverlayController.cpp:
899         (WebCore::PageOverlayController::installedPageOverlaysChanged):
900         (WebCore::PageOverlayController::detachViewOverlayLayers):
901         (WebCore::PageOverlayController::installPageOverlay):
902         (WebCore::PageOverlayController::uninstallPageOverlay):
903         (WebCore::PageOverlayController::willDetachRootLayer): Deleted.
904         * page/PageOverlayController.h:
905         As intended by r240940, move installedPageOverlaysChanged to PageOverlayController.
906         Also, make it ignore isInWindow state; otherwise, if you install a overlay
907         and then come into window, nothing installs the root layer. There is no
908         need for this code to follow in-window state manually anymore since
909         the DrawingArea and RenderLayerCompositor just hook the layers up when needed.
910
911         Make some methods private, and make detachViewOverlayLayers only touch
912         *view* overlays, so that we don't detach the document-relative root
913         layer when you drop to having no view overlays. This maintains
914         existing behavior because nothing was calling PageOverlayController::detachViewOverlayLayers.
915
916         Now there are no callers of willDetachRootLayer, so remove it.
917
918 2019-02-22  Andy Estes  <aestes@apple.com>
919
920         [iOS] Break a reference cycle between PreviewLoader and ResourceLoader
921         https://bugs.webkit.org/show_bug.cgi?id=194964
922         <rdar://problem/48279441>
923
924         Reviewed by Alex Christensen.
925
926         When a document's QuickLook preview is loaded, a reference cycle is created between
927         PreviewLoader and ResourceLoader. Break the cycle by clearing m_previewLoader in
928         ResourceLoader::releaseResources().
929
930         Fixes leaks detected by `run-webkit-tests --leaks LayoutTests/quicklook`.
931
932         * loader/ResourceLoader.cpp:
933         (WebCore::ResourceLoader::releaseResources):
934
935 2019-02-22  Sihui Liu  <sihui_liu@apple.com>
936
937         Crash under IDBServer::IDBConnectionToClient::identifier() const
938         https://bugs.webkit.org/show_bug.cgi?id=194843
939         <rdar://problem/48203102>
940
941         Reviewed by Geoffrey Garen.
942
943         UniqueIDBDatabase should ignore requests from connections that are already closed.
944
945         Tests are hard to create without some tricks on UniqueIDBDatabase so this fix is verified manually. 
946         One test is created by adding delay to UniqueIDBDatabase::openBackingStore on the background thread to make sure
947         disconnection of web process happens before UniqueIDBDatabase::didOpenBackingStore, because didOpenBackingStore
948         may start a version change transaction and ask for identifier from the connection that is already gone.
949
950         * Modules/indexeddb/server/IDBConnectionToClient.cpp:
951         (WebCore::IDBServer::IDBConnectionToClient::connectionToClientClosed):
952         * Modules/indexeddb/server/IDBConnectionToClient.h:
953         (WebCore::IDBServer::IDBConnectionToClient::isClosed):
954         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
955         (WebCore::IDBServer::UniqueIDBDatabase::clearStalePendingOpenDBRequests):
956         (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations):
957         (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired):
958         * Modules/indexeddb/server/UniqueIDBDatabase.h:
959
960 2019-02-22  Wenson Hsieh  <wenson_hsieh@apple.com>
961
962         Input type "formatSetInlineTextDirection" is dispatched when changing paragraph-level text direction
963         https://bugs.webkit.org/show_bug.cgi?id=194703
964         <rdar://problem/48111775>
965
966         Reviewed by Ryosuke Niwa.
967
968         Currently, when changing text direction, WebKit always sends input events of type formatSetInlineTextDirection,
969         even when changing paragraph text direction. Instead, we should be emitting formatSetBlockTextDirection in this
970         scenario. This is problematic when using the context menus on macOS to change writing direction, since changing
971         "Selection Direction" is currently indistinguishable from changing "Paragraph Direction".
972
973         To fix this, we split EditAction::SetWritingDirection into EditAction::SetInlineWritingDirection and
974         EditAction::SetBlockWritingDirection, which emit inline and block text direction input events, respectively.
975
976         Tests: fast/events/before-input-events-prevent-block-text-direction.html
977                fast/events/before-input-events-prevent-inline-text-direction.html
978
979         * editing/CompositeEditCommand.cpp:
980         (WebCore::CompositeEditCommand::apply):
981         * editing/EditAction.cpp:
982         (WebCore::undoRedoLabel):
983         * editing/EditAction.h:
984         * editing/EditCommand.cpp:
985         (WebCore::inputTypeNameForEditingAction):
986         * editing/Editor.cpp:
987         (WebCore::inputEventDataForEditingStyleAndAction):
988         (WebCore::Editor::setBaseWritingDirection):
989         * editing/EditorCommand.cpp:
990         (WebCore::executeMakeTextWritingDirectionLeftToRight):
991         (WebCore::executeMakeTextWritingDirectionNatural):
992         (WebCore::executeMakeTextWritingDirectionRightToLeft):
993
994 2019-02-22  Rob Buis  <rbuis@igalia.com>
995
996         Remove stripLeadingAndTrailingWhitespace from MathMLElement.cpp
997         https://bugs.webkit.org/show_bug.cgi?id=160172
998
999         Reviewed by Frédéric Wang.
1000
1001         Remove stripLeadingAndTrailingWhitespace and use stripLeadingAndTrailingHTTPSpaces
1002         from HTTPParsers instead.
1003
1004         No new tests, already covered by MathML tests.
1005
1006         * mathml/MathMLElement.cpp:
1007         (WebCore::MathMLElement::stripLeadingAndTrailingWhitespace): Deleted.
1008         * mathml/MathMLElement.h:
1009         * mathml/MathMLPresentationElement.cpp:
1010         (WebCore::MathMLPresentationElement::parseMathMLLength):
1011         * mathml/MathMLTokenElement.cpp:
1012         (WebCore::MathMLTokenElement::convertToSingleCodePoint):
1013
1014 2019-02-22  Eric Carlson  <eric.carlson@apple.com>
1015
1016         Update some media logging
1017         https://bugs.webkit.org/show_bug.cgi?id=194915
1018
1019         Reviewed by Jer Noble.
1020
1021         No new tests, no functional change.
1022
1023         * Modules/mediasource/SourceBuffer.cpp:
1024         (WebCore::SourceBuffer::evictCodedFrames):
1025         (WebCore::SourceBuffer::provideMediaData):
1026         (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
1027
1028         * html/HTMLMediaElement.cpp:
1029         (WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity):
1030         (WebCore::HTMLMediaElement::loadResource):
1031         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
1032         (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
1033         (WebCore::HTMLMediaElement::seekTask):
1034         (WebCore::HTMLMediaElement::playInternal):
1035         (WebCore::HTMLMediaElement::pauseInternal):
1036         (WebCore::HTMLMediaElement::setLoop):
1037         (WebCore::HTMLMediaElement::setControls):
1038         (WebCore::HTMLMediaElement::sourceWasRemoved):
1039
1040         * html/MediaElementSession.cpp:
1041         (WebCore::convertEnumerationToString):
1042
1043         * html/MediaElementSession.h:
1044         (WTF::LogArgument<WebCore::MediaPlaybackDenialReason>::toString):
1045
1046         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1047         (WebCore::SourceBufferPrivateAVFObjC::enqueueSample):
1048
1049 2019-02-22  Rob Buis  <rbuis@igalia.com>
1050
1051         Fix unitless usage of mathsize
1052         https://bugs.webkit.org/show_bug.cgi?id=194940
1053
1054         Reviewed by Frédéric Wang.
1055
1056         Convert unitless lengths to percentage values to correct the computed
1057         font size.
1058
1059         * mathml/MathMLElement.cpp:
1060         (WebCore::convertToPercentageIfNeeded):
1061         (WebCore::MathMLElement::collectStyleForPresentationAttribute):
1062
1063 2019-02-21  Simon Fraser  <simon.fraser@apple.com>
1064
1065         Hardcode Visual Viewports on everywhere except iOS WK1
1066         https://bugs.webkit.org/show_bug.cgi?id=194928
1067
1068         Reviewed by Zalan Bujtas.
1069
1070         Remove the WK1 and WK2 preferences and MiniBrowser menu item for "visual viewports",
1071         change the default value of the Setting to 'true', and hardcode WebView on iOS to
1072         set it to false. The setting has shipped for several years and there's no need to turn
1073         it off now.
1074
1075         Similarly, disable the "Visual Viewport API" on iOS WK1, since it makes no sense if
1076         Visual Viewports are not enabled.
1077         
1078         Remove the "visualViewportEnabled" flag and unused code paths from scrolling tree code
1079         that only runs in WK2
1080
1081         * page/Settings.yaml:
1082         * page/scrolling/AsyncScrollingCoordinator.cpp:
1083         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1084         (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
1085         (WebCore::AsyncScrollingCoordinator::visualViewportEnabled const): Deleted.
1086         * page/scrolling/AsyncScrollingCoordinator.h:
1087         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1088         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
1089         (WebCore::ScrollingStateFrameScrollingNode::setAllPropertiesChanged):
1090         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties const):
1091         (WebCore::ScrollingStateFrameScrollingNode::setVisualViewportEnabled): Deleted.
1092         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1093         * page/scrolling/ScrollingTree.cpp:
1094         (WebCore::ScrollingTree::commitTreeState):
1095         * page/scrolling/ScrollingTree.h:
1096         (WebCore::ScrollingTree::visualViewportEnabled const): Deleted.
1097         (WebCore::ScrollingTree::setVisualViewportEnabled): Deleted.
1098         * page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
1099         (WebCore::ScrollingTreeFrameScrollingNode::layoutViewportForScrollPosition const):
1100         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1101         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollPositionWithoutContentEdgeConstraints):
1102         (WebCore::ScrollingTreeFrameScrollingNodeMac::setScrollLayerPosition):
1103
1104 2019-02-21  Darin Adler  <darin@apple.com>
1105
1106         Some refinements for Node and Document
1107         https://bugs.webkit.org/show_bug.cgi?id=194764
1108
1109         Reviewed by Ryosuke Niwa.
1110
1111         * accessibility/AccessibilityObject.cpp:
1112         (WebCore::AccessibilityObject::press): Use shadowHost instead of
1113         deprecatedShadowAncestorNode.
1114         (WebCore::AccessibilityObject::axObjectCache const): Tweak coding style.
1115         (WebCore::AccessibilityObject::focusedUIElement const): Use existing page
1116         function to streamline.
1117
1118         * accessibility/AccessibilityRenderObject.cpp:
1119         (WebCore::AccessibilityRenderObject::accessKey const): Use
1120         attributeWithoutSynchronization for efficiency and consistency with other
1121         code working with the accesskey attribute.
1122
1123         * dom/ContainerNode.cpp:
1124         (WebCore::ContainerNode::childrenChanged): Added call to
1125         invalidateAccessKeyCache, replacing old scheme tied to style recalculation.
1126
1127         * dom/DecodedDataDocumentParser.cpp:
1128         (WebCore::DecodedDataDocumentParser::appendBytes): Update for name and return
1129         type change of createDecoderIfNeeded to decoder.
1130         (WebCore::DecodedDataDocumentParser::flush): Ditto.
1131
1132         * dom/Document.cpp:
1133         (WebCore::Document::elementForAccessKey): Renamed from getElementForAccessKey
1134         to match WebKit coding style. Changed to use unique_ptr instead of separate
1135         boolean to keep track of map validity status.
1136         (WebCore::Document::buildAccessKeyCache): Renamed from buildAccessKeyMap to
1137         clarify that this is a cache. Changed to use composedTreeDescendants rather
1138         than explicit calls to shadowRoot. Use add instead of set so that first element
1139         in document order wins, instead of last element in document order. Updated
1140         to make a new map in a new unique_ptr instead of populating a map.
1141         (WebCore::Document::invalidateAccessKeyCacheSlowCase): Renamed from
1142         invalidateAccessKeyMap, and left an inline part in the header so the fast case
1143         of quickly checking for a null pointer can be inlined.
1144         (WebCore::Document::doctype const): Use downcast instead of static_cast.
1145         (WebCore::Document::scheduleStyleRecalc): Moved call to invalidateAccessKeyMap
1146         from here to childrenChanged and accesskey attribute change handling.
1147         (WebCore::Document::processFormatDetection): Set m_isTelephoneNumberParsingAllowed
1148         directly since this is the only place that does it and we don't need to factor
1149         that one line of code into a function.
1150         (WebCore::Document::getOverrideStyle): Moved to header since it's just a stub
1151         that always returns nullptr and can be inlined.
1152         (WebCore::Document::setIsTelephoneNumberParsingAllowed): Deleted.
1153         (WebCore::Document::ensureTemplateDocument): Removed nullptr frame argument to
1154         the create function, since Document::create now always involves no frame.
1155         (WebCore::Document::didAssociateFormControl): Changed argument type to a reference
1156         and simplified the logic with a local variable.
1157         (WebCore::Document::didAssociateFormControlsTimerFired): Simplified the null
1158         checks and rearranged things so that m_associatedFormControls will always
1159         get cleared even if the document is no longer associated with a page.
1160
1161         * dom/Document.h: Removed unnnecessary explicit values for enumerations (first
1162         value is always zero, etc.) and formatted simple enumerations in a single line
1163         for easier reading. Moved Document::create fucntion bodies out of line, removed
1164         the frame argument from the simple "create with URL" overload and made the frame
1165         argument for createNonRenderedPlaceholder be a reference rather than a pointer.
1166         Renamed getElementByAccessKey to elementForAccessKey, invalidateAccessKeyMap to
1167         invalidateAccessKeyCache, buildAccessKeyMap to buildAccessKeCache,
1168         m_elementsByAccessKey to m_accessKeyCache and changed its type.
1169         Removed bogus "DOM methods" comment, unused setParserFeature friend declaration,
1170         setIsTelephoneNumberParsingAllowed function, and m_accessKeyMapValid flag.
1171
1172         * dom/Document.idl: Added comment highlighting that getOverrideStyle is just a
1173         placeholder returning null.
1174
1175         * dom/Element.cpp:
1176         (WebCore::Element::attributeChanged): Call invalidateAccessKeyCache when the
1177         value of the accesskey attribute is changed. Also moved the class attribute code
1178         so the attributes here are in alphabetical order (only class and id were out of
1179         alphabetical order).
1180
1181         * dom/Node.cpp:
1182         (WebCore::Node::isDescendantOrShadowDescendantOf const): Rewrote to no longer
1183         use deprecatedShadowAncestorNode and used boolean operators to make it a
1184         single line and easier to understand. Also added a FIXME since the
1185         containsIncludingShadowDOM function is so similar, yet differently written.
1186         (WebCore::Node::contains const): Rewrote as a single line to make this easier
1187         to read and to *slightly* improve the speed in the "this == node" case.
1188         (WebCore::Node::containsIncludingHostElements const): Use downcast.
1189         (WebCore::Node::deprecatedShadowAncestorNode const): Deleted.
1190
1191         * dom/Node.h: Deleted now-unused deprecatedShadowAncestorNode.
1192
1193         * editing/ReplaceSelectionCommand.cpp:
1194         (WebCore::ReplacementFragment::ReplacementFragment): Rewrote to use shadowHost
1195         instead of deprecatedShadowAncestorNode.
1196
1197         * html/FormAssociatedElement.cpp:
1198         (WebCore::FormAssociatedElement::resetFormOwner): Pass reference to
1199         didAssociateFormControl.
1200         (WebCore::FormAssociatedElement::formAttributeChanged): Ditto.
1201
1202         * html/HTMLAreaElement.cpp:
1203         (WebCore::HTMLAreaElement::parseAttribute): Removed special case for accesskey
1204         attribute, because we want to call the base class parseAttribute in that case.
1205
1206         * html/HTMLFormElement.cpp:
1207         (WebCore::HTMLFormElement::insertedIntoAncestor): Pass reference to
1208         didAssociateFormControl.
1209
1210         * html/HTMLSelectElement.cpp:
1211         (WebCore::HTMLSelectElement::parseAttribute): Removed special case for accesskey
1212         attribute with mysterious FIXME, because we want to call the base class
1213         parseAttribute in that case. The old code had no effect before; the access key
1214         logic would still find the attribute; if the goal is to ignore the attribute
1215         for these elements we will need a different solution.
1216         * html/HTMLTextAreaElement.cpp:
1217         (WebCore::HTMLTextAreaElement::parseAttribute): Ditto.
1218
1219         * loader/DocumentLoader.cpp:
1220         (WebCore::DocumentLoader::DocumentLoader): Removed code that was always passing
1221         nullptr as the frame for the newly created DocumentWriter. It used m_frame, but
1222         m_frame was always null.
1223         (WebCore::DocumentLoader::attachToFrame): Pass reference to DocumentWriter::setFrame.
1224
1225         * loader/DocumentWriter.cpp:
1226         (WebCore::DocumentWriter::DocumentWriter): Deleted. The old version set m_frame to
1227         the passed in frame, which was always nullptr, and initialized some booleans and an
1228         enumeration, which are now initialized in the class definition.
1229         (WebCore::DocumentWriter::createDocument): Pass a reference for the frame.
1230         (WebCore::DocumentWriter::begin): Updated now that State is an enum class.
1231         (WebCore::DocumentWriter::decoder): Renamed from createDecoderIfNeeded and changed
1232         to return a reference.
1233         (WebCore::DocumentWriter::addData): Use RELEASE_ASSERT instead of if/CRASH and
1234         updated now that State is an enum class.
1235         (WebCore::DocumentWriter::insertDataSynchronously): Updated now that State is an
1236         enum class.
1237         (WebCore::DocumentWriter::end): Ditto.
1238
1239         * loader/DocumentWriter.h: Removed unneeded include and forward declaration.
1240         Removed the frame pointer argument to the constructor, caller was always passing a
1241         nullptr. Changed argument to setFrame to be a reference. Renamed createDecoderIfNeeded
1242         to decoder and changed it to return a reference. Initialized m_frame,
1243         m_hasReceivedSomeData, m_encodingWasChosenByUser, and m_state here so we don't need
1244         to initialize them in a constructor. Renamed the enum from WriterState to State since
1245         it's a member of DocumentWriter already, and made it an enum class rather than ending
1246         each enumeration value with WritingState.
1247
1248         * page/DragController.cpp:
1249         (WebCore::isEnabledColorInput): Removed boolean argument setToShadowAncestor. The
1250         one caller that formerly passed true now calls the new hasEnabledColorInputAsShadowHost
1251         function instead.
1252         (WebCore::hasEnabledColorInputAsShadowHost): Added.
1253         (WebCore::elementUnderMouse): Use shadowHost instead of deprecatedShadowAncestorNode.
1254         Also added FIXME since it seems this should instead be using parentElementInComposedTree.
1255         (WebCore::DragController::concludeEditDrag): Removed "false" argument to isEnabledColorInput.
1256         (WebCore::DragController::canProcessDrag): Removed "true" argument to isEnabledColorInput
1257         and added call to hasEnabledColorInputAsShadowHost. Also put the value of the node to drag
1258         into a local variable to simplify code.
1259         (WebCore::DragController::draggableElement const): Removed "false" argument to isEnabledColorInput.
1260
1261         * page/EventHandler.cpp:
1262         (WebCore::EventHandler::handleAccessKey): Update name of elementForAccessKey.
1263
1264         * page/FocusController.cpp:
1265         (WebCore::clearSelectionIfNeeded): Use shadowHost instead of deprecatedShadowAncestorNode.
1266
1267         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1268         (WebCore::createPageForServiceWorker): Pass reference instead of pointer for frame to
1269         Document::createNonRenderedPlaceholder.
1270
1271 2019-02-21  Daniel Bates  <dabates@apple.com>
1272
1273         Same Site Lax cookies are not sent with cross-site redirect from client-initiated load
1274         https://bugs.webkit.org/show_bug.cgi?id=194906
1275         <rdar://problem/44305947>
1276
1277         Reviewed by Brent Fulgham.
1278
1279         Ensure that a request for a top-level navigation is annotated as such regardless of whether
1280         the request has a computed Same Site policy.
1281
1282         "New loads" initiated by a the client (Safari) either by API or a human either explicitly
1283         typing a URL in the address bar or Command + clicking a hyperlink to open it in a new window/tab
1284         are always considered Same Site. This is by definition from the spec. [1] as we aren't navigating
1285         from an existing page. (Command + click should be thought of as a convenience to the user from
1286         having to copy the hyperlink's URL, create a new window, and paste the URL into the address bar).
1287         Currently the frame loader marks a request as a top-level navigation if and only if the request
1288         does not have a pre-computed Same Site policy. However, "New loads" have a pre-computed Same Site
1289         policy. So, these loads would never be marked as a top-level navigation by the frame loading code.
1290         Therefore, if the "new load" turned out to be a cross-site redirect then WebKit would incorrectly
1291         tell the networking stack that the load was a cross-site, non-top-level navigation, and per the
1292         Same Site spec [2], the networking stack would not send Same Site Lax cookies. Instead,
1293         WebKit should unconditionally ensure that requests are marked as a top-level navigation, if applicable.
1294
1295         [1] See Note for (1) in  <https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-02#section-5.2>
1296         [2] <https://tools.ietf.org/html/draft-ietf-httpbis-rfc6265bis-02#section-5.3.7.1>
1297
1298         Test: http/tests/cookies/same-site/user-load-cross-site-redirect.php
1299
1300         * loader/FrameLoader.cpp:
1301         (WebCore::FrameLoader::addExtraFieldsToRequest): Unconditionally update the request's top-
1302         level navigation bit.
1303         * platform/network/ResourceRequestBase.cpp:
1304         (WebCore::ResourceRequestBase::setAsIsolatedCopy): Unconditionally copy a request's top-
1305         level navigation bit.
1306
1307 2019-02-21  Per Arne Vollan  <pvollan@apple.com>
1308
1309         Layout Test fast/text/international/khmer-selection.html is crashing
1310         https://bugs.webkit.org/show_bug.cgi?id=191368
1311
1312         Reviewed by Brent Fulgham.
1313
1314         GlyphBuffer's offset array wasn't getting filled by UniscribeController.
1315         Our underlining code requires this array.
1316
1317         Uniscribe gives us a character -> glyph mapping, so we just have to compute
1318         the inverse and give it to the GlyphBuffer.
1319
1320         This patch is written by Myles C. Maxfield.
1321
1322         Test: fast/text/international/khmer-selection.html.
1323
1324         * platform/graphics/GlyphBuffer.h:
1325         (WebCore::GlyphBuffer::add):
1326         * platform/graphics/displaylists/DisplayListItems.cpp:
1327         (WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const):
1328         * platform/graphics/win/UniscribeController.cpp:
1329         (WebCore::UniscribeController::advance):
1330         (WebCore::UniscribeController::itemizeShapeAndPlace):
1331         (WebCore::UniscribeController::shapeAndPlaceItem):
1332         * platform/graphics/win/UniscribeController.h:
1333
1334 2019-02-21  Sihui Liu  <sihui_liu@apple.com>
1335
1336         IndexedDB: leak UniqueIDBDatabase in layout tests
1337         https://bugs.webkit.org/show_bug.cgi?id=194870
1338         <rdar://problem/48163812>
1339
1340         Reviewed by Geoffrey Garen.
1341
1342         UniqueIDBDatabase owns a pointer to itself after it is hard closed. It should release the pointer when it 
1343         receives confirmation from clients and all pending tasks are done. UniqueIDBDatabase already checks whether the
1344         pointer should be released when a database task finishes, but it didn't perform a check when a confirm message 
1345         is received. 
1346
1347         No new test as the order of task completion and confirmation arrival is uncertain.
1348
1349         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1350         (WebCore::IDBServer::UniqueIDBDatabase::confirmDidCloseFromServer):
1351
1352 2019-02-21  Andy Estes  <aestes@apple.com>
1353
1354         contentfiltering tests leak documents
1355         https://bugs.webkit.org/show_bug.cgi?id=189434
1356         <rdar://44239943>
1357
1358         Reviewed by Simon Fraser.
1359
1360         Changed ContentFilter to capture the blocked Frame as a WeakPtr to break a reference cycle.
1361
1362         This fixes world leaks in several tests in LayoutTests/contentfiltering/.
1363
1364         * bindings/js/ScriptController.h:
1365         * loader/ContentFilter.cpp:
1366         (WebCore::ContentFilter::didDecide):
1367
1368 2019-02-21  Don Olmstead  <don.olmstead@sony.com>
1369
1370         [CMake][Win] Fix !USE(CF) build of WebCore
1371         https://bugs.webkit.org/show_bug.cgi?id=194879
1372
1373         Reviewed by Konstantin Tokarev.
1374
1375         * PlatformAppleWin.cmake:
1376         * PlatformWin.cmake:
1377         * PlatformWinCairo.cmake:
1378
1379 2019-02-21  Zalan Bujtas  <zalan@apple.com>
1380
1381         [LFC][Floats] Add support for placing formatting roots in-between floats.
1382         https://bugs.webkit.org/show_bug.cgi?id=194902
1383
1384         Reviewed by Antti Koivisto.
1385
1386         This patch add support for placing a formatting root box in-between existing floats.
1387         The initial vertical position of a formatting root is its static position which can make the box
1388         placed above exsiting floats (whereas we can never place a regular float above existing floats.)
1389
1390         Test: fast/block/block-only/floats-and-block-formatting-roots.html
1391
1392         * layout/blockformatting/BlockFormattingContext.cpp:
1393         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
1394         * layout/floats/FloatingContext.cpp:
1395         (WebCore::Layout::FloatPair::LeftRightIndex::isEmpty const):
1396         (WebCore::Layout::FloatPair::isEmpty const):
1397         (WebCore::Layout::FloatPair::operator* const):
1398         (WebCore::Layout::Iterator::operator* const):
1399         (WebCore::Layout::begin):
1400         (WebCore::Layout::end):
1401         (WebCore::Layout::FloatingContext::positionForFloat const):
1402         (WebCore::Layout::FloatingContext::positionForFormattingContextRoot const):
1403         (WebCore::Layout::findAvailablePosition):
1404         (WebCore::Layout::FloatingContext::findPositionForFloatBox const):
1405         (WebCore::Layout::FloatingContext::findPositionForFormattingContextRoot const):
1406         (WebCore::Layout::FloatPair::FloatPair):
1407         (WebCore::Layout::FloatPair::left const):
1408         (WebCore::Layout::FloatPair::right const):
1409         (WebCore::Layout::FloatPair::intersects const):
1410         (WebCore::Layout::FloatPair::operator == const):
1411         (WebCore::Layout::FloatPair::horizontalConstraints const):
1412         (WebCore::Layout::FloatPair::bottom const):
1413         (WebCore::Layout::Iterator::operator++):
1414         (WebCore::Layout::Iterator::set):
1415         (WebCore::Layout::FloatingPair::isEmpty const): Deleted.
1416         (WebCore::Layout::FloatingPair::verticalConstraint const): Deleted.
1417         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const): Deleted.
1418         (WebCore::Layout::FloatingContext::floatingPosition const): Deleted.
1419         (WebCore::Layout::FloatingPair::FloatingPair): Deleted.
1420         (WebCore::Layout::FloatingPair::left const): Deleted.
1421         (WebCore::Layout::FloatingPair::right const): Deleted.
1422         (WebCore::Layout::FloatingPair::intersects const): Deleted.
1423         (WebCore::Layout::FloatingPair::operator == const): Deleted.
1424         (WebCore::Layout::FloatingPair::horizontalConstraints const): Deleted.
1425         (WebCore::Layout::FloatingPair::bottom const): Deleted.
1426         * layout/floats/FloatingContext.h:
1427
1428 2019-02-21  Rob Buis  <rbuis@igalia.com>
1429
1430         Update MIME type parser
1431         https://bugs.webkit.org/show_bug.cgi?id=180526
1432
1433         Reviewed by Darin Adler.
1434
1435         Further testing showed the MIME parser needs these fixes:
1436         - stripWhitespace is wrong for removing HTTP whitespace, use
1437           stripLeadingAndTrailingHTTPSpaces instead.
1438         - HTTP Token code points checking for Rfc2045 and Mimesniff were
1439           mixed up, use the dedicated isValidHTTPToken for Mimesniff mode.
1440         - Quoted Strings were not unescaped/escaped, this seems ok for
1441           serializing but is wrong when gettings individual parameter values.
1442           Implement [1] and [2] Step 2.4 to properly unescape and escape.
1443
1444         This change also tries to avoid hard to read uses of find.
1445
1446         Test: ParsedContentType.Serialize
1447
1448         [1] https://fetch.spec.whatwg.org/#collect-an-http-quoted-string
1449         [2] https://mimesniff.spec.whatwg.org/#serializing-a-mime-type
1450
1451         * platform/network/ParsedContentType.cpp:
1452         (WebCore::skipSpaces):
1453         (WebCore::parseToken):
1454         (WebCore::isNotQuoteOrBackslash):
1455         (WebCore::collectHTTPQuotedString):
1456         (WebCore::containsNonTokenCharacters):
1457         (WebCore::parseQuotedString):
1458         (WebCore::ParsedContentType::parseContentType):
1459         (WebCore::ParsedContentType::create):
1460         (WebCore::ParsedContentType::setContentType):
1461         (WebCore::containsNonQuoteStringTokenCharacters):
1462         (WebCore::ParsedContentType::setContentTypeParameter):
1463         (WebCore::ParsedContentType::serialize const):
1464         (WebCore::substringForRange): Deleted.
1465         (WebCore::isNonTokenCharacter): Deleted.
1466         (WebCore::isNonQuotedStringTokenCharacter): Deleted.
1467         * platform/network/ParsedContentType.h:
1468
1469 2019-02-20  Simon Fraser  <simon.fraser@apple.com>
1470
1471         REGRESSION (240698): Fixed position banners flicker and move when scrolling on iOS
1472         https://bugs.webkit.org/show_bug.cgi?id=194889
1473         rdar://problem/47755552
1474
1475         Reviewed by Tim Horton.
1476         
1477         After r240698 we could commit scrolling changes for a fixed node where the "viewportRectAtLastLayout" and the layer
1478         position were mismatched; this happened when AsyncScrollingCoordinator::reconcileScrollingState() came back from the UI process
1479         with an unstable update and set a new layoutViewport, then some other layout triggered a compositing tree update. During the tree
1480         update, we'd update the fixed scrolling node with the new viewport, and an old layer position.
1481         
1482         Fix by ensuring that we only update the geometry info for a scrolling tree node when we update layer geometry for the corresponding
1483         layer.
1484
1485         Not currently testable.
1486
1487         * rendering/RenderLayerCompositor.cpp:
1488         (WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
1489
1490 2019-02-20  Dean Jackson  <dino@apple.com>
1491
1492         Rotation animations sometimes use the wrong origin (affects apple.com)
1493         https://bugs.webkit.org/show_bug.cgi?id=194878
1494         <rdar://problem/43908047>
1495
1496         Reviewed by Simon Fraser.
1497
1498         Some versions of CoreAnimation apply additive animations in reverse
1499         order. Detect this and reverse the list of animations we provide.
1500
1501         Update the existing animations/additive-transform-animations.html test to
1502         be a ref-test that would identify this failure. Previously it relied on
1503         a pixel test.
1504
1505         * platform/graphics/ca/GraphicsLayerCA.cpp: Use 
1506             HAVE_CA_WHERE_ADDITIVE_TRANSFORMS_ARE_REVERSED to decide whether or
1507             not to flip the list of animations (and mark the correct ones as
1508             additive).
1509         (WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
1510         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
1511
1512 2019-02-20  Don Olmstead  <don.olmstead@sony.com>
1513
1514         [Win] Guard CF usage in RenderThemeWin
1515         https://bugs.webkit.org/show_bug.cgi?id=194875
1516
1517         Reviewed by Alex Christensen.
1518
1519         No new tests. No change in behavior.
1520
1521         Add #if USE(CF) checks to RenderThemeWin so it can compile without CF support.
1522
1523         * rendering/RenderThemeWin.cpp:
1524         (WebCore::RenderThemeWin::stringWithContentsOfFile):
1525         (WebCore::RenderThemeWin::mediaControlsStyleSheet):
1526         (WebCore::RenderThemeWin::mediaControlsScript):
1527         * rendering/RenderThemeWin.h:
1528
1529 2019-02-20  Ryosuke Niwa  <rniwa@webkit.org>
1530
1531         Crash in DOMWindowExtension::suspendForPageCache
1532         https://bugs.webkit.org/show_bug.cgi?id=194871
1533
1534         Reviewed by Chris Dumez.
1535
1536         This is a speculative fix for a crash in DOMWindowExtension::suspendForPageCache.
1537
1538         We think it's possible for DOMWindowExtension::suspendForPageCache notifying the clients via
1539         dispatchWillDisconnectDOMWindowExtensionFromGlobalObject to remove other DOMWindowExtension's.
1540         Check that each DOMWindowProperty is still in m_properties before invoking suspendForPageCache
1541         to avoid the crash.
1542
1543         * page/DOMWindow.cpp:
1544         (WebCore::DOMWindow::willDestroyCachedFrame):
1545         (WebCore::DOMWindow::willDestroyDocumentInFrame):
1546         (WebCore::DOMWindow::willDetachDocumentFromFrame):
1547         (WebCore::DOMWindow::suspendForPageCache):
1548         (WebCore::DOMWindow::resumeFromPageCache):
1549         * page/DOMWindowExtension.cpp:
1550         (WebCore::DOMWindowExtension::suspendForPageCache):
1551
1552 2019-02-20  Alex Christensen  <achristensen@webkit.org>
1553
1554         Always call CompletionHandlers after r240909
1555         https://bugs.webkit.org/show_bug.cgi?id=194823
1556
1557         Reviewed by Ryosuke Niwa.
1558
1559         * loader/PolicyChecker.cpp:
1560         (WebCore::PolicyChecker::checkNavigationPolicy):
1561         (WebCore::PolicyChecker::checkNewWindowPolicy):
1562
1563 2019-02-20  Andy Estes  <aestes@apple.com>
1564
1565         [Xcode] Add SDKVariant.xcconfig to various Xcode projects
1566         https://bugs.webkit.org/show_bug.cgi?id=194869
1567
1568         Rubber-stamped by Jer Noble.
1569
1570         * WebCore.xcodeproj/project.pbxproj:
1571
1572 2019-02-20  Said Abou-Hallawa  <sabouhallawa@apple.com>
1573
1574         drawImage() clears the canvas if it's the source of the image and globalCompositeOperation is "copy"
1575         https://bugs.webkit.org/show_bug.cgi?id=194746
1576
1577         Reviewed by Dean Jackson.
1578
1579         Test: fast/canvas/canvas-drawImage-composite-copy.html
1580
1581         If the source canvas of drawImage() is the same as the destination and
1582         globalCompositeOperation is set to "copy", copy the srcRect from the 
1583         canvas to a temporary buffer before calling clearCanvas() then drawImage
1584         from this temporary buffer.
1585
1586         * html/canvas/CanvasRenderingContext2DBase.cpp:
1587         (WebCore::CanvasRenderingContext2DBase::drawImage):
1588         * platform/graphics/ImageBuffer.cpp:
1589         (WebCore::ImageBuffer::copyRectToBuffer):
1590         * platform/graphics/ImageBuffer.h:
1591
1592 2019-02-20  Simon Fraser  <simon.fraser@apple.com>
1593
1594         REGRESSION (r241788>): ASSERTION FAILED: !m_normalFlowListDirty in TestWebKitAPI.WebKit.ResizeReversePaginatedWebView test
1595         https://bugs.webkit.org/show_bug.cgi?id=194866
1596
1597         Reviewed by Antti Koivisto.
1598
1599         r241788 removed some calls that updated layer lists (normal flow and z-order) during compositing updates, causing
1600         a later call to RenderLayerCompositor::recursiveRepaintLayer() to assert when the lists were dirty. Fix by updating
1601         the lists in RenderLayerCompositor::recursiveRepaintLayer(), as we do in various other places.
1602
1603         * rendering/RenderLayerCompositor.cpp:
1604         (WebCore::RenderLayerCompositor::recursiveRepaintLayer):
1605
1606 2019-02-20  Daniel Bates  <dabates@apple.com>
1607
1608         [iOS] Tweak UI for focus rings
1609         https://bugs.webkit.org/show_bug.cgi?id=194864
1610         <rdar://problem/47831886>
1611
1612         Reviewed by Brent Fulgham.
1613
1614         Make use of UIKit constants to make focus rings pretty.
1615
1616         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1617         (WebCore::drawFocusRingAtTime):
1618
1619 2019-02-20  Timothy Hatcher  <timothy@apple.com>
1620
1621         RenderThemeIOS should use RenderTheme's color cache instead of its own.
1622         https://bugs.webkit.org/show_bug.cgi?id=194822
1623         rdar://problem/48208296
1624
1625         Reviewed by Tim Horton.
1626
1627         Tested by fast/css/apple-system-colors.html.
1628
1629         * css/CSSValueKeywords.in:
1630         * css/parser/CSSPropertyParser.cpp:
1631         (WebCore::isAppleLegacyCssValueKeyword):
1632         * platform/graphics/Color.h:
1633         * platform/graphics/cg/ColorCG.cpp:
1634         (WebCore::makeRGBAFromCGColor):
1635         (WebCore::Color::Color):
1636         * rendering/RenderThemeIOS.h:
1637         * rendering/RenderThemeIOS.mm:
1638         (WebCore::RenderThemeIOS::systemColor const):
1639         * rendering/RenderThemeMac.mm:
1640         (WebCore::RenderThemeMac::systemColor const):
1641
1642 2019-02-20  Loïc Yhuel  <loic.yhuel@softathome.com>
1643
1644         Fix crash when opening Web Inspector after a WebSocket was blocked by content extensions
1645         https://bugs.webkit.org/show_bug.cgi?id=194819
1646
1647         Reviewed by Joseph Pecoraro.
1648
1649         Test: http/tests/inspector/network/contentextensions/blocked-websocket-crash.html
1650
1651         * Modules/websockets/WebSocketChannel.h:
1652         (WebCore::WebSocketChannel::hasCreatedHandshake):
1653         * inspector/agents/page/PageNetworkAgent.cpp:
1654         Ignore WebSocketChannel without an WebSocketHandshake, which would crash in InspectorNetworkAgent::enable.
1655
1656 2019-02-20  Zalan Bujtas  <zalan@apple.com>
1657
1658         [LFC][Floats] Make FloatAvoider::resetPosition implicit
1659         https://bugs.webkit.org/show_bug.cgi?id=194855
1660
1661         Reviewed by Antti Koivisto.
1662
1663         Let's compute the initial top/left position during c'tor time.
1664         This is in preparation for fixing formatting root box placement in a float context.
1665
1666         * layout/floats/FloatAvoider.cpp:
1667         (WebCore::Layout::FloatAvoider::resetPosition): Deleted.
1668         * layout/floats/FloatAvoider.h:
1669         (WebCore::Layout::FloatAvoider::displayBox):
1670         (WebCore::Layout::FloatAvoider::initialVerticalPosition const): Deleted.
1671         * layout/floats/FloatBox.cpp:
1672         (WebCore::Layout::FloatBox::FloatBox):
1673         (WebCore::Layout::FloatBox::initialVerticalPosition const):
1674         * layout/floats/FloatBox.h:
1675         * layout/floats/FloatingContext.cpp:
1676         (WebCore::Layout::FloatingContext::floatingPosition const):
1677
1678 2019-02-20  Don Olmstead  <don.olmstead@sony.com>
1679
1680         [MSVC] Fix compilation errors with lambdas in Service Workers
1681         https://bugs.webkit.org/show_bug.cgi?id=194841
1682
1683         Reviewed by Alex Christensen.
1684
1685         No new tests. No change in behavior.
1686
1687         MSVC has problems with the scoping of `this` within a nested lambda. In these cases `this` is
1688         referring to the enclosing lambda according to MSVC. This patch works around this behavior
1689         through by using the `protectedThis` pattern in WebKit code.
1690
1691         * workers/service/server/RegistrationDatabase.cpp:
1692         (WebCore::RegistrationDatabase::openSQLiteDatabase):
1693
1694 2019-02-20  Adrian Perez de Castro  <aperez@igalia.com>
1695
1696         [WPE][GTK] Enable support for CONTENT_EXTENSIONS
1697         https://bugs.webkit.org/show_bug.cgi?id=167941
1698
1699         Reviewed by Carlos Garcia Campos.
1700
1701         * platform/gtk/po/POTFILES.in: Added WebKitUserContentFilterStore.cpp
1702         to the list of files with translatable strings.
1703
1704 2019-02-19  Simon Fraser  <simon.fraser@apple.com>
1705
1706         REGRESSION (r238090): Toggling visibility on the <html> element can result in a blank web view
1707         https://bugs.webkit.org/show_bug.cgi?id=194827
1708         rdar://problem/47620594
1709
1710         Reviewed by Antti Koivisto.
1711
1712         Incremental compositing updates, added in rr238090, use repaints as a trigger for re-evaluating
1713         layer configurations, since a repaint implies that a layer gains painted content. This is done
1714         via the call to setNeedsCompositingConfigurationUpdate() in RenderLayerBacking::setContentsNeedDisplay{InRect}.
1715         The RenderView's layer is opted out of this to avoid doing lots of redundant layer config recomputation
1716         for the root. The configuration state that matters here is whether the layer contains painted content,
1717         and therefore needs backing store; this is computed by RenderLayerBacking::isSimpleContainerCompositingLayer(),
1718         and feeds into GraphicsLayer::drawsContent().
1719
1720         However, if <html> starts as "visibility:hidden" or "opacity:0", as some sites do to hide incremental loading,
1721         then we'll fail to recompute 'drawsContent' for the root and leave the root with drawsContent=false, which
1722         causes RenderLayerBacking::setContentsNeedDisplay{InRect} to short-circuit, and then we paint nothing.
1723
1724         Ironically, 'drawsContent' doesn't actually save any backing store for the root, since it has no affect on
1725         the root tile caches; we always make tiles. So the simple fix here is to change RenderLayerBacking::isSimpleContainerCompositingLayer()
1726         to always return false for the RenderView's layer (the root).
1727         
1728         Testing this was tricky; ref testing doesn't work because we force repaint, and we normally skip
1729         properties of the root in layer tree dumps to hide WK1/WK2 differences. Therefore I had to add
1730         LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES and fix RenderLayerBacking::shouldDumpPropertyForLayer to
1731         respect it.
1732
1733         Test: compositing/visibility/root-visibility-toggle.html
1734
1735         * page/Frame.h:
1736         * platform/graphics/GraphicsLayer.cpp:
1737         (WebCore::GraphicsLayer::dumpProperties const):
1738         * platform/graphics/GraphicsLayerClient.h:
1739         (WebCore::GraphicsLayerClient::shouldDumpPropertyForLayer const):
1740         * rendering/RenderLayerBacking.cpp:
1741         (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const):
1742         (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const):
1743         * rendering/RenderLayerBacking.h:
1744         * rendering/RenderLayerCompositor.cpp:
1745         (WebCore::RenderLayerCompositor::layerTreeAsText):
1746         * testing/Internals.cpp:
1747         (WebCore::toLayerTreeFlags):
1748         * testing/Internals.h:
1749         * testing/Internals.idl:
1750
1751 2019-02-19  Ryosuke Niwa  <rniwa@webkit.org>
1752
1753         REGRESSION(r240909): Release assertion in FrameLoader::loadPostRequest when opening new window
1754         https://bugs.webkit.org/show_bug.cgi?id=194820
1755
1756         Reviewed by Geoffrey Garen.
1757
1758         This release assertion was wrong. The invocation of PolicyChecker::checkNewWindowPolicy in FrameLoader
1759         doesn’t require PolicyChecker's load type to be set in PolicyChecker because FrameLoader's
1760         continueLoadAfterNewWindowPolicy invokes loadWithNavigationAction which sets the load type later,
1761         and we don't rely on PolicyChecker's load type until then.
1762
1763         Fixed the crash by removing relese asserts before invoking checkNewWindowPolicy accordingly.
1764
1765         This patch reverts r241015 since it too was asserting that PolicyChecker's load type is set before
1766         invoking checkNewWindowPolicy which is not the right assumption.
1767
1768         Test: fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html
1769
1770         * loader/FrameLoader.cpp:
1771         (WebCore::FrameLoader::loadURL):
1772         (WebCore::FrameLoader::load):
1773         (WebCore::FrameLoader::loadPostRequest):
1774
1775 2019-02-19  Zalan Bujtas  <zalan@apple.com>
1776
1777         Fix post-commit feedback.
1778
1779         Unreviewed. 
1780
1781         * layout/floats/FloatingContext.cpp:
1782         (WebCore::Layout::FloatingPair::intersects const):
1783
1784 2019-02-19  Zalan Bujtas  <zalan@apple.com>
1785
1786         [LFC][Floats] Remove redundant intersecting logic
1787         https://bugs.webkit.org/show_bug.cgi?id=194804
1788
1789         Reviewed by Antti Koivisto.
1790
1791         floatAvoider.overflowsContainingBlock() check already (and properly) takes care of the far left/right case (see comment).
1792
1793         * layout/floats/FloatingContext.cpp:
1794         (WebCore::Layout::FloatingContext::floatingPosition const):
1795         (WebCore::Layout::FloatingPair::intersects const):
1796
1797 2019-02-19  Commit Queue  <commit-queue@webkit.org>
1798
1799         Unreviewed, rolling out r241722.
1800         https://bugs.webkit.org/show_bug.cgi?id=194801
1801
1802         Causing time outs and EWS failures after expectation file was
1803         added. (Requested by ShawnRoberts on #webkit).
1804
1805         Reverted changeset:
1806
1807         "IndexedDB: leak IDBDatabase and IDBTransacstion in layout
1808         tests"
1809         https://bugs.webkit.org/show_bug.cgi?id=194709
1810         https://trac.webkit.org/changeset/241722
1811
1812 2019-02-16  Darin Adler  <darin@apple.com>
1813
1814         Continue reducing use of String::format, now focusing on hex: "%p", "%x", etc.
1815         https://bugs.webkit.org/show_bug.cgi?id=194752
1816
1817         Reviewed by Daniel Bates.
1818
1819         * Modules/websockets/WebSocket.cpp: Added an include of HexNumber.h. This previously
1820         got included because of Logger.h, but that no longer pulls in HexNumber.h.
1821
1822         * css/CSSMarkup.cpp: Removed unneeded include of StringBuffer.h.
1823         * css/CSSPrimitiveValue.cpp: Ditto.
1824
1825         * css/CSSUnicodeRangeValue.cpp:
1826         (WebCore::CSSUnicodeRangeValue::customCSSText const): Use makeString and hex instead
1827         of String::format and "%x".
1828
1829         * html/HTMLMediaElement.h:
1830         (WTF::ValueToString<WebCore::TextTrackCue::string): Use a non-template function,
1831         TextTrackCure::debugString, so we don't need to use HextNumber.h in a header.
1832
1833         * html/canvas/WebGLRenderingContextBase.cpp:
1834         (GetErrorString): Use makeString and hex instead of String::format and "%04x".
1835
1836         * html/track/TextTrackCue.cpp:
1837         (WebCore::TextTrackCue::debugString const): Added. Moved string conversion here
1838         from HTMLMediaElement.h and use makeString instead of String::format. Also use
1839         the word "debug" to make it clear that it's not OK to use this string, with a
1840         pointer value serialized into it, outside of debugging.
1841         * html/track/TextTrackCue.h: Added TextTrackCue::debugString.
1842
1843         * page/linux/ResourceUsageOverlayLinux.cpp:
1844         (WebCore::formatByteNumber): Use makeString and FormattedNumber::fixedWidth
1845         instead of String::format and "%.1f" etc.
1846
1847         * platform/cocoa/KeyEventCocoa.mm:
1848         (WebCore::keyIdentifierForCharCode): Use the new hex function here instead of
1849         the old code that did each of the four characters explicitly.
1850
1851         * platform/gamepad/mac/HIDGamepad.cpp:
1852         (WebCore::HIDGamepad::HIDGamepad): Use makeString instead of String::format.
1853
1854         * platform/graphics/Color.cpp:
1855         (WebCore::Color::nameForRenderTreeAsText const): Use hex instead of doing each
1856         digit separately.
1857
1858         * platform/graphics/FloatPolygon.cpp:
1859         (WebCore::FloatPolygonEdge::debugString const): Added. Moved string conversion here
1860         from the header and use makeString instead of String::format. Also use
1861         the word "debug" to make it clear that it's not OK to use this string, with a
1862         pointer value serialized into it, outside of debugging.
1863         * platform/graphics/FloatPolygon.h: Updated for the above.
1864
1865         * platform/graphics/ca/GraphicsLayerCA.cpp:
1866         (WebCore::GraphicsLayerCA::setName): Use makeString instead of String::format.
1867         (WebCore::GraphicsLayerCA::recursiveCommitChanges): DItto.
1868         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1869         (WebCore::MediaPlayerPrivateGStreamer::load): Ditto.
1870         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Ditto.
1871         * platform/gtk/PlatformKeyboardEventGtk.cpp:
1872         (WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode): Ditto.
1873         * platform/libwpe/PlatformKeyboardEventLibWPE.cpp:
1874         (WebCore::PlatformKeyboardEvent::keyIdentifierForWPEKeyCode): Ditto.
1875         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
1876         (WebCore::GStreamerVideoEncoder::makeElement): Ditto.
1877         (WebCore::GStreamerVideoEncoder::InitEncode): Ditto.
1878
1879         * platform/text/TextCodecLatin1.cpp: Removed unneeded include of StringBuffer.h
1880         and "using namespace WTF".
1881
1882         * platform/win/GDIObjectCounter.cpp:
1883         (WebCore::GDIObjectCounter::GDIObjectCounter): Use makeString instead of String::format.
1884         * platform/win/KeyEventWin.cpp:
1885         (WebCore::keyIdentifierForWindowsKeyCode): Ditto.
1886
1887         * rendering/FloatingObjects.cpp:
1888         (WebCore::FloatingObject::debugString const): Added. Moved string conversion here
1889         from the header and use makeString instead of String::format. Also use
1890         the word "debug" to make it clear that it's not OK to use this string, with a
1891         pointer value serialized into it, outside of debugging.
1892         * rendering/FloatingObjects.h: Updated for the above.
1893
1894         * rendering/RenderFragmentContainer.cpp:
1895         (WebCore::RenderFragmentContainer::debugString const): Added. Moved string
1896         conversion here from the header and use makeString instead of String::format.
1897         Also use the word "debug" to make it clear that it's not OK to use this string,
1898         with a pointer value serialized into it, outside of debugging.
1899         * rendering/RenderFragmentContainer.h: Updated for the above.
1900         * rendering/RenderFragmentedFlow.h: Ditto.
1901
1902         * testing/Internals.cpp:
1903         (WebCore::Internals::address): Use makeString instead of String::format.
1904
1905 2019-02-18  Wenson Hsieh  <wenson_hsieh@apple.com>
1906
1907         [iOS] Support pasting item-provider-backed data on the pasteboard as attachment elements
1908         https://bugs.webkit.org/show_bug.cgi?id=194670
1909         <rdar://problem/39066529>
1910
1911         Reviewed by Tim Horton.
1912
1913         Adds support for pasting files on the pasteboard as attachment elements, if the attachment element runtime
1914         switch is enabled. Currently, the only types of data that can be pasted as attachments are images, which take a
1915         special codepath in WebContentReader::readImage.
1916
1917         This patch adds a readDataBuffer method that converts a given blob of data from the pasteboard into an
1918         attachment-element-backed representation in the DOM (i.e. either an attachment element or image element that
1919         contains an attachment element). In the case where the given pasteboard item has been explicitly marked as an
1920         attachment (via the preferredPresentationStyle hint) and the item has at least one type representation that
1921         conforms to "public.content", we take this codepath instead of first attempting the web content reading types
1922         supported by default in WebKit.
1923
1924         See below for more detail.
1925
1926         Test: WKAttachmentTestsIOS.InsertPastedFilesAsAttachments
1927
1928         * editing/Editor.cpp:
1929         (WebCore::Editor::clientReplacementURLForResource): Deleted.
1930         * editing/Editor.h:
1931         * editing/WebContentReader.h:
1932         * editing/cocoa/WebContentReaderCocoa.mm:
1933         (WebCore::mimeTypeFromContentType):
1934         (WebCore::contentTypeIsSuitableForInlineImageRepresentation):
1935         (WebCore::createFragmentAndAddResources):
1936         (WebCore::sanitizeMarkupWithArchive):
1937
1938         Remove all logic for handling subresource URL replacement. See WebKit ChangeLog for more details on this.
1939
1940         (WebCore::WebContentReader::readImage):
1941         (WebCore::attachmentForFilePath):
1942         (WebCore::attachmentForData):
1943
1944         Add a helper that creates an attachment element for a given blob of data and content type. The logic here is
1945         quite similar to that of attachmentForFilePath, and we should find a way to either merge them, or pull out more
1946         of their similarities into helper functions.
1947
1948         (WebCore::WebContentReader::readDataBuffer):
1949         (WebCore::replaceSubresourceURLsWithURLsFromClient): Deleted.
1950
1951         Remove more logic for handling subresource URL replacement. See WebKit ChangeLog for more details on this.
1952
1953         * loader/EmptyClients.cpp:
1954         * page/EditorClient.h:
1955         * platform/Pasteboard.h:
1956         * platform/PasteboardItemInfo.h:
1957         (WebCore::PasteboardItemInfo::contentTypeForHighestFidelityItem const):
1958         (WebCore::PasteboardItemInfo::pathForHighestFidelityItem const):
1959         (WebCore::PasteboardItemInfo::encode const):
1960         (WebCore::PasteboardItemInfo::decode):
1961
1962         Add contentTypesByFidelity to PasteboardItemInfo, instead of requesting this information using a separate IPC
1963         message. This means we can also remove getTypesByFidelityForItemAtIndex, and just use the item's types in
1964         fidelity order instead.
1965
1966         * platform/PasteboardStrategy.h:
1967         * platform/PlatformPasteboard.h:
1968         * platform/ios/AbstractPasteboard.h:
1969         * platform/ios/PasteboardIOS.mm:
1970         (WebCore::Pasteboard::read):
1971
1972         Shave off (potentially many) sync IPC messages to the UI process by pulling each call to
1973         informationForItemAtIndex out of the inner loop when reading web content.
1974
1975         (WebCore::Pasteboard::readRespectingUTIFidelities):
1976
1977         Shave off one extraneous sync IPC message by rolling the types in fidelity order into the request for
1978         PasteboardItemInfo, instead of being sent in a separate message.
1979
1980         * platform/ios/PlatformPasteboardIOS.mm:
1981         (WebCore::PlatformPasteboard::informationForItemAtIndex):
1982
1983         Populate contentTypesForFileUpload in the case where UIPasteboard is used (i.e. copy and paste).
1984
1985         (WebCore::PlatformPasteboard::getTypesByFidelityForItemAtIndex): Deleted.
1986         * platform/ios/WebItemProviderPasteboard.h:
1987         * platform/ios/WebItemProviderPasteboard.mm:
1988         (-[WebItemProviderPasteboard pasteboardTypesByFidelityForItemAtIndex:]): Deleted.
1989
1990 2019-02-18  Daniel Bates  <dabates@apple.com>
1991
1992         Clean up and modernize RenderThemeIOS::paintCheckboxDecorations()
1993         https://bugs.webkit.org/show_bug.cgi?id=194785
1994
1995         Reviewed by Simon Fraser.
1996
1997         Change from early return to else-clause to make the states clearer and make it more straightforward
1998         to share more common code. Use constexpr, allocate temporary vectors with inline capacity, and
1999         switch to uniform initializer syntax.
2000
2001         * rendering/RenderThemeIOS.mm:
2002         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
2003
2004 2019-02-18  Daniel Bates  <dabates@apple.com>
2005
2006         [iOS] Focus ring for checkboxes, radio buttons, buttons and search fields should hug tighter to the contour
2007         https://bugs.webkit.org/show_bug.cgi?id=193599
2008         <rdar://problem/47399602>
2009
2010         Reviewed by Simon Fraser.
2011
2012         For now, iOS uses a 3px outline width for its focus rings. Do not inset the focus ring on iOS
2013         for text fields, textareas, keygens, and selects so as to match the visual appearance of all
2014         the other controls.
2015
2016         Tests: fast/forms/ios/focus-button.html
2017                fast/forms/ios/focus-checkbox.html
2018                fast/forms/ios/focus-checked-checkbox.html
2019                fast/forms/ios/focus-checked-radio.html
2020                fast/forms/ios/focus-radio.html
2021                fast/forms/ios/focus-reset-button.html
2022                fast/forms/ios/focus-search-field.html
2023                fast/forms/ios/focus-submit-button.html
2024                fast/forms/ios/focus-text-field.html
2025                fast/forms/ios/focus-textarea.html
2026
2027         * css/html.css:
2028         (:focus): Use 3px outline width.
2029         (input:focus, textarea:focus, keygen:focus, select:focus): Guard this code to exclude it when building for iOS.
2030         * rendering/RenderBox.cpp:
2031         (WebCore::RenderBox::paintBoxDecorations): Add FIXME comment.
2032         * rendering/RenderElement.cpp:
2033         (WebCore::RenderElement::paintOutline): Call RenderTheme::adjustPaintRect() to adjust the paint rect.
2034         Otherwise, the focus rings for radios and checkboxes are drawn at the wrong y-coordinate and are not snug.
2035
2036 2019-02-18  Oriol Brufau  <obrufau@igalia.com>
2037
2038         [css-grid] Handle indefinite percentages in fit-content()
2039         https://bugs.webkit.org/show_bug.cgi?id=194509
2040
2041         Reviewed by Javier Fernandez.
2042
2043         Test: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-fit-content-percentage.html
2044
2045         If the size of the grid container depends on the size of its tracks,
2046         a percentage in fit-content() is indefinite. Without this patch, some
2047         places treated this case as fit-content(0), which prevented the grid
2048         container from growing enough to contain the max-content contribution
2049         of its grid items.
2050
2051         This patch treats such fit-content() as minmax(auto, max-content),
2052         but once the size of the grid container is known and it is laid out
2053         "for real", then the percentage is definite and it's used.
2054
2055         * rendering/GridTrackSizingAlgorithm.cpp:
2056         (WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
2057         (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
2058
2059 2019-02-18  John Wilander  <wilander@apple.com>
2060
2061         Check the existence of the frame in Document::hasFrameSpecificStorageAccess() and Document::setHasFrameSpecificStorageAccess()
2062         https://bugs.webkit.org/show_bug.cgi?id=194777
2063         <rdar://problem/47731945>
2064
2065         Reviewed by Geoffrey Garen and Chris Dumez.
2066
2067         Test: http/tests/storageAccess/remove-requesting-iframe.html
2068
2069         * dom/Document.cpp:
2070         (WebCore::Document::hasFrameSpecificStorageAccess const):
2071             Now checks for the existence of the frame.
2072         (WebCore::Document::setHasFrameSpecificStorageAccess):
2073             Now checks for the existence of the frame.
2074         * loader/ResourceLoadObserver.cpp:
2075         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2076             Now checks that the session ID is valid.
2077
2078 2019-02-18  Jer Noble  <jer.noble@apple.com>
2079
2080         -[AVSampleBufferDisplayLayer player]: Unrecognized selector crash
2081         https://bugs.webkit.org/show_bug.cgi?id=194790
2082         <rdar://problem/33866742>
2083
2084         Reviewed by Jon Lee.
2085
2086         Ensure that a WebVideoContainerLayer's sole sublayer is actually an AVPlayerLayer (and not
2087         an AVSampleBufferDisplayLayer) before reporting that the layer type is LayerTypeAVPlayerLayer.
2088
2089         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2090         (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer):
2091
2092 2019-02-18  Joseph Pecoraro  <pecoraro@apple.com>
2093
2094         Web Inspector: Better categorize CPU usage per-thread / worker
2095         https://bugs.webkit.org/show_bug.cgi?id=194564
2096
2097         Reviewed by Devin Rousso.
2098
2099         Test: inspector/cpu-profiler/threads.html
2100
2101         * workers/WorkerThread.cpp:
2102         (WebCore::WorkerThread::workerThreadsMutex):
2103         (WebCore::WorkerThread::workerThreadCount):
2104         (WebCore::WorkerThread::WorkerThread):
2105         (WebCore::WorkerThread::~WorkerThread):
2106         (WebCore::WorkerThread::workerThread):
2107         (WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThreads):
2108         * workers/WorkerThread.h:
2109         (WebCore::WorkerThread::identifier const):
2110         Expose the set of all WorkerThreads.
2111
2112         * inspector/agents/InspectorCPUProfilerAgent.cpp:
2113         (WebCore::InspectorCPUProfilerAgent::collectSample):
2114         Send inspector additional per-thread data.
2115
2116         * page/ResourceUsageData.h:
2117         (WebCore::WorkerCPUInfo::WorkerCPUInfo):
2118         * page/cocoa/ResourceUsageThreadCocoa.mm:
2119         (WebCore::ThreadInfo::ThreadInfo):
2120         (WebCore::threadInfos):
2121         (WebCore::ResourceUsageThread::platformCollectCPUData):
2122         (WebCore::threadSendRights): Deleted.
2123         (WebCore::cpuUsage): Deleted.
2124         Compute per-thread values on cocoa ports.
2125
2126         * page/linux/ResourceUsageThreadLinux.cpp:
2127         (WebCore::ResourceUsageThread::platformCollectCPUData):
2128         Stub per-thread values on linux ports.
2129
2130 2019-02-18  Jer Noble  <jer.noble@apple.com>
2131
2132         Uncaught Exception crash in MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus()
2133         https://bugs.webkit.org/show_bug.cgi?id=194786
2134
2135         Reviewed by Eric Carlson.
2136
2137         Convert a runtime crash to a debug assert by wrapping the call to -[AVPlayer removeObserver:forKeyPath:]
2138         in an exception handler.
2139
2140         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2141         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus):
2142
2143 2019-02-18  Daniel Bates  <dabates@apple.com>
2144
2145         [iOS] Keyups for non-modifier keys identified as "Dead" when not focused in a content-editable element
2146         https://bugs.webkit.org/show_bug.cgi?id=192824
2147         <rdar://problem/47100332>
2148
2149         Reviewed by Wenson Hsieh.
2150
2151         When building with USE(UIKIT_KEYBOARD_ADDITIONS) enabled, normalize input strings for some more key codes
2152         now that hardware key events to non-editable elements use the same code path as for editable elements. 
2153
2154         * platform/ios/KeyEventIOS.mm:
2155         (WebCore::windowsKeyCodeForCharCode): Demarcate mappings that are only needed when building with
2156         !USE(UIKIT_KEYBOARD_ADDITIONS) in the hope that one day we can remove this code.
2157         (WebCore::isFunctionKey): Ditto.
2158         * platform/ios/WebEvent.mm:
2159         (normalizedStringWithAppKitCompatibilityMapping): Normalize some more input strings when building with
2160         USE(UIKIT_KEYBOARD_ADDITIONS) enabled.
2161
2162 2019-02-18  Eric Carlson  <eric.carlson@apple.com>
2163
2164         Add MSE logging configuration
2165         https://bugs.webkit.org/show_bug.cgi?id=194719
2166         <rdar://problem/48122151>
2167
2168         Reviewed by Joseph Pecoraro.
2169
2170         No new tests, updated inspector/console/webcore-logging.html.
2171
2172         * dom/Document.cpp:
2173         (WebCore::messageSourceForWTFLogChannel): Recognize the MSE logging channel.
2174
2175         * inspector/agents/WebConsoleAgent.cpp:
2176         (WebCore::WebConsoleAgent::getLoggingChannels): Ditto.
2177
2178 2019-02-18  Antoine Quint  <graouts@apple.com>
2179
2180         [iOS] Dispatch additional events along with pointerdown and pointerup
2181         https://bugs.webkit.org/show_bug.cgi?id=194776
2182         <rdar://problem/48164284>
2183
2184         Reviewed by Brent Fulgham.
2185
2186         The Pointer Events specification mandates that "pointerover" and "pointerenter" events precede a "pointerdown" event and that "pointerout"
2187         and "pointerleave" events follow a "pointerup" event. We remove the EventHandler::dispatchPointerEventForTouchAtIndex() method and replace
2188         it with a PointerCaptureController::dispatchEventForTouchAtIndex() that can handle the dispatch of such additional events correctly, also
2189         allowing for two PointerCaptureController methods (pointerEventWillBeDispatched and pointerEventWasDispatched) to become private.
2190
2191         Test: pointerevents/ios/over-enter-out-leave.html
2192
2193         * dom/EventNames.h: Add the new "pointerover", "pointerenter", "pointerout" and "pointerleave" event types.
2194         * dom/PointerEvent.h:
2195         * dom/ios/PointerEventIOS.cpp:
2196         (WebCore::PointerEvent::create):
2197         * page/EventHandler.cpp:
2198         (WebCore::EventHandler::dispatchPointerEventForTouchAtIndex): Deleted.
2199         * page/EventHandler.h:
2200         * page/PointerCaptureController.cpp:
2201         (WebCore::PointerCaptureController::dispatchEventForTouchAtIndex): Take the existing code from EventHandler::dispatchPointerEventForTouchAtIndex()
2202         and extend it to dispatch additional events as mandated. Since several events may be dispatched we check whether the dispatch of any of those events
2203         had defaultPrevented() or defaultHanded() return true and return those values as a pair.
2204         (WebCore::PointerCaptureController::pointerEventWasDispatched):
2205         * page/PointerCaptureController.h:
2206
2207 2019-02-18  Sihui Liu  <sihui_liu@apple.com>
2208
2209         IndexedDB: leak IDBDatabase and IDBTransacstion in layout tests
2210         https://bugs.webkit.org/show_bug.cgi?id=194709
2211
2212         Reviewed by Geoffrey Garen.
2213
2214         When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so 
2215         IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle. 
2216
2217         Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle
2218         between IDBOpenDBRequest and IDBTransaction.
2219
2220         Test: storage/indexeddb/IDBObject-leak.html
2221
2222         * Modules/indexeddb/IDBDatabase.cpp:
2223         (WebCore::IDBDatabase::connectionToServerLost):
2224         * Modules/indexeddb/IDBTransaction.cpp:
2225         (WebCore::IDBTransaction::IDBTransaction):
2226         (WebCore::IDBTransaction::~IDBTransaction):
2227         (WebCore::IDBTransaction::finishedDispatchEventForRequest):
2228         (WebCore::IDBTransaction::connectionClosedFromServer):
2229         * Modules/indexeddb/IDBTransaction.h:
2230         * testing/Internals.cpp:
2231         (WebCore::Internals::numberOfIDBTransactions const):
2232         * testing/Internals.h:
2233         * testing/Internals.idl:
2234
2235 2019-02-18  Chris Fleizach  <cfleizach@apple.com>
2236
2237         AX: PSON: Going back from apple.com to search results, cannot interact with HTML content. Disabling Swap Processes on Cross-Site Navigation resolves the issue.
2238         https://bugs.webkit.org/show_bug.cgi?id=194742
2239
2240         Reviewed by Chris Dumez.
2241
2242         With the new process model, WebProcess hits a case where it tries to send the "page loaded" notification before VoiceOver
2243         had a chance to register for any notifications. This leads to those notifications being dropped (and thus this bug).
2244
2245         This change instead asks the UIProcess to send the notification, which we know VoiceOver has registered for, and can reliably
2246         receive notifications.
2247
2248         It also sends the notification for "load failures," which to the VO users' perspective amounts to the same thing as a successful
2249         page load.
2250
2251         * accessibility/mac/AXObjectCacheMac.mm:
2252         (WebCore::AXObjectCache::frameLoadingEventPlatformNotification):
2253
2254 2019-02-18  Megan Gardner  <megan_gardner@apple.com>
2255
2256         Turn On Smart Delete
2257         https://bugs.webkit.org/show_bug.cgi?id=194320
2258
2259         Reviewed by Ryosuke Niwa.
2260
2261         Updated the following tests to work with iOS:
2262         * editing/deleting/smart-delete-001.html:
2263         * editing/deleting/smart-delete-002.html:
2264         * editing/deleting/smart-delete-003.html:
2265         * editing/deleting/smart-delete-004.html:
2266         * editing/deleting/smart-delete-across-editable-boundaries-2.html:
2267         * editing/selection/delete-word-granularity-text-control.html:
2268
2269         Turn on Smart delete for iOS at all times. Modify checks to allow Mac and iOS and other 
2270         platforms to turn on smart delete when desired.
2271
2272         * editing/Editor.cpp:
2273         (WebCore::Editor::shouldSmartDelete):
2274         Allow platfroms to determine if smart delete should be on.
2275         On mac, this is via word granularity, on iOS this is just on all the time.
2276         (WebCore::Editor::canSmartCopyOrDelete):
2277         (WebCore::Editor::performCutOrCopy):
2278         * editing/Editor.h:
2279         * editing/EditorCommand.cpp:
2280         (WebCore::executeDelete):
2281         * editing/ios/EditorIOS.mm:
2282         (WebCore::Editor::shouldSmartDelete):
2283         * editing/mac/EditorMac.mm:
2284         (WebCore::Editor::shouldSmartDelete):
2285
2286 2019-02-17  David Kilzer  <ddkilzer@apple.com>
2287
2288         Unreviewed, rolling out r241620.
2289
2290         "Causes use-after-free crashes running layout tests with ASan and GuardMalloc."
2291         (Requested by ddkilzer on #webkit.)
2292
2293         Reverted changeset:
2294
2295         "[WTF] Add environment variable helpers"
2296         https://bugs.webkit.org/show_bug.cgi?id=192405
2297         https://trac.webkit.org/changeset/241620
2298
2299 2019-02-16  Zalan Bujtas  <zalan@apple.com>
2300
2301         [LFC] RenderImage's default intrinsic size is 0.
2302         https://bugs.webkit.org/show_bug.cgi?id=194745
2303
2304         Reviewed by Antti Koivisto.
2305
2306         While the images are being loaded, their intrinsic size is set to 0 (RenderImage c'tor). Note that this code is temporary.
2307         * layout/layouttree/LayoutTreeBuilder.cpp:
2308         (WebCore::Layout::TreeBuilder::createSubTree):
2309
2310 2019-02-16  Zalan Bujtas  <zalan@apple.com>
2311
2312         [LFC][BFC] Add support for block replaced intrinsic width.
2313         https://bugs.webkit.org/show_bug.cgi?id=194705
2314
2315         Reviewed by Simon Fraser.
2316
2317         Replaced boxes should report their intrinsic width as preferred widths.
2318
2319         Test: fast/block/block-only/replaced-intrinsic-width-simple.html
2320
2321         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2322         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
2323
2324 2019-02-16  Zalan Bujtas  <zalan@apple.com>
2325
2326         [LFC] Apply min/max width constraints to preferred width computation
2327         https://bugs.webkit.org/show_bug.cgi?id=194739
2328
2329         Reviewed by Simon Fraser.
2330
2331         Ensure that both min-height and max-height are taken into account while computing the preferred width.
2332
2333         Test: fast/block/block-only/min-max-and-preferred-width-simple.html
2334
2335         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2336         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
2337
2338 2019-02-15  Yusuke Suzuki  <ysuzuki@apple.com>
2339
2340         [JSC] Make builtin objects more lazily initialized under non-JIT mode
2341         https://bugs.webkit.org/show_bug.cgi?id=194727
2342
2343         Reviewed by Saam Barati.
2344
2345         * Modules/streams/ReadableByteStreamInternals.js:
2346         (privateInitializeReadableByteStreamController):
2347         (readableByteStreamControllerRespond):
2348
2349 2019-02-15  Dean Jackson  <dino@apple.com>
2350
2351         Allow emulation of user gestures from Web Inspector console
2352         https://bugs.webkit.org/show_bug.cgi?id=194725
2353         <rdar://problem/48126604>
2354
2355         Reviewed by Joseph Pecoraro and Devin Rousso.
2356
2357         Test: inspector/runtime/evaluate-userGestureEmulation.html
2358
2359         * inspector/agents/page/PageRuntimeAgent.cpp: Override the emulate method and create
2360         a UserGestureIndicator based on the emulateUserGesture option.
2361         (WebCore::PageRuntimeAgent::evaluate):
2362         * inspector/agents/page/PageRuntimeAgent.h:
2363
2364 2019-02-15  Chris Dumez  <cdumez@apple.com>
2365
2366         Sample domainsVisited diagnostic logging
2367         https://bugs.webkit.org/show_bug.cgi?id=194657
2368
2369         Reviewed by Ryosuke Niwa.
2370
2371         Sample domainsVisited diagnostic logging, we are getting a lot of data from
2372         this key and this is hurting our other keys.
2373
2374         * page/Page.cpp:
2375         (WebCore::Page::logNavigation):
2376
2377 2019-02-15  Ryosuke Niwa  <rniwa@webkit.org>
2378
2379         Crash in the hit testing code via HTMLPlugInElement::isReplacementObscured()
2380         https://bugs.webkit.org/show_bug.cgi?id=194691
2381
2382         Reviewed by Simon Fraser.
2383
2384         The crash was caused by HTMLPlugInElement::isReplacementObscured updating the document
2385         without updating the layout of ancestor documents (i.e. documents in which frame owner
2386         elements appear) even though it hit-tests against the top-level document's RenderView.
2387
2388         Fixed the bug by updating the layout of the top-level document as needed.
2389
2390         Test: plugins/unsupported-plugin-with-replacement-in-iframe-crash.html
2391
2392         * html/HTMLPlugInElement.cpp:
2393         (WebCore::HTMLPlugInElement::isReplacementObscured):
2394
2395 2019-02-15  Ross Kirsling  <ross.kirsling@sony.com>
2396
2397         [WTF] Add environment variable helpers
2398         https://bugs.webkit.org/show_bug.cgi?id=192405
2399
2400         Reviewed by Michael Catanzaro.
2401
2402         * platform/NotImplemented.h:
2403         * platform/cocoa/SystemVersion.mm:
2404         (WebCore::createSystemMarketingVersion):
2405         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2406         (WebCore::initializeGStreamer):
2407         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2408         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2409         * platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
2410         (Nicosia::PaintingEngine::create):
2411         * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
2412         (WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
2413         * platform/graphics/x11/PlatformDisplayX11.cpp:
2414         (WebCore::PlatformDisplayX11::create):
2415         * platform/gtk/RenderThemeWidget.cpp:
2416         (WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
2417         * platform/gtk/ScrollbarThemeGtk.cpp:
2418         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
2419         * platform/network/curl/CurlContext.cpp:
2420         (WebCore::CurlContext::CurlContext):
2421         (WebCore::EnvironmentVariableReader::read): Deleted.
2422         (WebCore::EnvironmentVariableReader::defined): Deleted.
2423         (WebCore::EnvironmentVariableReader::readAs): Deleted.
2424         (WebCore::EnvironmentVariableReader::sscanTemplate): Deleted.
2425         (WebCore::EnvironmentVariableReader::sscanTemplate<signed>): Deleted.
2426         (WebCore::EnvironmentVariableReader::sscanTemplate<unsigned>): Deleted.
2427         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2428         (WebCore::defaultCookieJarPath):
2429         * platform/network/playstation/CurlSSLHandlePlayStation.cpp:
2430         (WebCore::getCACertPathEnv):
2431         * platform/network/win/CurlSSLHandleWin.cpp:
2432         (WebCore::getCACertPathEnv):
2433         * platform/text/hyphen/HyphenationLibHyphen.cpp:
2434         (WebCore::topLevelPath):
2435         (WebCore::webkitBuildDirectory):
2436         * platform/unix/LoggingUnix.cpp:
2437         (WebCore::logLevelString):
2438         * platform/win/LoggingWin.cpp:
2439         (WebCore::logLevelString):
2440         Utilize WTF::Environment where possible.
2441
2442 2019-02-15  Antoine Quint  <graouts@apple.com>
2443
2444         Add a method to dispatch a PointerEvent based on a PlatformTouchEvent
2445         https://bugs.webkit.org/show_bug.cgi?id=194702
2446         <rdar://problem/48109355>
2447
2448         Reviewed by Dean Jackson.
2449
2450         * page/EventHandler.cpp:
2451         (WebCore::EventHandler::dispatchPointerEventForTouchAtIndex):
2452         * page/EventHandler.h:
2453
2454 2019-02-15  Per Arne Vollan  <pvollan@apple.com>
2455
2456         [WebVTT] Inline WebVTT styles should start with '::cue'
2457         https://bugs.webkit.org/show_bug.cgi?id=194227
2458
2459         Reviewed by Eric Carlson.
2460
2461         The original fix in r241203 is not sufficient, since it only checks if the CSS string starts
2462         with '::cue'. Before accepting a CSS string from a WebVTT file, it should be checked that
2463         all selectors starts with '::cue'.
2464
2465         Test: media/track/track-cue-css.html
2466
2467         * html/track/WebVTTParser.cpp:
2468         (WebCore::WebVTTParser::checkAndStoreStyleSheet):
2469
2470 2019-02-15  Youenn Fablet  <youenn@apple.com>
2471
2472         Add binding tests for ContextAllowsMediaDevices and ContextHasServiceWorkerScheme
2473         https://bugs.webkit.org/show_bug.cgi?id=194713
2474
2475         Reviewed by Eric Carlson.
2476
2477         Binding tests covering mediaDevices and serviceWorker attributes.
2478
2479         * bindings/scripts/test/JS/JSTestObj.cpp:
2480         (WebCore::JSTestObjPrototype::finishCreation):
2481         (WebCore::jsTestObjMediaDevices1Getter):
2482         (WebCore::jsTestObjMediaDevices1):
2483         (WebCore::jsTestObjMediaDevices2Getter):
2484         (WebCore::jsTestObjMediaDevices2):
2485         (WebCore::jsTestObjServiceWorkers1Getter):
2486         (WebCore::jsTestObjServiceWorkers1):
2487         (WebCore::jsTestObjServiceWorkers2Getter):
2488         (WebCore::jsTestObjServiceWorkers2):
2489         * bindings/scripts/test/TestObj.idl:
2490
2491 2019-02-15  Beth Dakin  <bdakin@apple.com>
2492
2493         Build fix.
2494
2495         * rendering/RenderThemeIOS.mm:
2496         (WebCore::iconForAttachment):
2497
2498 2019-02-15  Youenn Fablet  <youenn@apple.com>
2499
2500         Make ServiceWorkerClientFetch closer to WebResourceLoader
2501         https://bugs.webkit.org/show_bug.cgi?id=194651
2502
2503         Reviewed by Alex Christensen.
2504
2505         Check for redirection response and if so call a specific client API.
2506         Ensure ServiceWorkerFetch::Client gets called in the service worker thread proxy
2507         so that its m_connection is only accessed on that thread.
2508
2509         Covered by existing tests.
2510
2511         * platform/network/FormData.h:
2512         * platform/network/ResourceErrorBase.h:
2513         * workers/service/context/ServiceWorkerFetch.cpp:
2514         (WebCore::ServiceWorkerFetch::processResponse):
2515         * workers/service/context/ServiceWorkerFetch.h:
2516         * workers/service/context/ServiceWorkerThreadProxy.cpp:
2517         (WebCore::ServiceWorkerThreadProxy::cancelFetch):
2518         (WebCore::ServiceWorkerThreadProxy::continueDidReceiveFetchResponse):
2519         * workers/service/context/ServiceWorkerThreadProxy.h:
2520
2521 2019-02-15  Youenn Fablet  <youenn@apple.com>
2522
2523         Make navigator.mediaDevices SecureContext
2524         https://bugs.webkit.org/show_bug.cgi?id=194666
2525
2526         Reviewed by Eric Carlson.
2527
2528         Make navigator.mediaDevices SecureContext.
2529         This can still be enabled for unsecure context using the existing page settings.
2530         To cover that case, introduce ContextHasMediaDevices custom IDL keyword.
2531
2532         Covered by API test.
2533
2534         * Modules/mediastream/NavigatorMediaDevices.idl:
2535         * bindings/scripts/CodeGeneratorJS.pm:
2536         (GenerateRuntimeEnableConditionalString):
2537         * bindings/scripts/IDLAttributes.json:
2538         * dom/ScriptExecutionContext.cpp:
2539         (WebCore::ScriptExecutionContext::hasMediaDevices const):
2540         (WebCore::ScriptExecutionContext::hasServiceWorkerScheme const):
2541         * dom/ScriptExecutionContext.h:
2542
2543 2019-02-15  Youenn Fablet  <youenn@apple.com>
2544
2545         WebSocket should not fire events after being stopped
2546         https://bugs.webkit.org/show_bug.cgi?id=194690
2547
2548         Reviewed by Geoffrey Garen.
2549
2550         dispatchOrQueueErrorEvent is scheduled using RunLoop::main().dispatch or dispatch_async.
2551         This makes it possible to dispatch an event while WebSocket is already stopped.
2552         Instead, use Document::postTask so that the task is only executed if WebSocket is not stopped.
2553
2554         As a refactoring, make use of PendingActivity to keep track of setPendingActivity/unsetPendingActivity more easily.
2555
2556         * Modules/websockets/WebSocket.cpp:
2557         (WebCore::WebSocket::stop):
2558         (WebCore::WebSocket::connect):
2559         * Modules/websockets/WebSocket.h:
2560
2561 2019-02-15  Youenn Fablet  <youenn@apple.com>
2562
2563         Performance should not fire events when its context is stopped
2564         https://bugs.webkit.org/show_bug.cgi?id=194689
2565
2566         Reviewed by Alex Christensen.
2567
2568         Stop the timer when its context is destroyed.
2569         Add an assertion to ensure the timer does not fire after context is destroyed.
2570
2571         * page/Performance.cpp:
2572         (WebCore::Performance::stop):
2573
2574 2019-02-15  Alex Christensen  <achristensen@webkit.org>
2575
2576         REGRESSION: ( r240978-r240985 ) [ iOS Release ] Layout Test imported/w3c/web-platform-tests/xhr/send-redirect-post-upload.htm is crashing
2577         https://bugs.webkit.org/show_bug.cgi?id=194523
2578
2579         Reviewed by Geoffrey Garen.
2580
2581         The scope of the FormCreationContext was limited to the scope of createHTTPBodyCFReadStream,
2582         so when it was used in formCreate it was lucky to get the same context if the stack hadn't been overwritten
2583         and if the FormData hadn't been freed.  Instead, keep it alive with new/delete like we do the FormStreamFields.
2584         A younger me should've noticed this when reviewing r218517.
2585
2586         * platform/network/cf/FormDataStreamCFNet.cpp:
2587         (WebCore::formCreate):
2588         (WebCore::createHTTPBodyCFReadStream):
2589
2590 2019-02-15  Commit Queue  <commit-queue@webkit.org>
2591
2592         Unreviewed, rolling out r241559 and r241566.
2593         https://bugs.webkit.org/show_bug.cgi?id=194710
2594
2595         Causes layout test crashes under GuardMalloc (Requested by
2596         ryanhaddad on #webkit).
2597
2598         Reverted changesets:
2599
2600         "[WTF] Add environment variable helpers"
2601         https://bugs.webkit.org/show_bug.cgi?id=192405
2602         https://trac.webkit.org/changeset/241559
2603
2604         "Unreviewed build fix for WinCairo Debug after r241559."
2605         https://trac.webkit.org/changeset/241566
2606
2607 2019-02-15  Youenn Fablet  <youenn@apple.com>
2608
2609         Stop the endpoint synchronously in RTCPeerConnection::close
2610         https://bugs.webkit.org/show_bug.cgi?id=194688
2611
2612         Reviewed by Eric Carlson.
2613
2614         In the case where the peer connection is being closed, it was asynchronously stopping the endpoint.
2615         But the endpoint, before being stopped, could try to fire an event.
2616         If the context is gone in between, we end up with a null pointer dereference.
2617
2618         * Modules/mediastream/RTCPeerConnection.cpp:
2619         (WebCore::RTCPeerConnection::close):
2620
2621 2019-02-15  Zalan Bujtas  <zalan@apple.com>
2622
2623         [LFC] Out-of-flow box is never a float box
2624         https://bugs.webkit.org/show_bug.cgi?id=194704
2625
2626         Reviewed by Antti Koivisto.
2627
2628         We can't have it both ways. Absolute positioning wins.
2629
2630         Test: fast/block/block-only/out-of-flow-is-never-float-box.html
2631
2632         * layout/layouttree/LayoutBox.cpp:
2633         (WebCore::Layout::Box::isFloatingPositioned const):
2634         (WebCore::Layout::Box::isLeftFloatingPositioned const):
2635         (WebCore::Layout::Box::isRightFloatingPositioned const):
2636
2637 2019-02-15  Philippe Normand  <pnormand@igalia.com>
2638
2639         [GStreamer] Simplify GObject class name check
2640         https://bugs.webkit.org/show_bug.cgi?id=194537
2641
2642         Reviewed by Michael Catanzaro.
2643
2644         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2645         (WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback):
2646         Use G_OBJECT_TYPE_NAME() to filter out uridecodebin child
2647         elements.
2648
2649 2019-02-15  Wenson Hsieh  <wenson_hsieh@apple.com>
2650
2651         Refactor EditingStyle::textDirection to return an Optional<WritingDirection> instead of a bool
2652         https://bugs.webkit.org/show_bug.cgi?id=194686
2653
2654         Reviewed by Ryosuke Niwa.
2655
2656         Changes EditingStyle::textDirection to return an Optional<WritingDirection>, instead of taking a reference to
2657         the resulting WritingDirection. No change in behavior.
2658
2659         * editing/ApplyStyleCommand.cpp:
2660         (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
2661         (WebCore::ApplyStyleCommand::applyInlineStyle):
2662         * editing/EditingStyle.cpp:
2663         (WebCore::EditingStyle::textDirection const):
2664         (WebCore::EditingStyle::textDirectionForSelection):
2665         * editing/EditingStyle.h:
2666
2667 2019-02-10  Darin Adler  <darin@apple.com>
2668
2669         Replace more uses of String::format with StringConcatenate (mostly non-Apple platform-specific cases)
2670         https://bugs.webkit.org/show_bug.cgi?id=194487
2671
2672         Reviewed by Daniel Bates.
2673
2674         * accessibility/win/AccessibilityObjectWrapperWin.cpp:
2675         (WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue): Use makeString
2676         instead of String::format.
2677
2678         * page/linux/ResourceUsageOverlayLinux.cpp:
2679         (WebCore::formatByteNumber): Use String::number instead of String::format.
2680
2681         * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp:
2682         (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer):
2683         Use makeString instead of String::format.
2684         * platform/glib/UserAgentGLib.cpp:
2685         (WebCore::platformVersionForUAString): Ditto.
2686         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2687         (WebCore::simpleBusMessageCallback): Ditto.
2688         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2689         (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Ditto.
2690         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
2691         (WebCore::AppendPipeline::AppendPipeline): Ditto.
2692         (WebCore::AppendPipeline::handleStateChangeMessage): Ditto.
2693         (WebCore::AppendPipeline::resetParserState): Ditto.
2694         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2695         (WebCore::MediaPlayerPrivateGStreamerMSE::load): Ditto.
2696         (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek): Ditto.
2697
2698         * platform/graphics/gtk/ImageBufferGtk.cpp:
2699         (WebCore::encodeImage): Use String::number instead of String::format.
2700
2701         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
2702         (WebCore::GStreamerAudioCaptureSource::create): Use makeString instead of
2703         String::format.
2704         * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
2705         (WebCore::GStreamerCaptureDeviceManager::addDevice): Ditto.
2706         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
2707         (WebCore::webkitMediaStreamSrcAddPad): Ditto.
2708         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
2709         (WebCore::GStreamerVideoCaptureSource::create): Ditto.
2710         * platform/network/curl/CookieJarDB.cpp:
2711         (WebCore::CookieJarDB::verifySchemaVersion): Ditto.
2712         * platform/win/SearchPopupMenuDB.cpp:
2713         (WebCore::SearchPopupMenuDB::verifySchemaVersion): Ditto.
2714
2715 2019-02-15  Philippe Normand  <pnormand@igalia.com>
2716
2717         [GStreamer] Decoding media-capabilities configuration initial support
2718         https://bugs.webkit.org/show_bug.cgi?id=191191
2719
2720         Reviewed by Xabier Rodriguez-Calvar.
2721
2722         This patch enables basic platform probing for GStreamer decoders,
2723         optionally using Hardware decoding capabilities. The previous code
2724         for decoders/demuxers probing partially duplicated between the MSE
2725         player and its parent class was moved to a new module called
2726         GStreamerRegistryScanner. There is one instance of it for the MSE player
2727         and one for the parent class.
2728
2729         The scanner can check for the presence of the GstElement Hardware
2730         metadata classifier in decoders and thus advise the
2731         MediaEngineConfigurationFactoryGStreamer that hardware decoding is
2732         supported or not. This is only a first step though. The scanner
2733         should also probably attempt a NULL->READY transition on decoders
2734         to validate specific input caps are supported. As this might
2735         require changes in GStreamer, this part of the patch wasn't
2736         included.
2737
2738         This patch is covered by the existing media tests.
2739
2740         * platform/GStreamer.cmake: New files.
2741         * platform/graphics/MediaPlayer.cpp: Add support for converting
2742         SupportsType enum to string.
2743         (WebCore::convertEnumerationToString):
2744         * platform/graphics/MediaPlayer.h: Ditto.
2745         * platform/graphics/MediaPlayerEnums.h: Ditto.
2746         * platform/graphics/gstreamer/GStreamerCommon.cpp: Move
2747         gstRegistryHasElementForMediaType to GStreamerRegistryScanner.
2748         * platform/graphics/gstreamer/GStreamerCommon.h: Ditto.
2749         * platform/graphics/gstreamer/GStreamerRegistryScanner.cpp: Added.
2750         (WebCore::GStreamerRegistryScanner::singleton):
2751         (WebCore::GStreamerRegistryScanner::GStreamerRegistryScanner): Initialize
2752         supported mime-types and codecs from the GStreamer registry.
2753         (WebCore::GStreamerRegistryScanner::~GStreamerRegistryScanner): Free the element factories.
2754         (WebCore::GStreamerRegistryScanner::gstRegistryHasElementForMediaType):
2755         Check the input caps are supported, optionally using hardware
2756         device.
2757         (WebCore::GStreamerRegistryScanner::fillMimeTypeSetFromCapsMapping):
2758         Moved from MediaPlayerPrivateGStreamer{,MSE}.
2759         (WebCore::GStreamerRegistryScanner::initialize): Ditto.
2760         (WebCore::GStreamerRegistryScanner::supportsCodec const): Ditto.
2761         (WebCore::GStreamerRegistryScanner::supportsAllCodecs const): Ditto.
2762         (WebCore::GStreamerRegistryScanner::isDecodingSupported const): Check
2763         the given configuration is supported. For now hardware support is
2764         checked for video configurations only as it is quite uncommon
2765         anyway to have hardware-enabled audio decoders.
2766         * platform/graphics/gstreamer/GStreamerRegistryScanner.h: Added.
2767         (WebCore::GStreamerRegistryScanner::mimeTypeSet):
2768         (WebCore::GStreamerRegistryScanner::supportsContainerType const):
2769         (WebCore::GStreamerRegistryScanner::RegistryLookupResult::operator bool const):
2770         * platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.cpp: Added.
2771         (WebCore::createMediaPlayerDecodingConfigurationGStreamer):
2772         * platform/graphics/gstreamer/MediaEngineConfigurationFactoryGStreamer.h: Added.
2773         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2774         Rely on new GStreamerRegistryScanner and add some debugging macros.
2775         (WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes):
2776         (WebCore::MediaPlayerPrivateGStreamer::supportsType):
2777         * platform/graphics/gstreamer/mse/AppendPipeline.cpp: Ditto. Also
2778         plug qtdemux for AAC containers, this is an explicit consequence
2779         of finer-grained codecs probing.
2780         (WebCore::AppendPipeline::AppendPipeline):
2781         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
2782         * platform/graphics/gstreamer/mse/GStreamerRegistryScannerMSE.cpp: Added.
2783         (WebCore::GStreamerRegistryScannerMSE::singleton):
2784         (WebCore::GStreamerRegistryScannerMSE::GStreamerRegistryScannerMSE):
2785         * platform/graphics/gstreamer/mse/GStreamerRegistryScannerMSE.h: Added.
2786         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2787         Rely on new GStreamerRegistryScanner and add some debugging macros.
2788         (WebCore::MediaPlayerPrivateGStreamerMSE::getSupportedTypes):
2789         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
2790         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
2791         * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
2792         (WebCore::factories): GStreamer support.
2793
2794 2019-02-14  Joseph Pecoraro  <pecoraro@apple.com>
2795
2796         Web Inspector: Occasional crash under WebCore::CSSStyleSheet::item called from Inspector
2797         https://bugs.webkit.org/show_bug.cgi?id=194671
2798         <rdar://problem/47628191>
2799
2800         Reviewed by Devin Rousso.
2801
2802         * css/CSSStyleSheet.cpp:
2803         (WebCore::CSSStyleSheet::item):
2804         A crash may happen if the m_childRuleCSSOMWrappers Vector gets out of
2805         sync with the m_contents list of rules. In particular if the wrappers
2806         vector is shorter than the rule list. We tried exercising code paths
2807         that modify these lists but were not able to reproduce the crash.
2808         To avoid a crash we can make this access safer and avoid the original
2809         overflow. At the same time we will keep and promote the assertion that
2810         would catch the lists getting out of sync in debug builds.
2811
2812 2019-02-14  Ross Kirsling  <ross.kirsling@sony.com>
2813
2814         Unreviewed build fix for WinCairo Debug after r241559.
2815
2816         * platform/network/curl/CurlContext.cpp:
2817         (WebCore::CurlContext::CurlContext):
2818
2819 2019-02-14  Ross Kirsling  <ross.kirsling@sony.com>
2820
2821         [WTF] Add environment variable helpers
2822         https://bugs.webkit.org/show_bug.cgi?id=192405
2823
2824         Reviewed by Michael Catanzaro.
2825
2826         * platform/NotImplemented.h:
2827         * platform/cocoa/SystemVersion.mm:
2828         (WebCore::createSystemMarketingVersion):
2829         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2830         (WebCore::initializeGStreamer):
2831         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
2832         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
2833         * platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
2834         (Nicosia::PaintingEngine::create):
2835         * platform/graphics/texmap/TextureMapperFPSCounter.cpp:
2836         (WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
2837         * platform/graphics/x11/PlatformDisplayX11.cpp:
2838         (WebCore::PlatformDisplayX11::create):
2839         * platform/gtk/RenderThemeWidget.cpp:
2840         (WebCore::RenderThemeScrollbar::RenderThemeScrollbar):
2841         * platform/gtk/ScrollbarThemeGtk.cpp:
2842         (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
2843         * platform/network/curl/CurlContext.cpp:
2844         (WebCore::CurlContext::CurlContext):
2845         (WebCore::EnvironmentVariableReader::read): Deleted.
2846         (WebCore::EnvironmentVariableReader::defined): Deleted.
2847         (WebCore::EnvironmentVariableReader::readAs): Deleted.
2848         (WebCore::EnvironmentVariableReader::sscanTemplate): Deleted.
2849         (WebCore::EnvironmentVariableReader::sscanTemplate<signed>): Deleted.
2850         (WebCore::EnvironmentVariableReader::sscanTemplate<unsigned>): Deleted.
2851         * platform/network/curl/NetworkStorageSessionCurl.cpp:
2852         (WebCore::defaultCookieJarPath):
2853         * platform/network/playstation/CurlSSLHandlePlayStation.cpp:
2854         (WebCore::getCACertPathEnv):
2855         * platform/network/win/CurlSSLHandleWin.cpp:
2856         (WebCore::getCACertPathEnv):
2857         * platform/text/hyphen/HyphenationLibHyphen.cpp:
2858         (WebCore::topLevelPath):
2859         (WebCore::webkitBuildDirectory):
2860         * platform/unix/LoggingUnix.cpp:
2861         (WebCore::logLevelString):
2862         * platform/win/LoggingWin.cpp:
2863         (WebCore::logLevelString):
2864         Utilize WTF::Environment where possible.
2865
2866 2019-02-14  Chris Dumez  <cdumez@apple.com>
2867
2868         [PSON] Introduce a WebContent Process cache
2869         https://bugs.webkit.org/show_bug.cgi?id=194594
2870         <rdar://problem/46793397>
2871
2872         Reviewed by Geoff Garen.
2873
2874         Update localizable strings.
2875
2876         * en.lproj/Localizable.strings:
2877
2878 2019-02-14  Commit Queue  <commit-queue@webkit.org>
2879
2880         Unreviewed, rolling out r241486.
2881         https://bugs.webkit.org/show_bug.cgi?id=194655
2882
2883         causing API failures in builds (Requested by ShawnRoberts on
2884         #webkit).
2885
2886         Reverted changeset:
2887
2888         "[Cocoa] Media elements will restart network buffering just
2889         before suspending"
2890         https://bugs.webkit.org/show_bug.cgi?id=193691
2891         https://trac.webkit.org/changeset/241486
2892
2893 2019-02-13  Brian Burg  <bburg@apple.com>
2894
2895         Web Inspector: don't include accessibility role in DOM.Node object payloads
2896         https://bugs.webkit.org/show_bug.cgi?id=194623
2897         <rdar://problem/36384037>
2898
2899         Reviewed by Devin Rousso.
2900
2901         Accessibility properties are complicated to fetch at all the points where we want to build and push nodes immediately.
2902         Turning on AX often indirectly causes style recalc and layout. This is bad because we are often building nodes in the
2903         first place due to a DOM node tree update (i.e., NodeInserted).
2904
2905         It turns out that DOM.getAccessibilityPropertiesForNode is called every time we display
2906         the computed role in the Elements Tab > Nodes Sidebar > Accessibility Section. So it is not
2907         necessary to collect this information in a problematic way when initially pushing the node, as
2908         it will be updated anyway.
2909
2910         No new tests, no change in behavior.
2911
2912         * inspector/agents/InspectorDOMAgent.cpp:
2913         (WebCore::InspectorDOMAgent::buildObjectForNode):
2914
2915 2019-02-14  Zalan Bujtas  <zalan@apple.com>
2916
2917         [LFC][BFC][MarginCollapse] Replaced boxes don't collapse through their margins
2918         https://bugs.webkit.org/show_bug.cgi?id=194622
2919
2920         Reviewed by Antti Koivisto.
2921
2922         Ensure that block replaced boxes don't collapse through their vertical margins. 
2923
2924         Test: fast/block/block-only/block-replaced-with-vertical-margins.html
2925
2926         * layout/blockformatting/BlockMarginCollapse.cpp:
2927         (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough):
2928         * page/FrameViewLayoutContext.cpp:
2929         (WebCore::layoutUsingFormattingContext):
2930
2931 2019-02-14  Zalan Bujtas  <zalan@apple.com>
2932
2933         [LFC] Shrink-to-fit-width should be constrained by min/max width
2934         https://bugs.webkit.org/show_bug.cgi?id=194653
2935
2936         Reviewed by Antti Koivisto.
2937
2938         Use the fixed value of min-width/max-width to constrain the computed preferred width.
2939
2940         * layout/FormattingContext.h:
2941         * layout/FormattingContextGeometry.cpp:
2942         (WebCore::Layout::FormattingContext::Geometry::constrainByMinMaxWidth):
2943         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2944         (WebCore::Layout::BlockFormattingContext::Geometry::intrinsicWidthConstraints):
2945         * layout/inlineformatting/InlineFormattingContext.cpp:
2946         (WebCore::Layout::InlineFormattingContext::computeIntrinsicWidthConstraints const):
2947
2948 2019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
2949
2950         Crash in DOMTimer::fired
2951         https://bugs.webkit.org/show_bug.cgi?id=194638
2952
2953         Reviewed by Brent Fulgham.
2954
2955         This patch continues the saga of hunting down timer related crashes after r239814, r225985, r227934.
2956
2957         The crash was caused by the bug that we don't remove a DOMTimer from NestedTimersMap if a DOMTimer
2958         is created & installed inside another DOMTimer's callback (via execute call in DOMTimer::fired).
2959
2960         Fixed the crash by using a Ref in NestedTimersMap. This will keep the timer alive until we exit
2961         from DOMTimer::fired. Because DOMTimer::fired always calls stopTracking() which clears the map
2962         we would not leak these DOM timers.
2963
2964         We could, alternatively, use WeakPtr in NestedTimersMap but that would unnecessarily increase the
2965         size of DOMTimer for a very marginal benefit of DOMTimer objcets being deleted slightly earlier.
2966         Deleting itself in DOMTimer's destructor involves more logic & house keeping in the timer code,
2967         and is no longer the preferred approach when dealing with these classes of bugs in WebKit.
2968
2969         Test: fast/dom/timer-destruction-during-firing.html
2970
2971         * page/DOMTimer.cpp:
2972         (WebCore::NestedTimersMap::add):
2973         (WebCore::DOMTimer::install):
2974         (WebCore::DOMTimer::fired):
2975
2976 2019-02-13  Joseph Pecoraro  <pecoraro@apple.com>
2977
2978         Web Inspector: Crash when inspecting an element that constantly changes visibility
2979         https://bugs.webkit.org/show_bug.cgi?id=194632
2980         <rdar://problem/48060258>
2981
2982         Reviewed by Matt Baker and Devin Rousso.
2983
2984         * inspector/agents/InspectorDOMAgent.h:
2985         * inspector/agents/InspectorDOMAgent.cpp:
2986         (WebCore::InspectorDOMAgent::processAccessibilityChildren):
2987         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
2988         Don't use rvalue-references as that was taking ownership and deleting
2989         the object we want to keep around. Instead simplify this to just use
2990         references so no ref counting changes happen.
2991
2992 2019-02-13  Chris Fleizach  <cfleizach@apple.com>
2993
2994         AX: Crash in handleMenuOpen
2995         https://bugs.webkit.org/show_bug.cgi?id=194627
2996
2997         Reviewed by Zalan Bujtas.
2998
2999         Tests run under libGuardMalloc will cause crashes.
3000
3001         This list of objects is a Node list, not an Element list, so we were
3002         not removing some nodes when they were being deallocated.
3003
3004         * accessibility/AXObjectCache.cpp:
3005         (WebCore::AXObjectCache::remove):
3006
3007 2019-02-13  Jer Noble  <jer.noble@apple.com>
3008
3009         [Mac] PiP window can get "stuck" if PiP is closed while Safari window is minimized.
3010         https://bugs.webkit.org/show_bug.cgi?id=194621
3011         <rdar://problem/48002560>
3012
3013         Reviewed by Eric Carlson.
3014
3015         When Safari is minimized, no rAF() requests are executed. Don't gate responding to presentation
3016         change events in the media-controller.js on rAF().
3017
3018         * Modules/modern-media-controls/media/media-controller.js:
3019         (MediaController.prototype._returnMediaLayerToInlineIfNeeded):
3020
3021 2019-02-13  John Wilander  <wilander@apple.com>
3022
3023         Ignore Ad Click Attribution where source and destination are same-site
3024         https://bugs.webkit.org/show_bug.cgi?id=194620
3025         <rdar://problem/47890018>
3026
3027         Reviewed by Jiewen Tan.
3028
3029         Updated the existing test.
3030
3031         We should not accept Ad Click Attribution requests where the site of the
3032         anchor tag and its addestination attribute are same-site. Such attributions
3033         don’t make sense (the site can track intra-site clicks through better means)
3034         and would just lead to increased memory use where are the pending
3035         attributions are stored.
3036
3037         For ports that don't have access to the Public Suffix List, this patch
3038         only checks that the hosts don't match, i.e. not just eTLD+1.
3039
3040         * html/HTMLAnchorElement.cpp:
3041         (WebCore::HTMLAnchorElement::parseAdClickAttribution const):
3042             Now returns WTF::nullopt if the current document and the
3043             addestination are same site. Also fixed a console message
3044             typo.
3045
3046 2019-02-13  Eric Carlson  <eric.carlson@apple.com> and Youenn Fablet  <youenn@apple.com>
3047
3048         getUserMedia with an ideal deviceId constraint doesn't always select the correct device
3049         https://bugs.webkit.org/show_bug.cgi?id=193614
3050
3051         Reviewed by Eric Carlson.
3052
3053         Compute a fitness score based on constraints.
3054         For each constraint, a fitness score is computed from the distance.
3055         The smaller the distance, the higher the score.
3056         Fitness scores are then summed to give a device fitness score.
3057         Matching devices are then sorted according the fitness score.
3058
3059         For important constraints, deviceId and facingMode, add a more important weight.
3060         This ensures that should any of these ideal constraints are set, they will be respected.
3061
3062         Restrict our automatic setting of default constraints to not add a default ideal facingMode in case of existing deviceId constraint.
3063         Do not set a default ideal frameRate if width and height are already set.
3064
3065         Covered by updated test.
3066
3067         * platform/mediastream/MediaConstraints.cpp:
3068         (WebCore::FlattenedConstraint::set):
3069         (WebCore::MediaConstraints::setDefaultVideoConstraints):
3070         * platform/mediastream/RealtimeMediaSource.cpp:
3071         (WebCore::RealtimeMediaSource::fitnessDistance):
3072         (WebCore::RealtimeMediaSource::selectSettings):
3073         (WebCore::RealtimeMediaSource::supportsConstraints):
3074         (WebCore::RealtimeMediaSource::applyConstraints):
3075         * platform/mediastream/RealtimeMediaSource.h:
3076         * platform/mediastream/RealtimeMediaSourceCenter.cpp:
3077         (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints):
3078
3079 2019-02-13  Eric Carlson  <eric.carlson@apple.com>
3080
3081         [iOS] Add a hack to work around buggy video control library
3082         https://bugs.webkit.org/show_bug.cgi?id=194615
3083         <rdar://problem/46146946>
3084
3085         Reviewed by Jer Noble.
3086
3087         Test: media/ios/video-volume-ios-quirk.html
3088
3089         * html/HTMLMediaElement.cpp:
3090         (WebCore::HTMLMediaElement::setVolume): Change m_volume for one turn of the runloop.
3091         (WebCore::HTMLMediaElement::cancelPendingTasks): Clear the task queue used to restore m_volume.
3092         (WebCore::HTMLMediaElement::closeTaskQueues): Close it.
3093         * html/HTMLMediaElement.h:
3094
3095 2019-02-13  Jer Noble  <jer.noble@apple.com>
3096
3097         [Cocoa] Media elements will restart network buffering just before suspending
3098         https://bugs.webkit.org/show_bug.cgi?id=193691
3099
3100         Reviewed by Eric Carlson.
3101
3102         API Test: WebKit.ProcessSuspendMediaBuffering
3103
3104         Allow the Page to suspend all media buffering in its child Documents.
3105
3106         * dom/Document.cpp:
3107         (WebCore::Document::suspendAllMediaBuffering):
3108         (WebCore::Document::resumeAllMediaBuffering):
3109         * dom/Document.h:
3110         * html/MediaElementSession.cpp:
3111         (WebCore::MediaElementSession::dataBufferingPermitted const):
3112         (WebCore::MediaElementSession::suspendBuffering):
3113         (WebCore::MediaElementSession::resumeBuffering):
3114         (WebCore::MediaElementSession::bufferingSuspended const):
3115         * html/MediaElementSession.h:
3116         * page/Page.cpp:
3117         (WebCore::Page::suspendAllMediaBuffering):
3118         (WebCore::Page::resumeAllMediaBuffering):
3119         * page/Page.h:
3120         (WebCore::Page::mediaPlaybackIsSuspended const):
3121         (WebCore::Page::mediaBufferingIsSuspended const):
3122         (WebCore::Page::mediaPlaybackIsSuspended): Deleted.
3123         * platform/audio/PlatformMediaSession.h:
3124         (WebCore::PlatformMediaSession::suspendBuffering):
3125         (WebCore::PlatformMediaSession::resumeBuffering):
3126         * platform/audio/PlatformMediaSessionManager.cpp:
3127         (WebCore::PlatformMediaSessionManager::suspendAllMediaBufferingForDocument):
3128         (WebCore::PlatformMediaSessionManager::resumeAllMediaBufferingForDocument):
3129         * platform/audio/PlatformMediaSessionManager.h:
3130
3131 2019-02-13  Jer Noble  <jer.noble@apple.com>
3132
3133         Entering fullscreen inside a shadow root will not set fullscreen pseudoclasses outside of root
3134         https://bugs.webkit.org/show_bug.cgi?id=194516
3135         <rdar://problem/44678353>
3136
3137         Reviewed by Antoine Quint.
3138
3139         Test: fast/shadow-dom/fullscreen-in-shadow-full-screen-ancestor.html
3140
3141         When walking up the element ancestor chain, use parentElementInComposedTree() to
3142         walk past the shadow root boundary.
3143
3144         * dom/Element.cpp:
3145         (WebCore::parentCrossingFrameBoundaries):
3146
3147 2019-02-13  Chris Dumez  <cdumez@apple.com>
3148
3149         Unreviewed, update localizable strings.
3150
3151         * en.lproj/Localizable.strings:
3152
3153 2019-02-12  Jiewen Tan  <jiewen_tan@apple.com>
3154
3155         Further restricting webarchive loads
3156         https://bugs.webkit.org/show_bug.cgi?id=194567
3157         <rdar://problem/47610130>
3158
3159         Reviewed by Youenn Fablet.
3160
3161         This patch futher restricts main frame webarchive loads to the followings:
3162         1) loaded by clients;
3163         2) loaded by drag;
3164         3) reloaded from any of the previous two.
3165
3166         It moves setAlwaysAllowLocalWebarchive, which is used for testing only, from Document
3167         to FrameLoader such that the option is remembered during redirections.
3168
3169         Covered by API tests.
3170
3171         * dom/Document.h:
3172         (WebCore::Document::setAlwaysAllowLocalWebarchive): Deleted.
3173         (WebCore::Document::alwaysAllowLocalWebarchive const): Deleted.
3174         * loader/DocumentLoader.cpp:
3175         (WebCore::DocumentLoader::disallowWebArchive const):
3176         * loader/DocumentLoader.h:
3177         (WebCore::DocumentLoader::setAllowsWebArchiveForMainFrame):
3178         (WebCore::DocumentLoader::allowsWebArchiveForMainFrame):
3179         * loader/FrameLoadRequest.h:
3180         (WebCore::FrameLoadRequest::setIsRequestFromClientOrUserInput):
3181         (WebCore::FrameLoadRequest::isRequestFromClientOrUserInput):
3182         * loader/FrameLoader.cpp:
3183         (WebCore::FrameLoader::load):
3184         (WebCore::FrameLoader::reload):
3185         * loader/FrameLoader.h:
3186         (WebCore::FrameLoader::setAlwaysAllowLocalWebarchive):
3187         (WebCore::FrameLoader::alwaysAllowLocalWebarchive const):
3188         * page/DragController.cpp:
3189         (WebCore::DragController::performDragOperation):
3190         * testing/Internals.cpp:
3191         (WebCore::Internals::setAlwaysAllowLocalWebarchive const):
3192         * testing/Internals.h:
3193         * testing/Internals.idl:
3194
3195 2019-02-13  Jer Noble  <jer.noble@apple.com>
3196
3197         Null-deref crash at SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged()
3198         https://bugs.webkit.org/show_bug.cgi?id=194613
3199         <rdar://problem/48023912>
3200
3201         Reviewed by Eric Carlson.
3202
3203         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
3204         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
3205
3206 2019-02-13  Michael Catanzaro  <mcatanzaro@igalia.com>
3207
3208         Unreviewed, fix unused variable warnings after r241148/r241251
3209         https://bugs.webkit.org/show_bug.cgi?id=194348
3210         <rdar://problem/47566449>
3211
3212         * Modules/mediasource/SourceBuffer.cpp:
3213         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveRenderingError):
3214         (WebCore::SourceBuffer::evictCodedFrames):
3215         (WebCore::SourceBuffer::provideMediaData):
3216
3217 2019-02-13  Sihui Liu  <sihui_liu@apple.com>
3218
3219         REGRESSION: [ Mac Debug WK2 ] Layout Test storage/indexeddb/key-type-infinity-private.html is a flaky crash
3220         https://bugs.webkit.org/show_bug.cgi?id=194413
3221         <rdar://problem/47897254>
3222
3223         Reviewed by Brady Eidson.
3224
3225         IDB clients expected transaction operations to be executed in order, but in 
3226         UniqueIDBDatabase::immediateCloseForUserDelete, callbacks in callback map were errored out randomly.
3227         This patch added a callback queue to UniqueIDBDatabase to make sure callbacks will be called in the same order
3228         as IDB Server receives the request.
3229
3230         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
3231         (WebCore::IDBServer::UniqueIDBDatabase::storeCallbackOrFireError):
3232         (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete):
3233         (WebCore::IDBServer::UniqueIDBDatabase::performErrorCallback):
3234         (WebCore::IDBServer::UniqueIDBDatabase::performKeyDataCallback):
3235         (WebCore::IDBServer::UniqueIDBDatabase::performGetResultCallback):
3236         (WebCore::IDBServer::UniqueIDBDatabase::performGetAllResultsCallback):
3237         (WebCore::IDBServer::UniqueIDBDatabase::performCountCallback):
3238         (WebCore::IDBServer::UniqueIDBDatabase::forgetErrorCallback):
3239         * Modules/indexeddb/server/UniqueIDBDatabase.h:
3240
3241 2019-02-13  John Wilander  <wilander@apple.com>
3242
3243         Store Ad Click Attribution requests in the network process
3244         https://bugs.webkit.org/show_bug.cgi?id=194510
3245         <rdar://problem/47650118>
3246
3247         Reviewed by Alex Christensen and Daniel Bates.
3248
3249         Test: http/tests/adClickAttribution/store-ad-click-attribution.html
3250
3251         This patch adds support functions for validation and storage of
3252         WebCore::AdClickAttribution objects. It also adds WTF::HashTraits so that
3253         WebCore::AdClickAttribution::Source and WebCore::AdClickAttribution::Destination
3254         can be used in a HashMap.
3255
3256         * loader/AdClickAttribution.cpp:
3257         (WebCore::AdClickAttribution::toString const):
3258         * loader/AdClickAttribution.h:
3259         (WebCore::AdClickAttribution::Source::operator== const):
3260         (WebCore::AdClickAttribution::Source::deletedValue):
3261         (WebCore::AdClickAttribution::Source::constructDeletedValue):
3262         (WebCore::AdClickAttribution::Source::deleteValue):
3263         (WebCore::AdClickAttribution::Source::isDeletedValue const):
3264         (WebCore::AdClickAttribution::SourceHash::hash):
3265         (WebCore::AdClickAttribution::SourceHash::equal):
3266         (WebCore::AdClickAttribution::Destination::operator== const):
3267         (WebCore::AdClickAttribution::Destination::matches const):
3268             This convenience function allows matching of a WTF::URL object.
3269         (WebCore::AdClickAttribution::Destination::deletedValue):
3270         (WebCore::AdClickAttribution::Destination::constructDeletedValue):
3271         (WebCore::AdClickAttribution::Destination::deleteValue):
3272         (WebCore::AdClickAttribution::Destination::isDeletedValue const):
3273         (WebCore::AdClickAttribution::DestinationHash::hash):
3274         (WebCore::AdClickAttribution::DestinationHash::equal):
3275         (WebCore::AdClickAttribution::source const):
3276         (WebCore::AdClickAttribution::destination const):
3277             Getters added to support mapped storage based on source and destination.
3278         (WTF::HashTraits<WebCore::AdClickAttribution::Source>::emptyValue):
3279         (WTF::HashTraits<WebCore::AdClickAttribution::Source>::constructDeletedValue):
3280         (WTF::HashTraits<WebCore::AdClickAttribution::Source>::isDeletedValue):
3281         (WTF::HashTraits<WebCore::AdClickAttribution::Destination>::emptyValue):
3282         (WTF::HashTraits<WebCore::AdClickAttribution::Destination>::constructDeletedValue):
3283         (WTF::HashTraits<WebCore::AdClickAttribution::Destination>::isDeletedValue):
3284         * loader/NavigationAction.h:
3285         (WebCore::NavigationAction::adClickAttribution const):
3286         (WebCore::NavigationAction::adClickAttribution): Deleted.
3287             Corrected the constness of this function.
3288
3289 2019-02-13  Eric Carlson  <eric.carlson@apple.com>
3290
3291         Revert r240434
3292         https://bugs.webkit.org/show_bug.cgi?id=194600
3293         <rdar://problem/48044566>
3294
3295         Reviewed by Brent Fulgham.
3296
3297         * html/HTMLMediaElement.cpp:
3298         (WebCore::HTMLMediaElement::setVolume):
3299         (WebCore::HTMLMediaElement::mediaPlayerVolumeChanged):
3300         (WebCore::HTMLMediaElement::updateVolume):
3301         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3302         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume):
3303
3304 2019-02-13  Alex Christensen  <achristensen@webkit.org>
3305
3306         Stop using setDefersLoading from WebCore
3307         https://bugs.webkit.org/show_bug.cgi?id=194315
3308
3309         Reviewed by Jer Noble.
3310
3311         That is what CompletionHandlers are for.
3312
3313         * loader/MediaResourceLoader.cpp:
3314         (WebCore::MediaResource::responseReceived):
3315         (WebCore::MediaResource::setDefersLoading): Deleted.
3316         * loader/MediaResourceLoader.h:
3317         * platform/graphics/PlatformMediaResourceLoader.h:
3318         (WebCore::PlatformMediaResourceClient::responseReceived):
3319         (WebCore::PlatformMediaResource::stop):
3320         (WebCore::PlatformMediaResource::setDefersLoading): Deleted.
3321         * platform/network/cocoa/WebCoreNSURLSession.mm:
3322         (WebCore::WebCoreNSURLSessionDataTaskClient::responseReceived):
3323         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:completionHandler:]):
3324         (-[WebCoreNSURLSessionDataTask _setDefersLoading:]): Deleted.
3325         (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]): Deleted.
3326
3327 2019-02-13  Jer Noble  <jer.noble@apple.com>
3328
3329         [Cocoa] Switch to CVPixelBufferGetBytesPerRow() for calculating CVPixelBuffer base address size.
3330         https://bugs.webkit.org/show_bug.cgi?id=194580
3331         <rdar://problem/42727739>
3332
3333         Reviewed by Eric Carlson.
3334
3335         * platform/cocoa/CoreVideoSoftLink.cpp:
3336         * platform/cocoa/CoreVideoSoftLink.h:
3337         * platform/graphics/cv/PixelBufferConformerCV.cpp:
3338         (WebCore::CVPixelBufferGetBytePointerCallback):
3339         (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
3340
3341 2019-02-13  Antoine Quint  <graouts@apple.com>
3342
3343         Support simulated mouse events on iOS based on a PlatformTouchEvent
3344         https://bugs.webkit.org/show_bug.cgi?id=194501
3345         <rdar://problem/46910790>
3346
3347         Reviewed by Dean Jackson.
3348
3349         Add support for two new internal runtime flags to control whether simulated mouse events should be dipatched along with touch events and
3350         whether simulated mousemove events dispatched should automatically trigger the behavior preventDefault() would also trigger. To facilitate
3351         that, we allow for a MouseEvent to be created, much like a PointerEvent, based on a PlatformTouchEvent. Then, we set a flag on Event within
3352         EventTarget::innerInvokeEventListeners() to see whether any page code has been evaluated as a result of a mousemove event being dispatched.
3353         Finally, we also track mouse events when invalidating touch regions provided the required internal runtime flag is on.
3354
3355         Test: fast/events/touch/ios/mouse-events-dispatch-with-touch.html
3356
3357         * SourcesCocoa.txt:
3358         * WebCore.xcodeproj/project.pbxproj:
3359         * dom/Event.cpp:
3360         * dom/Event.h:
3361         (WebCore::Event::hasEncounteredListener const):
3362         (WebCore::Event::setHasEncounteredListener):
3363         * dom/EventNames.h:
3364         (WebCore::EventNames::isTouchRelatedEventType const):
3365         (WebCore::EventNames::touchRelatedEventNames const):
3366         (WebCore::EventNames::extendedTouchRelatedEventNames const):
3367         (WebCore::EventNames::isTouchEventType const): Deleted.
3368         (WebCore::EventNames::touchAndPointerEventNames const): Deleted.
3369         * dom/EventTarget.cpp:
3370         (WebCore::EventTarget::innerInvokeEventListeners):
3371         * dom/MouseEvent.h:
3372         * dom/Node.cpp:
3373         (WebCore::Node::moveNodeToNewDocument):
3374         (WebCore::tryAddEventListener):
3375         (WebCore::tryRemoveEventListener):
3376         (WebCore::Node::defaultEventHandler):
3377         * dom/ios/MouseEventIOS.cpp: Added.
3378         (WebCore::mouseEventType):
3379         (WebCore::MouseEvent::create):
3380         * dom/ios/PointerEventIOS.cpp:
3381         (WebCore::pointerEventType):
3382         (WebCore::PointerEvent::create):
3383         (WebCore::eventType): Deleted.
3384         * page/DOMWindow.cpp:
3385         (WebCore::DOMWindow::addEventListener):
3386         (WebCore::DOMWindow::removeEventListener):
3387         * page/EventHandler.h:
3388         * page/RuntimeEnabledFeatures.h:
3389         (WebCore::RuntimeEnabledFeatures::mouseEventsSimulationEnabled const):
3390         (WebCore::RuntimeEnabledFeatures::setMouseEventsSimulationEnabled):
3391         (WebCore::RuntimeEnabledFeatures::mousemoveEventHandlingPreventsDefaultEnabled const):
3392         (WebCore::RuntimeEnabledFeatures::setMousemoveEventHandlingPreventsDefaultEnabled):
3393
3394 2019-02-13  Carlos Garcia Campos  <cgarcia@igalia.com>
3395
3396         [FreeType] Unable to render some Hebrew characters
3397         https://bugs.webkit.org/show_bug.cgi?id=194498
3398
3399         Reviewed by Michael Catanzaro.
3400
3401         We are failing to find a font for some of the combining character sequences because normalization is failing due
3402         to overflow error. In case of overflow, normalize returns the required length for the normalized characters, so
3403         we should handle that case to resize the output buffer and try again.
3404
3405         * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
3406         (WebCore::FontCascade::fontForCombiningCharacterSequence const):
3407
3408 2019-02-13  Ryosuke Niwa  <rniwa@webkit.org>
3409
3410         Release assert in PolicyCheckIdentifier::isValidFor via WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction
3411         https://bugs.webkit.org/show_bug.cgi?id=194582
3412
3413         Reviewed by Antti Koivisto.
3414
3415         Check the zero-ness of m_policyCheck first so that we can differentiate process ID being wrong
3416         from the non-generated identifier being sent to us as it was the case in this failure.
3417
3418         * loader/PolicyChecker.cpp:
3419         (WebCore::PolicyCheckIdentifier::isValidFor):
3420
3421 2019-02-13  Commit Queue  <commit-queue@webkit.org>
3422
3423         Unreviewed, rolling out r241273.
3424         https://bugs.webkit.org/show_bug.cgi?id=194579
3425
3426         This change is causing a flaky assertion failure crash in High
3427         Sierra Debug (Requested by ShawnRoberts on #webkit).
3428
3429         Reverted changeset:
3430
3431         "Stop using setDefersLoading from WebCore"
3432         https://bugs.webkit.org/show_bug.cgi?id=194315
3433         https://trac.webkit.org/changeset/241273
3434
3435 2019-02-12  Mark Lam  <mark.lam@apple.com>
3436
3437         Remove unnecessary null check in bindings.
3438         https://bugs.webkit.org/show_bug.cgi?id=194581
3439
3440         Reviewed by Yusuke Suzuki.
3441
3442         It is always safe to call visitor.containsOpaqueRoot(root) with a null root pointer.
3443         It will just return false.  Since we don't expect the root pointer to be null in
3444         the common case, having a null check here is also not optimal.  We'll remove this
3445         unneeded null check.
3446
3447         * bindings/scripts/CodeGeneratorJS.pm:
3448         (GenerateImplementation):
3449         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3450         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
3451
3452 2019-02-12  Rob Buis  <rbuis@igalia.com>
3453
3454         Align with Fetch on data: URLs
3455         https://bugs.webkit.org/show_bug.cgi?id=182325
3456
3457         Reviewed by Alex Christensen.
3458
3459         The MIME type part of the data url should be serialized as
3460         specified in step 3 under "data" [1].
3461
3462         Test: web-platform-tests/fetch/data-urls/processing.any.js
3463
3464         [1] https://fetch.spec.whatwg.org/#concept-scheme-fetch 
3465
3466         * platform/network/DataURLDecoder.cpp:
3467         (WebCore::DataURLDecoder::parseMediaType):
3468
3469 2019-02-12  Alex Christensen  <achristensen@webkit.org>
3470
3471         Build fix after r241320
3472         https://bugs.webkit.org/show_bug.cgi?id=194271
3473
3474         * page/Frame.cpp:
3475         (WebCore::Frame::requestDOMPasteAccess):
3476
3477 2019-02-12  Justin Fan  <justin_fan@apple.com>
3478
3479         [WebGPU] Remove WebGPUBufferDescriptor/Usage and use GPU versions
3480         https://bugs.webkit.org/show_bug.cgi?id=194552
3481
3482         Reviewed by Dean Jackson.
3483
3484         WebGPUBufferDescriptor/Usage have been renamed to GPUBufferDescriptor/Usage in the Web GPU API.
3485         Consolidate the two versions of these classes in our implementation.
3486
3487         Affected layout tests updated with new names. No change in behavior.
3488
3489         * CMakeLists.txt:
3490         * DerivedSources-input.xcfilelist:
3491         * DerivedSources-output.xcfilelist:
3492         * DerivedSources.make:
3493         * Modules/webgpu/GPUBufferDescriptor.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBufferDescriptor.idl.
3494         * Modules/webgpu/GPUBufferUsage.idl: Renamed from Source/WebCore/Modules/webgpu/WebGPUBufferUsage.idl.
3495         * Modules/webgpu/WebGPUBufferUsage.h: Removed.
3496         * Modules/webgpu/WebGPUDevice.cpp:
3497         (WebCore::WebGPUDevice::createBuffer const):
3498         * Modules/webgpu/WebGPUDevice.h:
3499         * Modules/webgpu/WebGPUDevice.idl:
3500         * Sources.txt:
3501         * WebCore.xcodeproj/project.pbxproj:
3502         * bindings/js/WebCoreBuiltinNames.h:
3503         * platform/graphics/gpu/GPUBufferDescriptor.h: Moved out GPUBufferUsage.
3504         * platform/graphics/gpu/GPUBufferUsage.h: Moved from GPUBufferDescriptor.h.
3505
3506 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3507
3508         Unreviewed, try to fix the internal iOS build after r241321
3509
3510         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
3511
3512 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3513
3514         Allow pages to trigger programmatic paste from script on iOS
3515         https://bugs.webkit.org/show_bug.cgi?id=194271
3516         <rdar://problem/47808810>
3517
3518         Reviewed by Tim Horton.
3519
3520         Tests: editing/pasteboard/ios/dom-paste-confirmation.html
3521                editing/pasteboard/ios/dom-paste-consecutive-confirmations.html
3522                editing/pasteboard/ios/dom-paste-rejection.html
3523                editing/pasteboard/ios/dom-paste-requires-user-gesture.html
3524
3525         * dom/UserGestureIndicator.cpp:
3526         (WebCore::UserGestureIndicator::~UserGestureIndicator):
3527
3528         Reset a gesture token's DOM paste access when exiting the scope of a user gesture. This prevents DOM paste
3529         access permissions from leaking into `setTimeout()` callbacks when we forward user gesture tokens.
3530
3531         * dom/UserGestureIndicator.h:
3532         (WebCore::UserGestureToken::resetDOMPasteAccess):
3533
3534 2019-02-12  Chris Fleizach  <cfleizach@apple.com>
3535
3536         AX: IsolatedTree: Implement more attributes
3537         https://bugs.webkit.org/show_bug.cgi?id=193911
3538         <rdar://problem/47599217>
3539
3540         Reviewed by Daniel Bates.
3541
3542         Make use of new HIServices SPI to use a secondary AX thread.
3543         Store root node/focused node status in IsolatedTree rather than on the element.
3544         Implement the following attributes: children, parent, isIgnored, isTree, isTreeItem, relativeFrame, speechHint, title, description.
3545         Implement hit-testing using relative-frames.
3546         Ensure that WKAccessibilityWebPageObject queries happen on main thread when they need to.
3547
3548         * SourcesCocoa.txt:
3549         * WebCore.xcodeproj/project.pbxproj:
3550         * accessibility/AXObjectCache.cpp:
3551         (WebCore::AXObjectCache::generateIsolatedAccessibilityTree):
3552         * accessibility/AXObjectCache.h:
3553         (WebCore::AXObjectCache::focusedUIElementForPage):
3554         * accessibility/AccessibilityAttachment.cpp:
3555         (WebCore::AccessibilityAttachment::accessibilityText const):
3556         (WebCore::AccessibilityAttachment::accessibilityText): Deleted.
3557         * accessibility/AccessibilityAttachment.h:
3558         * accessibility/AccessibilityImageMapLink.cpp:
3559         (WebCore::AccessibilityImageMapLink::accessibilityText const):
3560         (WebCore::AccessibilityImageMapLink::accessibilityText): Deleted.
3561         * accessibility/AccessibilityImageMapLink.h:
3562         * accessibility/AccessibilityMediaControls.cpp:
3563         (WebCore::AccessibilityMediaControl::accessibilityText const):
3564         (WebCore::AccessibilityMediaControl::accessibilityText): Deleted.
3565         * accessibility/AccessibilityMediaControls.h:
3566         * accessibility/AccessibilityNodeObject.cpp:
3567         (WebCore::AccessibilityNodeObject::accessibilityText const):
3568         (WebCore::AccessibilityNodeObject::accessibilityText): Deleted.
3569         * accessibility/AccessibilityNodeObject.h:
3570         * accessibility/AccessibilityObject.cpp:
3571         (WebCore::AccessibilityObject::convertFrameToSpace const):
3572         (WebCore::AccessibilityObject::relativeFrame const):
3573         (WebCore::AccessibilityObject::elementAccessibilityHitTest const):
3574         (WebCore::AccessibilityObject::focusedUIElement const):
3575         * accessibility/AccessibilityObject.h:
3576         (WebCore::AccessibilityObject::accessibilityText const):
3577         (WebCore::AccessibilityObject::isLink const): Deleted.
3578         (WebCore::AccessibilityObject::isImage const): Deleted.
3579         (WebCore::AccessibilityObject::isAttachment const): Deleted.
3580         (WebCore::AccessibilityObject::isFileUploadButton const): Deleted.
3581         (WebCore::AccessibilityObject::isImageMapLink const): Deleted.
3582         (WebCore::AccessibilityObject::isMediaControlLabel const): Deleted.
3583         (WebCore::AccessibilityObject::isTree const): Deleted.
3584         (WebCore::AccessibilityObject::isTreeItem const): Deleted.
3585         (WebCore::AccessibilityObject::isScrollbar const): Deleted.
3586         (WebCore::AccessibilityObject::accessibilityHitTest const): Deleted.
3587         (WebCore::AccessibilityObject::accessibilityText): Deleted.
3588         (WebCore::AccessibilityObject::roleValue const): Deleted.
3589         (WebCore::AccessibilityObject::wrapper const): Deleted.
3590         * accessibility/AccessibilityObjectInterface.h: Replaced.
3591         * accessibility/AccessibilityRenderObject.cpp:
3592         (WebCore::AccessibilityRenderObject::isTabItemSelected const):
3593         (WebCore::AccessibilityRenderObject::remoteSVGElementHitTest const):
3594         (WebCore::AccessibilityRenderObject::elementAccessibilityHitTest const):
3595         (WebCore::AccessibilityRenderObject::accessibilityHitTest const):
3596         (WebCore::AccessibilityRenderObject::selectedChildren):
3597         * accessibility/AccessibilityRenderObject.h:
3598         * accessibility/AccessibilitySVGElement.cpp:
3599         (WebCore::AccessibilitySVGElement::accessibilityText const):
3600         (WebCore::AccessibilitySVGElement::accessibilityText): Deleted.
3601         * accessibility/AccessibilitySVGElement.h:
3602         * accessibility/AccessibilityScrollView.cpp:
3603         (WebCore::AccessibilityScrollView::accessibilityHitTest const):
3604         * accessibility/AccessibilityScrollView.h:
3605         * accessibility/ios/AccessibilityObjectIOS.mm:
3606         (WebCore::AccessibilityObject::fileUploadButtonReturnsValueInTitle const):
3607         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3608         (-[WebAccessibilityObjectWrapper fileUploadButtonReturnsValueInTitle]): Deleted.
3609         * accessibility/isolatedtree: Replaced.
3610         * accessibility/isolatedtree/AXIsolatedTree.cpp: Added.
3611         (WebCore::AXIsolatedTree::treePageCache):
3612         (WebCore::AXIsolatedTree::AXIsolatedTree):
3613         (WebCore::AXIsolatedTree::nodeInTreeForID):
3614         (WebCore::AXIsolatedTree::nodeForID const):
3615         (WebCore::AXIsolatedTree::focusedUIElement):
3616         (WebCore::AXIsolatedTree::setRootNodeID):
3617         (WebCore::AXIsolatedTree::setFocusedNodeID):
3618         (WebCore::AXIsolatedTree::setInitialRequestInProgress):
3619         (WebCore::AXIsolatedTree::applyPendingChanges):
3620         * accessibility/isolatedtree/AXIsolatedTree.h: Added.
3621         * accessibility/isolatedtree/AXIsolatedTreeNode.cpp: Added.
3622         (WebCore::AXIsolatedTreeNode::AXIsolatedTreeNode):
3623         (WebCore::AXIsolatedTreeNode::~AXIsolatedTreeNode):
3624         (WebCore::AXIsolatedTreeNode::initializeAttributeData):
3625         (WebCore::AXIsolatedTreeNode::setProperty):
3626         (WebCore::AXIsolatedTreeNode::setParent):
3627         (WebCore::AXIsolatedTreeNode::setTreeIdentifier):
3628         (WebCore::AXIsolatedTreeNode::focusedUIElement const):
3629         (WebCore::AXIsolatedTreeNode::parentObjectInterfaceUnignored const):
3630         (WebCore::AXIsolatedTreeNode::accessibilityHitTest const):
3631         (WebCore::AXIsolatedTreeNode::tree const):
3632         (WebCore::AXIsolatedTreeNode::rectAttributeValue const):
3633         (WebCore::AXIsolatedTreeNode::stringAttributeValue const):
3634         * accessibility/isolatedtree/AXIsolatedTreeNode.h: Added.
3635         * accessibility/mac/AXObjectCacheMac.mm:
3636         (WebCore::AXObjectCache::associateIsolatedTreeNode):
3637         * accessibility/mac/AccessibilityObjectBase.mm: Added.
3638         (WebCore::AccessibilityObject::speechHintAttributeValue const):
3639         (WebCore::AccessibilityObject::descriptionAttributeValue const):
3640         (WebCore::AccessibilityObject::titleAttributeValue const):
3641         (WebCore::AccessibilityObject::helpTextAttributeValue const):
3642         * accessibility/mac/AccessibilityObjectMac.mm:
3643         (WebCore::AccessibilityObject::fileUploadButtonReturnsValueInTitle const):
3644         * accessibility/mac/WebAccessibilityObjectWrapperBase.h:
3645         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
3646         (addChildToArray):
3647         (convertToNSArray):
3648         (-[WebAccessibilityObjectWrapperBase isolatedTreeNode]):
3649         (-[WebAccessibilityObjectWrapperBase detach]):
3650         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
3651         (-[WebAccessibilityObjectWrapperBase accessibilityObject]):
3652         (-[WebAccessibilityObjectWrapperBase baseAccessibilityTitle]):
3653         (-[WebAccessibilityObjectWrapperBase axBackingObject]):
3654         (-[WebAccessibilityObjectWrapperBase baseAccessibilityDescription]):
3655         (-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]):
3656         (-[WebAccessibilityObjectWrapperBase baseAccessibilityHelpText]):
3657         (convertPathToScreenSpaceFunction):
3658         (-[WebAccessibilityObjectWrapperBase convertRectToSpace:space:]):
3659         (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
3660         (-[WebAccessibilityObjectWrapperBase titleTagShouldBeUsedInDescriptionField]): Deleted.
3661         (-[WebAccessibilityObjectWrapperBase fileUploadButtonReturnsValueInTitle]): Deleted.
3662         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3663         (-[WebAccessibilityObjectWrapper IGNORE_WARNINGS_END]):
3664         (-[WebAccessibilityObjectWrapper childrenVectorSize]):
3665         (-[WebAccessibilityObjectWrapper childrenVectorArray]):
3666         (-[WebAccessibilityObjectWrapper position]):
3667         (-[WebAccessibilityObjectWrapper subrole]):
3668         (-[WebAccessibilityObjectWrapper roleDescription]):
3669         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3670         (-[WebAccessibilityObjectWrapper accessibilityFocusedUIElement]):
3671         (-[WebAccessibilityObjectWrapper accessibilityHitTest:]):
3672         (-[WebAccessibilityObjectWrapper accessibilityIndexOfChild:]):
3673         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeCount:]):
3674         (-[WebAccessibilityObjectWrapper accessibilityArrayAttributeValues:index:maxCount:]):
3675
3676 2019-02-12  Wenson Hsieh  <wenson_hsieh@apple.com>
3677
3678         Allow pages to trigger programmatic paste from script on iOS
3679         https://bugs.webkit.org/show_bug.cgi?id=194271
3680         <rdar://problem/47808810>
3681
3682         Reviewed by Ryosuke Niwa.
3683
3684         Add support for allowing script to trigger programmatic paste commands. Currently on macOS and iOS, the ability
3685         to trigger programmatic paste (i.e. `document.execCommand('Paste');`) is disabled by default, such that
3686         execCommand is simply a no-op that returns false. This policy is a privacy measure (common among other major
3687         browsers) that prevents untrusted web content from sniffing content from the system pasteboard (even on user
3688         interaction, since unintended user interaction occasionally happens as well!).
3689
3690         In order to make it possible for web pages to programmatically paste without opening the door to privacy and
3691         security issues, we make paste commands triggered from bindings present platform UI on iOS, in the form of a
3692         callout bar with the single option to paste. This UI is dismissed upon any user interaction; furthermore, any
3693         user interaction short of explicitly triggering the "Paste" action subsequently prevents the page from executing
3694         the paste (and causes execCommand to return false). However, if the paste action is chosen by the user, we
3695         instead follow through with the programmatic paste command.
3696
3697         New tests to come in a followup patch.
3698
3699         * WebCore.xcodeproj/project.pbxproj:
3700         * dom/DOMPasteAccessPolicy.h: Added.
3701         * dom/UserGestureIndicator.h:
3702         (WebCore::UserGestureToken::domPasteAccessPolicy const):
3703         (WebCore::UserGestureToken::didRequestDOMPasteAccess):
3704
3705         Add helpers on UserGestureToken to update and query the current DOM paste access policy. The access policies are
3706         "NotRequestedYet" (i.e. pending a response from the user), "Granted" (the user has granted DOM paste access to
3707         the page), or "Denied" (the user has prevented the page from reading the contents of the clipboard). When DOM
3708         paste access is granted or rejected, make this decision sticky until the end of the current user gesture.
3709
3710         * editing/EditorCommand.cpp:
3711         (WebCore::executePaste):
3712         (WebCore::executePasteAndMatchStyle):
3713         (WebCore::executePasteAsPlainText):
3714         (WebCore::executePasteAsQuotation):
3715
3716         When executing a paste command where the source is DOM bindings, request DOM paste if needed before proceeding
3717         with the paste.
3718
3719         (WebCore::supportedPaste):
3720         * loader/EmptyClients.cpp:
3721         * page/EditorClient.h:
3722         * page/Frame.cpp:
3723         (WebCore::Frame::requestDOMPasteAccess):
3724
3725         Add a helper method that requests access to the clipboard on behalf of script when pasting.
3726
3727         * page/Frame.h:
3728         * page/Settings.yaml:
3729
3730         Introduce a new WebCore setting, used to gate DOM paste access requests.
3731
3732 2019-02-12  Alex Christensen  <achristensen@webkit.org>
3733
3734         Remove setDefersLoading infrastructure from WebKit2
3735         https://bugs.webkit.org/show_bug.cgi?id=194506
3736
3737         Reviewed by Brady Eidson.
3738
3739         setDefersLoading is inherently racy from WebCore to the NetworkProcess,
3740         it adds unwanted complexity to the initialization and use of network objects,
3741         and it has led to many unrecoverable hang bugs over the years.
3742         We needed to force it into WebKit2 to transition some existing clients who relied on it,
3743         but we have recently finished transitioning those clients to other solutions, mostly
3744         completion handlers.
3745
3746         * inspector/PageScriptDebugServer.cpp:
3747         (WebCore::PageScriptDebugServer::setJavaScriptPaused):
3748
3749 2019-02-12  Michael Catanzaro  <mcatanzaro@igalia.com>
3750
3751         Unreviewed, fix build warnings after content extensions enablement
3752         https://bugs.webkit.org/show_bug.cgi?id=193622
3753         <rdar://problem/47982850>
3754
3755         * contentextensions/DFABytecode.h:
3756         (WebCore::ContentExtensions::instructionSizeWithArguments):
3757         * contentextensions/DFABytecodeCompiler.h:
3758         * contentextensions/URLFilterParser.cpp:
3759         (WebCore::ContentExtensions::URLFilterParser::statusString):
3760
3761 2019-02-12  Justin Fan  <justin_fan@apple.com>
3762
3763         [Web GPU] DepthStencilAttachment implementation
3764         https://bugs.webkit.org/show_bug.cgi?id=194458
3765         <rdar://problem/47932446>
3766
3767         Reviewed by Dean Jackson.
3768
3769         Implement ability to provide a depth attachment to the render pass encoder. Also implement
3770         GPULoad/StoreOp and update color attachments' implementation for full functionality.
3771
3772         Test: webgpu/depth-enabled-triangle-strip.html
3773
3774         Update project files for new symbols:
3775         * CMakeLists.txt:
3776         * DerivedSources-input.xcfilelist:
3777         * DerivedSources-output.xcfilelist:
3778         * DerivedSources.make:
3779         * Sources.txt:
3780         * WebCore.xcodeproj/project.pbxproj:
3781
3782         * Modules/webgpu/GPUColor.idl: Renamed from WebGPUColor.idl
3783         * Modules/webgpu/GPULoadOp.idl: Added. Interface for attachment operation enum.
3784         * Modules/webgpu/GPUStoreOp.idl: Ditto.
3785         * Modules/webpug/WebGPUColor.h: Removed.
3786         * Modules/webgpu/WebGPUCommandBuffer.cpp: Refactored descriptor validation logic out of this file.
3787         (WebCore::WebGPUCommandBuffer::beginRenderPass):
3788         * Modules/webgpu/WebGPURenderPassDescriptor.cpp: Added. Now owns code for validating descriptors.
3789         (WebCore::WebGPURenderPassDescriptor::validateAndConvertToGPUVersion const):
3790         * Modules/webgpu/WebGPURenderPassColorAttachmentDescriptor.h/idl: Removed. Code moved into WebGPURenderPassDescriptor.
3791         * Modules/webgpu/WebGPURenderPassDescriptor.h: Move sub-descriptor definitions into this file.
3792         * Modules/webgpu/WebGPURenderPassDescriptor.idl: Ditto.
3793         * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Make depthStencilState optional to match API update.
3794         * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: Ditto.
3795         * Modules/webgpu/WebGPUTextureView.h:
3796         * platform/graphics/gpu/GPULoadOp.h: Added.
3797         * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Removed (moved into GPURenderPassDescriptor).
3798         * platform/graphics/gpu/GPURenderPassDescriptor.h: Mirror WebGPU* changes.
3799         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Make depthStencilState optional.
3800         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor):
3801         * platform/graphics/gpu/GPUStoreOp.h: Added.
3802         * platform/graphics/gpu/GPUTexture.h:
3803         * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
3804         (WebCore::loadActionForGPULoadOp): Added.
3805         (WebCore::storeActionForGPUStoreOp): Added.
3806         (WebCore::populateMtlColorAttachmentsArray): Added. Create all expected color attachments, rather than just the first.
3807         (WebCore::populateMtlDepthStencilAttachment): Added.
3808         (WebCore::GPURenderPassEncoder::create):
3809         * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Make depthStencilState optional.
3810         (WebCore::GPURenderPipeline::create):
3811
3812 2019-02-12  David Kilzer  <ddkilzer@apple.com>
3813
3814         REGRESSION (r238955, r240494): Soft-linking optional Lookup.framework triggers release assertion when missing
3815         <https://webkit.org/b/194529>
3816         <rdar://problem/47924449>
3817
3818         Reviewed by Eric Carlson.
3819
3820         * SourcesCocoa.txt:
3821         - Do not include DataDetectorsCoreSoftLink.mm in unified
3822           sources.
3823         * WebCore.xcodeproj/project.pbxproj:
3824         - Add DataDetectorsCoreSoftLink.mm to the WebCore target now
3825           that it isn't part of the unifed sources.
3826         * platform/cocoa/DataDetectorsCoreSoftLink.mm:
3827         - Switch from using SOFT_LINK_PRIVATE_FRAMEWORK_OPTIONAL() to
3828           SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE() when linking
3829           DataDetectorsCore.framework. None of the other macros assume
3830           this framework is optional, and it was likely made optional
3831           originally because the framework was new to iOS and thus
3832           didn't exist on older versions.
3833         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3834         - Change use of SOFT_LINK_CLASS_FOR_SOURCE() macros to
3835           SOFT_LINK_CLASS() since the latter can only be used with
3836           SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation).  This broke after
3837           the fix for <wtf/SoftLinking.h> was applied.
3838
3839 2019-02-12  Youenn Fablet  <youenn@apple.com>
3840
3841         Make use of is<SubresourceLoader>
3842         https://bugs.webkit.org/show_bug.cgi?id=194541
3843
3844         Reviewed by Alex Christensen.
3845
3846         No change of behavior.
3847
3848         * inspector/agents/InspectorNetworkAgent.cpp:
3849         (WebCore::InspectorNetworkAgent::didReceiveResponse):
3850         * loader/SubresourceLoader.h:
3851         (isType):
3852
3853 2019-02-12  Mark Lam  <mark.lam@apple.com>
3854
3855         Add some null checks in JSNodeCustom.h's root() and generated isReachableFromOpaqueRoots() functions.
3856         https://bugs.webkit.org/show_bug.cgi?id=194530
3857         <rdar://problem/47973274>
3858
3859         Reviewed by Chris Dumez.
3860
3861         This is needed to fix a null pointer dereference that arises from the following scenario:
3862         1. a Document detaches from its StyleSheetList.
3863         2. the JSStyleSheetList that is associated with the detached StyleSheetList has yet
3864            to be scanned and collected by the GC.
3865         3. the GC eventually looks for the opaque root of the StyleSheetList's owner, and
3866            discovers a null owner pointer.
3867
3868         This patch fixes this issue by applying the following null checks:
3869
3870         1. Add a null check in JSNodeCustom.h's root().
3871
3872            root() is called from a isReachableFromOpaqueRoots() generated by CodeGeneratorJS.pm.
3873            isReachableFromOpaqueRoots() calls a ownerNode() method and passes its result
3874            to root().  However, depending on which class the ownerNode() method belongs to,
3875            it can either return a pointer or a reference.  The null check only makes sense
3876            in the pointer case.
3877
3878            To accommodate the 2 forms, root() itself is has an overload that takes a
3879            reference instead of a pointer.
3880
3881            Since CodeGeneratorJS.pm can't tell what the generated class' ownerNode()
3882            returns, it can't discern when the result is a pointer and apply the null check.
3883            Instead, we just add the null check to the version of root() that takes a
3884            pointer.  If the node pointer is null, we'll return a null opaque root.
3885
3886         2. Fix CodeGeneratorJS.pm to null check the opaque root before using it.
3887
3888         * bindings/js/JSNodeCustom.h:
3889         (WebCore::root):
3890         * bindings/scripts/CodeGeneratorJS.pm:
3891         (GenerateImplementation):
3892         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3893         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
3894
3895 2019-02-12  Andy Estes  <aestes@apple.com>
3896
3897         [iOSMac] Enable Parental Controls Content Filtering
3898         https://bugs.webkit.org/show_bug.cgi?id=194521
3899         <rdar://39732376>
3900
3901         Reviewed by Tim Horton.
3902
3903         * Configurations/FeatureDefines.xcconfig:
3904         * platform/ContentFilterUnblockHandler.h:
3905         * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
3906         * platform/cocoa/ParentalControlsContentFilter.mm:
3907
3908 2019-02-11  Jer Noble  <jer.noble@apple.com>
3909
3910         Unreviewed build fix; add a HAVE_CELESTIAL guard around Celestial framework usage.
3911
3912         * platform/audio/ios/MediaSessionManagerIOS.h:
3913         * platform/audio/ios/MediaSessionManagerIOS.mm:
3914         (WebCore::MediaSessionManageriOS::providePresentingApplicationPIDIfNecessary):
3915
3916 2019-02-12  Antti Koivisto  <antti@apple.com>
3917
3918         Crash in WebCore::ScrollingTree::updateTreeFromStateNode
3919         https://bugs.webkit.org/show_bug.cgi?id=194538
3920         <rdar://problem/47841926>
3921
3922         Reviewed by Zalan Bujtas.
3923
3924         * page/scrolling/ScrollingTree.cpp:
3925         (WebCore::ScrollingTree::updateTreeFromStateNode):
3926
3927         Make sure we don't leave node entry behind in m_nodeMap in case we failed to add it to the parent.
3928
3929 2019-02-12  Zalan Bujtas  <zalan@apple.com>
3930
3931         [LFC] Remove redundant InlineFormattingContext::computeBorderAndPadding
3932         https://bugs.webkit.org/show_bug.cgi?id=194540
3933
3934         Reviewed by Antti Koivisto.
3935
3936         Use FormattingContext::computeBorderAndPadding instead.
3937
3938         * layout/FormattingContext.cpp:
3939         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
3940         * layout/FormattingContext.h:
3941         * layout/inlineformatting/InlineFormattingContext.cpp:
3942         (WebCore::Layout::InlineFormattingContext::computeBorderAndPadding const): Deleted.
3943         * layout/inlineformatting/InlineFormattingContext.h:
3944
3945 2019-02-12  Zalan Bujtas  <zalan@apple.com>
3946
3947         [LFC][IFC] Add intrinsic width support for float boxes.
3948         https://bugs.webkit.org/show_bug.cgi?id=194528
3949
3950         Reviewed by Antti Koivisto.
3951
3952         This patch implements a very simple float box support for intrinsic width.
3953