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