ae3f886446d9fc461f94097811e0aaa4ac0e0b04
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-05-08  Daniel Bates  <dabates@apple.com>
2
3         Resign Strong Password appearance when text field value changes
4         https://bugs.webkit.org/show_bug.cgi?id=185433
5         <rdar://problem/39958508>
6
7         Reviewed by Ryosuke Niwa.
8
9         Remove the Strong Password decoration when the text field's value changes to avoid interfering
10         with web sites that allow a person to clear the password field.
11
12         Tests: fast/forms/auto-fill-button/auto-fill-strong-password-button-when-maxlength-changes.html
13                fast/forms/auto-fill-button/auto-fill-strong-password-button-when-minlength-changes.html
14                fast/forms/auto-fill-button/hide-auto-fill-strong-password-button-when-value-changes.html
15
16         * html/HTMLInputElement.cpp:
17         (WebCore::HTMLInputElement::resignStrongPasswordAppearance): Extracted from HTMLInputElement::updateType().
18         (WebCore::HTMLInputElement::updateType): Extract out logic to resign the Strong Password appearance
19         into a function that can be shared by this function and HTMLInputElement::setValue().
20         (WebCore::HTMLInputElement::setValue): Resign the Strong Password appearance if this field was
21         changed programmatically (i.e. no DOM change event was dispatched).
22         * html/HTMLInputElement.h:
23
24 2018-05-08  Jer Noble  <jer.noble@apple.com>
25
26         Unreviewed build fix; add missing function definition.
27
28         * html/HTMLMediaElement.h:
29         (WebCore::HTMLMediaElement::didPassCORSAccessCheck const):
30
31 2018-05-08  Jer Noble  <jer.noble@apple.com>
32
33         Mute MediaElementSourceNode when tainted.
34         https://bugs.webkit.org/show_bug.cgi?id=184866
35
36         Reviewed by Eric Carlson.
37
38         Test: http/tests/security/webaudio-render-remote-audio-blocked-no-crossorigin.html
39
40         * Modules/webaudio/AudioContext.cpp:
41         (WebCore::AudioContext::wouldTaintOrigin const):
42         * Modules/webaudio/AudioContext.h:
43         * Modules/webaudio/MediaElementAudioSourceNode.cpp:
44         (WebCore::MediaElementAudioSourceNode::setFormat):
45         (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
46         (WebCore::MediaElementAudioSourceNode::process):
47         * Modules/webaudio/MediaElementAudioSourceNode.h:
48
49 2018-05-08  Eric Carlson  <eric.carlson@apple.com>
50
51         Log rtcstats as JSON
52         https://bugs.webkit.org/show_bug.cgi?id=185437
53         <rdar://problem/40065332>
54
55         Reviewed by Youenn Fablet.
56
57         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
58         (WebCore::RTCStatsLogger::RTCStatsLogger): Create a wrapper class so we don't have to add a
59         toJSONString method to libwebrtc.
60         (WebCore::RTCStatsLogger::toJSONString const): Log stats as JSON.
61         (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered): Don't use the LOGIDENTIFIER macro because
62         it doesn't work well inside of a lambda.
63         (WTF::LogArgument<WebCore::RTCStatsLogger>::toString): Move into .cpp file because it is only
64         used here.
65         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
66         (WTF::LogArgument<webrtc::RTCStats>::toString): Deleted. Move to .cpp file.
67
68 2018-05-08  Dean Jackson  <dino@apple.com>
69
70         System Preview links should trigger a download
71         https://bugs.webkit.org/show_bug.cgi?id=185439
72         <rdar://problem/40065545>
73
74         Reviewed by Jon Lee.
75
76         Add a new field to FrameLoadRequest, which then is copied
77         into ResourceRequest, identifying if the link clicked
78         is a system preview.
79
80         * html/HTMLAnchorElement.cpp:
81         (WebCore::HTMLAnchorElement::handleClick): Look for isSystemPreviewLink().
82         * loader/FrameLoadRequest.cpp:
83         (WebCore::FrameLoadRequest::FrameLoadRequest):
84         * loader/FrameLoadRequest.h: New property.
85         (WebCore::FrameLoadRequest::FrameLoadRequest):
86         (WebCore::FrameLoadRequest::isSystemPreview const):
87         * loader/FrameLoader.cpp:
88         (WebCore::FrameLoader::urlSelected):
89         (WebCore::FrameLoader::loadURL):
90         * loader/FrameLoader.h:
91         * platform/network/ResourceRequestBase.cpp:
92         (WebCore::ResourceRequestBase::isSystemPreview const):
93         (WebCore::ResourceRequestBase::setSystemPreview):
94         * platform/network/ResourceRequestBase.h:
95
96 2018-05-08  Commit Queue  <commit-queue@webkit.org>
97
98         Unreviewed, rolling out r231491.
99         https://bugs.webkit.org/show_bug.cgi?id=185434
100
101         Setting the Created key on a cookie does not work yet, due a
102         bug in CFNetwork (Requested by ggaren on #webkit).
103
104         Reverted changeset:
105
106         "[WKHTTPCookieStore getAllCookies] returns inconsistent
107         creation time"
108         https://bugs.webkit.org/show_bug.cgi?id=185041
109         https://trac.webkit.org/changeset/231491
110
111 2018-05-08  Sihui Liu  <sihui_liu@apple.com>
112
113         [WKHTTPCookieStore getAllCookies] returns inconsistent creation time
114         https://bugs.webkit.org/show_bug.cgi?id=185041
115         <rdar://problem/34684214>
116
117         Reviewed by Geoffrey Garen.
118
119         Set creationtime property when creating Cookie object to keep consistency after conversion.
120
121         New API test: WebKit.WKHTTPCookieStoreCreationTime.
122
123         * platform/network/cocoa/CookieCocoa.mm:
124         (WebCore::Cookie::operator NSHTTPCookie * const):
125
126 2018-05-08  Eric Carlson  <eric.carlson@apple.com>
127
128         Text track cue logging should include cue text
129         https://bugs.webkit.org/show_bug.cgi?id=185353
130         <rdar://problem/40003565>
131
132         Reviewed by Brent Fulgham.
133
134         No new tests, tested manually.
135
136         * html/track/VTTCue.cpp:
137         (WebCore::VTTCue::toJSON const):
138         * platform/graphics/InbandTextTrackPrivateClient.h:
139         (WebCore::GenericCueData::toJSONString const):
140         * platform/graphics/iso/ISOVTTCue.cpp:
141         (WebCore::ISOWebVTTCue::toJSONString const):
142
143 2018-05-08  Sam Weinig  <sam@webkit.org>
144
145         More cleanup of XMLHttpRequestUpload
146         https://bugs.webkit.org/show_bug.cgi?id=185409
147
148         Reviewed by Alex Christensen.
149
150         - Remove unneeded #includes
151         - Rename m_xmlHttpRequest to m_request
152         - Make some overloaded some methods private, and mark them as final rather
153           than override.
154
155         * xml/XMLHttpRequestUpload.cpp:
156         (WebCore::XMLHttpRequestUpload::XMLHttpRequestUpload):
157         * xml/XMLHttpRequestUpload.h:
158
159 2018-05-08  Zalan Bujtas  <zalan@apple.com>
160
161         [LFC] Start using BlockMarginCollapse
162         https://bugs.webkit.org/show_bug.cgi?id=185424
163
164         Reviewed by Antti Koivisto.
165
166         BlockMarginCollapse could be all static.
167
168         * layout/blockformatting/BlockFormattingContext.cpp:
169         (WebCore::Layout::BlockFormattingContext::marginTop const):
170         (WebCore::Layout::BlockFormattingContext::marginBottom const):
171         * layout/blockformatting/BlockMarginCollapse.cpp:
172         (WebCore::Layout::isMarginTopCollapsedWithSibling):
173         (WebCore::Layout::isMarginBottomCollapsedWithSibling):
174         (WebCore::Layout::isMarginTopCollapsedWithParent):
175         (WebCore::Layout::isMarginBottomCollapsedWithParent):
176         (WebCore::Layout::collapsedMarginTopFromFirstChild):
177         (WebCore::Layout::collapsedMarginBottomFromLastChild):
178         (WebCore::Layout::nonCollapsedMarginTop):
179         (WebCore::Layout::nonCollapsedMarginBottom):
180         (WebCore::Layout::BlockMarginCollapse::marginTop):
181         (WebCore::Layout::BlockMarginCollapse::marginBottom):
182         (WebCore::Layout::BlockMarginCollapse::BlockMarginCollapse): Deleted.
183         (WebCore::Layout::BlockMarginCollapse::marginTop const): Deleted.
184         (WebCore::Layout::BlockMarginCollapse::marginBottom const): Deleted.
185         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithSibling const): Deleted.
186         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithSibling const): Deleted.
187         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParent const): Deleted.
188         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent const): Deleted.
189         (WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginTop const): Deleted.
190         (WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginBottom const): Deleted.
191         (WebCore::Layout::BlockMarginCollapse::collapsedMarginTopFromFirstChild const): Deleted.
192         (WebCore::Layout::BlockMarginCollapse::collapsedMarginBottomFromLastChild const): Deleted.
193         (WebCore::Layout::BlockMarginCollapse::hasAdjoiningMarginTopAndBottom const): Deleted.
194         * layout/blockformatting/BlockMarginCollapse.h:
195
196 2018-05-08  Youenn Fablet  <youenn@apple.com>
197
198         Allow WebResourceLoader to cancel a load served from a service worker
199         https://bugs.webkit.org/show_bug.cgi?id=185274
200
201         Reviewed by Chris Dumez.
202
203         Add support for cancelling a fetch from WebProcess to service worker process.
204         Use FetchIdentifier instead of uint64_t.
205
206         * Modules/fetch/FetchIdentifier.h: Added.
207         * WebCore.xcodeproj/project.pbxproj:
208         * workers/service/context/ServiceWorkerFetch.h:
209         * workers/service/context/ServiceWorkerThreadProxy.cpp:
210         (WebCore::ServiceWorkerThreadProxy::startFetch):
211         (WebCore::ServiceWorkerThreadProxy::cancelFetch):
212         * workers/service/context/ServiceWorkerThreadProxy.h:
213
214 2018-05-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
215
216         feTurbulence is not rendered correctly on Retina display
217         https://bugs.webkit.org/show_bug.cgi?id=183798
218
219         Reviewed by Simon Fraser.
220
221         On 2x display the feTurbulence filter creates a scaled ImageBuffer but
222         processes only the unscaled size. This is a remaining work of r168577 and
223         is very similar to what was done for the feMorphology filter in r188271.
224
225         Test: fast/hidpi/filters-turbulence.html
226
227         * platform/graphics/filters/FETurbulence.cpp:
228         (WebCore::FETurbulence::fillRegion const):
229         (WebCore::FETurbulence::platformApplySoftware):
230
231 2018-05-07  Zalan Bujtas  <zalan@apple.com>
232
233         [LFC] Add FormattingContext::layoutOutOfFlowDescendants implementation
234         https://bugs.webkit.org/show_bug.cgi?id=185377
235
236         Reviewed by Antti Koivisto.
237
238         Also, remove FormattingContext's m_layoutContext member and pass it in to ::layout() instead.
239         In theory LayoutContext is needed only during ::layout() call. 
240
241         * layout/FormattingContext.cpp:
242         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
243         * layout/FormattingContext.h:
244         (WebCore::Layout::FormattingContext::layoutContext const):
245         * layout/LayoutContext.cpp:
246         (WebCore::Layout::LayoutContext::updateLayout):
247         * layout/blockformatting/BlockFormattingContext.cpp:
248         (WebCore::Layout::BlockFormattingContext::layout const):
249         * layout/blockformatting/BlockFormattingContext.h:
250         * layout/inlineformatting/InlineFormattingContext.cpp:
251         (WebCore::Layout::InlineFormattingContext::layout const):
252         * layout/inlineformatting/InlineFormattingContext.h:
253
254 2018-05-07  Daniel Bates  <dabates@apple.com>
255
256         Check X-Frame-Options and CSP frame-ancestors in network process
257         https://bugs.webkit.org/show_bug.cgi?id=185410
258         <rdar://problem/37733934>
259
260         Reviewed by Ryosuke Niwa.
261
262         * WebCore.xcodeproj/project.pbxproj: Make PingLoader.h a private header so that we can include it in WebKit.
263         * loader/DocumentLoader.cpp:
264         (WebCore::DocumentLoader::responseReceived): Only check CSP frame-ancestors and X-Frame-Options here if
265         we are not checking them in the NetworkProcess and HTTP response access is restricted. I code is otherwise kept
266         unchanged. There may be opportunities to clean this code up more and share more of it. We should look into this
267         in subsequent bugs.
268         * loader/DocumentLoader.h: Change visibility of stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied() from
269         private to public and export it so that we can call it from the WebKit.
270         * loader/PingLoader.h:
271         * page/Settings.yaml: Add a new setting called networkProcessCSPFrameAncestorsCheckingEnabled (defaults: false)
272         and is hardcoded in WebPage.cpp to be enabled. This setting is used to determine if we will be using the NetworkProcess.
273         Ideally we wouldn't have this setting and just key off RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess().
274         However RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess() is always enabled in WebKit Legacy
275         at the time of writing (why?). And, strangely, RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess()
276         is conditionally enabled in WebKit. For now, we add a new setting, networkProcessCSPFrameAncestorsCheckingEnabled,
277         to determine if CSP checking should be performed in NetworkProcess. For checking to actually happen in NetworkProcess
278         and not in DocumentLoader::responseReceived() RuntimeEnabledFeatures::sharedFeatures().restrictedHTTPResponseAccess()
279         will also need to be enabled.
280         * page/csp/ContentSecurityPolicy.cpp:
281         (WebCore::ContentSecurityPolicy::allowFrameAncestors const): Added a variant that takes a vector of ancestor origins.
282         * page/csp/ContentSecurityPolicy.h:
283         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
284         (WebCore::checkFrameAncestors): Ditto.
285         (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFrameAncestorOrigins const): Ditto.
286         * page/csp/ContentSecurityPolicyDirectiveList.h: Export constructor so that we can invoke it from NetworkResourceLoader::shouldInterruptLoadForCSPFrameAncestorsOrXFrameOptions().
287         * page/csp/ContentSecurityPolicyResponseHeaders.h:
288         * platform/network/HTTPParsers.h: Export XFrameOptionsDisposition() so that we can use in WebKit.
289
290 2018-05-07  Daniel Bates  <dabates@apple.com>
291
292         Abstract logic to log console messages and send CSP violation reports into a client
293         https://bugs.webkit.org/show_bug.cgi?id=185393
294         <rdar://problem/40036053>
295
296         Reviewed by Brent Fulgham.
297
298         First pass at adding infrastructure to supporting CSP reporting from NetworkProcess and workers.
299         Replaces the existing ContentSecurityPolicy constructor that takes a Frame with one that
300         takes a ContentSecurityPolicyClient to delegate to for logging and sending reports. We will look
301         to remove ContentSecurityPolicy constructor that takes a ScriptExecutionContext in a follow up.
302
303         Standardize on instantiating a ContentSecurityPolicy with the full URL to resource that it protects
304         instead of taking only the SecurityOrigin of this URL. By taking the full URL the ContentSecurityPolicy
305         object is now capable of resolving a relative report URL without needing a Document/ScriptExecutionContext.
306
307         We are underutilizing the CSPInfo struct and ContentSecurityPolicyClient::willSendCSPViolationReport()
308         delegate callback in this patch. We will make use of this functionality in a subsequent patch to
309         support collecting script state (e.g. source line number) when reporting CSP violations in worker
310         threads. We also no longer go through the unnecessary motions to try to collect script state for a
311         frame-ancestors violation (since DocumentLoader extends ContentSecurityPolicyClient and does not
312         implement ContentSecurityPolicyClient::willSendCSPViolationReport()). The frame-ancestors directive
313         is checked before a document is parsed and executes script; => there will never be any script state
314         to collect; => it is not necessary to try to collect it as we currently do.
315
316         * Sources.txt: Add file ContentSecurityPolicyClient.cpp. See the remarks for ContentSecurityPolicyClient.cpp
317         below on why we have this file.
318         * WebCore.xcodeproj/project.pbxproj: Add files ContentSecurityPolicyClient.{h, cpp}.
319         * dom/Document.cpp:
320         (WebCore::Document::initSecurityContext): Pass the URL of the protected document.
321         * loader/DocumentLoader.cpp:
322         (WebCore::DocumentLoader::responseReceived): Ditto.
323         (WebCore::DocumentLoader::addConsoleMessage): Added.
324         (WebCore::DocumentLoader::sendCSPViolationReport): Added.
325         (WebCore::DocumentLoader::dispatchSecurityPolicyViolationEvent): Added.
326         * loader/DocumentLoader.h:
327         * loader/FrameLoaderClient.h: Fix typo in comment.
328         * loader/WorkerThreadableLoader.cpp:
329         (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge): Pass the URL of the worker script.
330         * page/csp/ContentSecurityPolicy.cpp:
331         (WebCore::ContentSecurityPolicy::ContentSecurityPolicy): Added overload that takes a URL&& and an optional
332         ContentSecurityPolicyClient*.
333         (WebCore::ContentSecurityPolicy::deprecatedURLForReporting const): Extracted and simplified stripURLForUseInReport()
334         into this member function.
335         (WebCore::ContentSecurityPolicy::reportViolation const): Modified to make use of the client, if we have
336         one and removed code for handling a ContentSecurityPolicy that was instantiated with a Frame.
337         (WebCore::ContentSecurityPolicy::logToConsole const): Ditto.
338         (WebCore::stripURLForUseInReport): Deleted; incorporated into ContentSecurityPolicy::deprecatedURLForReporting().
339         * page/csp/ContentSecurityPolicy.h:
340         * page/csp/ContentSecurityPolicyClient.cpp: Added. This file exists so that we can define the virtual
341         destructor out-of-line and export this abstract class so as to avoid the need for the vtable to be
342         defined in the translation unit of each derived class.
343         * page/csp/ContentSecurityPolicyClient.h: Added.
344         * page/csp/ContentSecurityPolicySource.cpp:
345         (WebCore::ContentSecurityPolicySource::operator SecurityOriginData const): Added.
346         * page/csp/ContentSecurityPolicySource.h:
347         * workers/WorkerGlobalScope.cpp:
348         (WebCore::WorkerGlobalScope::WorkerGlobalScope): Instantiate the ContentSecurityPolicy object with the
349         URL of the worker script.
350
351 2018-05-07  Simon Fraser  <simon.fraser@apple.com>
352
353         CSS filters which reference SVG filters fail to respect the "color-interpolation-filters" of the filter
354         https://bugs.webkit.org/show_bug.cgi?id=185343
355
356         Reviewed by Dean Jackson.
357
358         Test: css3/filters/color-interpolation-filters.html
359         
360         When applying CSS reference filters, apply the value of "color-interpolation-filters" for the
361         referenced filter effect element, just as we do for SVG filters.
362
363         * rendering/FilterEffectRenderer.cpp:
364         (WebCore::FilterEffectRenderer::buildReferenceFilter):
365
366 2018-05-07  Daniel Bates  <dabates@apple.com>
367
368         CSP status-code incorrect for document blocked due to violation of its frame-ancestors directive
369         https://bugs.webkit.org/show_bug.cgi?id=185366
370         <rdar://problem/40035116>
371
372         Reviewed by Brent Fulgham.
373
374         Fixes an issue where the status-code in the sent CSP report for an HTTP document blocked because
375         its frame-ancestors directive was violated would be the status code of the previously loaded
376         document in the frame. If the previously loaded document was about:blank then this would be 0.
377
378         Currently whenever we send a CSP report we ask the document's loader (Document::loader()) for the
379         HTTP status code for the last response. Document::loader() returns the loader for the last committed
380         document its frame. For a frame-ancestors violation, a CSP report is sent before the document
381         that had the frame-ancestors directive has been committed and after it has been associate with a frame.
382         As a result we are in are in a transient transition state for the frame and hence the last response
383         for new document's loader (Document::loader()) is actually the last response of the previously loaded
384         document in the frame. Instead we need to take care to tell CSP about the HTTP status code for the
385         response associated with the document the CSP came from.
386
387         * dom/Document.cpp:
388         (WebCore::Document::processHttpEquiv):
389         (WebCore::Document::initSecurityContext):
390         Pass the HTTP status code to CSP.
391
392         * page/csp/ContentSecurityPolicy.cpp:
393         (WebCore::ContentSecurityPolicy::copyStateFrom):
394         (WebCore::ContentSecurityPolicy::responseHeaders const):
395         (WebCore::ContentSecurityPolicy::didReceiveHeaders):
396         (WebCore::ContentSecurityPolicy::didReceiveHeader):
397         (WebCore::ContentSecurityPolicy::reportViolation const):
398         * page/csp/ContentSecurityPolicy.h:
399         Modify existing functions to take the HTTP status code, store it in a instance variable,
400         and reference this variable when reporting a violation.
401
402         * page/csp/ContentSecurityPolicyResponseHeaders.cpp:
403         (WebCore::ContentSecurityPolicyResponseHeaders::ContentSecurityPolicyResponseHeaders):
404         (WebCore::ContentSecurityPolicyResponseHeaders::isolatedCopy const):
405         * page/csp/ContentSecurityPolicyResponseHeaders.h:
406         (WebCore::ContentSecurityPolicyResponseHeaders::encode const):
407         (WebCore::ContentSecurityPolicyResponseHeaders::decode):
408         Store the HTTP status code along with the response headers.
409
410 2018-05-07  Daniel Bates  <dabates@apple.com>
411
412         CSP referrer incorrect for document blocked due to violation of its frame-ancestors directive
413         https://bugs.webkit.org/show_bug.cgi?id=185380
414
415         Reviewed by Brent Fulgham.
416
417         Similar to <https://bugs.webkit.org/show_bug.cgi?id=185366>, fixes an issue where the referrer
418         in the sent CSP report for an HTTP document blocked because its frame-ancestors directive was
419         violated would be the referrer of the previously loaded document in the frame.
420
421         Currently whenever we send a CSP report we ask the document's loader (Document::loader()) for
422         the referrer for the last request. Document::loader() returns the loader for the last committed
423         document in its frame. For a frame-ancestors violation, a CSP report is sent before the document
424         that had the frame-ancestors directive has been committed and after it has been associate with a
425         frame. As a result we are in a transient transition state for the frame and hence the last request
426         for the new document's loader (Document::loader()) is actually the last request of the previously
427         loaded document in the frame. Instead we need to take care to tell CSP about the referrer for the
428         request associated with the document the CSP came from.
429
430         * loader/DocumentLoader.cpp:
431         (WebCore::DocumentLoader::responseReceived):
432
433 2018-05-07  Brent Fulgham  <bfulgham@apple.com>
434
435         Add experimental feature to prompt for Storage Access API use
436         https://bugs.webkit.org/show_bug.cgi?id=185335
437         <rdar://problem/39994649>
438
439         Reviewed by Alex Christensen and Youenn Fablet.
440
441         Create a new experimental feature that gates the ability of WebKit clients to prompt the user when
442         Storage Access API is invoked.
443
444         Currently this feature doesn't have any user-visible impact.
445
446         * page/RuntimeEnabledFeatures.h:
447         (WebCore::RuntimeEnabledFeatures::setStorageAccessPromptsEnabled):
448         (WebCore::RuntimeEnabledFeatures::storageAccessPromptsEnabled const):
449         * testing/InternalSettings.cpp:
450         (WebCore::InternalSettings::Backup::Backup):
451         (WebCore::InternalSettings::Backup::restoreTo):
452         (WebCore::InternalSettings::setStorageAccessPromptsEnabled):
453         * testing/InternalSettings.h:
454         * testing/InternalSettings.idl:
455
456 2018-05-07  Chris Dumez  <cdumez@apple.com>
457
458         Stop using an iframe's id as fallback if its name attribute is not set
459         https://bugs.webkit.org/show_bug.cgi?id=11388
460
461         Reviewed by Geoff Garen.
462
463         WebKit had logic to use an iframe's id as fallback name when its name
464         content attribute is not set. This behavior was not standard and did not
465         match other browsers:
466         - https://html.spec.whatwg.org/#attr-iframe-name
467
468         Gecko / Trident never behaved this way. Blink was aligned with us until
469         they started to match the specification in:
470         - https://bugs.chromium.org/p/chromium/issues/detail?id=347169
471
472         This WebKit quirk was causing some Web-compatibility issues because it
473         would affect the behavior of Window's name property getter when trying
474         to look up an iframe by id. Because of Window's named property getter
475         behavior [1], we would return the frame's contentWindow instead of the
476         iframe element itself.
477
478         [1] https://html.spec.whatwg.org/multipage/window-object.html#named-access-on-the-window-object
479
480         Test: fast/dom/Window/named-getter-frame-id.html
481
482         * html/HTMLFrameElementBase.cpp:
483         (WebCore::HTMLFrameElementBase::openURL):
484         (WebCore::HTMLFrameElementBase::parseAttribute):
485         (WebCore::HTMLFrameElementBase::didFinishInsertingNode):
486         * html/HTMLFrameElementBase.h:
487
488 2018-05-07  Chris Dumez  <cdumez@apple.com>
489
490         ASSERT(!childItemWithTarget(child->target())) is hit in HistoryItem::addChildItem()
491         https://bugs.webkit.org/show_bug.cgi?id=185322
492
493         Reviewed by Geoff Garen.
494
495         We generate unique names for Frame to be used in HistoryItem. Those names not only
496         need to be unique, they also need to be repeatable to avoid layout tests flakiness
497         and for things like restoring form state from a HistoryItem.
498
499         The previously generated frame names were relying on the Frame's index among a
500         parent Frame's children. The issue was that we could end up with duplicate names
501         because one could insert a Frame *before* an existing one. This is because the code
502         would not take care of updating existing Frames' unique name on frame tree mutation.
503
504         Updating frame tree names on mutation would be inefficient and is also not necessary.
505         The approach chosen in this patch is to stop using the Frame's index and instead rely
506         on an increasing counter stored on the top-frame's FrameTree. To make the names
507         repeatable, we reset the counter on page navigation.
508
509         * page/Frame.cpp:
510         (WebCore::Frame::setDocument):
511         * page/FrameTree.cpp:
512         (WebCore::FrameTree::uniqueChildName const):
513         (WebCore::FrameTree::generateUniqueName const):
514         * page/FrameTree.h:
515         (WebCore::FrameTree::resetFrameIdentifiers):
516
517 2018-05-07  Yacine Bandou  <yacine.bandou_ext@softathome.com>
518
519         [EME][GStreamer] Fix wrong subsample parsing on r227067
520         https://bugs.webkit.org/show_bug.cgi?id=185382
521
522         Reviewed by Philippe Normand.
523
524         The initialization of sampleIndex should be moved outside of the loop.
525         Without this patch we will have a bad log and the check of the subsample
526         count will be useless.
527
528         * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
529         (webKitMediaClearKeyDecryptorDecrypt):
530
531 2018-05-07  Daniel Bates  <dabates@apple.com>
532
533         CSP should be passed the referrer
534         https://bugs.webkit.org/show_bug.cgi?id=185367
535
536         Reviewed by Per Arne Vollan.
537
538         As a step towards formalizing a CSP delegate object and removing the dependencies
539         on ScriptExecutionContext and Frame, we should pass the document's referrer directly
540         instead of indirectly obtaining it from the ScriptExecutionContext or Frame used
541         to instantiate the ContentSecurityPolicy object.
542
543         * dom/Document.cpp:
544         (WebCore::Document::processHttpEquiv): Pass the document's referrer.
545         (WebCore::Document::initSecurityContext): Ditto.
546         (WebCore::Document::applyQuickLookSandbox): Ditto.
547         * loader/DocumentLoader.cpp:
548         (WebCore::DocumentLoader::responseReceived): Ditto.
549         * loader/FrameLoader.cpp:
550         (WebCore::FrameLoader::didBeginDocument): Ditto.
551         * page/csp/ContentSecurityPolicy.cpp:
552         (WebCore::ContentSecurityPolicy::copyStateFrom): We pass a null string for the referrer
553         to didReceiveHeader() as a placeholder since it requires the referrer be given to it. We
554         fix up the referrer (m_referrer) after copying all the policy headers.
555         (WebCore::ContentSecurityPolicy::didReceiveHeaders): Ditto.
556         (WebCore::ContentSecurityPolicy::didReceiveHeader): Modified to take a referrer and WTFMove()s
557         it into an instance variable (m_referrer).
558         (WebCore::ContentSecurityPolicy::reportViolation const): Modified to use the stored referrer.
559         * page/csp/ContentSecurityPolicy.h:
560         * workers/WorkerGlobalScope.cpp:
561         (WebCore::WorkerGlobalScope::applyContentSecurityPolicyResponseHeaders): Pass a null string
562         for the referrer as a worker does not have a referrer.
563
564 2018-05-07  Daniel Bates  <dabates@apple.com>
565
566         CSP should only notify Inspector to pause the debugger on the first policy to violate a directive
567         https://bugs.webkit.org/show_bug.cgi?id=185364
568
569         Reviewed by Brent Fulgham.
570
571         Notify Web Inspector that a script was blocked on the first enforced CSP policy that it
572         violates.
573
574         A page can have more than one enforced Content Security Policy. Currently for inline
575         scripts, inline event handlers, JavaScript URLs, and eval() that are blocked by CSP
576         we notify Web Inspector that it was blocked for each CSP policy that blocked it. When
577         Web Inspector is notified it pauses script execution. It does not seem very meaningful
578         to pause script execution on the same script for each CSP policy that blocked it.
579         Therefore, only tell Web Inspector that a script was blocked for the first enforced CSP
580         policy that blocked it.
581
582         * page/csp/ContentSecurityPolicy.cpp:
583         (WebCore::ContentSecurityPolicy::allowJavaScriptURLs const):
584         (WebCore::ContentSecurityPolicy::allowInlineEventHandlers const):
585         (WebCore::ContentSecurityPolicy::allowInlineScript const):
586         (WebCore::ContentSecurityPolicy::allowEval const):
587
588 2018-05-07  Daniel Bates  <dabates@apple.com>
589
590         Substitute CrossOriginPreflightResultCache::clear() for CrossOriginPreflightResultCache::empty()
591         https://bugs.webkit.org/show_bug.cgi?id=185170
592
593         Reviewed by Per Arne Vollan.
594
595         Rename CrossOriginPreflightResultCache::empty() to CrossOriginPreflightResultCache::clear() make
596         it consistent with the terminology we use in WebKit to signify a function that clears a collection.
597         A member function named "empty" is expected to return an instance of a class in its "empty state".
598         For example, StringImpl::empty() returns a StringImpl instance that represents the empty string.
599         However CrossOriginPreflightResultCache::empty() clears out the cache in-place. We should rename
600         this function to better describe its purpose.
601
602         * loader/CrossOriginPreflightResultCache.cpp:
603         (WebCore::CrossOriginPreflightResultCache::clear):
604         (WebCore::CrossOriginPreflightResultCache::empty): Deleted.
605         * loader/CrossOriginPreflightResultCache.h:
606
607 2018-05-06  Dean Jackson  <dino@apple.com>
608
609         WebGL: Reset simulated values after validation fails
610         https://bugs.webkit.org/show_bug.cgi?id=185363
611         <rdar://problem/39733417>
612
613         Reviewed by Anders Carlsson.
614
615         While fixing a previous bug, I forgot to reset some values
616         when validation fails. This caused a bug where a subsequent
617         invalid call might use those values and escape detection.
618
619         Test: fast/canvas/webgl/index-validation-with-subsequent-draws.html
620
621         * html/canvas/WebGLRenderingContextBase.cpp:
622         (WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): Reset the
623         sizes when validation fails.
624         * html/canvas/WebGLRenderingContextBase.h:
625
626 2018-05-07  Ms2ger  <Ms2ger@igalia.com>
627
628         Support negative sw/sh values in createImageBitmap().
629         https://bugs.webkit.org/show_bug.cgi?id=184449
630
631         Reviewed by Dean Jackson.
632
633         Tests: LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
634                LayoutTests/http/wpt/2dcontext/imagebitmap/createImageBitmap.html
635
636         * html/ImageBitmap.cpp:
637         (WebCore::ImageBitmap::createPromise): handle negative values per spec.
638
639 2018-05-07  Brian Burg  <bburg@apple.com>
640
641         Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
642         https://bugs.webkit.org/show_bug.cgi?id=184861
643         <rdar://problem/39153768>
644
645         Reviewed by Timothy Hatcher.
646
647         Notify the client of the current connection count whenever a frontend connects or disconnects.
648
649         Covered by new API test.
650
651         * inspector/InspectorClient.h:
652         (WebCore::InspectorClient::frontendCountChanged):
653         * inspector/InspectorController.cpp:
654         (WebCore::InspectorController::connectFrontend):
655         (WebCore::InspectorController::disconnectFrontend):
656         (WebCore::InspectorController::disconnectAllFrontends):
657         * inspector/InspectorController.h:
658
659 2018-05-07  Eric Carlson  <eric.carlson@apple.com>
660
661         Text track cue logging should include cue text
662         https://bugs.webkit.org/show_bug.cgi?id=185353
663         <rdar://problem/40003565>
664
665         Reviewed by Youenn Fablet.
666
667         No new tests, tested manually.
668
669         * html/track/VTTCue.cpp:
670         (WebCore::VTTCue::toJSONString const): Use toJSON.
671         (WebCore::VTTCue::toJSON const): New.
672         * html/track/VTTCue.h:
673
674         * platform/graphics/InbandTextTrackPrivateClient.h:
675         (WebCore::GenericCueData::toJSONString const): Log m_content.
676
677         * platform/graphics/iso/ISOVTTCue.cpp:
678         (WebCore::ISOWebVTTCue::toJSONString const): Log m_cueText.
679
680 2018-05-06  Zalan Bujtas  <zalan@apple.com>
681
682         [LFC] Add assertions for stale Display::Box geometry
683         https://bugs.webkit.org/show_bug.cgi?id=185357
684
685         Reviewed by Antti Koivisto.
686
687         Ensure that we don't access stale geometry of other boxes during layout.
688         For example, in order to layout a block child we need the containing block's content box top/left and width (but not the height)
689
690         * layout/displaytree/DisplayBox.h:
691         (WebCore::Display::Box::invalidateTop):
692         (WebCore::Display::Box::invalidateLeft):
693         (WebCore::Display::Box::invalidateWidth):
694         (WebCore::Display::Box::invalidateHeight):
695         (WebCore::Display::Box::hasValidPosition const):
696         (WebCore::Display::Box::hasValidSize const):
697         (WebCore::Display::Box::hasValidGeometry const):
698         (WebCore::Display::Box::invalidatePosition):
699         (WebCore::Display::Box::invalidateSize):
700         (WebCore::Display::Box::setHasValidPosition):
701         (WebCore::Display::Box::setHasValidSize):
702         (WebCore::Display::Box::setHasValidGeometry):
703         (WebCore::Display::Box::rect const):
704         (WebCore::Display::Box::top const):
705         (WebCore::Display::Box::left const):
706         (WebCore::Display::Box::bottom const):
707         (WebCore::Display::Box::right const):
708         (WebCore::Display::Box::topLeft const):
709         (WebCore::Display::Box::bottomRight const):
710         (WebCore::Display::Box::size const):
711         (WebCore::Display::Box::width const):
712         (WebCore::Display::Box::height const):
713         (WebCore::Display::Box::setRect):
714         (WebCore::Display::Box::setTopLeft):
715         (WebCore::Display::Box::setTop):
716         (WebCore::Display::Box::setLeft):
717         (WebCore::Display::Box::setSize):
718         (WebCore::Display::Box::setWidth):
719         (WebCore::Display::Box::setHeight):
720
721 2018-05-06  Zalan Bujtas  <zalan@apple.com>
722
723         [LFC] Add BlockFormattingContext::computeStaticPosition
724         https://bugs.webkit.org/show_bug.cgi?id=185352
725
726         Reviewed by Antti Koivisto.
727
728         This is the core logic for positioning inflow boxes in a block formatting context (very naive though).
729
730         * layout/blockformatting/BlockFormattingContext.cpp:
731         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
732         * layout/displaytree/DisplayBox.h:
733
734 2018-05-05  Sam Weinig  <sam@webkit.org>
735
736         Cleanup XMLHttpRequestUpload a little
737         https://bugs.webkit.org/show_bug.cgi?id=185344
738
739         Reviewed by Yusuke Suzuki.
740
741         * bindings/js/JSXMLHttpRequestCustom.cpp:
742         (WebCore::JSXMLHttpRequest::visitAdditionalChildren):
743         Use auto to reduce redundancy.
744
745         * xml/XMLHttpRequest.cpp:
746         (WebCore::XMLHttpRequest::upload):
747         * xml/XMLHttpRequest.h:
748         Switch upload() to return a reference.
749         
750         * xml/XMLHttpRequestUpload.cpp:
751         (WebCore::XMLHttpRequestUpload::XMLHttpRequestUpload):
752         (WebCore::XMLHttpRequestUpload::dispatchProgressEvent):
753         * xml/XMLHttpRequestUpload.h:
754         Cleanup formatting, modernize and switch XMLHttpRequest member from a pointer
755         to a reference.
756
757 2018-05-05  Dean Jackson  <dino@apple.com>
758
759         Draw a drop-shadow behind the system preview badge
760         https://bugs.webkit.org/show_bug.cgi?id=185356
761         <rdar://problem/40004936>
762
763         Reviewed by Wenson Hsieh.
764
765         Draw a very subtle drop-shadow under the system
766         preview badge so that it is more visible on a pure
767         white background.
768
769         I also moved some code around to make it more clear
770         and improved comments.
771
772         * rendering/RenderThemeIOS.mm:
773         (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
774
775 2018-05-04  Wenson Hsieh  <wenson_hsieh@apple.com>
776
777         [iOS] Multiple links in Mail are dropped in a single line, and are difficult to tell apart
778         https://bugs.webkit.org/show_bug.cgi?id=185289
779         <rdar://problem/35756912>
780
781         Reviewed by Tim Horton and Darin Adler.
782
783         When inserting multiple URLs as individual items in a single drop, we currently separate each item with a space
784         (see r217284). However, it still seems difficult to tell dropped links apart. This patch makes some slight
785         tweaks to WebContentReader::readURL so that it inserts line breaks before dropped URLs, if the dropped URL isn't
786         the first item to be inserted in the resulting document fragment.
787
788         Augments existing API tests in DataInteractionTests.
789
790         * editing/ios/WebContentReaderIOS.mm:
791
792         Additionally remove some extraneous header imports from this implementation file.
793
794         (WebCore::WebContentReader::readURL):
795
796 2018-05-02  Dean Jackson  <dino@apple.com>
797
798         Use IOSurfaces for CoreImage operations where possible
799         https://bugs.webkit.org/show_bug.cgi?id=185230
800         <rdar://problem/39926929>
801
802         Reviewed by Jon Lee.
803
804         On iOS hardware, we can use IOSurfaces as a rendering destination
805         for CoreImage, which means we're keeping data on the GPU
806         for rendering.
807
808         As a drive-by fix, I used a convenience method for Gaussian blurs.
809
810         * rendering/RenderThemeIOS.mm:
811         (WebCore::RenderThemeIOS::paintSystemPreviewBadge):
812
813 2018-05-04  Tim Horton  <timothy_horton@apple.com>
814
815         Shift to a lower-level framework for simplifying URLs
816         https://bugs.webkit.org/show_bug.cgi?id=185334
817
818         Reviewed by Dan Bernstein.
819
820         * Configurations/WebCore.xcconfig:
821         * platform/mac/DragImageMac.mm:
822         (WebCore::LinkImageLayout::LinkImageLayout):
823
824 2018-05-03  Ryosuke Niwa  <rniwa@webkit.org>
825
826         Release assert in ScriptController::canExecuteScripts via HTMLMediaElement::~HTMLMediaElement()
827         https://bugs.webkit.org/show_bug.cgi?id=185288
828
829         Reviewed by Jer Noble.
830
831         The crash is caused by HTMLMediaElement::~HTMLMediaElement canceling the resource load via CachedResource
832         which ends up calling FrameLoader::checkCompleted() and fire load event on the document synchronously.
833         Speculatively fix the crash by scheduling the check instead.
834
835         In long term, ResourceLoader::cancel should never fire load event synchronously: webkit.org/b/185284.
836
837         Unfortunately, no new tests since I can't get MediaResource to get destructed at the right time.
838
839         * html/HTMLMediaElement.cpp:
840         (WebCore::HTMLMediaElement::isRunningDestructor): Added to detect this specific case.
841         (WebCore::HTMLMediaElementDestructorScope): Added.
842         (WebCore::HTMLMediaElementDestructorScope::HTMLMediaElementDestructorScope): Added.
843         (WebCore::HTMLMediaElementDestructorScope::~HTMLMediaElementDestructorScope): Added.
844         (WebCore::HTMLMediaElement::~HTMLMediaElement): Instantiate HTMLMediaElement.
845         * html/HTMLMediaElement.h:
846         * loader/FrameLoader.cpp:
847         (WebCore::FrameLoader::checkCompleted): Call scheduleCheckCompleted instead of synchronously calling
848         checkCompleted if we're in the middle of destructing a HTMLMediaElement.
849
850 2018-05-04  Ryosuke Niwa  <rniwa@webkit.org>
851
852         Rename DocumentOrderedMap to TreeScopeOrderedMap
853         https://bugs.webkit.org/show_bug.cgi?id=185290
854
855         Reviewed by Zalan Bujtas.
856
857         Renamed the class since it's almost always a mistake to use this class as a member variable of Document.
858
859         * Sources.txt:
860         * WebCore.xcodeproj/project.pbxproj:
861         * dom/MouseRelatedEvent.cpp: Include the forgotten DOMWindow.h. Unified build files bit us here.
862         * dom/TreeScope.cpp:
863         (WebCore::TreeScope::addElementById):
864         (WebCore::TreeScope::addElementByName):
865         (WebCore::TreeScope::addImageMap):
866         (WebCore::TreeScope::addImageElementByUsemap):
867         (WebCore::TreeScope::labelElementForId):
868         * dom/TreeScope.h:
869         * dom/TreeScopeOrderedMap.cpp: Renamed from DocumentOrderedMap.cpp
870         * dom/TreeScopeOrderedMap.h: Renamed from DocumentOrderedMap.h
871         * html/HTMLDocument.h:
872
873 2018-05-04  Don Olmstead  <don.olmstead@sony.com>
874
875         [Win][WebKit] Fix forwarding headers for Windows build
876         https://bugs.webkit.org/show_bug.cgi?id=184412
877
878         Reviewed by Alex Christensen.
879
880         No new tests. No change in behavior.
881
882         * PlatformWin.cmake:
883
884 2018-05-04  Zalan Bujtas  <zalan@apple.com>
885
886         [Simple line layout] Add support for line layout box generation with multiple text renderers.
887         https://bugs.webkit.org/show_bug.cgi?id=185276
888
889         Reviewed by Antti Koivisto.
890
891         Covered by existing tests.
892
893         * rendering/SimpleLineLayoutFunctions.cpp:
894         (WebCore::SimpleLineLayout::canUseForLineBoxTree):
895         (WebCore::SimpleLineLayout::generateLineBoxTree):
896         * rendering/SimpleLineLayoutResolver.cpp:
897         (WebCore::SimpleLineLayout::RunResolver::Run::renderer const):
898         (WebCore::SimpleLineLayout::RunResolver::Run::localStart const):
899         (WebCore::SimpleLineLayout::RunResolver::Run::localEnd const):
900         * rendering/SimpleLineLayoutResolver.h:
901
902 2018-05-04  Timothy Hatcher  <timothy@apple.com>
903
904         Deprecate legacy WebView and friends
905         https://bugs.webkit.org/show_bug.cgi?id=185279
906         rdar://problem/33268700
907
908         Reviewed by Tim Horton.
909
910         * Configurations/WebCore.xcconfig:
911         Added BUILDING_WEBKIT define to disable the deprecation macros.
912         * bridge/objc/WebScriptObject.h:
913         Added deprecation macros to WebScriptObject and WebUndefined.
914         * platform/cocoa/WebKitAvailability.h:
915         Added more macros and a way to disable deprecation warnings for
916         WebKit build and in clients like Safari.
917
918 2018-05-04  Eric Carlson  <eric.carlson@apple.com>
919
920         Log media time range as JSON
921         https://bugs.webkit.org/show_bug.cgi?id=185321
922         <rdar://problem/39986746>
923
924         Reviewed by Youenn Fablet.
925
926         No new tests, tested manually.
927
928         * html/HTMLMediaElement.cpp:
929         (WebCore::HTMLMediaElement::addPlayedRange): Log as time range.
930         (WebCore::HTMLMediaElement::visibilityStateChanged): Cleanup.
931
932         * platform/graphics/MediaPlayer.h:
933         (WTF::LogArgument<MediaTime>::toString):
934         (WTF::LogArgument<MediaTimeRange>::toString):
935
936         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
937         (WebCore::InbandTextTrackPrivateAVF::processAttributedStrings): Log error as time range.
938
939 2018-05-04  Zalan Bujtas  <zalan@apple.com>
940
941         Use the containing block to compute the pagination gap when the container is inline.
942         https://bugs.webkit.org/show_bug.cgi?id=184724
943         <rdar://problem/39521800>
944
945         Reviewed by Simon Fraser.
946
947         Test: fast/overflow/page-overflow-with-inline-body-crash.html
948
949         * page/FrameView.cpp:
950         (WebCore::FrameView::applyPaginationToViewport):
951
952 2018-05-04  Tim Horton  <timothy_horton@apple.com>
953
954         Don't use GSFont* in minimal simulator mode
955         https://bugs.webkit.org/show_bug.cgi?id=185320
956         <rdar://problem/39734478>
957
958         Reviewed by Beth Dakin.
959
960         * page/cocoa/MemoryReleaseCocoa.mm:
961         (WebCore::platformReleaseMemory):
962
963 2018-05-04  Chris Dumez  <cdumez@apple.com>
964
965         Unreviewed, rolling out r231331.
966
967         Caused a few tests to assert
968
969         Reverted changeset:
970
971         "Stop using an iframe's id as fallback if its name attribute
972         is not set"
973         https://bugs.webkit.org/show_bug.cgi?id=11388
974         https://trac.webkit.org/changeset/231331
975
976 2018-05-04  Youenn Fablet  <youenn@apple.com>
977
978         Use more references in updateTracksOfType
979         https://bugs.webkit.org/show_bug.cgi?id=185305
980
981         Reviewed by Eric Carlson.
982
983         No change of behavior.
984
985         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
986         (WebCore::updateTracksOfType):
987         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
988
989 2018-05-04  Myles C. Maxfield  <mmaxfield@apple.com>
990
991         Text shaping in the simple path is flipped in the y direction
992         https://bugs.webkit.org/show_bug.cgi?id=185062
993         <rdar://problem/39778678>
994
995         Reviewed by Simon Fraser.
996
997         Shaping in our simple codepath occurs in an "increasing-y-goes-up" coordinate system, but our painting
998         code uses an "increasing-y-goes-down" coordinate system. We weren't fixing up the coordinate systems
999         because we never noticed. This is because the simple codepath is only designed for kerning and ligatures,
1000         neither of which move glyphs vertically in the common case.
1001
1002         Test: fast/text/vertical-displacement-simple-codepath.html
1003
1004         * platform/graphics/Font.cpp:
1005         (WebCore::Font::applyTransforms const):
1006         * platform/graphics/WidthIterator.cpp:
1007         (WebCore::WidthIterator::applyFontTransforms):
1008
1009 2018-05-04  Chris Nardi  <cnardi@chromium.org>
1010
1011         Serialize all URLs with double-quotes per CSSOM spec
1012         https://bugs.webkit.org/show_bug.cgi?id=184935
1013
1014         Reviewed by Antti Koivisto.
1015
1016         According to https://drafts.csswg.org/cssom/#serialize-a-url, all URLs should be serialized as strings,
1017         which means they should have double quotes around the text of the URL. Update our implementation to match
1018         this (and Firefox/Chrome). Also remove isCSSTokenizerURL() as this method is no longer needed.
1019
1020         Tests: Many LayoutTests updated to use double quotes.
1021
1022         * css/CSSMarkup.cpp:
1023         (WebCore::serializeString): Remove FIXME as this was already fixed in a previous patch.
1024         (WebCore::serializeURL): Remove FIXME and update implementation.
1025
1026 2018-05-04  Youenn Fablet  <youenn@apple.com>
1027
1028         LayoutTests/fast/mediastream/change-tracks-media-stream-being-played.html is crashing after r231304
1029         https://bugs.webkit.org/show_bug.cgi?id=185303
1030
1031         Reviewed by Eric Carlson.
1032
1033         We need to stop observing the audio track like we do for video track once we are no longer interested in it.
1034         Covered by test no longer crashing.
1035
1036         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1037         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateTracks):
1038
1039 2018-05-04  Zalan Bujtas  <zalan@apple.com>
1040
1041         [LFC] Set the invalidation root as the result of style change.
1042         https://bugs.webkit.org/show_bug.cgi?id=185301
1043
1044         Reviewed by Antti Koivisto.
1045
1046         Compute/propagate the update type on the ancestor chain and return the invalidation root
1047         so that LayoutContext could use it as the entry point for the next layout frame.
1048
1049         * layout/LayoutContext.cpp:
1050         (WebCore::Layout::LayoutContext::updateLayout):
1051         (WebCore::Layout::LayoutContext::styleChanged):
1052         * layout/LayoutContext.h: order is not important.
1053         * layout/blockformatting/BlockInvalidation.cpp:
1054         (WebCore::Layout::invalidationStopsAtFormattingContextBoundary):
1055         (WebCore::Layout::computeUpdateType):
1056         (WebCore::Layout::computeUpdateTypeForAncestor):
1057         (WebCore::Layout::BlockInvalidation::invalidate):
1058         * layout/blockformatting/BlockInvalidation.h:
1059         * layout/inlineformatting/InlineInvalidation.cpp:
1060         (WebCore::Layout::InlineInvalidation::invalidate):
1061         * layout/inlineformatting/InlineInvalidation.h:
1062
1063 2018-05-04  Youenn Fablet  <youenn@apple.com>
1064
1065         PeerConnection should have its connectionState closed even if doing gathering
1066         https://bugs.webkit.org/show_bug.cgi?id=185267
1067
1068         Reviewed by Darin Adler.
1069
1070         Test: webrtc/addICECandidate-closed.html
1071
1072         In case m_iceConnectionState is closed, m_connectionState should also be set to closed
1073         and RTCPeerConnection should be closed so as to reject any other call.
1074
1075         * Modules/mediastream/RTCPeerConnection.cpp:
1076         (WebCore::RTCPeerConnection::close):
1077         (WebCore::RTCPeerConnection::updateConnectionState):
1078
1079 2018-05-04  Yacine Bandou  <yacine.bandou_ext@softathome.com>
1080
1081         [MSE][GStreamer] Delete properly the stream from the WebKitMediaSource
1082         https://bugs.webkit.org/show_bug.cgi?id=185242
1083
1084         Reviewed by Xabier Rodriguez-Calvar.
1085
1086         When the sourceBuffer is removed from mediasource, the appropriate stream is not
1087         properly deleted from WebKitMediaSource, because the appsrc and parser elements
1088         of the stream are not removed from the WebKitMediaSource bin.
1089
1090         This patch avoids the regression of r231089, see https://bugs.webkit.org/show_bug.cgi?id=185071
1091
1092         * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
1093         (webKitMediaSrcFreeStream):
1094
1095 2018-05-04  Carlos Garcia Campos  <cgarcia@igalia.com>
1096
1097         [GTK] Epiphany (GNOME Web) says "Error downloading: Service Unavailable." when trying to download an image from discogs.com
1098         https://bugs.webkit.org/show_bug.cgi?id=174730
1099
1100         Reviewed by Michael Catanzaro.
1101
1102         Export ResourceRequestBase::hasHTTPHeaderField().
1103
1104         * platform/network/ResourceRequestBase.h:
1105
1106 2018-05-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1107
1108         Use subprocess.call instead of os.system to handle path with spaces
1109         https://bugs.webkit.org/show_bug.cgi?id=185291
1110
1111         Reviewed by Darin Adler.
1112
1113         If gperf path includes spaces, these python scripts fail to execute gperf.
1114         We use subprocess module instead of os.system to invoke gperf.
1115
1116         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
1117         * css/makeSelectorPseudoElementsMap.py:
1118         * platform/network/create-http-header-name-table:
1119
1120 2018-05-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1121
1122         Unreviewed, attempt to fix WinCairo build failure
1123         https://bugs.webkit.org/show_bug.cgi?id=185218
1124
1125         * platform/text/win/LocaleWin.cpp:
1126         (WebCore::LocaleWin::getLocaleInfoString):
1127
1128 2018-05-03  Filip Pizlo  <fpizlo@apple.com>
1129
1130         Strings should not be allocated in a gigacage
1131         https://bugs.webkit.org/show_bug.cgi?id=185218
1132
1133         Reviewed by Saam Barati.
1134
1135         No new tests because no new behavior.
1136
1137         * Modules/indexeddb/server/IDBSerialization.cpp:
1138         (WebCore::decodeKey):
1139         * bindings/js/SerializedScriptValue.cpp:
1140         (WebCore::CloneDeserializer::readString):
1141         * html/canvas/CanvasRenderingContext2D.cpp:
1142         (WebCore::normalizeSpaces):
1143         * html/parser/HTMLTreeBuilder.cpp:
1144         (WebCore::HTMLTreeBuilder::ExternalCharacterTokenBuffer::takeRemainingWhitespace):
1145         * platform/URLParser.cpp:
1146         (WebCore::percentEncodeByte):
1147         (WebCore::serializeURLEncodedForm):
1148         (WebCore::URLParser::serialize):
1149         * platform/URLParser.h:
1150         * platform/graphics/FourCC.cpp:
1151         (WebCore::FourCC::toString const):
1152         * platform/graphics/ca/GraphicsLayerCA.cpp:
1153         (WebCore::GraphicsLayerCA::ReplicaState::cloneID const):
1154         * platform/text/LocaleICU.cpp:
1155         (WebCore::LocaleICU::decimalSymbol):
1156         (WebCore::LocaleICU::decimalTextAttribute):
1157         (WebCore::getDateFormatPattern):
1158         (WebCore::LocaleICU::createLabelVector):
1159         (WebCore::getFormatForSkeleton):
1160         * platform/win/FileSystemWin.cpp:
1161         (WebCore::FileSystem::getFinalPathName):
1162         (WebCore::FileSystem::pathByAppendingComponent):
1163         (WebCore::FileSystem::storageDirectory):
1164
1165 2018-05-02  Brent Fulgham  <bfulgham@apple.com>
1166
1167         Widgets should hold a WeakPtr to their parents
1168         https://bugs.webkit.org/show_bug.cgi?id=185239
1169         <rdar://problem/39741250>
1170
1171         Reviewed by Zalan Bujtas.
1172
1173         * platform/ScrollView.h:
1174         (WebCore::ScrollView::weakPtrFactory): Added.
1175         * platform/Widget.cpp:
1176         (WebCore::Widget::init): Don't perform an unnecessary assignment.
1177         (WebCore::Widget::setParent): Grab a WeakPtr to the parent ScrollView.
1178         * platform/Widget.h:
1179         (WebCore::Widget::parent const): Change type to a WeakPtr.
1180
1181 2018-05-03  Yusuke Suzuki  <utatane.tea@gmail.com>
1182
1183         Use pointer instead of std::optional<T&>
1184         https://bugs.webkit.org/show_bug.cgi?id=185186
1185
1186         Reviewed by Alex Christensen.
1187
1188         std::optional<T&> is not accepted in C++17 spec.
1189         In this patch, we replace it with T*, which is well-aligned to
1190         WebKit's convention.
1191
1192         * Modules/mediastream/RTCPeerConnection.cpp:
1193         (WebCore::iceServersFromConfiguration):
1194         (WebCore::RTCPeerConnection::initializeConfiguration):
1195         (WebCore::RTCPeerConnection::setConfiguration):
1196         * css/parser/CSSParser.cpp:
1197         (WebCore::CSSParser::parseSystemColor):
1198         * css/parser/CSSParser.h:
1199         * dom/DatasetDOMStringMap.cpp:
1200         (WebCore::DatasetDOMStringMap::item const):
1201         (WebCore::DatasetDOMStringMap::namedItem const):
1202         (WebCore:: const): Deleted.
1203         * dom/DatasetDOMStringMap.h:
1204         * dom/Element.cpp:
1205         (WebCore::Element::insertAdjacentHTML):
1206         * dom/Element.h:
1207         * html/canvas/CanvasStyle.cpp:
1208         (WebCore::parseColor):
1209         * inspector/DOMEditor.cpp:
1210         * platform/network/curl/CurlFormDataStream.cpp:
1211         (WebCore::CurlFormDataStream::getPostData):
1212         (): Deleted.
1213         * platform/network/curl/CurlFormDataStream.h:
1214         * platform/network/curl/CurlRequest.cpp:
1215         (WebCore::CurlRequest::setupPOST):
1216         * testing/MockCDMFactory.cpp:
1217         (WebCore::MockCDMFactory::keysForSessionWithID const):
1218         (WebCore::MockCDMInstance::updateLicense):
1219         (WebCore:: const): Deleted.
1220         * testing/MockCDMFactory.h:
1221
1222 2018-05-03  Chris Dumez  <cdumez@apple.com>
1223
1224         Stop using an iframe's id as fallback if its name attribute is not set
1225         https://bugs.webkit.org/show_bug.cgi?id=11388
1226
1227         Reviewed by Geoff Garen.
1228
1229         WebKit had logic to use an iframe's id as fallback name when its name
1230         content attribute is not set. This behavior was not standard and did not
1231         match other browsers:
1232         - https://html.spec.whatwg.org/#attr-iframe-name
1233
1234         Gecko / Trident never behaved this way. Blink was aligned with us until
1235         they started to match the specification in:
1236         - https://bugs.chromium.org/p/chromium/issues/detail?id=347169
1237
1238         This WebKit quirk was causing some Web-compatibility issues because it
1239         would affect the behavior of Window's name property getter when trying
1240         to look up an iframe by id. Because of Window's named property getter
1241         behavior [1], we would return the frame's contentWindow instead of the
1242         iframe element itself.
1243
1244         [1] https://html.spec.whatwg.org/multipage/window-object.html#named-access-on-the-window-object
1245
1246         Test: fast/dom/Window/named-getter-frame-id.html
1247
1248         * html/HTMLFrameElementBase.cpp:
1249         (WebCore::HTMLFrameElementBase::openURL):
1250         (WebCore::HTMLFrameElementBase::parseAttribute):
1251         (WebCore::HTMLFrameElementBase::didFinishInsertingNode):
1252         * html/HTMLFrameElementBase.h:
1253
1254 2018-05-03  Eric Carlson  <eric.carlson@apple.com>
1255
1256         [iOS] Internal text and audio tracks not in fullscreen menu
1257         https://bugs.webkit.org/show_bug.cgi?id=185268
1258         <rdar://problem/38673440>
1259
1260         Reviewed by Jer Noble.
1261
1262         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
1263         (WebCore::PlaybackSessionModelMediaElement::setMediaElement): 'addtrack' and 'removetrack'
1264         events are fired at the track lists, not the media element.
1265
1266 2018-05-03  Ryosuke Niwa  <rniwa@webkit.org>
1267
1268         Using image map inside a shadow tree results hits a release assert in DocumentOrderedMap::add
1269         https://bugs.webkit.org/show_bug.cgi?id=185238
1270
1271         Reviewed by Antti Koivisto.
1272
1273         The bug was caused by DocumentOrderedMap for the image elements with usemap being stored in Document
1274         even if those image elements were in a shadow tree. Fixed the bug by moving the map to TreeScope.
1275
1276         Test: fast/images/imagemap-in-nested-shadow-tree.html
1277               fast/images/imagemap-in-shadow-tree.html
1278
1279         * dom/Document.cpp:
1280         (WebCore::Document::addImageElementByUsemap): Moved to TreeScope.
1281         (WebCore::Document::removeImageElementByUsemap): Ditto.
1282         (WebCore::Document::imageElementByUsemap const): Ditto.
1283         * dom/Document.h:
1284         * dom/TreeScope.cpp:
1285         (WebCore::TreeScope::destroyTreeScopeData): Clear m_imagesByUsemap as well as m_elementsByName.
1286         (WebCore::TreeScope::getImageMap const): Removed the code to parse usemap. RenderImage::imageMap()
1287         which used to call this function with the raw value of the usemap content attribute now calls it
1288         via HTMLImageElement::associatedMapElement(), which uses the parsed usemap.
1289         (WebCore::TreeScope::addImageElementByUsemap): Moved from Document.
1290         (WebCore::TreeScope::removeImageElementByUsemap): Ditto.
1291         (WebCore::TreeScope::imageElementByUsemap const): Ditto.
1292         * dom/TreeScope.h:
1293         * html/HTMLImageElement.cpp:
1294         (WebCore::HTMLImageElement::parseAttribute):
1295         (WebCore::HTMLImageElement::insertedIntoAncestor): This image element can be associated with a map element
1296         if it's connected to a document.
1297         (WebCore::HTMLImageElement::removedFromAncestor):
1298         (WebCore::HTMLImageElement::associatedMapElement const):
1299         * html/HTMLImageElement.h:
1300         * html/HTMLMapElement.cpp:
1301         (WebCore::HTMLMapElement::imageElement):
1302         * rendering/RenderImage.cpp:
1303         (WebCore::RenderImage::imageMap const):
1304
1305 2018-05-03  Justin Fan  <justin_fan@apple.com>
1306
1307         [WebGL] Add runtime flag for enabling ASTC support in WebGL
1308         https://bugs.webkit.org/show_bug.cgi?id=184840
1309
1310         Reviewed by Myles C. Maxfield.
1311
1312         Added runtime flag for ASTC support in WebGL, to turn on/off when extension is implemented.
1313
1314         * page/RuntimeEnabledFeatures.h:
1315         (WebCore::RuntimeEnabledFeatures::setWebGLCompressedTextureASTCSupportEnabled):
1316         (WebCore::RuntimeEnabledFeatures::webGLCompressedTextureASTCSupportEnabled const):
1317
1318 2018-05-03  Chris Nardi  <cnardi@chromium.org>
1319
1320         Remove [NoInterfaceObject] from DOMRectList
1321         https://bugs.webkit.org/show_bug.cgi?id=185255
1322
1323         Reviewed by Chris Dumez.
1324
1325         In https://github.com/w3c/fxtf-drafts/issues/233, [NoInterfaceObject] was removed
1326         from DOMRectList. Remove it from our implementation to match the spec, as well as
1327         Chrome and Firefox.
1328
1329         Updated web platform tests IDL test for the Geometry spec.
1330
1331         * dom/DOMRectList.idl:
1332
1333 2018-05-03  Chris Dumez  <cdumez@apple.com>
1334
1335         REGRESSION(iOS 11.3): Crashes in TimerBase::~TimerBase() in Tencent x5gamehelper
1336         https://bugs.webkit.org/show_bug.cgi?id=185073
1337         <rdar://problem/39821223>
1338
1339         Reviewed by Alexey Proskuryakov.
1340
1341         The following changes were made:
1342         - Make sure SocketStream callbacks are always scheduled on the right runloop:
1343           WebThreadRunLoop() on WebKitLegacy iOS, loaderRunLoop() on Windows and
1344           main runloop otherwise.
1345         - When the SocketStream callbacks are called, unconditionally call callOnMainThreadAndWait()
1346           before calling methods on the SocketStream client. Previously, this code path
1347           was specific to Windows but there is no reason to have platform-specific code here.
1348           callOnMainThreadAndWait() calls the function right away if we're already on the main
1349           thread, which will be the case on other platform than Windows.
1350
1351         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
1352         (WebCore::callbacksRunLoop):
1353         (WebCore::callbacksRunLoopMode):
1354         (WebCore::SocketStreamHandleImpl::scheduleStreams):
1355         (WebCore::SocketStreamHandleImpl::pacExecutionCallback):
1356         (WebCore::SocketStreamHandleImpl::executePACFileURL):
1357         (WebCore::SocketStreamHandleImpl::removePACRunLoopSource):
1358         (WebCore::SocketStreamHandleImpl::readStreamCallback):
1359         (WebCore::SocketStreamHandleImpl::writeStreamCallback):
1360         (WebCore::SocketStreamHandleImpl::platformClose):
1361
1362 2018-05-03  Zalan Bujtas  <zalan@apple.com>
1363
1364         [LFC] Enable multiple layout roots for incremental layout.
1365         https://bugs.webkit.org/show_bug.cgi?id=185185
1366
1367         Reviewed by Antti Koivisto.
1368
1369         With certain type of style changes, we can stop the box invalidation at the formatting context boundary.
1370         When multiple boxes need updating in different formatting contexts, instead of marking the parent containing block chain all
1371         the way up to a common ancestor, we could just work with a list of layout entry points per layout frame.
1372
1373         * layout/FormattingState.h:
1374         * layout/LayoutContext.cpp:
1375         (WebCore::Layout::LayoutContext::updateLayout):
1376         (WebCore::Layout::LayoutContext::addLayoutEntryPoint):
1377         * layout/LayoutContext.h:
1378
1379 2018-05-03  Zalan Bujtas  <zalan@apple.com>
1380
1381         [LFC] Box invalidation logic should go to dedicated classes.
1382         https://bugs.webkit.org/show_bug.cgi?id=185249
1383
1384         Reviewed by Antti Koivisto.
1385
1386         Each formatting context can initiate a different type of invalidation when
1387         style attribute changes in a box.
1388
1389         * Sources.txt:
1390         * WebCore.xcodeproj/project.pbxproj:
1391         * layout/FormattingState.cpp:
1392         (WebCore::Layout::FormattingState::FormattingState):
1393         * layout/FormattingState.h:
1394         (WebCore::Layout::FormattingState::isBlockFormattingState const):
1395         (WebCore::Layout::FormattingState::isInlineFormattingState const):
1396         * layout/LayoutContext.cpp:
1397         (WebCore::Layout::LayoutContext::styleChanged):
1398         (WebCore::Layout::LayoutContext::markNeedsUpdate):
1399         * layout/LayoutContext.h:
1400         * layout/blockformatting/BlockFormattingState.cpp:
1401         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
1402         * layout/blockformatting/BlockFormattingState.h:
1403         * layout/blockformatting/BlockInvalidation.cpp: Copied from Source/WebCore/layout/blockformatting/BlockFormattingState.cpp.
1404         (WebCore::Layout::BlockInvalidation::invalidate):
1405         * layout/blockformatting/BlockInvalidation.h: Copied from Source/WebCore/layout/inlineformatting/InlineFormattingState.h.
1406         * layout/inlineformatting/InlineFormattingState.cpp:
1407         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
1408         * layout/inlineformatting/InlineFormattingState.h:
1409         * layout/inlineformatting/InlineInvalidation.cpp: Copied from Source/WebCore/layout/inlineformatting/InlineFormattingState.cpp.
1410         (WebCore::Layout::InlineInvalidation::invalidate):
1411         * layout/inlineformatting/InlineInvalidation.h: Copied from Source/WebCore/layout/blockformatting/BlockFormattingState.h.
1412
1413 2018-05-03  Michael Catanzaro  <mcatanzaro@igalia.com>
1414
1415         WebKit should send fake macOS user agent to docs.google.com
1416         https://bugs.webkit.org/show_bug.cgi?id=185165
1417
1418         Reviewed by Carlos Garcia Campos.
1419
1420         * platform/UserAgentQuirks.cpp:
1421         (WebCore::urlRequiresMacintoshPlatform):
1422         (WebCore::urlRequiresLinuxDesktopPlatform):
1423
1424 2018-05-03  Commit Queue  <commit-queue@webkit.org>
1425
1426         Unreviewed, rolling out r231223 and r231288.
1427         https://bugs.webkit.org/show_bug.cgi?id=185256
1428
1429         The change in r231223 breaks internal builds, and r231288 is a
1430         dependent change. (Requested by ryanhaddad on #webkit).
1431
1432         Reverted changesets:
1433
1434         "Use default std::optional if it is provided"
1435         https://bugs.webkit.org/show_bug.cgi?id=185159
1436         https://trac.webkit.org/changeset/231223
1437
1438         "Use pointer instead of
1439         std::optional<std::reference_wrapper<>>"
1440         https://bugs.webkit.org/show_bug.cgi?id=185186
1441         https://trac.webkit.org/changeset/231288
1442
1443 2018-05-03  Ryan Haddad  <ryanhaddad@apple.com>
1444
1445         Unreviewed, rolling out r231253.
1446
1447         The API test added with this change is crashing on the bots.
1448
1449         Reverted changeset:
1450
1451         "Web Inspector: opt out of process swap on navigation if a Web
1452         Inspector frontend is connected"
1453         https://bugs.webkit.org/show_bug.cgi?id=184861
1454         https://trac.webkit.org/changeset/231253
1455
1456 2018-05-03  Youenn Fablet  <youenn@apple.com>
1457
1458         A MediaStream being played should allow removing some of its tracks
1459         https://bugs.webkit.org/show_bug.cgi?id=185233
1460
1461         Reviewed by Eric Carlson.
1462
1463         Update the tracks out of the for loop.
1464         Test: fast/mediastream/change-tracks-media-stream-being-played.html
1465
1466         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
1467         (WebCore::updateTracksOfType):
1468
1469 2018-05-03  Miguel Gomez  <magomez@igalia.com>
1470
1471         WebCore::TextureMapperLayer object used after freed
1472         https://bugs.webkit.org/show_bug.cgi?id=184729
1473
1474         Reviewed by Michael Catanzaro.
1475
1476         Replace the raw pointers with WeakPtr for effectTarget, maskLayer and replicaLayer
1477         inside TextureMapperLayer.
1478
1479         * platform/graphics/texmap/TextureMapperLayer.cpp:
1480         (WebCore::TextureMapperLayer::~TextureMapperLayer):
1481         (WebCore::TextureMapperLayer::setMaskLayer):
1482         (WebCore::TextureMapperLayer::setReplicaLayer):
1483         * platform/graphics/texmap/TextureMapperLayer.h:
1484
1485 2018-05-03  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1486
1487         [Curl] Add OpenSSL/LibreSSL multi-threading support
1488         https://bugs.webkit.org/show_bug.cgi?id=185138
1489
1490         The older OpenSSL manual says the locking_function and threadid_function should
1491         be set when use it in multi-threading environment. This applies to LibreSSL also.
1492         https://www.openssl.org/docs/man1.0.2/crypto/threads.html
1493
1494         For unix and other similar os, the default threadId_function implementation is
1495         good enough. We'll set custom callback only for Windows OS.
1496
1497         Note it's not required for OpenSSL 1.1.0 and after.
1498         https://www.openssl.org/blog/blog/2017/02/21/threads/
1499
1500         Reviewed by Per Arne Vollan.
1501
1502         * platform/network/curl/CurlSSLHandle.cpp:
1503         (WebCore::CurlSSLHandle::CurlSSLHandle):
1504         (WebCore::CurlSSLHandle::ThreadSupport::ThreadSupport):
1505         (WebCore::CurlSSLHandle::ThreadSupport::lockingCallback):
1506         (WebCore::CurlSSLHandle::ThreadSupport::threadIdCallback):
1507         * platform/network/curl/CurlSSLHandle.h:
1508         (WebCore::CurlSSLHandle::ThreadSupport::setup):
1509         (WebCore::CurlSSLHandle::ThreadSupport::singleton):
1510         (WebCore::CurlSSLHandle::ThreadSupport::lock):
1511         (WebCore::CurlSSLHandle::ThreadSupport::unlock):
1512
1513 2018-05-02  Ryosuke Niwa  <rniwa@webkit.org>
1514
1515         Remove superfluous check for a null attribute value check in Element::removeAttributeInternal
1516         https://bugs.webkit.org/show_bug.cgi?id=185227
1517
1518         Reviewed by Chris Dumez.
1519
1520         Removed the check. The attribute value string can never be null.
1521
1522         * dom/Element.cpp:
1523         (WebCore::Element::removeAttributeInternal):
1524
1525 2018-05-02  Zalan Bujtas  <zalan@apple.com>
1526
1527         [LFC] Implement LayoutContext::createDisplayBox
1528         https://bugs.webkit.org/show_bug.cgi?id=185158
1529
1530         Reviewed by Antti Koivisto.
1531
1532         Now compute*() functions take both the const layout and the corresponding non-const display boxes.
1533         Display boxes are owned by the LayoutContext and they don't form a tree structure (only implicitly through the layout tree).
1534         (This might need to change in the future if we decide to arrange them in some sort of painting order)
1535
1536         * layout/FloatingContext.cpp:
1537         (WebCore::Layout::FloatingContext::computePosition):
1538         * layout/FloatingContext.h:
1539         * layout/FormattingContext.cpp:
1540         (WebCore::Layout::FormattingContext::computeStaticPosition const):
1541         (WebCore::Layout::FormattingContext::computeInFlowPositionedPosition const):
1542         (WebCore::Layout::FormattingContext::computeOutOfFlowPosition const):
1543         (WebCore::Layout::FormattingContext::computeWidth const):
1544         (WebCore::Layout::FormattingContext::computeHeight const):
1545         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
1546         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
1547         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
1548         (WebCore::Layout::FormattingContext::computeFloatingHeight const):
1549         * layout/FormattingContext.h:
1550         * layout/LayoutContext.cpp:
1551         (WebCore::Layout::LayoutContext::createDisplayBox):
1552         * layout/LayoutContext.h:
1553         (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
1554         * layout/blockformatting/BlockFormattingContext.cpp:
1555         (WebCore::Layout::BlockFormattingContext::layout const):
1556         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
1557         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
1558         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
1559         * layout/blockformatting/BlockFormattingContext.h:
1560         * layout/displaytree/DisplayBox.h:
1561         (WebCore::Display::Box::parent const): Deleted.
1562         (WebCore::Display::Box::nextSibling const): Deleted.
1563         (WebCore::Display::Box::previousSibling const): Deleted.
1564         (WebCore::Display::Box::firstChild const): Deleted.
1565         (WebCore::Display::Box::lastChild const): Deleted.
1566         (WebCore::Display::Box::setParent): Deleted.
1567         (WebCore::Display::Box::setNextSibling): Deleted.
1568         (WebCore::Display::Box::setPreviousSibling): Deleted.
1569         (WebCore::Display::Box::setFirstChild): Deleted.
1570         (WebCore::Display::Box::setLastChild): Deleted.
1571         (): Deleted.
1572         * layout/inlineformatting/InlineFormattingContext.cpp:
1573         (WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
1574         (WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
1575         * layout/inlineformatting/InlineFormattingContext.h:
1576
1577 2018-05-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
1578
1579         Hiding then showing an <object> of type image makes the underlaying image disappear
1580         https://bugs.webkit.org/show_bug.cgi?id=185216
1581         <rdar://problem/39055630>
1582
1583         Reviewed by Youenn Fablet.
1584
1585         Ensure the HTMLPlugInImageElement updates the RenderImageResource of its
1586         RenderImage with the CachedImage of its ImageLoader when the RenderImage
1587         is recreated.
1588
1589         Test: fast/images/object-image-hide-show.html
1590
1591         * html/HTMLPlugInImageElement.cpp:
1592         (WebCore::HTMLPlugInImageElement::didAttachRenderers):
1593         This is very similar to what we do in HTMLImageElement::didAttachRenderers().
1594
1595
1596 2018-05-02  Brent Fulgham  <bfulgham@apple.com>
1597
1598         Use RetainPtr for form input type
1599         https://bugs.webkit.org/show_bug.cgi?id=185210
1600         <rdar://problem/39734040>
1601
1602         Reviewed by Ryosuke Niwa.
1603
1604         Refactor our HTMLInputElement class to store its InputType member as a RefPtr.
1605
1606         Test: fast/forms/access-key-mutation-2.html.
1607
1608         * html/HTMLInputElement.cpp:
1609         (WebCore::HTMLInputElement::HTMLInputElement):
1610         (WebCore::HTMLInputElement::didAddUserAgentShadowRoot):
1611         (WebCore::HTMLInputElement::accessKeyAction):
1612         (WebCore::HTMLInputElement::parseAttribute):
1613         (WebCore::HTMLInputElement::appendFormData):
1614         * html/HTMLInputElement.h:
1615         * html/InputType.cpp:
1616         (WebCore::createInputType):
1617         (WebCore::InputType::create):
1618         (WebCore::InputType::createText):
1619         * html/InputType.h:
1620
1621 2018-05-01  Yusuke Suzuki  <utatane.tea@gmail.com>
1622
1623         Use pointer instead of std::optional<std::reference_wrapper<>>
1624         https://bugs.webkit.org/show_bug.cgi?id=185186
1625
1626         Reviewed by Alex Christensen.
1627
1628         std::optional<T&> is not accepted in C++17 spec. So we replaced it
1629         with std::optional<std::reference_wrapper<T>>.
1630
1631         In this patch, we replace it with T*, which is well-aligned to
1632         WebKit's convention.
1633
1634         * Modules/mediastream/RTCPeerConnection.cpp:
1635         (WebCore::iceServersFromConfiguration):
1636         (WebCore::RTCPeerConnection::initializeConfiguration):
1637         (WebCore::RTCPeerConnection::setConfiguration):
1638         * css/parser/CSSParser.cpp:
1639         (WebCore::CSSParser::parseSystemColor):
1640         * css/parser/CSSParser.h:
1641         * dom/DatasetDOMStringMap.cpp:
1642         (WebCore::DatasetDOMStringMap::item const):
1643         (WebCore::DatasetDOMStringMap::namedItem const):
1644         * dom/DatasetDOMStringMap.h:
1645         * dom/Element.cpp:
1646         (WebCore::Element::insertAdjacentHTML):
1647         * dom/Element.h:
1648         * html/canvas/CanvasStyle.cpp:
1649         (WebCore::parseColor):
1650         * inspector/DOMEditor.cpp:
1651         * platform/network/curl/CurlFormDataStream.cpp:
1652         (WebCore::CurlFormDataStream::getPostData):
1653         * platform/network/curl/CurlFormDataStream.h:
1654         * platform/network/curl/CurlRequest.cpp:
1655         (WebCore::CurlRequest::setupPOST):
1656         * testing/MockCDMFactory.cpp:
1657         (WebCore::MockCDMFactory::keysForSessionWithID const):
1658         (WebCore::MockCDMInstance::updateLicense):
1659         * testing/MockCDMFactory.h:
1660
1661 2018-05-02  Keith Rollin  <krollin@apple.com>
1662
1663         Add facility for tracking times and results of page and resource loading
1664         https://bugs.webkit.org/show_bug.cgi?id=184838
1665         <rdar://problem/36548974>
1666
1667         Reviewed by Brent Fulgham.
1668
1669         Update FrameProgressTracker to send the necessary page load start/stop
1670         signals so that we can track the entire page load at a network level.
1671         Add an empty override of the pure virtual
1672         LoaderStrategy::pageLoadCompleted method.
1673
1674         No new tests. There is no testable effect from these changes. On
1675         Cocoa, measurable changes take place in another (non-WebKit) process.
1676         On non-Cocoa systems, this facility is currently disabled.
1677
1678         * loader/FrameLoader.cpp:
1679         (WebCore::FrameLoader::FrameProgressTracker::progressCompleted):
1680         * loader/LoaderStrategy.h:
1681
1682 2018-05-02  Aditya Keerthi  <akeerthi@apple.com>
1683
1684         Can't copy and paste URLs that have no title into Mail (macOS)
1685         https://bugs.webkit.org/show_bug.cgi?id=185205
1686         <rdar://problem/36352406>
1687
1688         Reviewed by Tim Horton.
1689
1690         The pasteboardURL generated has an empty title for URLs without titles. Currently, the pasteboardURL.title is being saved to the pasteboard.
1691
1692         To fix the error, we check whether the title is empty and instead save the lastPathComponent to the pasteboard. This matches current behavior as the fallback title.
1693
1694         Augmented WebKitLegacy.ContextMenuCanCopyURL test
1695
1696         * platform/mac/PasteboardMac.mm:
1697         (WebCore::writeURLForTypes):
1698
1699 2018-05-01  Ryosuke Niwa  <rniwa@webkit.org>
1700
1701         REGRESSION(r225868): Release assert when removing an SVGUseElement from Document::m_svgUseElements
1702         https://bugs.webkit.org/show_bug.cgi?id=182188
1703         <rdar://problem/36689240>
1704
1705         Reviewed by Antti Koivisto.
1706
1707         Fixed the crash by removing up the release assert.
1708
1709         The crash is likely caused by re-entrancy to Document::resolveStyle during SVGUseElement::updateShadowTree.
1710         Because Document::resolveStyle invokes updateShadowTree on SVG use elements in Document::m_svgUseElements
1711         without clearing the map, the nested call to resolveStyle ends up calling updateShadowTree() for all elements
1712         in m_svgUseElements and removing them all from the map. When the stack frame eventually comes back to the outer
1713         invocation of Document::resolveStyle, updateShadowTree gets invoked for the second time on SVG use elements
1714         whose shadow tree had already been updated within the inner invocation to updateShadowTree, and release-asserts.
1715
1716         There is an alternative fix: avoid calling updateShadowTree on a svg element when shadowTreeNeedsUpdate returns
1717         true on the element in resolveStyle. However, removing the release assert is a sure way to fix the crash so
1718         this patch opts for that fix instead especially since we don't have any reproducible test case for this crash.
1719
1720         This release assertion was added in r225868 as a cautious measure to catch any use-after-frees of SVGUseElement's
1721         since m_svgUseElements stored raw pointes to SVG use elements but this crash is not an indicative of any UAF,
1722         and there is no evidence that r225868 has led to new UAFs even after five months.
1723
1724         No new tests. I couldn't find a way to trigger a nested style update inside SVGUseElement::updateShadowTree.
1725
1726         * dom/Document.cpp:
1727         (WebCore::Document::removeSVGUseElement):
1728
1729 2018-05-02  Dirk Schulze  <dschulze@chromium.org>
1730
1731         getCharNumAtPosition should take DOMPointInit as argument
1732         https://bugs.webkit.org/show_bug.cgi?id=184695
1733
1734         Reviewed by Antti Koivisto.
1735
1736         Extend existing tests for getCharNumAtPosition.
1737
1738         * svg/SVGTextContentElement.cpp:
1739         (WebCore::SVGTextContentElement::getCharNumAtPosition):
1740         * svg/SVGTextContentElement.h:
1741         * svg/SVGTextContentElement.idl: Use DOMPointInit argument.
1742
1743 2018-05-02  Youenn Fablet  <youenn@apple.com>
1744
1745         Use NetworkLoadChecker for navigation loads
1746         https://bugs.webkit.org/show_bug.cgi?id=184892
1747         <rdar://problem/39652686>
1748
1749         Reviewed by Chris Dumez.
1750
1751         Sanitize headers according response tainting.
1752         If tainting is basic, it means same origin load in which case we only filter Cookie related headers.
1753         If tainting is Opaque, we filter all uncommon headers.
1754         If tainting is CORS, we filter all uncommon headers except the one explicitely allowed by CORS headers.
1755         Covered by updated test.
1756
1757         * platform/network/ResourceResponseBase.cpp:
1758         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting):
1759         (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFields):
1760         * platform/network/ResourceResponseBase.h:
1761
1762 2018-05-02  Myles C. Maxfield  <mmaxfield@apple.com>
1763
1764         Collection fragment identifiers don't use PostScript names
1765         https://bugs.webkit.org/show_bug.cgi?id=184624
1766         <rdar://problem/39432089>
1767
1768         Reviewed by Simon Fraser.
1769
1770         In a previous version of the CSS Fonts spec, there was text saying that items in font collections
1771         should be 1-indexed (so the first item would be MyFonts.ttc#1). However, this is unfortunate because
1772         inserting an item into the middle of a collection would throw off all content that uses the file.
1773         Instead, the spec has since changed to use PostScript names (so the content instead would say
1774         MyFonts.ttc#MyFont-Regular).
1775
1776         Test: fast/text/font-collection.html
1777
1778         * css/CSSFontFaceSource.cpp:
1779         (WebCore::CSSFontFaceSource::load):
1780         * loader/cache/CachedFont.cpp:
1781         (WebCore::CachedFont::calculateItemInCollection const):
1782         (WebCore::CachedFont::ensureCustomFontData):
1783         (WebCore::CachedFont::createCustomFontData):
1784         (WebCore::CachedFont::calculateIndex const): Deleted.
1785         * loader/cache/CachedFont.h:
1786         * platform/graphics/mac/FontCustomPlatformData.cpp:
1787         (WebCore::createFontCustomPlatformData):
1788         * platform/graphics/mac/FontCustomPlatformData.h:
1789
1790 2018-05-02  Brian Burg  <bburg@apple.com>
1791
1792         Web Inspector: opt out of process swap on navigation if a Web Inspector frontend is connected
1793         https://bugs.webkit.org/show_bug.cgi?id=184861
1794         <rdar://problem/39153768>
1795
1796         Reviewed by Ryosuke Niwa.
1797
1798         Notify the client of the current connection count whenever a frontend connects or disconnects.
1799
1800         Covered by new API test.
1801
1802         * inspector/InspectorClient.h:
1803         (WebCore::InspectorClient::frontendCountChanged):
1804         * inspector/InspectorController.cpp:
1805         (WebCore::InspectorController::connectFrontend):
1806         (WebCore::InspectorController::disconnectFrontend):
1807         (WebCore::InspectorController::disconnectAllFrontends):
1808         * inspector/InspectorController.h:
1809
1810 2018-05-02  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1811
1812         [GStreamer] Remove unneeded include of gstgldisplay_wayland.h after r228866 and r229022
1813         https://bugs.webkit.org/show_bug.cgi?id=185207
1814
1815         Reviewed by Michael Catanzaro.
1816
1817         Remove unneeded include of gstgldisplay_wayland.h
1818
1819         No new tests, no change in behaviour.
1820
1821         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1822
1823 2018-05-02  Chris Dumez  <cdumez@apple.com>
1824
1825         document.open() event listener removal is not immediate
1826         https://bugs.webkit.org/show_bug.cgi?id=185191
1827
1828         Reviewed by Darin Adler.
1829
1830         We need to make sure we set the 'wasremoved' flag on RegisteredEventListeners
1831         whenever they get removed from the EventListenerMap. We were doing so correctly
1832         in EventListenerMap:remove() but not EventListenerMap::clear(). This patch
1833         updates clear() accordingly.
1834
1835         The reason we need to set this flag is that RegisteredEventListeners is RefCounted
1836         and EventTarget::fireEventListeners() may be currently running and calling
1837         each listener one by one, holding a reference to all listener of a given event.
1838
1839         Test: fast/dom/Document/document-open-removes-all-listeners.html
1840
1841         * dom/EventListenerMap.cpp:
1842         (WebCore::EventListenerMap::clear):
1843
1844 2018-05-02  Zalan Bujtas <zalan@apple.com>
1845
1846         Use WeakPtr in GridCell
1847         https://bugs.webkit.org/show_bug.cgi?id=185180
1848         <rdar://problem/39432165>
1849
1850         Reviewed by Antti Koivisto.
1851
1852         Since GridCell does not own the renderers, it should
1853         construct weak pointers.
1854
1855         Unable to create a reliably reproducible test case.
1856
1857         * rendering/Grid.cpp:
1858         (WebCore::Grid::insert):
1859         (WebCore::GridIterator::nextGridItem):
1860         * rendering/Grid.h:
1861         * rendering/RenderGrid.cpp:
1862         (WebCore::RenderGrid::firstLineBaseline const):
1863
1864 2018-05-02  Eric Carlson  <eric.carlson@apple.com>
1865
1866         [iOS] Provide audio route information when invoking AirPlay picker
1867         https://bugs.webkit.org/show_bug.cgi?id=185199
1868         <rdar://problem/39853103>
1869
1870         Reviewed by Jer Noble.
1871
1872         No new tests, this requires a specific hardware setup.
1873
1874         * dom/Document.cpp:
1875         (WebCore::Document::showPlaybackTargetPicker): Pass route sharing policy and routing context UID.
1876         * dom/Document.h:
1877
1878         * html/MediaElementSession.cpp:
1879         (WebCore::MediaElementSession::showPlaybackTargetPicker): Ditto.
1880
1881         * loader/EmptyClients.h:
1882         * page/ChromeClient.h:
1883
1884         * page/Page.cpp:
1885         (WebCore::Page::showPlaybackTargetPicker): Ditto.
1886         * page/Page.h:
1887
1888         * platform/audio/AudioSession.cpp:
1889         (WebCore::AudioSession::routeSharingPolicy const): Empty implementation for non-iOS ports.
1890         (WebCore::routingContextUID const): Ditto.
1891         * platform/audio/AudioSession.h:
1892
1893         * platform/audio/ios/AudioSessionIOS.mm:
1894         (WebCore::AudioSession::routeSharingPolicy const): Return the route sharing policy.
1895         (WebCore::AudioSession::routingContextUID const): Return the route context UID.
1896
1897 2018-05-02  Dean Jackson  <dino@apple.com>
1898
1899         Draw SystemPreview badge to specification on iOS
1900         https://bugs.webkit.org/show_bug.cgi?id=185203
1901         <rdar://problem/39908855>
1902
1903         Reviewed by Tim Horton.
1904
1905         Use CoreImage to render a badge with a blurred background,
1906         at particular sizes.
1907
1908         This will be tested internally while we're getting artwork
1909         from WebKitAdditions.
1910
1911         * Configurations/WebCore.xcconfig: Link against CoreImage.
1912         * rendering/RenderThemeIOS.h:
1913         * rendering/RenderThemeIOS.mm:
1914         (WebCore::RenderThemeIOS::paintSystemPreviewBadge): New function
1915         in the iOS platform RenderTheme that draws the system preview.
1916
1917 2018-05-01  Brent Fulgham  <bfulgham@apple.com>
1918
1919         Prevent Debug ASSERT when changing forms
1920         https://bugs.webkit.org/show_bug.cgi?id=185173
1921         <rdar://problem/39738669>
1922
1923         Reviewed by Ryosuke Niwa.
1924
1925         Form submission could trigger a debug assertion during validation when
1926         a form is changed during an input submission. Fix this by cleaning up
1927         the event handling logic and make it more consistent with modern WebKit
1928         coding style.
1929
1930         Test: fast/forms/form-submission-crash-3.html
1931
1932         * html/HTMLButtonElement.cpp:
1933         (WebCore::HTMLButtonElement::defaultEventHandler): Make sure layout runs before
1934         attempting to perform event handling.
1935         * html/HTMLFormElement.cpp:
1936         (WebCore::HTMLFormElement::reportValidity): Ditto.
1937         (WebCore::HTMLFormElement::validateInteractively): Remove call to perform layout here,
1938         since we expect this to happen earlier in the layout pass. Add an assertion that the
1939         tree is not dirty.
1940         * html/ImageInputType.cpp:
1941         (WebCore::ImageInputType::handleDOMActivateEvent): Make sure layout runs before
1942         attempting to perform event handling.
1943         * html/SubmitInputType.cpp:
1944         (WebCore::SubmitInputType::handleDOMActivateEvent): Ditto.
1945
1946 2018-05-02  Jer Noble  <jer.noble@apple.com>
1947
1948         Unreviewed; address review comments made before landing r231231.
1949
1950         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1951         (VideoFullscreenControllerContext::volume const):
1952
1953 2018-05-02  Jer Noble  <jer.noble@apple.com>
1954
1955         Pipe volume through PlaybackSessionManager/Proxy.
1956         https://bugs.webkit.org/show_bug.cgi?id=185182
1957
1958         Reviewed by Eric Carlson.
1959
1960         Add support for the volume property to PlaybackSessionModel, and all its clients.
1961
1962         * platform/cocoa/PlaybackSessionModel.h:
1963         (WebCore::PlaybackSessionModelClient::volumeChanged):
1964         * platform/cocoa/PlaybackSessionModelMediaElement.h:
1965         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
1966         (WebCore::PlaybackSessionModelMediaElement::updateForEventName):
1967         (WebCore::PlaybackSessionModelMediaElement::setVolume):
1968         (WebCore::PlaybackSessionModelMediaElement::volume const):
1969         * platform/ios/PlaybackSessionInterfaceAVKit.h:
1970         * platform/ios/PlaybackSessionInterfaceAVKit.mm:
1971         (WebCore::PlaybackSessionInterfaceAVKit::volumeChanged):
1972         * platform/ios/WebAVPlayerController.h:
1973         * platform/ios/WebAVPlayerController.mm:
1974         (-[WebAVPlayerController volume]):
1975         (-[WebAVPlayerController setVolume:]):
1976         (-[WebAVPlayerController volumeChanged:]):
1977         (-[WebAVPlayerController resetMediaState]):
1978         * platform/ios/WebVideoFullscreenControllerAVKit.mm:
1979         (VideoFullscreenControllerContext::volumeChanged):
1980         (VideoFullscreenControllerContext::volume const):
1981         (VideoFullscreenControllerContext::setVolume):
1982
1983 2018-05-01  Yusuke Suzuki  <utatane.tea@gmail.com>
1984
1985         Unreviewed, fix build in WinCairo
1986         https://bugs.webkit.org/show_bug.cgi?id=185169
1987
1988         * bindings/js/JSDOMWindowBase.cpp:
1989         (WebCore::JSDOMWindowBase::instantiateStreaming):
1990         * bindings/js/JSDOMWindowBase.h:
1991
1992 2018-05-01  Yusuke Suzuki  <utatane.tea@gmail.com>
1993
1994         Use default std::optional if it is provided
1995         https://bugs.webkit.org/show_bug.cgi?id=185159
1996
1997         Reviewed by JF Bastien.
1998
1999         * Modules/mediastream/RTCPeerConnection.cpp:
2000         (WebCore::iceServersFromConfiguration):
2001         (WebCore::RTCPeerConnection::setConfiguration):
2002         * css/parser/CSSParser.cpp:
2003         (WebCore::CSSParser::parseSystemColor):
2004         * css/parser/CSSParser.h:
2005         * dom/DatasetDOMStringMap.cpp:
2006         (WebCore::DatasetDOMStringMap::item const):
2007         (WebCore::DatasetDOMStringMap::namedItem const):
2008         (WebCore:: const): Deleted.
2009         * dom/DatasetDOMStringMap.h:
2010         * dom/Element.cpp:
2011         (WebCore::Element::insertAdjacentHTML):
2012         * dom/Element.h:
2013         * inspector/DOMEditor.cpp:
2014         * platform/network/curl/CurlFormDataStream.cpp:
2015         (WebCore::CurlFormDataStream::getPostData):
2016         (): Deleted.
2017         * platform/network/curl/CurlFormDataStream.h:
2018         * testing/MockCDMFactory.cpp:
2019         (WebCore::MockCDMFactory::keysForSessionWithID const):
2020         (WebCore::MockCDMInstance::updateLicense):
2021         (WebCore:: const): Deleted.
2022         * testing/MockCDMFactory.h:
2023
2024 2018-05-01  Chris Dumez  <cdumez@apple.com>
2025
2026         Add release assertions in CFNetwork's SocketStreamHandleImpl to help debug a threading issue
2027         https://bugs.webkit.org/show_bug.cgi?id=185181
2028
2029         Reviewed by Geoffrey Garen.
2030
2031         Add release assertions in CFNetwork's SocketStreamHandleImpl to help debug a threading issue
2032         on iOS WebKitLegacy (Bug 185073). It appears readStreamCallback() can get called on the UIThread,
2033         which should not be possible if scheduleStreams() was called on the WebThread, as it is supposed
2034         to. The new release assertion in scheduleStreams() should tell us if somebody is calling it from
2035         the UIthread instead of the WebThread on iOS WebKitLegacy.
2036
2037         * platform/network/cf/SocketStreamHandleImplCFNet.cpp:
2038         (WebCore::SocketStreamHandleImpl::scheduleStreams):
2039         (WebCore::SocketStreamHandleImpl::readStreamCallback):
2040
2041 2018-05-01  Wenson Hsieh  <wenson_hsieh@apple.com>
2042
2043         Unreviewed, remove an unused variable in RuntimeEnabledFeatures.h
2044
2045         * page/RuntimeEnabledFeatures.h:
2046
2047 2018-05-01  Oleksandr Skachkov  <gskachkov@gmail.com>
2048
2049         Fix build error after r231194
2050         https://bugs.webkit.org/show_bug.cgi?id=185169
2051
2052         Reviewed by JF Bastien.
2053
2054         Prevent compile error in iOS Simulator debug build
2055         by tagging function
2056
2057         * bindings/js/JSDOMWindowBase.cpp:
2058         (WebCore::JSDOMWindowBase::compileStreaming):
2059         (WebCore::JSDOMWindowBase::instantiateStreaming):
2060
2061 2018-05-01  Oleksandr Skachkov  <gskachkov@gmail.com>
2062
2063         WebAssembly: add support for stream APIs - JavaScript API
2064         https://bugs.webkit.org/show_bug.cgi?id=183442
2065
2066         Reviewed by Yusuke Suzuki and JF Bastien.
2067
2068         Add WebAssembly streaming API to WebCore.
2069
2070         * Configurations/FeatureDefines.xcconfig:
2071         * bindings/js/JSDOMWindowBase.cpp:
2072         (WebCore::tryAllocate):
2073         (WebCore::isResponseCorrect):
2074         (WebCore::handleResponseOnStreamingAction):
2075         (WebCore::JSDOMWindowBase::compileStreaming):
2076         (WebCore::JSDOMWindowBase::instantiateStreaming):
2077         * bindings/js/JSDOMWindowBase.h:
2078         * bindings/js/JSRemoteDOMWindowBase.cpp:
2079         * bindings/js/JSWorkerGlobalScopeBase.cpp:
2080
2081 2018-04-30  Myles C. Maxfield  <mmaxfield@apple.com>
2082
2083         Improve the performance of FontCascadeDescription's effectiveFamilies
2084         https://bugs.webkit.org/show_bug.cgi?id=184720
2085         <rdar://problem/38970927>
2086
2087         Reviewed by Simon Fraser.
2088
2089         The page that had the performance problem renders many different Chinese characters in system-ui
2090         with only a small number of individual fonts. It turns out we were calling into the system-ui
2091         machinery for each character in order to opportunistically start loading data URLs (see also:
2092         https://bugs.webkit.org/show_bug.cgi?id=175845). These data URLS will never represent the system
2093         font, so we don't need to invoke the system-ui machinery at all.
2094
2095         This patch makes a 92x performance improvement on the associated performance test. This test is
2096         designed to test Chinese text rendered with system-ui.
2097
2098         Performance test: Layout/system-ui.html
2099
2100         * platform/graphics/FontCascadeFonts.cpp:
2101         (WebCore::opportunisticallyStartFontDataURLLoading):
2102
2103 2018-04-30  Jer Noble  <jer.noble@apple.com>
2104
2105         <img src=mp4> does not display on ios despite Accept: video/* advertisement
2106         https://bugs.webkit.org/show_bug.cgi?id=185029
2107         <rdar://problem/39771989>
2108
2109         Reviewed by Eric Carlson.
2110
2111         Returning "NO" from resourceLoader:shouldWaitForLoadingOfResource: signals that the load failed,
2112         even if the resource request is successfully fulfilled prior to the return. Always return YES in
2113         the case that loading succeeded.
2114
2115         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
2116         (-[WebCoreSharedBufferResourceLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
2117
2118 2018-04-30  Zalan Bujtas  <zalan@apple.com>
2119
2120         REGRESSION(r230914) Selecting text on this apple.com page makes it vanish
2121         https://bugs.webkit.org/show_bug.cgi?id=185142
2122         <rdar://problem/39821446>
2123
2124         Reviewed by Simon Fraser.
2125
2126         Set the overflow rect on the inline textbox when needed.
2127
2128         Test: fast/text/simple-line-layout-selection-with-overflow.html
2129
2130         * rendering/SimpleLineLayoutFunctions.cpp:
2131         (WebCore::SimpleLineLayout::initializeInlineTextBox):
2132         (WebCore::SimpleLineLayout::generateLineBoxTree):
2133         (WebCore::SimpleLineLayout::initializeInlineBox): Deleted.
2134
2135 2018-04-30  JF Bastien  <jfbastien@apple.com>
2136
2137         Use some C++17 features
2138         https://bugs.webkit.org/show_bug.cgi?id=185135
2139
2140         Reviewed by Alex Christensen.
2141
2142         As discussed here [0] let's move WebKit to a subset of C++17. We
2143         now require GCC 6 [1] which means that, according to [2] we can
2144         use the following C++17 language features (I removed some
2145         uninteresting ones):
2146
2147          - New auto rules for direct-list-initialization
2148          - static_assert with no message
2149          - typename in a template template parameter
2150          - Nested namespace definition
2151          - Attributes for namespaces and enumerators
2152          - u8 character literals
2153          - Allow constant evaluation for all non-type template arguments
2154          - Fold Expressions
2155          - Unary fold expressions and empty parameter packs
2156          - __has_include in preprocessor conditional
2157          - Differing begin and end types in range-based for
2158          - Improving std::pair and std::tuple
2159
2160         Consult the Tony Tables [3] to see before / after examples.
2161
2162         Of course we can use any library feature if we're willing to
2163         import them to WTF (and they don't require language support).
2164
2165
2166           [0]: https://lists.webkit.org/pipermail/webkit-dev/2018-March/029922.html
2167           [1]: https://trac.webkit.org/changeset/231152/webkit
2168           [2]: https://en.cppreference.com/w/cpp/compiler_support
2169           [3]: https://github.com/tvaneerd/cpp17_in_TTs/blob/master/ALL_IN_ONE.md
2170
2171         * DerivedSources.make:
2172         * platform/URLParser.cpp: work around an odd GCC 6 bug with class
2173           static value as a template parameter.
2174         (WebCore::URLParser::percentDecode):
2175         (WebCore::URLParser::domainToASCII):
2176         (WebCore::URLParser::hasForbiddenHostCodePoint):
2177         (WebCore::URLParser::parseHostAndPort):
2178         * platform/URLParser.h:
2179
2180 2018-04-30  Wenson Hsieh  <wenson_hsieh@apple.com>
2181
2182         [Extra zoom mode] Respect the existing shrink-to-fit attribute instead of using min-device-width
2183         https://bugs.webkit.org/show_bug.cgi?id=185132
2184         <rdar://problem/39834562>
2185
2186         Reviewed by Tim Horton.
2187
2188         Removes the `min-device-width` attribute added in r231095. Instead, we key this behavior off of the
2189         `shrink-to-fit` attribute introduced for multitasking on iPad, such that `shrink-to-fit=no` achieves the same
2190         behavior as `min-device-width=0` in extra zoom mode. See comments below for more detail.
2191
2192         Adjusted an existing layout test: fast/viewport/extrazoom/viewport-change-min-device-width.html.
2193
2194         * dom/ViewportArguments.cpp:
2195         (WebCore::setViewportFeature):
2196         (WebCore::operator<<):
2197         * dom/ViewportArguments.h:
2198
2199         Removes the `minDeviceWidth` viewport argument.
2200
2201         * page/RuntimeEnabledFeatures.h:
2202         (WebCore::RuntimeEnabledFeatures::setMinDeviceWidthEnabled): Deleted.
2203         (WebCore::RuntimeEnabledFeatures::minDeviceWidthEnabled const): Deleted.
2204
2205         Removes the runtime switch for `min-device-width`.
2206
2207         * page/ViewportConfiguration.cpp:
2208         (WebCore::platformDeviceWidthOverride):
2209
2210         Hard-code the override device width in extra zoom mode.
2211
2212         (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit const):
2213
2214         In extra zoom mode, override the device width only if shrink-to-fit has not been expliticly disabled, and the
2215         device width is less than the override device width.
2216
2217         (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
2218         (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const):
2219         (WebCore::ViewportConfiguration::updateConfiguration):
2220         (WebCore::ViewportConfiguration::updateMinimumLayoutSize):
2221
2222         Do not override the minimum layout size if `shrink-to-fit` has been explicitly explicitly disabled, or if the
2223         device width is greater than the override device width.
2224
2225         (WebCore::computedMinDeviceWidth): Deleted.
2226         (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const): Deleted.
2227         * page/ViewportConfiguration.h:
2228
2229 2018-04-30  Chris Nardi  <cnardi@chromium.org>
2230
2231         Serialize font-variation-settings with double-quotes per spec
2232         https://bugs.webkit.org/show_bug.cgi?id=182542
2233
2234         Reviewed by Myles C. Maxfield.
2235
2236         According to the CSSOM spec [1], all strings should be serialized with double-quotes.
2237         The axis name in font-variation-settings was previously serialized with single-quotes;
2238         change this to double-quotes to match the spec and non-WebKit browsers.
2239
2240         [1]: https://drafts.csswg.org/cssom/#common-serializing-idioms
2241
2242         Updated fast/text/variations/getComputedStyle.html to test the change.
2243
2244         * css/CSSFontVariationValue.cpp:
2245         (WebCore::CSSFontVariationValue::customCSSText const):
2246
2247 2018-04-30  Chris Dumez  <cdumez@apple.com>
2248
2249         Fix bad use of RunLoop::main().dispatch() in MessagePort::dispatchMessages()
2250         https://bugs.webkit.org/show_bug.cgi?id=185134
2251
2252         Reviewed by Geoffrey Garen.
2253
2254         Fix bad use of RunLoop::main().dispatch() in MessagePort::dispatchMessages(). This code runs on iOS WebKitLegacy
2255         and it is therefore unsafe to use RunLoop::main() here. We want to use callOnMainThread() instead to run code on
2256         the WebThread.
2257
2258         * dom/MessagePort.cpp:
2259         (WebCore::MessagePort::dispatchMessages):
2260
2261 2018-04-30  Simon Fraser  <simon.fraser@apple.com>
2262
2263         Make color-filter affect caret-color
2264         https://bugs.webkit.org/show_bug.cgi?id=185129
2265         rdar://problem/39829066
2266
2267         Reviewed by Tim Horton.
2268         
2269         Transform the colors used to compare the caret color with the background through
2270         color-filter (since we want contrasting colors after filters are applied), and
2271         transform caret-color itself.
2272
2273         Test: css3/color-filters/color-filter-caret-color.html
2274
2275         * editing/FrameSelection.cpp:
2276         (WebCore::CaretBase::paintCaret const):
2277
2278 2018-04-30  Michael Catanzaro  <mcatanzaro@igalia.com>
2279
2280         [GTK] Webkit should spoof as Safari on a Mac when on Chase.com
2281         https://bugs.webkit.org/show_bug.cgi?id=185103
2282
2283         Reviewed by Carlos Garcia Campos.
2284
2285         Send a fake user agent to chase.com to make it work.
2286
2287         * platform/UserAgentQuirks.cpp:
2288         (WebCore::urlRequiresMacintoshPlatform):
2289         (WebCore::UserAgentQuirks::stringForQuirk): Also, remove this stale comment.
2290
2291 2018-04-29  Simon Fraser  <simon.fraser@apple.com>
2292
2293         Make color-filter affect <attachment>
2294         https://bugs.webkit.org/show_bug.cgi?id=185122
2295         rdar://problem/39818763
2296
2297         Reviewed by Tim Horton.
2298         
2299         Convert the colors used to render <attachment> through color-filter, except
2300         for those parts that render over the icon (like the progress bar).
2301
2302         Not easily testable.
2303
2304         * rendering/RenderThemeMac.mm:
2305         (WebCore::titleTextColorForAttachment):
2306         (WebCore::AttachmentLayout::layOutTitle):
2307         (WebCore::AttachmentLayout::layOutSubtitle):
2308         (WebCore::paintAttachmentIconBackground):
2309         (WebCore::paintAttachmentTitleBackground):
2310         (WebCore::paintAttachmentPlaceholderBorder):
2311
2312 2018-04-28  Simon Fraser  <simon.fraser@apple.com>
2313
2314         Fix color-filter to apply to SVG colors
2315         https://bugs.webkit.org/show_bug.cgi?id=185113
2316         rdar://problem/39665082
2317
2318         Reviewed by Dean Jackson.
2319         
2320         Convert SVG colors through color-filter operations for the places in SVG
2321         that use color, namely fill and stroke, gradients, lighting colors and
2322         drop-shadow.
2323
2324         Test: css3/color-filters/svg/color-filter-inline-svg.html
2325
2326         * rendering/svg/RenderSVGResourceGradient.cpp:
2327         (WebCore::RenderSVGResourceGradient::applyResource):
2328         * rendering/svg/RenderSVGResourceGradient.h:
2329         * rendering/svg/RenderSVGResourceLinearGradient.cpp:
2330         (WebCore::RenderSVGResourceLinearGradient::buildGradient const):
2331         * rendering/svg/RenderSVGResourceLinearGradient.h:
2332         * rendering/svg/RenderSVGResourceRadialGradient.cpp:
2333         (WebCore::RenderSVGResourceRadialGradient::buildGradient const):
2334         * rendering/svg/RenderSVGResourceRadialGradient.h:
2335         * rendering/svg/RenderSVGResourceSolidColor.cpp:
2336         (WebCore::RenderSVGResourceSolidColor::applyResource):
2337         * svg/SVGFEDiffuseLightingElement.cpp:
2338         (WebCore::SVGFEDiffuseLightingElement::setFilterEffectAttribute):
2339         (WebCore::SVGFEDiffuseLightingElement::build):
2340         * svg/SVGFEDropShadowElement.cpp:
2341         (WebCore::SVGFEDropShadowElement::build):
2342         * svg/SVGFEFloodElement.cpp:
2343         (WebCore::SVGFEFloodElement::build):
2344         * svg/SVGFESpecularLightingElement.cpp:
2345         (WebCore::SVGFESpecularLightingElement::setFilterEffectAttribute):
2346         (WebCore::SVGFESpecularLightingElement::build):
2347
2348 2018-04-29  Michael Catanzaro  <mcatanzaro@igalia.com>
2349
2350         [CMake] Require GCC 6
2351         https://bugs.webkit.org/show_bug.cgi?id=184985
2352
2353         Reviewed by Alex Christensen.
2354
2355         Remove a GCC 5 fallback path. This seems to be the only such fallback path in WebKit.
2356
2357         * platform/graphics/FourCC.h:
2358         (WebCore::FourCC::FourCC):
2359
2360 2018-04-29  Zalan Bujtas  <zalan@apple.com>
2361
2362         [LFC] Implement Display::Box functions
2363         https://bugs.webkit.org/show_bug.cgi?id=185116
2364
2365         Reviewed by Antti Koivisto.
2366
2367         * layout/displaytree/DisplayBox.cpp:
2368         (WebCore::Display::Box::Box):
2369         (WebCore::Display::Box::~Box):
2370         (WebCore::Display::Box::marginBox const):
2371         (WebCore::Display::Box::borderBox const):
2372         (WebCore::Display::Box::paddingBox const):
2373         (WebCore::Display::Box::contentBox const):
2374         * layout/displaytree/DisplayBox.h:
2375         (WebCore::Display::Box::rect const):
2376         (WebCore::Display::Box::top const):
2377         (WebCore::Display::Box::left const):
2378         (WebCore::Display::Box::bottom const):
2379         (WebCore::Display::Box::right const):
2380         (WebCore::Display::Box::topLeft const):
2381         (WebCore::Display::Box::bottomRight const):
2382         (WebCore::Display::Box::size const):
2383         (WebCore::Display::Box::width const):
2384         (WebCore::Display::Box::height const):
2385         (WebCore::Display::Box::marginTop const):
2386         (WebCore::Display::Box::marginLeft const):
2387         (WebCore::Display::Box::marginBottom const):
2388         (WebCore::Display::Box::marginRight const):
2389         (WebCore::Display::Box::parent const):
2390         (WebCore::Display::Box::nextSibling const):
2391         (WebCore::Display::Box::previousSibling const):
2392         (WebCore::Display::Box::firstChild const):
2393         (WebCore::Display::Box::lastChild const):
2394         (WebCore::Display::Box::setRect):
2395         (WebCore::Display::Box::setTopLeft):
2396         (WebCore::Display::Box::setTop):
2397         (WebCore::Display::Box::setLeft):
2398         (WebCore::Display::Box::setSize):
2399         (WebCore::Display::Box::setWidth):
2400         (WebCore::Display::Box::setHeight):
2401         (WebCore::Display::Box::setMarginTop):
2402         (WebCore::Display::Box::setMarginLeft):
2403         (WebCore::Display::Box::setMarginBottom):
2404         (WebCore::Display::Box::setMarginRight):
2405         (WebCore::Display::Box::setBorderTop):
2406         (WebCore::Display::Box::setBorderLeft):
2407         (WebCore::Display::Box::setBorderBottom):
2408         (WebCore::Display::Box::setBorderRight):
2409         (WebCore::Display::Box::setPaddingTop):
2410         (WebCore::Display::Box::setPaddingLeft):
2411         (WebCore::Display::Box::setPaddingBottom):
2412         (WebCore::Display::Box::setPaddingRight):
2413         (WebCore::Display::Box::setParent):
2414         (WebCore::Display::Box::setNextSibling):
2415         (WebCore::Display::Box::setPreviousSibling):
2416         (WebCore::Display::Box::setFirstChild):
2417         (WebCore::Display::Box::setLastChild):
2418
2419 2018-04-29  Youenn Fablet  <youenn@apple.com>
2420
2421         Make RestrictedHTTPResponseAccess flag true by default
2422         https://bugs.webkit.org/show_bug.cgi?id=185089
2423
2424         Reviewed by Geoffrey Garen.
2425
2426         * page/RuntimeEnabledFeatures.h:
2427
2428 2018-04-28  Sihui Liu  <sihui_liu@apple.com>
2429
2430         [Cocoa] Set HTTPOnly flag when converting Cookie to NSHTTPCookie
2431         https://bugs.webkit.org/show_bug.cgi?id=185052
2432
2433         Reviewed by Geoffrey Garen.
2434
2435         Set HTTPOnly for NSHTTPCookie when it's converted from Cookie, so the WebKit APIs could 
2436         create NSHTTPCookie with correct HTTPOnly flag. Also, reverted the change made to operator
2437         function because we want the Cookie class to act as a wrapper for NSHTTPCookie and leverage
2438         its equal function. 
2439
2440         Modified API test: WebKit.WKHTTPCookieStoreHttpOnly
2441
2442         * platform/network/cocoa/CookieCocoa.mm:
2443         (WebCore::Cookie::operator NSHTTPCookie * const):
2444         (WebCore::Cookie::operator== const):
2445         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2446         (WebCore::NetworkStorageSession::deleteCookie):
2447
2448 2018-04-28  Zalan Bujtas  <zalan@apple.com>
2449
2450         [LFC] Add LayoutTreeBuilder class to generate the layout tree
2451         https://bugs.webkit.org/show_bug.cgi?id=185108
2452
2453         Reviewed by Antti Koivisto.
2454
2455         This is for testing purposes.
2456
2457         * WebCore.xcodeproj/project.pbxproj:
2458         * layout/FormattingState.cpp:
2459         (WebCore::Layout::FormattingState::~FormattingState):
2460         * layout/FormattingState.h:
2461         * layout/LayoutContext.h:
2462         * layout/blockformatting/BlockFormattingState.cpp:
2463         (WebCore::Layout::BlockFormattingState::~BlockFormattingState):
2464         * layout/blockformatting/BlockFormattingState.h:
2465         * layout/inlineformatting/InlineFormattingState.cpp:
2466         (WebCore::Layout::InlineFormattingState::~InlineFormattingState):
2467         * layout/inlineformatting/InlineFormattingState.h:
2468         * layout/layouttree/LayoutBlockContainer.h:
2469         * layout/layouttree/LayoutBox.h:
2470         * layout/layouttree/LayoutContainer.h:
2471         * layout/layouttree/LayoutInlineContainer.h:
2472         * layout/layouttree/LayoutTreeBuilder.cpp: Added.
2473         (WebCore::Layout::TreeBuilder::createLayoutTree):
2474         (WebCore::Layout::TreeBuilder::createSubTree):
2475         (WebCore::Layout::outputLayoutBox):
2476         (WebCore::Layout::outputLayoutTree):
2477         (WebCore::Layout::TreeBuilder::showLayoutTree):
2478         (WebCore::Layout::printLayoutTreeForLiveDocuments):
2479         * layout/layouttree/LayoutTreeBuilder.h: Copied from Source/WebCore/layout/layouttree/LayoutBlockContainer.h.
2480         * page/mac/PageMac.mm:
2481         (WebCore::Page::platformInitialize):
2482
2483 2018-04-28  Zalan Bujtas  <zalan@apple.com>
2484
2485         [LFC] Implement BlockMarginCollapse functions.
2486         https://bugs.webkit.org/show_bug.cgi?id=185036
2487
2488         Reviewed by Antti Koivisto.
2489
2490         * layout/blockformatting/BlockMarginCollapse.cpp:
2491         (WebCore::Layout::marginValue):
2492         (WebCore::Layout::BlockMarginCollapse::BlockMarginCollapse):
2493         (WebCore::Layout::BlockMarginCollapse::marginTop const):
2494         (WebCore::Layout::BlockMarginCollapse::marginBottom const):
2495         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithSibling const):
2496         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithSibling const):
2497         (WebCore::Layout::BlockMarginCollapse::isMarginTopCollapsedWithParent const):
2498         (WebCore::Layout::BlockMarginCollapse::isMarginBottomCollapsedWithParent const):
2499         (WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginTop const):
2500         (WebCore::Layout::BlockMarginCollapse::nonCollapsedMarginBottom const):
2501         (WebCore::Layout::BlockMarginCollapse::collapsedMarginTopFromFirstChild const):
2502         (WebCore::Layout::BlockMarginCollapse::collapsedMarginBottomFromLastChild const):
2503         (WebCore::Layout::BlockMarginCollapse::hasAdjoiningMarginTopAndBottom const):
2504         * layout/blockformatting/BlockMarginCollapse.h:
2505         * layout/layouttree/LayoutBox.h:
2506         (WebCore::Layout::Box::style const):
2507
2508 2018-04-27  David Kilzer  <ddkilzer@apple.com>
2509
2510         Add logging when SpringBoard enables WebThread
2511         <https://webkit.org/b/185100>
2512         <rdar://problem/39746542>
2513
2514         Reviewed by Daniel Bates.
2515
2516         * platform/RuntimeApplicationChecks.h:
2517         (WebCore::IOSApplication::isSpringBoard): Add declaration.
2518         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
2519         (WebCore::IOSApplication::isSpringBoard): Add implementation.
2520         * platform/ios/wak/WebCoreThread.mm:
2521         (WebThreadEnable): Call RELEASE_LOG_FAULT() if this is called by
2522         SpringBoard.
2523
2524 2018-04-27  Keith Rollin  <krollin@apple.com>
2525
2526         Fix crash in DocumentLoader::startLoadingMainResource
2527         https://bugs.webkit.org/show_bug.cgi?id=185088
2528         rdar://problem/39689263
2529
2530         Reviewed by Chris Dumez.
2531
2532         Add a "protectedThis" to address a case where a deleted "this" was
2533         accessed in a RELEASE_LOG statement.
2534
2535         No new tests -- covered by existing tests, which now pass.
2536
2537         * loader/DocumentLoader.cpp:
2538         (WebCore::DocumentLoader::startLoadingMainResource):
2539
2540 2018-04-27  Simon Fraser  <simon.fraser@apple.com>
2541
2542         Implement color-filter for text stroke
2543         https://bugs.webkit.org/show_bug.cgi?id=185098
2544
2545         Reviewed by Alan Bujtas.
2546         
2547         Transform the text stroke color through color-filter.
2548
2549         Test: css3/color-filters/color-filter-text-stroke.html
2550
2551         * rendering/TextPaintStyle.cpp:
2552         (WebCore::computeTextPaintStyle):
2553
2554 2018-04-27  Simon Fraser  <simon.fraser@apple.com>
2555
2556         Implement animation for color-filter
2557         https://bugs.webkit.org/show_bug.cgi?id=185092
2558         rdar://problem/39773810
2559
2560         Reviewed by Tim Horton.
2561         
2562         Implement animation of color-filter.
2563         
2564         This requires tracking whether the color-filter function lists match for both old and new
2565         animation code paths.
2566         
2567         The filter-related ProperyWappers in CSSPropertyAnimation are cleaned up to use a single wrapper,
2568         which has to pass the propertyID to the blend function so we know which "lists match" to check.
2569         This wrapper reports that its accelerated for filter and backdrop-filter, but not color-filter.
2570
2571         Test: css3/color-filters/color-filter-animation.html
2572
2573         * animation/CSSPropertyBlendingClient.h:
2574         * animation/KeyframeEffectReadOnly.cpp:
2575         (WebCore::KeyframeEffectReadOnly::setBlendingKeyframes):
2576         (WebCore::KeyframeEffectReadOnly::checkForMatchingColorFilterFunctionLists):
2577         * animation/KeyframeEffectReadOnly.h:
2578         * page/animation/AnimationBase.h:
2579         * page/animation/CSSPropertyAnimation.cpp:
2580         (WebCore::blendFunc):
2581         (WebCore::PropertyWrapperFilter::PropertyWrapperFilter):
2582         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2583         (WebCore::PropertyWrapperAcceleratedFilter::PropertyWrapperAcceleratedFilter): Deleted.
2584         (WebCore::PropertyWrapperAcceleratedBackdropFilter::PropertyWrapperAcceleratedBackdropFilter): Deleted.
2585         (WebCore::PropertyWrapperAcceleratedBackdropFilter::animationIsAccelerated const): Deleted.
2586         (WebCore::PropertyWrapperAcceleratedBackdropFilter::blend const): Deleted.
2587         * page/animation/ImplicitAnimation.cpp:
2588         (WebCore::ImplicitAnimation::reset):
2589         (WebCore::ImplicitAnimation::checkForMatchingColorFilterFunctionLists):
2590         * page/animation/ImplicitAnimation.h:
2591         * page/animation/KeyframeAnimation.cpp:
2592         (WebCore::KeyframeAnimation::KeyframeAnimation):
2593         (WebCore::KeyframeAnimation::checkForMatchingColorFilterFunctionLists):
2594         * page/animation/KeyframeAnimation.h:
2595
2596 2018-04-27  Zalan Bujtas  <zalan@apple.com>
2597
2598         [LFC] Add FormattingContext::computeWidth/computeHeight logic.
2599         https://bugs.webkit.org/show_bug.cgi?id=185091
2600
2601         Reviewed by Antti Koivisto.
2602
2603         Inflow width and height can't really be computed without knowing the exact context. 
2604
2605         * layout/FormattingContext.cpp:
2606         (WebCore::Layout::FormattingContext::computeWidth const):
2607         (WebCore::Layout::FormattingContext::computeHeight const):
2608         (WebCore::Layout::FormattingContext::computeOutOfFlowWidth const):
2609         (WebCore::Layout::FormattingContext::computeFloatingWidth const):
2610         (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
2611         (WebCore::Layout::FormattingContext::computeFloatingHeight const):
2612         * layout/FormattingContext.h:
2613         * layout/blockformatting/BlockFormattingContext.cpp:
2614         (WebCore::Layout::BlockFormattingContext::computeInFlowWidth const):
2615         (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const):
2616         (WebCore::Layout::BlockFormattingContext::computeWidth const): Deleted.
2617         (WebCore::Layout::BlockFormattingContext::computeHeight const): Deleted.
2618         * layout/blockformatting/BlockFormattingContext.h:
2619         * layout/inlineformatting/InlineFormattingContext.cpp:
2620         (WebCore::Layout::InlineFormattingContext::computeInFlowWidth const):
2621         (WebCore::Layout::InlineFormattingContext::computeInFlowHeight const):
2622         * layout/inlineformatting/InlineFormattingContext.h:
2623
2624 2018-04-27  Chris Dumez  <cdumez@apple.com>
2625
2626         Use WindowProxy instead of DOMWindow in our IDL
2627         https://bugs.webkit.org/show_bug.cgi?id=185022
2628
2629         Reviewed by Sam Weinig.
2630
2631         Stop using DOMWindow in all of our IDL files and use WindowProxy as
2632         per their respective specifications. As a result, the implementation
2633         as also updated to use WindowProxy type instead of DOMWindow.
2634
2635         * WebCore.xcodeproj/project.pbxproj:
2636         * bindings/js/JSDOMConvertWindowProxy.h: Removed.
2637         * bindings/js/JSWindowProxy.cpp:
2638         (WebCore::JSWindowProxy::windowProxy const):
2639         (WebCore::JSWindowProxy::toWrapped):
2640         * bindings/js/JSWindowProxy.h:
2641         (WebCore::window):
2642         Use static_cast<>() instead of jsCast<>() because jsCast<>()
2643         relies on classInfo() which is not allowed to be called during
2644         JS sweep due to an assertion inside classInfo(). The JSWindowProxy
2645         objects are held strongly by the WindowProxy so we know the JSWindowProxy
2646         object is not getting destroyed here.
2647
2648         (WebCore::toJS):
2649         * bindings/js/WindowProxy.cpp:
2650         (WebCore::WindowProxy::globalObject):
2651         * bindings/js/WindowProxy.h:
2652         (WebCore::WindowProxy::frame const):
2653         * bindings/scripts/CodeGenerator.pm:
2654         (IsBuiltinType):
2655         (ComputeIsCallbackInterface):
2656         (ComputeIsCallbackFunction):
2657         * bindings/scripts/CodeGeneratorJS.pm:
2658         (AddToIncludesForIDLType):
2659         (GetBaseIDLType):
2660         (NativeToJSValueDOMConvertNeedsState):
2661         * bindings/scripts/test/JS/JSTestObj.cpp:
2662         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod9Body):
2663         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
2664         * bindings/scripts/test/TestObj.idl:
2665         * dom/CompositionEvent.cpp:
2666         (WebCore::CompositionEvent::CompositionEvent):
2667         (WebCore::CompositionEvent::initCompositionEvent):
2668         * dom/CompositionEvent.h:
2669         * dom/CompositionEvent.idl:
2670         * dom/Document.cpp:
2671         (WebCore::Document::defaultView const):
2672         * dom/Document.h:
2673         * dom/Document.idl:
2674         * dom/DocumentTouch.cpp:
2675         (WebCore::DocumentTouch::createTouch):
2676         * dom/DocumentTouch.h:
2677         * dom/DocumentTouch.idl:
2678         * dom/FocusEvent.cpp:
2679         (WebCore::FocusEvent::FocusEvent):
2680         * dom/FocusEvent.h:
2681         * dom/InputEvent.cpp:
2682         (WebCore::InputEvent::create):
2683         (WebCore::InputEvent::InputEvent):
2684         * dom/InputEvent.h:
2685         * dom/KeyboardEvent.cpp:
2686         (WebCore::KeyboardEvent::KeyboardEvent):
2687         (WebCore::KeyboardEvent::create):
2688         (WebCore::KeyboardEvent::initKeyboardEvent):
2689         (WebCore::KeyboardEvent::charCode const):
2690         * dom/KeyboardEvent.h:
2691         * dom/KeyboardEvent.idl:
2692         * dom/MessageEvent.h:
2693         * dom/MessageEvent.idl:
2694         * dom/MouseEvent.cpp:
2695         (WebCore::MouseEvent::create):
2696         (WebCore::MouseEvent::MouseEvent):
2697         (WebCore::MouseEvent::initMouseEvent):
2698         (WebCore::MouseEvent::initMouseEventQuirk):
2699         * dom/MouseEvent.h:
2700         * dom/MouseEvent.idl:
2701         * dom/MouseRelatedEvent.cpp:
2702         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
2703         (WebCore::MouseRelatedEvent::init):
2704         (WebCore::MouseRelatedEvent::frameViewFromWindowProxy):
2705         (WebCore::MouseRelatedEvent::initCoordinates):
2706         (WebCore::MouseRelatedEvent::documentToAbsoluteScaleFactor const):
2707         (WebCore::MouseRelatedEvent::computePageLocation):
2708         (WebCore::MouseRelatedEvent::locationInRootViewCoordinates const):
2709         * dom/MouseRelatedEvent.h:
2710         * dom/Node.cpp:
2711         * dom/SimulatedClick.cpp:
2712         * dom/TextEvent.cpp:
2713         (WebCore::TextEvent::create):
2714         (WebCore::TextEvent::createForPlainTextPaste):
2715         (WebCore::TextEvent::createForFragmentPaste):
2716         (WebCore::TextEvent::createForDrop):
2717         (WebCore::TextEvent::createForDictation):
2718         (WebCore::TextEvent::TextEvent):
2719         (WebCore::TextEvent::initTextEvent):
2720         * dom/TextEvent.h:
2721         * dom/TextEvent.idl:
2722         * dom/TouchEvent.idl:
2723         * dom/UIEvent.cpp:
2724         (WebCore::UIEvent::UIEvent):
2725         (WebCore::UIEvent::initUIEvent):
2726         * dom/UIEvent.h:
2727         (WebCore::UIEvent::create):
2728         (WebCore::UIEvent::view const):
2729         * dom/UIEvent.idl:
2730         * dom/UIEventInit.h:
2731         * dom/UIEventInit.idl:
2732         * dom/UIEventWithKeyState.h:
2733         (WebCore::UIEventWithKeyState::UIEventWithKeyState):
2734         * dom/WheelEvent.cpp:
2735         (WebCore::WheelEvent::WheelEvent):
2736         (WebCore::WheelEvent::create):
2737         (WebCore::WheelEvent::initWebKitWheelEvent):
2738         * dom/WheelEvent.h:
2739         * dom/WheelEvent.idl:
2740         * editing/AlternativeTextController.cpp:
2741         (WebCore::AlternativeTextController::insertDictatedText):
2742         * editing/Editor.cpp:
2743         (WebCore::Editor::pasteAsPlainText):
2744         (WebCore::Editor::pasteAsFragment):
2745         (WebCore::Editor::setComposition):
2746         * html/HTMLDocument.cpp:
2747         (WebCore::HTMLDocument::namedItem):
2748         * html/HTMLDocument.h:
2749         * html/HTMLDocument.idl:
2750         * html/HTMLFrameElement.idl:
2751         * html/HTMLFrameOwnerElement.cpp:
2752         (WebCore::HTMLFrameOwnerElement::contentWindow const):
2753         * html/HTMLFrameOwnerElement.h:
2754         * html/HTMLFrameSetElement.cpp:
2755         (WebCore::HTMLFrameSetElement::namedItem):
2756         * html/HTMLFrameSetElement.h:
2757         * html/HTMLFrameSetElement.idl:
2758         * html/HTMLIFrameElement.idl:
2759         * html/ImageDocument.cpp:
2760         * page/DOMWindow.cpp:
2761         (WebCore::PostMessageTimer::PostMessageTimer):
2762         (WebCore::PostMessageTimer::event):
2763         (WebCore::DOMWindow::postMessage):
2764         * page/DragController.cpp:
2765         (WebCore::DragController::dispatchTextInputEventFor):
2766         * page/EventHandler.cpp:
2767         (WebCore::EventHandler::handleTextInputEvent):
2768
2769 2018-04-27  Nan Wang  <n_wang@apple.com>
2770
2771         AX: Accessibility needs to know which part of the content view is visible on iOS
2772         https://bugs.webkit.org/show_bug.cgi?id=185085
2773         <rdar://problem/39801363>
2774
2775         Reviewed by Chris Fleizach.
2776
2777         Exposed unobscuredContentRect() to iOS accessibility object wrapper.
2778
2779         Test: accessibility/ios-simulator/unobscured-content-rect.html
2780
2781         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2782         (-[WebAccessibilityObjectWrapper accessibilityVisibleContentRect]):
2783
2784 2018-04-27  Simon Fraser  <simon.fraser@apple.com>
2785
2786         Refactor filter list checking code
2787         https://bugs.webkit.org/show_bug.cgi?id=185087
2788
2789         Reviewed by Alan Bujtas.
2790
2791         Deduplicate code between filter and backdrop-filter for checking whether function lists
2792         match, by making a shared function that takes a std::function.
2793         
2794         The call sites have to declare the return type (-> const FilterOperations&) to avoid std::function
2795         converting the return type into a value.
2796
2797         * animation/KeyframeEffectReadOnly.cpp:
2798         (WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists const):
2799         (WebCore::KeyframeEffectReadOnly::checkForMatchingFilterFunctionLists):
2800         (WebCore::KeyframeEffectReadOnly::checkForMatchingBackdropFilterFunctionLists):
2801         * animation/KeyframeEffectReadOnly.h:
2802         * page/animation/KeyframeAnimation.cpp:
2803         (WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists const):
2804         (WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists):
2805         (WebCore::KeyframeAnimation::checkForMatchingBackdropFilterFunctionLists):
2806         * page/animation/KeyframeAnimation.h:
2807
2808 2018-04-27  Chris Dumez  <cdumez@apple.com>
2809
2810         Regression(r222392?): Events can have a negative timestamp which causes app breakage
2811         https://bugs.webkit.org/show_bug.cgi?id=185040
2812         <rdar://problem/39638051>
2813
2814         Reviewed by Wenson Hsieh.
2815
2816         The real fix is in UIKit when generating the touch timestamps. However, this patch
2817         does some hardening to make sure that Event.timestamp can never return a negative
2818         value even if something goes wrong.
2819
2820         * dom/Event.cpp:
2821         (WebCore::Event::timeStampForBindings const):
2822
2823 2018-04-27  Christopher Reid  <chris.reid@sony.com>
2824
2825         URL::appendEncodedHostName is using the deprecated uidna_IDNToASCII function
2826         https://bugs.webkit.org/show_bug.cgi?id=184836
2827
2828         Reviewed by Alex Christensen.
2829
2830         Update URL::appendEncodedHostName to use uidna_nameToASCII as done in r208902.
2831
2832         Test: LayoutTests\fast\url\url-hostname-encoding.html
2833
2834         * platform/URL.cpp:
2835
2836 2018-04-27  Youenn Fablet  <youenn@apple.com>
2837
2838         CachedRawResource is not handling incremental data computation correctly
2839         https://bugs.webkit.org/show_bug.cgi?id=184936
2840         <rdar://problem/38798141>
2841
2842         Reviewed by Darin Adler.
2843
2844         * loader/cache/CachedRawResource.cpp:
2845         (WebCore::CachedRawResource::updateBuffer): Fixing style.
2846
2847 2018-04-27  Zalan Bujtas  <zalan@apple.com>
2848
2849         [LFC] Implement BlockFormattingContext::layout logic and its dependencies
2850         https://bugs.webkit.org/show_bug.cgi?id=185024
2851
2852         Reviewed by Antti Koivisto.
2853
2854         This patch implements the logic for block formatting context according to
2855         https://www.w3.org/TR/CSS22/visuren.html#block-formatting
2856
2857         1. Traverse the tree iteratively (in post-order fashion) and compute the width/static position for the containers as
2858         we visit the descendant nodes until we hit a leaf node.
2859         2. Compute the position/geometry of the leaf node and move over to its sibling(s).
2860         3. Finalize the container's height/final position as we climb back on the tree.
2861         4. Run layout on the out-of-flow descendants.  
2862
2863         Note that subtrees with a formatting context root need to be laid out completely before moving on to the next box.
2864         The formatting root box is laid out in the formatting context it lives in, however its descendants get laid out
2865         in a separate formatting context (excluding out-of-flow boxes that don't belong to the root). 
2866
2867         * layout/FloatingContext.cpp:
2868         (WebCore::Layout::FloatingContext::FloatingContext):
2869         (WebCore::Layout::FloatingContext::computePosition):
2870         * layout/FormattingContext.cpp:
2871         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
2872         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
2873         * layout/FormattingContext.h:
2874         * layout/LayoutContext.cpp:
2875         (WebCore::Layout::LayoutContext::updateLayout):
2876         (WebCore::Layout::LayoutContext::establishedFormattingState):
2877         * layout/LayoutContext.h:
2878         * layout/blockformatting/BlockFormattingContext.cpp:
2879         (WebCore::Layout::BlockFormattingContext::layout const):
2880         (WebCore::Layout::BlockFormattingContext::layout): Deleted.
2881         * layout/blockformatting/BlockFormattingContext.h:
2882         * layout/inlineformatting/InlineFormattingContext.cpp:
2883         (WebCore::Layout::InlineFormattingContext::layout const):
2884         (WebCore::Layout::InlineFormattingContext::layout): Deleted.
2885         * layout/inlineformatting/InlineFormattingContext.h:
2886
2887 2018-04-27  Youenn Fablet  <youenn@apple.com>
2888
2889         Use NetworkLoadChecker for XHR/fetch loads
2890         https://bugs.webkit.org/show_bug.cgi?id=184741
2891
2892         Reviewed by Chris Dumez.
2893
2894         Covered by existing tests.
2895
2896         * loader/DocumentThreadableLoader.cpp:
2897         (WebCore::DocumentThreadableLoader::shouldSetHTTPHeadersToKeep const):
2898         We need to set this option for CORS done in NetworkProcess.
2899         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
2900         Set httpHeadersTokeep when needed (service worker or CORS loads).
2901         Remove the synchronous disabling of preflight since this is now also done for asynchronous loads.
2902         (WebCore::DocumentThreadableLoader::checkURLSchemeAsCORSEnabled):
2903         Helper routine to make the same check for both simple and preflight case.
2904         This allows more consistent error logging between WK1 and WK2.
2905         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
2906         Skip preflight in case this is done in NetworkProcess.
2907         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
2908         (WebCore::isResponseComingFromNetworkProcess):
2909         (WebCore::DocumentThreadableLoader::redirectReceived):
2910         Bypass security checks when they are already done in NetworkProcess.
2911         (WebCore::DocumentThreadableLoader::didFail):
2912         In case of AccessControl error, it might be due to a CSP check done in NetworkProcess.
2913         Check it again to enable specific CSP console logging and error reporting.
2914         (WebCore::DocumentThreadableLoader::loadRequest):
2915         Recreating the error in case of synchronous loads to be able to log it adequately.
2916         (WebCore::DocumentThreadableLoader::isDoingSecurityChecksInNetworkProcess const):
2917         * loader/DocumentThreadableLoader.h:
2918         * loader/SubresourceLoader.cpp:
2919         (WebCore::SubresourceLoader::checkResponseCrossOriginAccessControl):
2920         Specific handling of SameOrigin credential mode for which cross-origin load will not use any credential.
2921         (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
2922         We keep the application headers so that DocumentThreadableLoader does not have to restart a brand new load.
2923         * loader/cache/CachedResourceLoader.cpp:
2924         (WebCore::CachedResourceLoader::requestResource):
2925         DocumentThreadableLoader is setting referrer and origin directly. Until we fix that, we remove them from the original requests
2926         as applications are not supposed to set these headers.
2927
2928 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2929
2930         Add an experimental feature flag for viewport "min-device-width"
2931         https://bugs.webkit.org/show_bug.cgi?id=185050
2932         <rdar://problem/39624038>
2933
2934         Reviewed by Tim Horton.
2935
2936         Add MinDeviceWidthEnabled as a new runtime-enabled feature.
2937
2938         * dom/ViewportArguments.cpp:
2939         (WebCore::setViewportFeature):
2940
2941         Gate the parsing of "min-device-width" on the runtime-enabled feature being flipped on.
2942
2943         * page/RuntimeEnabledFeatures.h:
2944         (WebCore::RuntimeEnabledFeatures::setMinDeviceWidthEnabled):
2945         (WebCore::RuntimeEnabledFeatures::minDeviceWidthEnabled const):
2946
2947 2018-04-27  Simon Fraser  <simon.fraser@apple.com>
2948
2949         Make color-filter transform gradient colors
2950         https://bugs.webkit.org/show_bug.cgi?id=185080
2951
2952         Reviewed by Zalan Bujtas.
2953         
2954         In CSSGradientValue::computeStops(), transform the color of each gradient color
2955         stop through the color filter. Having a color filter makes the gradient uncacheable.
2956         
2957         Color filters can add alpha, so we also have to fix up CSSGradientValue::knownToBeOpaque()
2958         to take a RenderStyle and convert the colors before testing opaqueness. Clean up some related
2959         functions to take const RenderStyle&.
2960
2961         Test: css3/color-filters/color-filter-gradients.html
2962
2963         * css/CSSCrossfadeValue.cpp:
2964         (WebCore::subimageKnownToBeOpaque):
2965         * css/CSSFilterImageValue.cpp:
2966         (WebCore::CSSFilterImageValue::knownToBeOpaque const):
2967         * css/CSSFilterImageValue.h:
2968         * css/CSSGradientValue.cpp:
2969         (WebCore::CSSGradientValue::image):
2970         (WebCore::CSSGradientValue::computeStops):
2971         (WebCore::CSSGradientValue::knownToBeOpaque const):
2972         (WebCore::CSSLinearGradientValue::createGradient):
2973         (WebCore::CSSRadialGradientValue::createGradient):
2974         * css/CSSGradientValue.h:
2975         * css/CSSImageGeneratorValue.cpp:
2976         (WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
2977         * css/CSSImageValue.cpp:
2978         (WebCore::CSSImageValue::knownToBeOpaque const):
2979         * css/CSSImageValue.h:
2980
2981 2018-04-26  Simon Fraser  <simon.fraser@apple.com>
2982
2983         Fix color-filter to apply to text decorations
2984         https://bugs.webkit.org/show_bug.cgi?id=185068
2985         <rdar://problem/39782136>
2986
2987         Reviewed by Alan Bujtas.
2988         
2989         Transform the colors of text shadows, and the shadows of text-decorations through
2990         the color-filter.
2991         
2992         Rather than clone the ShadowData stored on TextPainter and TextDecorationPainter
2993         (which would have awkward ownership implications) we pass the color filters through
2994         and just map the color through it before painting.
2995         
2996         Re-order the members of TextPainter a little to optimize padding.
2997         
2998         Also fix a bug where FilterOperations::transformColor() could transform an invalid
2999         color to a valid one; we never want this.
3000
3001         Tests: css3/color-filters/color-filter-text-decoration-shadow.html
3002                css3/color-filters/color-filter-text-shadow.html
3003
3004         * platform/graphics/filters/FilterOperations.cpp:
3005         (WebCore::FilterOperations::transformColor const):
3006         * rendering/InlineTextBox.cpp:
3007         (WebCore::InlineTextBox::paintMarkedTextForeground):
3008         (WebCore::InlineTextBox::paintMarkedTextDecoration):
3009         * rendering/TextDecorationPainter.cpp:
3010         (WebCore::TextDecorationPainter::paintTextDecoration):
3011         * rendering/TextDecorationPainter.h:
3012         (WebCore::TextDecorationPainter::setTextShadow):
3013         (WebCore::TextDecorationPainter::setShadowColorFilter):
3014         (WebCore::TextDecorationPainter::addTextShadow): Deleted.
3015         * rendering/TextPainter.cpp:
3016         (WebCore::ShadowApplier::ShadowApplier):
3017         (WebCore::TextPainter::paintTextWithShadows):
3018         (WebCore::TextPainter::paintTextAndEmphasisMarksIfNeeded): Simplify the logic that only paints the shadow
3019         on the first iteration.
3020         (WebCore::TextPainter::paintRange):
3021         * rendering/TextPainter.h:
3022         (WebCore::TextPainter::setShadowColorFilter):
3023         * rendering/svg/SVGInlineTextBox.cpp:
3024         (WebCore::SVGInlineTextBox::paintTextWithShadows):
3025
3026 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3027
3028         Rename minimumLayoutSize to viewLayoutSize
3029         https://bugs.webkit.org/show_bug.cgi?id=185050
3030         <rdar://problem/39624038>
3031
3032         Reviewed by Tim Horton.
3033
3034         See WebKit/ChangeLog for more information. No change in behavior.
3035
3036         * page/ViewportConfiguration.cpp:
3037         (WebCore::ViewportConfiguration::ViewportConfiguration):
3038         (WebCore::ViewportConfiguration::setViewLayoutSize):
3039
3040         Remove a FIXME comment that is addressed by this refactoring.
3041
3042         (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const):
3043         (WebCore::ViewportConfiguration::initialScaleFromSize const):
3044         (WebCore::ViewportConfiguration::minimumScale const):
3045         (WebCore::ViewportConfiguration::updateMinimumLayoutSize):
3046         (WebCore::ViewportConfiguration::setMinimumLayoutSize): Deleted.
3047         * page/ViewportConfiguration.h:
3048         (WebCore::ViewportConfiguration::viewLayoutSize const):
3049         (WebCore::ViewportConfiguration::viewSize const): Deleted.
3050
3051 2018-04-27  Zalan Bujtas  <zalan@apple.com>
3052
3053         [LFC] Formatting contexts should create floating states.
3054         https://bugs.webkit.org/show_bug.cgi?id=185032
3055
3056         Reviewed by Antti Koivisto.
3057
3058         This patch implements the logic for sharing floating states across multiple formatting contexts.
3059         At this point this is mostly about inline formatting contexts. They either create a new floating state
3060         or inherit it from the parent formatting context.
3061
3062         * layout/FloatingState.cpp:
3063         (WebCore::Layout::FloatingState::FloatingState):
3064         * layout/FloatingState.h:
3065         (WebCore::Layout::FloatingState::create):
3066         * layout/FormattingContext.cpp:
3067         (WebCore::Layout::FormattingContext::FormattingContext):
3068         * layout/FormattingContext.h:
3069         (WebCore::Layout::FormattingContext::layoutContext const):
3070         * layout/FormattingState.cpp:
3071         (WebCore::Layout::FormattingState::FormattingState):
3072         * layout/FormattingState.h:
3073         (WebCore::Layout::FormattingState::floatingState const):
3074         * layout/LayoutContext.cpp:
3075         (WebCore::Layout::LayoutContext::updateLayout):
3076         (WebCore::Layout::LayoutContext::formattingStateForBox const):
3077         (WebCore::Layout::LayoutContext::establishedFormattingState):
3078         (WebCore::Layout::LayoutContext::formattingContext):
3079         (WebCore::Layout::LayoutContext::formattingState): Deleted.
3080         * layout/LayoutContext.h:
3081         * layout/blockformatting/BlockFormattingContext.cpp:
3082         (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
3083         (WebCore::Layout::BlockFormattingContext::createFormattingState const):
3084         (WebCore::Layout::BlockFormattingContext::createOrFindFloatingState const):
3085         (WebCore::Layout::BlockFormattingContext::formattingState const): Deleted.
3086         * layout/blockformatting/BlockFormattingContext.h:
3087         * layout/blockformatting/BlockFormattingState.cpp:
3088         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
3089         * layout/blockformatting/BlockFormattingState.h:
3090         * layout/inlineformatting/InlineFormattingContext.cpp:
3091         (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
3092         (WebCore::Layout::InlineFormattingContext::createFormattingState const):
3093         (WebCore::Layout::InlineFormattingContext::createOrFindFloatingState const):
3094         (WebCore::Layout::InlineFormattingContext::formattingState const): Deleted.
3095         * layout/inlineformatting/InlineFormattingContext.h:
3096         * layout/inlineformatting/InlineFormattingState.cpp:
3097         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
3098         * layout/inlineformatting/InlineFormattingState.h:
3099         * layout/layouttree/LayoutBox.cpp:
3100         (WebCore::Layout::Box::formattingContextRoot const):
3101         * layout/layouttree/LayoutBox.h:
3102
3103 2018-04-27  Wenson Hsieh  <wenson_hsieh@apple.com>
3104
3105         [Extra zoom mode] Add a mechanism to override default viewport behaviors in extra zoom mode
3106         https://bugs.webkit.org/show_bug.cgi?id=185050
3107         <rdar://problem/39624038>
3108
3109         Reviewed by Tim Horton.
3110
3111         Currently, in extra zoom mode, there's no way for web pages to opt out of the default viewport behaviors
3112         (namely, laying out at a larger width and shrinking to fit) when the web view is very tall and narrow. This
3113         patch adds a new experimental viewport attribute, "min-device-width", that can be used to prevent WebKit from
3114         automatically clamping the web view width to a greater value for the device width in this scenario.
3115
3116         Note that after this patch, logic that plumbs a minimumLayoutSize from WKWebView to the viewport configuration
3117         will need to be renamed to reflect that this size is no longer the minimum layout size, but rather, the view
3118         size that is used for viewport device dimensions by default. This refactoring will be done in a followup part.
3119
3120         See per-method comments below for more detail.
3121
3122         Test: fast/viewport/extrazoom/viewport-change-min-device-width.html
3123
3124         * dom/ViewportArguments.cpp:
3125         (WebCore::setViewportFeature):
3126         (WebCore::operator<<):
3127         * dom/ViewportArguments.h:
3128
3129         Removes `m_forceHorizontalShrinkToFit` (more detail below).
3130
3131         * page/ViewportConfiguration.cpp:
3132         (WebCore::computedMinDeviceWidth):
3133         (WebCore::ViewportConfiguration::ViewportConfiguration):
3134         (WebCore::ViewportConfiguration::setMinimumLayoutSize):
3135
3136         Instead of directly setting the minimum layout size, setMinimumLayoutSize now first sets the view size (i.e. the
3137         size we use for `device-width` in the viewport meta tag), and then updates the minimum layout size.
3138
3139         (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthWithMinDeviceWidth const):
3140
3141         Replaces `m_forceHorizontalShrinkToFit`. Whether or not we shrink to fit is now determined by whether the
3142         min-device-width attribute is actively clamping the width of the view.
3143
3144         (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const):
3145         (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const):
3146         (WebCore::ViewportConfiguration::updateMinimumLayoutSize):
3147
3148         Computes and sets the minimum layout size using the view size, taking the minimum device width into account if
3149         needed.
3150
3151         (WebCore::ViewportConfiguration::description const):
3152         (WebCore::ViewportConfiguration::setForceHorizontalShrinkToFit): Deleted.
3153         * page/ViewportConfiguration.h:
3154
3155 2018-04-27  Zalan Bujtas  <zalan@apple.com>
3156
3157         [LFC] Formatting contexts should take const Box&
3158         https://bugs.webkit.org/show_bug.cgi?id=185031
3159
3160         Reviewed by Sam Weinig.
3161
3162         The formatting root boxes are supposed to be all const. The only reason why
3163         they are not is because WeakPtr<> does not support const objects yet.
3164         Use const_cast instead (remove it when WeakPtr<> gains const support).
3165
3166         * layout/FormattingContext.cpp:
3167         (WebCore::Layout::FormattingContext::FormattingContext):
3168         * layout/FormattingContext.h:
3169         * layout/LayoutContext.cpp:
3170         (WebCore::Layout::LayoutContext::LayoutContext):
3171         (WebCore::Layout::LayoutContext::formattingContext):
3172         * layout/LayoutContext.h:
3173         * layout/blockformatting/BlockFormattingContext.cpp:
3174         (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
3175         * layout/blockformatting/BlockFormattingContext.h:
3176         * layout/inlineformatting/InlineFormattingContext.cpp:
3177         (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
3178         * layout/inlineformatting/InlineFormattingContext.h:
3179
3180 2018-04-27  Zalan Bujtas  <zalan@apple.com>
3181
3182         [LFC] Add layout tree iterators.
3183         https://bugs.webkit.org/show_bug.cgi?id=185058
3184
3185         Reviewed by Antti Koivisto.
3186
3187         They work exactly like the renderer tree iterators.
3188
3189         * WebCore.xcodeproj/project.pbxproj:
3190         * layout/layouttree/LayoutAncestorIterator.h: Added.
3191         (WebCore::Layout::LayoutAncestorIterator<T>::LayoutAncestorIterator):
3192         (WebCore::Layout::LayoutAncestorIterator<T>::operator):
3193         (WebCore::Layout::LayoutAncestorIteratorAdapter<T>::LayoutAncestorIteratorAdapter):
3194         (WebCore::Layout::LayoutAncestorIteratorAdapter<T>::begin const):
3195         (WebCore::Layout::LayoutAncestorIteratorAdapter<T>::end const):
3196         (WebCore::Layout::LayoutAncestorIteratorAdapter<T>::first const):
3197         (WebCore::Layout::ancestorsOfType):
3198         (WebCore::Layout::lineageOfType):
3199         * layout/layouttree/LayoutBox.cpp:
3200         * layout/layouttree/LayoutChildIterator.h: Added.
3201         (WebCore::Layout::LayoutChildtIterator<T>::LayoutChildtIterator):
3202         (WebCore::Layout::LayoutChildtIterator<T>::operator):
3203         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::LayoutChildtIteratorAdapter):
3204         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::begin const):
3205         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::end const):
3206         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::first const):
3207         (WebCore::Layout::LayoutChildtIteratorAdapter<T>::last const):
3208         (WebCore::Layout::childrenOfType):
3209         * layout/layouttree/LayoutIterator.h: Added.
3210         (WebCore::Layout::isLayoutBoxOfType):
3211         (WebCore::Layout::Traversal::firstChild):
3212         (WebCore::Layout::Traversal::lastChild):
3213         (WebCore::Layout::Traversal::nextSibling):
3214         (WebCore::Layout::Traversal::previousSibling):
3215         (WebCore::Layout::Traversal::findAncestorOfType):
3216         (WebCore::Layout::Traversal::nextAncestorSibling):
3217         (WebCore::Layout::Traversal::nextWithin):
3218         (WebCore::Layout::Traversal::firstWithin):
3219         (WebCore::Layout::Traversal::next):
3220         (WebCore::Layout::LayoutIterator<T>::LayoutIterator):
3221         (WebCore::Layout::LayoutIterator<T>::traverseNextSibling):
3222         (WebCore::Layout::LayoutIterator<T>::traverseNext):
3223         (WebCore::Layout::LayoutIterator<T>::traversePreviousSibling):
3224         (WebCore::Layout::LayoutIterator<T>::traverseAncestor):
3225         (WebCore::Layout::LayoutIterator<T>::operator const):
3226         (WebCore::Layout:: const):
3227         (WebCore::Layout::= const):
3228
3229 2018-04-27  Commit Queue  <commit-queue@webkit.org>
3230
3231         Unreviewed, rolling out r231089.
3232         https://bugs.webkit.org/show_bug.cgi?id=185071
3233
3234         Broke and made crash some WPE EME tests (Requested by calvaris
3235         on #webkit).
3236
3237         Reverted changeset:
3238
3239         "[EME][GStreamer] Move the decryptor from AppendPipeline to
3240         PlaybackPipeline."
3241         https://bugs.webkit.org/show_bug.cgi?id=181855
3242         https://trac.webkit.org/changeset/231089
3243
3244 2018-04-27  Yacine Bandou  <yacine.bandou_ext@softathome.com>
3245
3246         [EME][GStreamer] Move the decryptor from AppendPipeline to PlaybackPipeline.
3247         https://bugs.webkit.org/show_bug.cgi?id=181855
3248
3249         Reviewed by Xabier Rodriguez-Calvar.
3250
3251         The goal of this move is to handle the limitation of SVP (Secure Video Path) memory size.
3252
3253         When the decryptor is in the AppendPipeline and we use SVP, we buffer in MediaSource queue
3254         the decrypted GstBuffers that are in SVP memory.
3255         This behavior cause an out-of-memory error, because we are limited in SVP memory size.
3256
3257         By moving the decryptor in PlaybackPipeline, we avoid to buffer the decrypted GstBuffers
3258         which use the SVP memory and we buffer the encrypted GstBuffers that are in system memory.
3259
3260         This new architecture also allows to start the buffering before obtaining the DRM license
3261         and it makes easier to manage dynamic change of the license or Key.
3262
3263         The decryptor is auto plugged by GStreamer playbin in PlaybackPipeline.
3264
3265         SVP: Secure Video Path also named trusted or protected video path, it is a memory which is
3266         protected by a hardware access control engine, it is not accessible to other unauthorised
3267         software or hardware components.
3268
3269         Tests:
3270             media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html
3271             media/encrypted-media/clearKey/clearKey-cenc-video-playback-mse.html
3272
3273         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
3274         (webkitMediaCommonEncryptionDecryptSinkEventHandler):
3275         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
3276         (WebCore::dumpAppendState):
3277         (WebCore::AppendPipeline::AppendPipeline):
3278         (WebCore::AppendPipeline::handleNeedContextSyncMessage):
3279         (WebCore::AppendPipeline::handleAppsrcNeedDataReceived):
3280         (WebCore::AppendPipeline::setAppendState):
3281         (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
3282         (WebCore::AppendPipeline::appsinkNewSample):
3283         (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
3284         (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
3285         (WebCore::appendPipelineElementMessageCallback): Deleted.
3286         (WebCore::AppendPipeline::handleElementMessage): Deleted.
3287         (WebCore::AppendPipeline::dispatchPendingDecryptionStructure): Deleted.
3288         (WebCore::AppendPipeline::dispatchDecryptionStructure): Deleted.
3289         * platform/graphics/gstreamer/mse/AppendPipeline.h:
3290         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
3291         (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance):
3292         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
3293
3294 2018-04-27  Yacine Bandou  <yacine.bandou_ext@softathome.com>
3295
3296         [EME][GStreamer] Add a new message "decrypt-key-needed" send from the decryptor to the application.
3297         https://bugs.webkit.org/show_bug.cgi?id=181858
3298
3299         Reviewed by Xabier Rodriguez-Calvar.
3300
3301         Add a new message "decrypt-key-needed" that the decryptor can send when it doesn't have an available key.
3302         This message should be handled by the application in order to dispatch or send the key to the decryptor.
3303         This patch is a preparation for the patch 181855.
3304         With the patch 181855, the decryptor will be in the PlaybackPipeline instead of AppendPipeline, thus we can
3305         get the DRM license or key before to instantiate or load the decryptor plugin in PlaybackPipeline.
3306         When the decryptor plugin is instantiated or loaded, it should able to ask the application to resend
3307         the DRM license or key by using this new message "decrypt-key-needed".
3308
3309
3310         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3311         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
3312         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3313         (WebCore::MediaPlayerPrivateGStreamerBase::dispatchCDMInstance):
3314         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3315         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
3316         (webkitMediaCommonEncryptionDecryptTransformInPlace):
3317
3318 2018-04-26  Justin Fan  <justin_fan@apple.com>
3319
3320         tex[Sub]Image2D slow when passing in a <canvas>, faster with ImageData.
3321         https://bugs.webkit.org/show_bug.cgi?id=184843
3322         <rdar://problem/34898868>
3323
3324         Reviewed by Simon Fraser.
3325
3326         On certain test pages passing 2d canvas objects to gl.texSubImage2D, we spend significant time doing an alpha unpremultiplication in FormatConverter::convert on a single thread. 
3327         For now, I am introducing use of the Accelerate framework to do canvas alpha unpremultiplication, specifically for RGBA8 > RGBA8.
3328         This improves this rendering path by a factor of ~4. The rest of FormatConverter could use similar improvements; filed https://bugs.webkit.org/show_bug.cgi?id=185064 for these. 
3329
3330         * platform/graphics/FormatConverter.cpp:
3331         (WebCore::FormatConverter::convert):
3332
3333 2018-04-26  Simon Fraser  <simon.fraser@apple.com>
3334
3335         Implement rendering support for the color-filter CSS property
3336         https://bugs.webkit.org/show_bug.cgi?id=185047
3337         rdar://problem/39664967
3338
3339         Reviewed by Tim Horton.
3340         
3341         The color-filter property transforms CSS colors just before painting. To support this,
3342         add to RenderStyle colorByApplyingColorFilter() and visitedDependentColorWithColorFilter().
3343         At most calls sites that transform colors for rendering, replace calls to
3344         visitedDependentColor() with visitedDependentColorWithColorFilter(). The few locations
3345         that don't use visitedDependentColor() (e.g. for shadows) call colorByApplyingColorFilter().
3346         
3347         Color transformation is implemented via a new virtual function on FilterOperation;
3348         BasicColorMatrixFilterOperation overrides this to use a new ColorMatrix class to
3349         do color math, and BasicComponentTransferFilterOperation to do the equivalent of component
3350         transfer operations. The math in both cases matches that for SVG filters, with the exception
3351         that color components are stored as floats through multiple filters and then mapped to
3352         normal 0-255 color components at the end.
3353
3354         Tests: css3/color-filters/color-filter-backgrounds-borders.html
3355                css3/color-filters/color-filter-box-shadow.html
3356                css3/color-filters/color-filter-brightness.html
3357                css3/color-filters/color-filter-color-property-list-item.html
3358                css3/color-filters/color-filter-color-property.html
3359                css3/color-filters/color-filter-color-text-decorations.html
3360                css3/color-filters/color-filter-column-rule.html
3361                css3/color-filters/color-filter-contrast.html
3362                css3/color-filters/color-filter-current-color.html
3363                css3/color-filters/color-filter-filter-list.html
3364                css3/color-filters/color-filter-grayscale.html
3365                css3/color-filters/color-filter-hue-rotate.html
3366                css3/color-filters/color-filter-inherits.html
3367                css3/color-filters/color-filter-invert.html
3368                css3/color-filters/color-filter-opacity.html
3369                css3/color-filters/color-filter-outline.html
3370                css3/color-filters/color-filter-saturate.html
3371                css3/color-filters/color-filter-sepia.html
3372                css3/color-filters/color-filter-text-emphasis.html
3373
3374         * html/HTMLTextFormControlElement.cpp:
3375         (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
3376         * page/FrameView.cpp:
3377         (WebCore::FrameView::documentBackgroundColor const):
3378         * platform/graphics/ColorUtilities.cpp:
3379         (WebCore::ColorMatrix::ColorMatrix):
3380         (WebCore::ColorMatrix::makeIdentity):
3381         (WebCore::ColorMatrix::grayscaleMatrix):
3382         (WebCore::ColorMatrix::saturationMatrix):
3383         (WebCore::ColorMatrix::hueRotateMatrix):
3384         (WebCore::ColorMatrix::sepiaMatrix):
3385         (WebCore::ColorMatrix::transformColorComponents const):
3386         * platform/graphics/ColorUtilities.h:
3387         * platform/graphics/filters/FilterOperation.cpp:
3388         (WebCore::BasicColorMatrixFilterOperation::transformColor const):
3389         (WebCore::BasicComponentTransferFilterOperation::transformColor const):
3390         * platform/graphics/filters/FilterOperation.h:
3391         (WebCore::FilterOperation::transformColor const):
3392         * platform/graphics/filters/FilterOperations.cpp:
3393         (WebCore::FilterOperations::transformColor const):
3394         * platform/graphics/filters/FilterOperations.h:
3395         * rendering/BorderEdge.cpp:
3396         (WebCore::BorderEdge::getBorderEdgeInfo):
3397         * rendering/EllipsisBox.cpp:
3398         (WebCore::EllipsisBox::paint):
3399         (WebCore::EllipsisBox::paintSelection):
3400         * rendering/InlineFlowBox.cpp:
3401         (WebCore::InlineFlowBox::paintBoxDecorations):
3402         * rendering/InlineTextBox.cpp:
3403         (WebCore::InlineTextBox::paintMarkedTextForeground):
3404         (WebCore::InlineTextBox::paintMarkedTextDecoration):
3405         (WebCore::InlineTextBox::paintCompositionUnderline const):
3406         * rendering/RenderBox.cpp:
3407         (WebCore::RenderBox::paintRootBoxFillLayers):
3408         (WebCore::RenderBox::paintBackground):
3409         (WebCore::RenderBox::getBackgroundPaintedExtent const):
3410         (WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect const):
3411         (WebCore::RenderBox::backgroundHasOpaqueTopLayer const):
3412         * rendering/RenderBoxModelObject.cpp:
3413         (WebCore::applyBoxShadowForBackground):
3414         (WebCore::RenderBoxModelObject::paintFillLayerExtended):
3415         (WebCore::RenderBoxModelObject::boxShadowShouldBeAppliedToBackground const):
3416         (WebCore::RenderBoxModelObject::paintBoxShadow):
3417         * rendering/RenderDetailsMarker.cpp:
3418         (WebCore::RenderDetailsMarker::paint):
3419         * rendering/RenderElement.cpp:
3420         (WebCore::RenderElement::selectionColor const):
3421         (WebCore::RenderElement::selectionBackgroundColor const):
3422         (WebCore::RenderElement::paintFocusRing):
3423         (WebCore::RenderElement::paintOutline):
3424         * rendering/RenderFileUploadControl.cpp:
3425         (WebCore::RenderFileUploadControl::paintObject):
3426         * rendering/RenderFrameSet.cpp:
3427         (WebCore::RenderFrameSet::paintColumnBorder):
3428         (WebCore::RenderFrameSet::paintRowBorder):
3429         * rendering/RenderImage.cpp:
3430         (WebCore::RenderImage::paintReplaced):
3431         (WebCore::RenderImage::paintAreaElementFocusRing):
3432         * rendering/RenderInline.cpp:
3433         (WebCore::RenderInline::paintOutline):
3434         * rendering/RenderLayerBacking.cpp:
3435         (WebCore::canDirectlyCompositeBackgroundBackgroundImage):
3436         (WebCore::RenderLayerBacking::rendererBackgroundColor const):
3437         * rendering/RenderLayerCompositor.cpp:
3438         (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
3439         * rendering/RenderListBox.cpp:
3440         (WebCore::RenderListBox::paintItemForeground):
3441         (WebCore::RenderListBox::paintItemBackground):
3442         * rendering/RenderListMarker.cpp:
3443         (WebCore::RenderListMarker::paint):
3444         * rendering/RenderMenuList.cpp:
3445         (RenderMenuList::itemStyle const):
3446         (RenderMenuList::getItemBackgroundColor const):
3447         (RenderMenuList::menuStyle const):
3448         * rendering/RenderMultiColumnSet.cpp:
3449         (WebCore::RenderMultiColumnSet::paintColumnRules):
3450         * rendering/RenderSearchField.cpp:
3451         (WebCore::RenderSearchField::menuStyle const):
3452         * rendering/RenderTable.h:
3453         (WebCore::RenderTable::bgColor const):
3454         * rendering/RenderTableCell.cpp:
3455         (WebCore::RenderTableCell::computeCollapsedStartBorder const):
3456         (WebCore::RenderTableCell::computeCollapsedEndBorder const):
3457         (WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
3458         (WebCore::RenderTableCell::computeCollapsedAfterBorder const):
3459         (WebCore::RenderTableCell::paintBackgroundsBehindCell):
3460         * rendering/RenderTableSection.cpp:
3461         (WebCore::RenderTableSection::paintRowGroupBorder):
3462         * rendering/RenderTheme.cpp:
3463         (WebCore::RenderTheme::paintSliderTicks):
3464         * rendering/TextDecorationPainter.cpp:
3465         (WebCore::decorationColor):
3466         * rendering/TextPaintStyle.cpp:
3467         (WebCore::computeTextPaintStyle):
3468         * rendering/mathml/MathOperator.cpp:
3469         (WebCore::MathOperator::paint):
3470         * rendering/mathml/RenderMathMLFraction.cpp:
3471         (WebCore::RenderMathMLFraction::paint):
3472         * rendering/mathml/RenderMathMLMenclose.cpp:
3473         (WebCore::RenderMathMLMenclose::paint):
3474         * rendering/mathml/RenderMathMLRoot.cpp:
3475         (WebCore::RenderMathMLRoot::paint):
3476         * rendering/mathml/RenderMathMLToken.cpp:
3477         (WebCore::RenderMathMLToken::paint):
3478         * rendering/style/RenderStyle.cpp:
3479         (WebCore::RenderStyle::visitedDependentColorWithColorFilter const):
3480         (WebCore::RenderStyle::colorByApplyingColorFilter const):
3481         * rendering/style/RenderStyle.h:
3482
3483 2018-04-26  Mark Lam  <mark.lam@apple.com>
3484
3485         Gardening: Speculative build fix for Windows.
3486         https://bugs.webkit.org/show_bug.cgi?id=184976
3487         <rdar://problem/39723901>
3488
3489         Not reviewed.
3490
3491         * cssjit/CSSPtrTag.h:
3492
3493 2018-04-26  Brent Fulgham  <bfulgham@apple.com>
3494
3495         Show punycode if URL contains Latin small letter o with dot below character
3496         https://bugs.webkit.org/show_bug.cgi?id=185051
3497         <rdar://problem/39459297>
3498
3499         Reviewed by David Kilzer.
3500
3501         Revise our "lookalike character" logic to include the small Latin o
3502         with dot below character.
3503
3504         Test: fast/url/host.html
3505
3506         * platform/mac/WebCoreNSURLExtras.mm:
3507         (WebCore::isLookalikeCharacter):
3508
3509 2018-04-26  Daniel Bates  <dabates@apple.com>
3510
3511         Fix the build following r231068
3512         (https://bugs.webkit.org/show_bug.cgi?id=185002)
3513
3514         Substitute mainResourceRequest.resourceRequest().url() for mainResourceRequest.url() as the
3515         latter does not exist.
3516
3517         * loader/DocumentLoader.cpp:
3518         (WebCore::DocumentLoader::loadMainResource):
3519
3520 2018-04-26  Daniel Bates  <dabates@apple.com>
3521
3522         DocumentLoader::loadMainResource() should WTFMove() the passed ResourceRequest
3523         https://bugs.webkit.org/show_bug.cgi?id=185002
3524
3525         Reviewed by Youenn Fablet and Alex Christensen.
3526
3527         In r224852 we extracted logic from DocumentLoader::startLoadingMainResource() into a new
3528         function DocumentLoader::loadMainResource() that could be shared by both DocumentLoader::startLoadingMainResource()
3529         and the service worker code. As part of this extraction, DocumentLoader::loadMainResource()
3530         takes a ResourceRequest by rvalue reference, but it never actually takes ownership of this
3531         ResourceRequest and subsequently makes a copy of it when instantiating a CachedResourceRequest.
3532         Instead we should WTFMove() the passed request into the CachedResourceRequest.
3533
3534         * loader/DocumentLoader.cpp:
3535         (WebCore::DocumentLoader::loadMainResource):
3536
3537 2018-04-26  Sihui Liu  <sihui_liu@apple.com>
3538
3539         -[WKHTTPCookieStore deleteCookie:completionHandler:] doesn't delete cookies
3540         https://bugs.webkit.org/show_bug.cgi?id=184938
3541         <rdar://problem/34737395>
3542
3543         Reviewed by Geoffrey Garen.
3544
3545         When a Cookie object was converted to NSHTTPCookie object, the HTTPOnly property information
3546         was lost so the delete function cannot find the proper cookie to delete.
3547         This patch implements a workaround that compares Cookie object instead of NSHTTPCookie 
3548         object. We might want to add the ability to set HTTPOnly header during conversion if there
3549         is an easy way to do it later.
3550         
3551         New API test: WebKit.WKHTTPCookieStoreHttpOnly
3552
3553         * platform/network/cocoa/CookieCocoa.mm:
3554         (WebCore::Cookie::operator== const):
3555         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
3556         (WebCore::NetworkStorageSession::deleteCookie):
3557
3558 2018-04-26  Commit Queue  <commit-queue@webkit.org>
3559
3560         Unreviewed, rolling out r231052.
3561         https://bugs.webkit.org/show_bug.cgi?id=185044
3562
3563         Broke test http/tests/security/credentials-main-resource.html
3564         (Requested by dydz on #webkit).
3565
3566         Reverted changeset:
3567
3568         "DocumentLoader::loadMainResource() should WTFMove() the
3569         passed ResourceRequest"
3570         https://bugs.webkit.org/show_bug.cgi?id=185002
3571         https://trac.webkit.org/changeset/231052
3572
3573 2018-04-26  Jer Noble  <jer.noble@apple.com>
3574
3575         WK_COCOA_TOUCH all the things.
3576         https://bugs.webkit.org/show_bug.cgi?id=185006
3577
3578         Reviewed by Tim Horton.
3579
3580         * Configurations/WebCore.xcconfig:
3581
3582 2018-04-26  David Kilzer  <ddkilzer@apple.com>
3583
3584         Make WAKScrollView delegate a weak property
3585         <https://webkit.org/b/184799>
3586         <rdar://problem/39469669>
3587
3588         Reviewed by Simon Fraser.
3589
3590         * platform/ios/wak/WAKScrollView.h:
3591         - Remove `delegate` instance variable declaration.
3592         - Declare `delegate` property as weak.
3593         (-[WAKScrollView setDelegate:]): Delete declaration.
3594         (-[WAKScrollView delegate]): Ditto.
3595         * platform/ios/wak/WAKScrollView.mm:
3596         - Synthesize getter/setter methods for `delegate` property.
3597         (-[WAKScrollView setDelegate:]): Delete implementation.
3598         (-[WAKScrollView delegate]): Ditto.
3599
3600 2018-04-26  Youenn Fablet  <youenn@apple.com>
3601
3602         CORS preflight checker should add a console message when preflight load is blocked
3603         https://bugs.webkit.org/show_bug.cgi?id=185021
3604
3605         Reviewed by Chris Dumez.
3606
3607         No change of behavior, adding a JS console message when preflight load is blocked.
3608         This mirrors what is being done in preflighting done from NetworkProcess.
3609         Covered by existing tests.
3610
3611         * loader/CrossOriginPreflightChecker.cpp:
3612         (WebCore::CrossOriginPreflightChecker::notifyFinished):
3613         (WebCore::CrossOriginPreflightChecker::doPreflight):
3614
3615 2018-04-26  Daniel Bates  <dabates@apple.com>
3616
3617         DocumentLoader::loadMainResource() should WTFMove() the passed ResourceRequest
3618         https://bugs.webkit.org/show_bug.cgi?id=185002
3619
3620         Reviewed by Youenn Fablet and Alex Christensen.
3621
3622         In r224852 we extracted logic from DocumentLoader::startLoadingMainResource() into a new
3623         function DocumentLoader::loadMainResource() that could be shared by both DocumentLoader::startLoadingMainResource()
3624         and the service worker code. As part of this extraction, DocumentLoader::loadMainResource()
3625         takes a ResourceRequest by rvalue reference, but it never actually takes ownership of this
3626         ResourceRequest and subsequently makes a copy of it when instantiating a CachedResourceRequest.
3627         Instead we should WTFMove() the passed request into the CachedResourceRequest.
3628
3629         * loader/DocumentLoader.cpp:
3630         (WebCore::DocumentLoader::loadMainResource):
3631
3632 2018-04-26  Per Arne Vollan  <pvollan@apple.com>
3633
3634         Disable content filtering in minimal simulator mode
3635         https://bugs.webkit.org/show_bug.cgi?id=185027
3636         <rdar://problem/39736091>
3637
3638         Reviewed by Jer Noble.
3639
3640         * Configurations/FeatureDefines.xcconfig:
3641
3642 2018-04-25  Brent Fulgham  <bfulgham@apple.com>
3643
3644         Add port 548 (afpovertcp) to port blacklist
3645         https://bugs.webkit.org/show_bug.cgi?id=185000
3646         <rdar://problem/39540481>
3647
3648         Reviewed by David Kilzer.
3649
3650         Tested by security/block-test.html.
3651
3652         * platform/URL.cpp:
3653         (WebCore::portAllowed):Also block port 548.
3654
3655 2018-04-26  Andy VanWagoner  <thetalecrafter@gmail.com>
3656
3657         [INTL] Implement Intl.PluralRules
3658         https://bugs.webkit.org/show_bug.cgi?id=184312
3659
3660         Reviewed by JF Bastien.
3661
3662         Added Intl.PluralRules feature flag.
3663
3664         Test: js/intl-pluralrules.html
3665
3666         * Configurations/FeatureDefines.xcconfig:
3667
3668 2018-04-15  Darin Adler  <darin@apple.com>
3669
3670         [Cocoa] Adopt CCRSAGetCRTComponents and stop using CCBigNum
3671         https://bugs.webkit.org/show_bug.cgi?id=184637
3672
3673         Reviewed by Alexey Proskuryakov.
3674
3675         * crypto/CommonCryptoUtilities.cpp: Compile out WebCore::CCBigNum class if
3676         HAVE(CCRSAGetCRTComponents) is true.
3677
3678         * crypto/CommonCryptoUtilities.h: Define HAVE(CCRSAGetCRTComponents) on new
3679         enough versions of iOS and macOS that have it and add declarations of the
3680         function for the non-Apple-internal-SDK case. Also don't define the
3681         WebCore::CCBigNum class if HAVE(CCRSAGetCRTComponents) is true.
3682
3683         * crypto/mac/CryptoKeyRSAMac.cpp:
3684         (WebCore::getPrivateKeyComponents): Use CCRSAGetCRTComponents if present.
3685
3686 2018-04-26  Per Arne Vollan  <pvollan@apple.com>
3687
3688         Add lazy initialization of caption display mode for videos.
3689         https://bugs.webkit.org/show_bug.cgi?id=184993
3690
3691         The call to MACaptionAppearanceGetDisplayType in CaptionUserPreferencesMediaAF::captionDisplayMode()
3692         is showing up in samples when called from HTMLMediaElement::finishInitialization().
3693
3694         Reviewed by Eric Carlson.
3695
3696         No new tests, covered by existing tests.
3697
3698         * html/HTMLMediaElement.cpp:
3699         (WebCore::HTMLMediaElement::finishInitialization):
3700         (WebCore::HTMLMediaElement::setSelectedTextTrack):
3701         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
3702         (WebCore::HTMLMediaElement::captionPreferencesChanged):
3703         (WebCore::HTMLMediaElement::captionDisplayMode):
3704         * html/HTMLMediaElement.h:
3705
3706 2018-04-26  Zan Dobersek  <zdobersek@igalia.com>
3707
3708         [GTK][WPE] Initial ASYNC_SCROLLING support
3709         https://bugs.webkit.org/show_bug.cgi?id=184961
3710
3711         Reviewed by Carlos Garcia Campos.
3712
3713         Add CoordinatedGraphics-specific code that will be required for async
3714         scrolling support. The ScrollingCoordinatorCoordinatedGraphics and
3715         ScrollingTreeCoordinatedGraphics classes are mostly complete already,
3716         but the new ScrollingTreeNode-inheriting classes will need further
3717         work that will have to be done in parallel with other improvements
3718         planned for the CoordinatedGraphics subsystem.
3719
3720         While the build-time flag is enabled, the feature is still not enabled
3721         at runtime due to being marked as unsupported by the DrawingArea
3722         implementation in the WebKit layer. It would also not work yet if it
3723         were enabled due to the before-mentioned pending changes.
3724
3725         Various build fixes that address non-Cocoa usage of ASYNC_SCROLLING
3726         code are included.
3727
3728         * Sources.txt: Add AsyncScrollingCoordinator.cpp to build.
3729         * SourcesCocoa.txt:
3730         * SourcesGTK.txt: Add new files to build.
3731         * SourcesWPE.txt: Ditto.
3732         * page/scrolling/AsyncScrollingCoordinator.cpp:
3733         Guard setStateScrollingNodeSnapOffsetsAsFloat() with CSS_SCROLL_SNAP.
3734         * page/scrolling/ScrollingTree.h:
3735         * page/scrolling/ThreadedScrollingTree.cpp:
3736         * page/scrolling/ThreadedScrollingTree.h:
3737         currentSnapPointIndicesDidChange() method is only invoked in
3738         Cocoa-specific code, and its implementation calls Cocoa-specific method
3739         on the AsyncScrollingCoordinator class.
3740         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
3741         (WebCore::ScrollingCoordinator::create):
3742         (WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics):
3743         (WebCore::ScrollingCoordinatorCoordinatedGraphics::~ScrollingCoordinatorCoordinatedGraphics):
3744         (WebCore::ScrollingCoordinatorCoordinatedGraphics::pageDestroyed):
3745         (WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeStateIfNeeded):
3746         (WebCore::ScrollingCoordinatorCoordinatedGraphics::handleWheelEvent):
3747         (WebCore::ScrollingCoordinatorCoordinatedGraphics::scheduleTreeStateCommit):
3748         (WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeState):
3749         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: Added.
3750         * page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp: Added.
3751         (WebCore::ScrollingTreeCoordinatedGraphics::create):
3752         (WebCore::ScrollingTreeCoordinatedGraphics::ScrollingTreeCoordinatedGraphics):
3753         (WebCore::ScrollingTreeCoordinatedGraphics::createScrollingTreeNode):
3754         * page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h: Added.
3755         * page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp: Added.
3756         (WebCore::ScrollingTreeFixedNode::create):
3757         (WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
3758         (WebCore::ScrollingTreeFixedNode::~ScrollingTreeFixedNode):
3759         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
3760         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
3761         * page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h: Added.
3762         * page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp: Added.
3763         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::create):
3764         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::ScrollingTreeFrameScrollingNodeCoordinatedGraphics):
3765         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::handleWheelEvent):
3766         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::scrollPosition const):
3767         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPosition):
3768         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPositionWithoutContentEdgeConstraints):
3769         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollLayerPosition):
3770         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::updateLayersAfterViewportChange):
3771         * page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h: Added.
3772         * page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp: Added.
3773         (WebCore::ScrollingTreeStickyNode::create):
3774         (WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
3775         (WebCore::ScrollingTreeStickyNode::~ScrollingTreeStickyNode):
3776         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
3777         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
3778         * page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h: Added.
3779         * platform/PlatformWheelEvent.h: Enable PlatformWheelEventPhase code
3780         for WPE. Guard latching-specific methods under ASYNC_SCROLLING.
3781         * platform/TextureMapper.cmake: Two build targets have been moved to
3782         SourcesGTK.txt and SourcesWPE.txt.
3783
3784 2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>
3785
3786         [WPE] Build and link against latest WPEBackend and WPEBackend-fdo
3787         https://bugs.webkit.org/show_bug.cgi?id=184643
3788
3789         Reviewed by Žan Doberšek.
3790
3791         Adapt to single-header WPE includes.
3792
3793         * platform/graphics/egl/GLContextEGLWPE.cpp:
3794         * platform/graphics/wpe/PlatformDisplayWPE.cpp:
3795         * platform/wpe/PlatformPasteboardWPE.cpp:
3796
3797 2018-04-25  Youenn Fablet  <youenn@apple.com>
3798
3799         Use NetworkLoadChecker for all subresource loads except fetch/XHR
3800         https://bugs.webkit.org/show_bug.cgi?id=184870
3801         <rdar://problem/39370034>
3802
3803         Reviewed by Chris Dumez.
3804
3805         No change of behavior.
3806         Update CachedResourceLoader error messages to match NetworkProcess error messages.
3807
3808         * loader/cache/CachedResourceLoader.cpp:
3809         (WebCore::CachedResourceLoader::printAccessDeniedMessage const):
3810
3811 2018-04-25  Zalan Bujtas  <zalan@apple.com>
3812
3813         [LFC] Add support for is<> and downcast<>
3814         https://bugs.webkit.org/show_bug.cgi?id=185016
3815
3816         Reviewed by Antti Koivisto.
3817
3818         * layout/layouttree/LayoutBlockContainer.cpp:
3819         (WebCore::Layout::BlockContainer::BlockContainer):
3820         * layout/layouttree/LayoutBlockContainer.h:
3821         * layout/layouttree/LayoutBox.cpp:
3822         (WebCore::Layout::Box::Box):
3823         * layout/layouttree/LayoutBox.h:
3824         (WebCore::Layout::Box::isContainer const):
3825         (WebCore::Layout::Box::isBlockContainer const):
3826         (WebCore::Layout::Box::isInlineBox const):
3827         (WebCore::Layout::Box::isInlineContainer const):
3828         * layout/layouttree/LayoutContainer.cpp:
3829         (WebCore::Layout::Container::Container):
3830         * layout/layouttree/LayoutContainer.h:
3831         * layout/layouttree/LayoutInlineBox.cpp:
3832         (WebCore::Layout::InlineBox::InlineBox):
3833         * layout/layouttree/LayoutInlineBox.h:
3834         * layout/layouttree/LayoutInlineContainer.cpp:
3835         (WebCore::Layout::InlineContainer::InlineContainer):
3836         * layout/layouttree/LayoutInlineContainer.h:
3837
3838 2018-04-25  Chris Dumez  <cdumez@apple.com>
3839
3840         window.postMessage() / focus() / blur() throw a TypeError when called on a RemoteDOMWindow
3841         https://bugs.webkit.org/show_bug.cgi?id=184981
3842
3843         Reviewed by Sam Weinig.
3844
3845         window.postMessage() / focus() / blur() was throwing a TypeError when called on a RemoteDOMWindow,
3846         complaining that |this| is not a Window. This was caused by a copy & paste mistake in
3847         JSDOMWindowCustom where we were calling the JSDOMWindow methods instead of the JSRemoteDOMWindow
3848         ones.
3849
3850         No new tests, updated existing tests.
3851
3852         * bindings/js/JSDOMWindowCustom.cpp:
3853         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
3854         * page/RemoteDOMWindow.cpp:
3855         (WebCore::RemoteDOMWindow::postMessage):
3856         * page/RemoteDOMWindow.h:
3857         * page/RemoteDOMWindow.idl:
3858
3859 2018-04-25  Simon Fraser  <simon.fraser@apple.com>
3860
3861         brightness() filter should default to 1, and not allow negative values
3862         https://bugs.webkit.org/show_bug.cgi?id=184937
3863
3864         Reviewed by Dean Jackson.
3865
3866         Remove the special-casing for brightness() in consumeFilterFunction(), so it now
3867         follows the same logic as the other color-related filters in not allowing negative
3868         values.
3869
3870         Removed the special-casing for brightness() in createFilterOperations() so its default
3871         value is now 1.
3872
3873         Modified existing tests.
3874
3875         * css/StyleResolver.cpp:
3876         (WebCore::StyleResolver::createFilterOperations):
3877         * css/parser/CSSPropertyParserHelpers.cpp:
3878         (WebCore::CSSPropertyParserHelpers::allowsValuesGreaterThanOne):
3879         (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
3880
3881 2018-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
3882
3883         Missing closing parenthesis when determining INSTALL_PATH build setting in WebCore.xcconfig
3884         https://bugs.webkit.org/show_bug.cgi?id=184999
3885
3886         Reviewed by Tim Horton.
3887
3888         Tweaks a line in WebCore.xcconfig that computes INSTALL_PATH, so that it doesn't use WK_NOT or WK_EMPTY.
3889
3890         * Configurations/WebCore.xcconfig:
3891
3892 2018-04-25  Zalan Bujtas  <zalan@apple.com>
3893
3894         [LFC] Implement LayoutContexet::layout() and its dependencies.
3895         https://bugs.webkit.org/show_bug.cgi?id=184951
3896
3897         Reviewed by Antti Koivisto.
3898
3899         * layout/FormattingContext.cpp:
3900         (WebCore::Layout::FormattingContext::FormattingContext):
3901         (WebCore::Layout::FormattingContext::~FormattingContext):
3902         (WebCore::Layout::FormattingContext::computeStaticPosition):
3903         (WebCore::Layout::FormattingContext::computeInFlowPositionedPosition):
3904         (WebCore::Layout::FormattingContext::computeOutOfFlowPosition):
3905         (WebCore::Layout::FormattingContext::computeWidth):
3906         (WebCore::Layout::FormattingContext::computeHeight):
3907         (WebCore::Layout::FormattingContext::marginTop):
3908         (WebCore::Layout::FormattingContext::marginLeft):
3909         (WebCore::Layout::FormattingContext::marginBottom):
3910         (WebCore::Layout::FormattingContext::marginRight):
3911         * layout/FormattingContext.h:
3912         * layout/FormattingState.cpp:
3913         (WebCore::Layout::FormattingState::FormattingState):
3914         * layout/FormattingState.h:
3915         * layout/LayoutContext.cpp:
3916         (WebCore::Layout::LayoutContext::LayoutContext):
3917         (WebCore::Layout::LayoutContext::updateLayout):
3918         (WebCore::Layout::LayoutContext::formattingState):
3919         (WebCore::Layout::LayoutContext::formattingContext):
3920         * layout/LayoutContext.h:
3921         * layout/blockformatting/BlockFormattingContext.cpp:
3922         (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
3923         (WebCore::Layout::BlockFormattingContext::layout):
3924         (WebCore::Layout::BlockFormattingContext::formattingState const):
3925         (WebCore::Layout::BlockFormattingContext::computeStaticPosition):
3926         (WebCore::Layout::BlockFormattingContext::computeWidth):
3927         (WebCore::Layout::BlockFormattingContext::computeHeight):
3928         (WebCore::Layout::BlockFormattingContext::marginTop):
3929         (WebCore::Layout::BlockFormattingContext::marginBottom):
3930         * layout/blockformatting/BlockFormattingContext.h:
3931         * layout/blockformatting/BlockFormattingState.cpp:
3932         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
3933         * layout/blockformatting/BlockFormattingState.h:
3934         * layout/inlineformatting/InlineFormattingContext.cpp:
3935         (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
3936         (WebCore::Layout::InlineFormattingContext::layout):
3937         (WebCore::Layout::InlineFormattingContext::formattingState const):
3938         * layout/inlineformatting/InlineFormattingContext.h:
3939         * layout/inlineformatting/InlineFormattingState.cpp:
3940         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
3941         * layout/inlineformatting/InlineFormattingState.h:
3942
3943 2018-04-25  Mark Lam  <mark.lam@apple.com>
3944
3945         Push the definition of PtrTag down to the WTF layer.
3946         https://bugs.webkit.org/show_bug.cgi?id=184976
3947         <rdar://problem/39723901>
3948
3949         Reviewed by Saam Barati.
3950
3951         No new tests needed.  This is covered by existing tests.
3952
3953         * cssjit/CSSPtrTag.h:
3954         * cssjit/SelectorCompiler.h:
3955         (WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
3956         (WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
3957         (WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
3958         (WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
3959
3960 2018-04-25  Eric Carlson  <eric.carlson@apple.com>
3961
3962         [iOS] remove media element parameter from MediaElementSession methods
3963         https://bugs.webkit.org/show_bug.cgi?id=184992
3964         <rdar://problem/39731624>
3965
3966         Reviewed by Jon Lee.
3967
3968         No new tests, no behavior change.
3969
3970         * Modules/mediacontrols/MediaControlsHost.cpp:
3971         (WebCore::MediaControlsHost::allowsInlineMediaPlayback const):
3972         (WebCore::MediaControlsHost::userGestureRequired const):
3973         * accessibility/AccessibilityMediaObject.cpp:
3974         (WebCore::AccessibilityMediaObject::isPlayingInline const):
3975         * html/HTMLMediaElement.cpp:
3976         (WebCore::HTMLMediaElement::~HTMLMediaElement):
3977         (WebCore::HTMLMediaElement::parseAttribute):
3978         (WebCore::HTMLMediaElement::prepareForLoad):
3979         (WebCore::HTMLMediaElement::selectMediaResource):
3980         (WebCore::HTMLMediaElement::loadResource):
3981         (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
3982         (WebCore::HTMLMediaElement::setReadyState):
3983         (WebCore::HTMLMediaElement::play):
3984         (WebCore::HTMLMediaElement::pause):
3985         (WebCore::HTMLMediaElement::pauseInternal):
3986         (WebCore::HTMLMediaElement::setVolume):
3987         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack):
3988         (WebCore::HTMLMediaElement::sourceWasAdded):
3989         (WebCore::HTMLMediaElement::mediaEngineWasUpdated):
3990         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
3991         (WebCore::HTMLMediaElement::updatePlayState):
3992         (WebCore::HTMLMediaElement::clearMediaPlayer):
3993         (WebCore::HTMLMediaElement::resume):
3994         (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker):
3995         (WebCore::HTMLMediaElement::addEventListener):
3996         (WebCore::HTMLMediaElement::removeEventListener):
3997         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
3998         (WebCore::HTMLMediaElement::exitFullscreen):
3999         (WebCore::HTMLMediaElement::configureMediaControls):
4000         (WebCore::HTMLMediaElement::createMediaPlayer):
4001         (WebCore::HTMLMediaElement::mediaPlayerIsFullscreenPermitted const):
4002         (WebCore::HTMLMediaElement::updateMediaState):
4003         (WebCore::HTMLMediaElement::mediaState const):
4004         (WebCore::HTMLMediaElement::allowsMediaDocumentInlinePlaybackChanged):
4005         (WebCore::HTMLMediaElement::updateShouldPlay):
4006         * html/HTMLVideoElement.cpp:
4007         (WebCore::HTMLVideoElement::parseAttribute):
4008         (WebCore::HTMLVideoElement::supportsFullscreen const):
4009         (WebCore::HTMLVideoElement::webkitEnterFullscreen):
4010         (WebCore::HTMLVideoElement::webkitWirelessVideoPlaybackDisabled const):
4011         (WebCore::HTMLVideoElement::webkitSupportsPresentationMode const):
4012         (WebCore::HTMLVideoElement::setFullscreenMode):
4013         * html/MediaElementSession.cpp:
4014         (WebCore::MediaElementSession::playbackPermitted const):
4015         (WebCore::MediaElementSession::dataLoadingPermitted const):
4016         (WebCore::MediaElementSession::fullscreenPermitted const):
4017         (WebCore::MediaElementSession::pageAllowsDataLoading const):
4018         (WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming const):
4019         (WebCore::MediaElementSession::canShowControlsManager const):
4020         (WebCore::MediaElementSession::showPlaybackTargetPicker):
4021         (WebCore::MediaElementSession::hasWirelessPlaybackTargets const):
4022         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
4023         (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
4024         (WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
4025         (WebCore::MediaElementSession::mediaStateDidChange):
4026         (WebCore::MediaElementSession::effectivePreloadForElement const):
4027         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback const):
4028         (WebCore::MediaElementSession::allowsAutomaticMediaDataLoading const):