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