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