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