f80c07f0f2de3e8e4bd9095370b873238bd1b88e
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-04-26  Mark Lam  <mark.lam@apple.com>
2
3         Gardening: Speculative build fix for Windows.
4         https://bugs.webkit.org/show_bug.cgi?id=184976
5         <rdar://problem/39723901>
6
7         Not reviewed.
8
9         * cssjit/CSSPtrTag.h:
10
11 2018-04-26  Brent Fulgham  <bfulgham@apple.com>
12
13         Show punycode if URL contains Latin small letter o with dot below character
14         https://bugs.webkit.org/show_bug.cgi?id=185051
15         <rdar://problem/39459297>
16
17         Reviewed by David Kilzer.
18
19         Revise our "lookalike character" logic to include the small Latin o
20         with dot below character.
21
22         Test: fast/url/host.html
23
24         * platform/mac/WebCoreNSURLExtras.mm:
25         (WebCore::isLookalikeCharacter):
26
27 2018-04-26  Daniel Bates  <dabates@apple.com>
28
29         Fix the build following r231068
30         (https://bugs.webkit.org/show_bug.cgi?id=185002)
31
32         Substitute mainResourceRequest.resourceRequest().url() for mainResourceRequest.url() as the
33         latter does not exist.
34
35         * loader/DocumentLoader.cpp:
36         (WebCore::DocumentLoader::loadMainResource):
37
38 2018-04-26  Daniel Bates  <dabates@apple.com>
39
40         DocumentLoader::loadMainResource() should WTFMove() the passed ResourceRequest
41         https://bugs.webkit.org/show_bug.cgi?id=185002
42
43         Reviewed by Youenn Fablet and Alex Christensen.
44
45         In r224852 we extracted logic from DocumentLoader::startLoadingMainResource() into a new
46         function DocumentLoader::loadMainResource() that could be shared by both DocumentLoader::startLoadingMainResource()
47         and the service worker code. As part of this extraction, DocumentLoader::loadMainResource()
48         takes a ResourceRequest by rvalue reference, but it never actually takes ownership of this
49         ResourceRequest and subsequently makes a copy of it when instantiating a CachedResourceRequest.
50         Instead we should WTFMove() the passed request into the CachedResourceRequest.
51
52         * loader/DocumentLoader.cpp:
53         (WebCore::DocumentLoader::loadMainResource):
54
55 2018-04-26  Sihui Liu  <sihui_liu@apple.com>
56
57         -[WKHTTPCookieStore deleteCookie:completionHandler:] doesn't delete cookies
58         https://bugs.webkit.org/show_bug.cgi?id=184938
59         <rdar://problem/34737395>
60
61         Reviewed by Geoffrey Garen.
62
63         When a Cookie object was converted to NSHTTPCookie object, the HTTPOnly property information
64         was lost so the delete function cannot find the proper cookie to delete.
65         This patch implements a workaround that compares Cookie object instead of NSHTTPCookie 
66         object. We might want to add the ability to set HTTPOnly header during conversion if there
67         is an easy way to do it later.
68         
69         New API test: WebKit.WKHTTPCookieStoreHttpOnly
70
71         * platform/network/cocoa/CookieCocoa.mm:
72         (WebCore::Cookie::operator== const):
73         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
74         (WebCore::NetworkStorageSession::deleteCookie):
75
76 2018-04-26  Commit Queue  <commit-queue@webkit.org>
77
78         Unreviewed, rolling out r231052.
79         https://bugs.webkit.org/show_bug.cgi?id=185044
80
81         Broke test http/tests/security/credentials-main-resource.html
82         (Requested by dydz on #webkit).
83
84         Reverted changeset:
85
86         "DocumentLoader::loadMainResource() should WTFMove() the
87         passed ResourceRequest"
88         https://bugs.webkit.org/show_bug.cgi?id=185002
89         https://trac.webkit.org/changeset/231052
90
91 2018-04-26  Jer Noble  <jer.noble@apple.com>
92
93         WK_COCOA_TOUCH all the things.
94         https://bugs.webkit.org/show_bug.cgi?id=185006
95
96         Reviewed by Tim Horton.
97
98         * Configurations/WebCore.xcconfig:
99
100 2018-04-26  David Kilzer  <ddkilzer@apple.com>
101
102         Make WAKScrollView delegate a weak property
103         <https://webkit.org/b/184799>
104         <rdar://problem/39469669>
105
106         Reviewed by Simon Fraser.
107
108         * platform/ios/wak/WAKScrollView.h:
109         - Remove `delegate` instance variable declaration.
110         - Declare `delegate` property as weak.
111         (-[WAKScrollView setDelegate:]): Delete declaration.
112         (-[WAKScrollView delegate]): Ditto.
113         * platform/ios/wak/WAKScrollView.mm:
114         - Synthesize getter/setter methods for `delegate` property.
115         (-[WAKScrollView setDelegate:]): Delete implementation.
116         (-[WAKScrollView delegate]): Ditto.
117
118 2018-04-26  Youenn Fablet  <youenn@apple.com>
119
120         CORS preflight checker should add a console message when preflight load is blocked
121         https://bugs.webkit.org/show_bug.cgi?id=185021
122
123         Reviewed by Chris Dumez.
124
125         No change of behavior, adding a JS console message when preflight load is blocked.
126         This mirrors what is being done in preflighting done from NetworkProcess.
127         Covered by existing tests.
128
129         * loader/CrossOriginPreflightChecker.cpp:
130         (WebCore::CrossOriginPreflightChecker::notifyFinished):
131         (WebCore::CrossOriginPreflightChecker::doPreflight):
132
133 2018-04-26  Daniel Bates  <dabates@apple.com>
134
135         DocumentLoader::loadMainResource() should WTFMove() the passed ResourceRequest
136         https://bugs.webkit.org/show_bug.cgi?id=185002
137
138         Reviewed by Youenn Fablet and Alex Christensen.
139
140         In r224852 we extracted logic from DocumentLoader::startLoadingMainResource() into a new
141         function DocumentLoader::loadMainResource() that could be shared by both DocumentLoader::startLoadingMainResource()
142         and the service worker code. As part of this extraction, DocumentLoader::loadMainResource()
143         takes a ResourceRequest by rvalue reference, but it never actually takes ownership of this
144         ResourceRequest and subsequently makes a copy of it when instantiating a CachedResourceRequest.
145         Instead we should WTFMove() the passed request into the CachedResourceRequest.
146
147         * loader/DocumentLoader.cpp:
148         (WebCore::DocumentLoader::loadMainResource):
149
150 2018-04-26  Per Arne Vollan  <pvollan@apple.com>
151
152         Disable content filtering in minimal simulator mode
153         https://bugs.webkit.org/show_bug.cgi?id=185027
154         <rdar://problem/39736091>
155
156         Reviewed by Jer Noble.
157
158         * Configurations/FeatureDefines.xcconfig:
159
160 2018-04-25  Brent Fulgham  <bfulgham@apple.com>
161
162         Add port 548 (afpovertcp) to port blacklist
163         https://bugs.webkit.org/show_bug.cgi?id=185000
164         <rdar://problem/39540481>
165
166         Reviewed by David Kilzer.
167
168         Tested by security/block-test.html.
169
170         * platform/URL.cpp:
171         (WebCore::portAllowed):Also block port 548.
172
173 2018-04-26  Andy VanWagoner  <thetalecrafter@gmail.com>
174
175         [INTL] Implement Intl.PluralRules
176         https://bugs.webkit.org/show_bug.cgi?id=184312
177
178         Reviewed by JF Bastien.
179
180         Added Intl.PluralRules feature flag.
181
182         Test: js/intl-pluralrules.html
183
184         * Configurations/FeatureDefines.xcconfig:
185
186 2018-04-15  Darin Adler  <darin@apple.com>
187
188         [Cocoa] Adopt CCRSAGetCRTComponents and stop using CCBigNum
189         https://bugs.webkit.org/show_bug.cgi?id=184637
190
191         Reviewed by Alexey Proskuryakov.
192
193         * crypto/CommonCryptoUtilities.cpp: Compile out WebCore::CCBigNum class if
194         HAVE(CCRSAGetCRTComponents) is true.
195
196         * crypto/CommonCryptoUtilities.h: Define HAVE(CCRSAGetCRTComponents) on new
197         enough versions of iOS and macOS that have it and add declarations of the
198         function for the non-Apple-internal-SDK case. Also don't define the
199         WebCore::CCBigNum class if HAVE(CCRSAGetCRTComponents) is true.
200
201         * crypto/mac/CryptoKeyRSAMac.cpp:
202         (WebCore::getPrivateKeyComponents): Use CCRSAGetCRTComponents if present.
203
204 2018-04-26  Per Arne Vollan  <pvollan@apple.com>
205
206         Add lazy initialization of caption display mode for videos.
207         https://bugs.webkit.org/show_bug.cgi?id=184993
208
209         The call to MACaptionAppearanceGetDisplayType in CaptionUserPreferencesMediaAF::captionDisplayMode()
210         is showing up in samples when called from HTMLMediaElement::finishInitialization().
211
212         Reviewed by Eric Carlson.
213
214         No new tests, covered by existing tests.
215
216         * html/HTMLMediaElement.cpp:
217         (WebCore::HTMLMediaElement::finishInitialization):
218         (WebCore::HTMLMediaElement::setSelectedTextTrack):
219         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
220         (WebCore::HTMLMediaElement::captionPreferencesChanged):
221         (WebCore::HTMLMediaElement::captionDisplayMode):
222         * html/HTMLMediaElement.h:
223
224 2018-04-26  Zan Dobersek  <zdobersek@igalia.com>
225
226         [GTK][WPE] Initial ASYNC_SCROLLING support
227         https://bugs.webkit.org/show_bug.cgi?id=184961
228
229         Reviewed by Carlos Garcia Campos.
230
231         Add CoordinatedGraphics-specific code that will be required for async
232         scrolling support. The ScrollingCoordinatorCoordinatedGraphics and
233         ScrollingTreeCoordinatedGraphics classes are mostly complete already,
234         but the new ScrollingTreeNode-inheriting classes will need further
235         work that will have to be done in parallel with other improvements
236         planned for the CoordinatedGraphics subsystem.
237
238         While the build-time flag is enabled, the feature is still not enabled
239         at runtime due to being marked as unsupported by the DrawingArea
240         implementation in the WebKit layer. It would also not work yet if it
241         were enabled due to the before-mentioned pending changes.
242
243         Various build fixes that address non-Cocoa usage of ASYNC_SCROLLING
244         code are included.
245
246         * Sources.txt: Add AsyncScrollingCoordinator.cpp to build.
247         * SourcesCocoa.txt:
248         * SourcesGTK.txt: Add new files to build.
249         * SourcesWPE.txt: Ditto.
250         * page/scrolling/AsyncScrollingCoordinator.cpp:
251         Guard setStateScrollingNodeSnapOffsetsAsFloat() with CSS_SCROLL_SNAP.
252         * page/scrolling/ScrollingTree.h:
253         * page/scrolling/ThreadedScrollingTree.cpp:
254         * page/scrolling/ThreadedScrollingTree.h:
255         currentSnapPointIndicesDidChange() method is only invoked in
256         Cocoa-specific code, and its implementation calls Cocoa-specific method
257         on the AsyncScrollingCoordinator class.
258         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
259         (WebCore::ScrollingCoordinator::create):
260         (WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics):
261         (WebCore::ScrollingCoordinatorCoordinatedGraphics::~ScrollingCoordinatorCoordinatedGraphics):
262         (WebCore::ScrollingCoordinatorCoordinatedGraphics::pageDestroyed):
263         (WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeStateIfNeeded):
264         (WebCore::ScrollingCoordinatorCoordinatedGraphics::handleWheelEvent):
265         (WebCore::ScrollingCoordinatorCoordinatedGraphics::scheduleTreeStateCommit):
266         (WebCore::ScrollingCoordinatorCoordinatedGraphics::commitTreeState):
267         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: Added.
268         * page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp: Added.
269         (WebCore::ScrollingTreeCoordinatedGraphics::create):
270         (WebCore::ScrollingTreeCoordinatedGraphics::ScrollingTreeCoordinatedGraphics):
271         (WebCore::ScrollingTreeCoordinatedGraphics::createScrollingTreeNode):
272         * page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h: Added.
273         * page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp: Added.
274         (WebCore::ScrollingTreeFixedNode::create):
275         (WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode):
276         (WebCore::ScrollingTreeFixedNode::~ScrollingTreeFixedNode):
277         (WebCore::ScrollingTreeFixedNode::commitStateBeforeChildren):
278         (WebCore::ScrollingTreeFixedNode::updateLayersAfterAncestorChange):
279         * page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h: Added.
280         * page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp: Added.
281         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::create):
282         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::ScrollingTreeFrameScrollingNodeCoordinatedGraphics):
283         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::handleWheelEvent):
284         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::scrollPosition const):
285         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPosition):
286         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollPositionWithoutContentEdgeConstraints):
287         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::setScrollLayerPosition):
288         (WebCore::ScrollingTreeFrameScrollingNodeCoordinatedGraphics::updateLayersAfterViewportChange):
289         * page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h: Added.
290         * page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp: Added.
291         (WebCore::ScrollingTreeStickyNode::create):
292         (WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode):
293         (WebCore::ScrollingTreeStickyNode::~ScrollingTreeStickyNode):
294         (WebCore::ScrollingTreeStickyNode::commitStateBeforeChildren):
295         (WebCore::ScrollingTreeStickyNode::updateLayersAfterAncestorChange):
296         * page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h: Added.
297         * platform/PlatformWheelEvent.h: Enable PlatformWheelEventPhase code
298         for WPE. Guard latching-specific methods under ASYNC_SCROLLING.
299         * platform/TextureMapper.cmake: Two build targets have been moved to
300         SourcesGTK.txt and SourcesWPE.txt.
301
302 2018-04-25  Michael Catanzaro  <mcatanzaro@igalia.com>
303
304         [WPE] Build and link against latest WPEBackend and WPEBackend-fdo
305         https://bugs.webkit.org/show_bug.cgi?id=184643
306
307         Reviewed by Žan Doberšek.
308
309         Adapt to single-header WPE includes.
310
311         * platform/graphics/egl/GLContextEGLWPE.cpp:
312         * platform/graphics/wpe/PlatformDisplayWPE.cpp:
313         * platform/wpe/PlatformPasteboardWPE.cpp:
314
315 2018-04-25  Youenn Fablet  <youenn@apple.com>
316
317         Use NetworkLoadChecker for all subresource loads except fetch/XHR
318         https://bugs.webkit.org/show_bug.cgi?id=184870
319         <rdar://problem/39370034>
320
321         Reviewed by Chris Dumez.
322
323         No change of behavior.
324         Update CachedResourceLoader error messages to match NetworkProcess error messages.
325
326         * loader/cache/CachedResourceLoader.cpp:
327         (WebCore::CachedResourceLoader::printAccessDeniedMessage const):
328
329 2018-04-25  Zalan Bujtas  <zalan@apple.com>
330
331         [LFC] Add support for is<> and downcast<>
332         https://bugs.webkit.org/show_bug.cgi?id=185016
333
334         Reviewed by Antti Koivisto.
335
336         * layout/layouttree/LayoutBlockContainer.cpp:
337         (WebCore::Layout::BlockContainer::BlockContainer):
338         * layout/layouttree/LayoutBlockContainer.h:
339         * layout/layouttree/LayoutBox.cpp:
340         (WebCore::Layout::Box::Box):
341         * layout/layouttree/LayoutBox.h:
342         (WebCore::Layout::Box::isContainer const):
343         (WebCore::Layout::Box::isBlockContainer const):
344         (WebCore::Layout::Box::isInlineBox const):
345         (WebCore::Layout::Box::isInlineContainer const):
346         * layout/layouttree/LayoutContainer.cpp:
347         (WebCore::Layout::Container::Container):
348         * layout/layouttree/LayoutContainer.h:
349         * layout/layouttree/LayoutInlineBox.cpp:
350         (WebCore::Layout::InlineBox::InlineBox):
351         * layout/layouttree/LayoutInlineBox.h:
352         * layout/layouttree/LayoutInlineContainer.cpp:
353         (WebCore::Layout::InlineContainer::InlineContainer):
354         * layout/layouttree/LayoutInlineContainer.h:
355
356 2018-04-25  Chris Dumez  <cdumez@apple.com>
357
358         window.postMessage() / focus() / blur() throw a TypeError when called on a RemoteDOMWindow
359         https://bugs.webkit.org/show_bug.cgi?id=184981
360
361         Reviewed by Sam Weinig.
362
363         window.postMessage() / focus() / blur() was throwing a TypeError when called on a RemoteDOMWindow,
364         complaining that |this| is not a Window. This was caused by a copy & paste mistake in
365         JSDOMWindowCustom where we were calling the JSDOMWindow methods instead of the JSRemoteDOMWindow
366         ones.
367
368         No new tests, updated existing tests.
369
370         * bindings/js/JSDOMWindowCustom.cpp:
371         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
372         * page/RemoteDOMWindow.cpp:
373         (WebCore::RemoteDOMWindow::postMessage):
374         * page/RemoteDOMWindow.h:
375         * page/RemoteDOMWindow.idl:
376
377 2018-04-25  Simon Fraser  <simon.fraser@apple.com>
378
379         brightness() filter should default to 1, and not allow negative values
380         https://bugs.webkit.org/show_bug.cgi?id=184937
381
382         Reviewed by Dean Jackson.
383
384         Remove the special-casing for brightness() in consumeFilterFunction(), so it now
385         follows the same logic as the other color-related filters in not allowing negative
386         values.
387
388         Removed the special-casing for brightness() in createFilterOperations() so its default
389         value is now 1.
390
391         Modified existing tests.
392
393         * css/StyleResolver.cpp:
394         (WebCore::StyleResolver::createFilterOperations):
395         * css/parser/CSSPropertyParserHelpers.cpp:
396         (WebCore::CSSPropertyParserHelpers::allowsValuesGreaterThanOne):
397         (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
398
399 2018-04-25  Wenson Hsieh  <wenson_hsieh@apple.com>
400
401         Missing closing parenthesis when determining INSTALL_PATH build setting in WebCore.xcconfig
402         https://bugs.webkit.org/show_bug.cgi?id=184999
403
404         Reviewed by Tim Horton.
405
406         Tweaks a line in WebCore.xcconfig that computes INSTALL_PATH, so that it doesn't use WK_NOT or WK_EMPTY.
407
408         * Configurations/WebCore.xcconfig:
409
410 2018-04-25  Zalan Bujtas  <zalan@apple.com>
411
412         [LFC] Implement LayoutContexet::layout() and its dependencies.
413         https://bugs.webkit.org/show_bug.cgi?id=184951
414
415         Reviewed by Antti Koivisto.
416
417         * layout/FormattingContext.cpp:
418         (WebCore::Layout::FormattingContext::FormattingContext):
419         (WebCore::Layout::FormattingContext::~FormattingContext):
420         (WebCore::Layout::FormattingContext::computeStaticPosition):
421         (WebCore::Layout::FormattingContext::computeInFlowPositionedPosition):
422         (WebCore::Layout::FormattingContext::computeOutOfFlowPosition):
423         (WebCore::Layout::FormattingContext::computeWidth):
424         (WebCore::Layout::FormattingContext::computeHeight):
425         (WebCore::Layout::FormattingContext::marginTop):
426         (WebCore::Layout::FormattingContext::marginLeft):
427         (WebCore::Layout::FormattingContext::marginBottom):
428         (WebCore::Layout::FormattingContext::marginRight):
429         * layout/FormattingContext.h:
430         * layout/FormattingState.cpp:
431         (WebCore::Layout::FormattingState::FormattingState):
432         * layout/FormattingState.h:
433         * layout/LayoutContext.cpp:
434         (WebCore::Layout::LayoutContext::LayoutContext):
435         (WebCore::Layout::LayoutContext::updateLayout):
436         (WebCore::Layout::LayoutContext::formattingState):
437         (WebCore::Layout::LayoutContext::formattingContext):
438         * layout/LayoutContext.h:
439         * layout/blockformatting/BlockFormattingContext.cpp:
440         (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
441         (WebCore::Layout::BlockFormattingContext::layout):
442         (WebCore::Layout::BlockFormattingContext::formattingState const):
443         (WebCore::Layout::BlockFormattingContext::computeStaticPosition):
444         (WebCore::Layout::BlockFormattingContext::computeWidth):
445         (WebCore::Layout::BlockFormattingContext::computeHeight):
446         (WebCore::Layout::BlockFormattingContext::marginTop):
447         (WebCore::Layout::BlockFormattingContext::marginBottom):
448         * layout/blockformatting/BlockFormattingContext.h:
449         * layout/blockformatting/BlockFormattingState.cpp:
450         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
451         * layout/blockformatting/BlockFormattingState.h:
452         * layout/inlineformatting/InlineFormattingContext.cpp:
453         (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
454         (WebCore::Layout::InlineFormattingContext::layout):
455         (WebCore::Layout::InlineFormattingContext::formattingState const):
456         * layout/inlineformatting/InlineFormattingContext.h:
457         * layout/inlineformatting/InlineFormattingState.cpp:
458         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
459         * layout/inlineformatting/InlineFormattingState.h:
460
461 2018-04-25  Mark Lam  <mark.lam@apple.com>
462
463         Push the definition of PtrTag down to the WTF layer.
464         https://bugs.webkit.org/show_bug.cgi?id=184976
465         <rdar://problem/39723901>
466
467         Reviewed by Saam Barati.
468
469         No new tests needed.  This is covered by existing tests.
470
471         * cssjit/CSSPtrTag.h:
472         * cssjit/SelectorCompiler.h:
473         (WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
474         (WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
475         (WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
476         (WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
477
478 2018-04-25  Eric Carlson  <eric.carlson@apple.com>
479
480         [iOS] remove media element parameter from MediaElementSession methods
481         https://bugs.webkit.org/show_bug.cgi?id=184992
482         <rdar://problem/39731624>
483
484         Reviewed by Jon Lee.
485
486         No new tests, no behavior change.
487
488         * Modules/mediacontrols/MediaControlsHost.cpp:
489         (WebCore::MediaControlsHost::allowsInlineMediaPlayback const):
490         (WebCore::MediaControlsHost::userGestureRequired const):
491         * accessibility/AccessibilityMediaObject.cpp:
492         (WebCore::AccessibilityMediaObject::isPlayingInline const):
493         * html/HTMLMediaElement.cpp:
494         (WebCore::HTMLMediaElement::~HTMLMediaElement):
495         (WebCore::HTMLMediaElement::parseAttribute):
496         (WebCore::HTMLMediaElement::prepareForLoad):
497         (WebCore::HTMLMediaElement::selectMediaResource):
498         (WebCore::HTMLMediaElement::loadResource):
499         (WebCore::HTMLMediaElement::canTransitionFromAutoplayToPlay const):
500         (WebCore::HTMLMediaElement::setReadyState):
501         (WebCore::HTMLMediaElement::play):
502         (WebCore::HTMLMediaElement::pause):
503         (WebCore::HTMLMediaElement::pauseInternal):
504         (WebCore::HTMLMediaElement::setVolume):
505         (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack):
506         (WebCore::HTMLMediaElement::sourceWasAdded):
507         (WebCore::HTMLMediaElement::mediaEngineWasUpdated):
508         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
509         (WebCore::HTMLMediaElement::updatePlayState):
510         (WebCore::HTMLMediaElement::clearMediaPlayer):
511         (WebCore::HTMLMediaElement::resume):
512         (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker):
513         (WebCore::HTMLMediaElement::addEventListener):
514         (WebCore::HTMLMediaElement::removeEventListener):
515         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
516         (WebCore::HTMLMediaElement::exitFullscreen):
517         (WebCore::HTMLMediaElement::configureMediaControls):
518         (WebCore::HTMLMediaElement::createMediaPlayer):
519         (WebCore::HTMLMediaElement::mediaPlayerIsFullscreenPermitted const):
520         (WebCore::HTMLMediaElement::updateMediaState):
521         (WebCore::HTMLMediaElement::mediaState const):
522         (WebCore::HTMLMediaElement::allowsMediaDocumentInlinePlaybackChanged):
523         (WebCore::HTMLMediaElement::updateShouldPlay):
524         * html/HTMLVideoElement.cpp:
525         (WebCore::HTMLVideoElement::parseAttribute):
526         (WebCore::HTMLVideoElement::supportsFullscreen const):
527         (WebCore::HTMLVideoElement::webkitEnterFullscreen):
528         (WebCore::HTMLVideoElement::webkitWirelessVideoPlaybackDisabled const):
529         (WebCore::HTMLVideoElement::webkitSupportsPresentationMode const):
530         (WebCore::HTMLVideoElement::setFullscreenMode):
531         * html/MediaElementSession.cpp:
532         (WebCore::MediaElementSession::playbackPermitted const):
533         (WebCore::MediaElementSession::dataLoadingPermitted const):
534         (WebCore::MediaElementSession::fullscreenPermitted const):
535         (WebCore::MediaElementSession::pageAllowsDataLoading const):
536         (WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming const):
537         (WebCore::MediaElementSession::canShowControlsManager const):
538         (WebCore::MediaElementSession::showPlaybackTargetPicker):
539         (WebCore::MediaElementSession::hasWirelessPlaybackTargets const):
540         (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const):
541         (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
542         (WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
543         (WebCore::MediaElementSession::mediaStateDidChange):
544         (WebCore::MediaElementSession::effectivePreloadForElement const):
545         (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback const):
546         (WebCore::MediaElementSession::allowsAutomaticMediaDataLoading const):
547         (WebCore::MediaElementSession::mediaEngineUpdated):
548         (WebCore::MediaElementSession::allowsPictureInPicture const):
549         * html/MediaElementSession.h:
550         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
551         (WebCore::PlaybackSessionModelMediaElement::wirelessVideoPlaybackDisabled const):
552
553 2018-04-25  Jiewen Tan  <jiewen_tan@apple.com>
554
555         Remove access to keychain from the WebContent process
556         https://bugs.webkit.org/show_bug.cgi?id=184428
557         <rdar://problem/13150903>
558
559         Reviewed by Brent Fulgham.
560
561         Part 2.
562
563         This patch move the operation of HTMLKeygenElement from WebContent Process to UI Process.
564         Function signedPublicKeyAndChallengeString is therefore marked as WEBCORE_EXPORT. Also, a
565         localized string is marked WEBCORE_EXPORT as well to support the API test.
566
567         Covered by existing tests and api tests.
568
569         * WebCore.xcodeproj/project.pbxproj:
570         * dom/Document.cpp:
571         (WebCore::Document::signedPublicKeyAndChallengeString):
572         * dom/Document.h:
573         * html/HTMLKeygenElement.cpp:
574         (WebCore::HTMLKeygenElement::appendFormData):
575         * page/ChromeClient.h:
576         * platform/LocalizedStrings.h:
577         * platform/SSLKeyGenerator.h:
578
579 2018-04-25  Ryosuke Niwa  <rniwa@webkit.org>
580
581         PSON: Don't create a new process when navigating to a blob URL, data URL, and about:blank
582         https://bugs.webkit.org/show_bug.cgi?id=184962
583
584         Reviewed by Youenn Fablet.
585
586         Added NavigationAction::treatAsSameOriginNavigation, which signifies WebKit code to avoid creating
587         a new WebContent process when navigating to a blob URL, data URL, and about:blank.
588
589         Tests: ProcessSwap.SameOriginBlobNavigation
590                ProcessSwap.CrossOriginBlobNavigation
591                ProcessSwap.NavigateToAboutBlank
592                ProcessSwap.NavigateToDataURL
593
594         * loader/NavigationAction.cpp:
595         (WebCore::treatAsSameOriginNavigation):
596         * loader/NavigationAction.h:
597         (WebCore::NavigationAction::treatAsSameOriginNavigation const):
598
599 2018-04-25  Zalan Bujtas  <zalan@apple.com>
600
601         [LFC] Implement Layout::BlockContainer functions.
602         https://bugs.webkit.org/show_bug.cgi?id=184994
603
604         Reviewed by Antti Koivisto.
605
606         * layout/layouttree/LayoutBlockContainer.cpp:
607         (WebCore::Layout::BlockContainer::BlockContainer):
608         (WebCore::Layout::BlockContainer::establishesInlineFormattingContext const):
609
610 2018-04-25  Zalan Bujtas  <zalan@apple.com>
611
612         [LFC] Implement Layout::Container functions.
613         https://bugs.webkit.org/show_bug.cgi?id=184988
614
615         Reviewed by Antti Koivisto.
616
617         * layout/layouttree/LayoutContainer.cpp:
618         (WebCore::Layout::Container::Container):
619         (WebCore::Layout::Container::firstInFlowChild const):
620         (WebCore::Layout::Container::firstInFlowOrFloatingChild const):
621         (WebCore::Layout::Container::lastInFlowChild const):
622         (WebCore::Layout::Container::lastInFlowOrFloatingChild const):
623         (WebCore::Layout::Container::setFirstChild):
624         (WebCore::Layout::Container::setLastChild):
625         (WebCore::Layout::Container::setOutOfFlowDescendants):
626         * layout/layouttree/LayoutContainer.h:
627         (WebCore::Layout::Container::firstChild const):
628         (WebCore::Layout::Container::lastChild const):
629         (WebCore::Layout::Container::hasChild const):
630         (WebCore::Layout::Container::hasInFlowChild const):
631         (WebCore::Layout::Container::hasInFlowOrFloatingChild const):
632         (WebCore::Layout::Container::outOfFlowDescendants):
633
634 2018-04-25  Brent Fulgham  <bfulgham@apple.com>
635
636         Don't Block First Party Cookies on Redirects
637         https://bugs.webkit.org/show_bug.cgi?id=184948
638         <rdar://problem/39534099>
639
640         Reviewed by Youenn Fablet.
641
642         The Navigation scheduler looses the 'requester' value when performing a ScheduledRedirect.
643
644         Test: http/tests/resourceLoadStatistics/do-not-block-top-level-navigation-redirect.html
645
646         * loader/NavigationScheduler.cpp:
647
648 2018-04-25  Youenn Fablet  <youenn@apple.com>
649
650         CachedRawResource is not handling incremental data computation correctly
651         https://bugs.webkit.org/show_bug.cgi?id=184936
652
653         Reviewed by Chris Dumez.
654
655         Covered by updated test.
656
657         The previous logic was handling the case of only one additional segment being added to the SharedBuffer.
658         In service worker case, a SharedBuffer may contain more than one segment.
659         This is fixed by iterating until all new data is sent to clients.
660
661         * loader/cache/CachedRawResource.cpp:
662         (WebCore::CachedRawResource::updateBuffer):
663
664 2018-04-25  Andy Estes  <aestes@apple.com>
665
666         [Mac] Number of drop items is always 0 when performing a DHTML drag
667         https://bugs.webkit.org/show_bug.cgi?id=184943
668
669         Reviewed by Ryosuke Niwa.
670
671         New API test: DragAndDropPasteboardTests.NumberOfValidItemsForDrop
672
673         DragController tracks the number of items to be accepted by a file input element, taking
674         into account whether the control is disabled or accepts multiple files. When this number
675         changes, WebKit informs the NSDraggingInfo-conforming object passed to -draggingUpdated by
676         calling -setNumberOfValidItemsForDrop:. This number is presented to the user in a badge
677         rendered next to the dragging item thumbnails.
678
679         When performing a DHTML drag, we don't know how many items the page will accept, so prior
680         to this patch we would render a "0" in the badge. This is misleading, because the page is
681         more likely to accept all the items (or at least one of them) rather than none of them.
682
683         Let's do the straightforward thing and set numberOfValidItemsForDrop to equal the number of
684         files in the drag operation when performing a DHTML file drag.
685
686         * page/DragController.cpp:
687         (WebCore::DragController::tryDocumentDrag):
688
689 2018-04-25  Eric Carlson  <eric.carlson@apple.com>
690
691         [iOS] Set route sharing policy when setting audio session category
692         https://bugs.webkit.org/show_bug.cgi?id=184979
693         <rdar://problem/39709577>
694
695         Reviewed by Jer Noble.
696
697         * platform/audio/ios/AudioSessionIOS.mm:
698         (WebCore::AudioSession::setCategory):
699
700 2018-04-25  Basuke Suzuki  <Basuke.Suzuki@sony.com>
701
702         [Curl] Fix wrong schema checking on r230973
703         https://bugs.webkit.org/show_bug.cgi?id=184977
704
705         Did write a wrong condition when making a string.
706
707         Reviewed by Alex Christensen.
708
709         No new tests because test interface is not ready.
710
711         * platform/network/curl/CurlProxySettings.cpp:
712         (WebCore::createProxyUrl):
713
714 2018-04-25  Youenn Fablet  <youenn@apple.com>
715
716         Make DocumentThreadableLoader error logging more consistent
717         https://bugs.webkit.org/show_bug.cgi?id=184853
718
719         Reviewed by Chris Dumez.
720
721         Covered by rebased tests.
722         Make EventSource, XHR and Fetch log error messages consistently.
723         This patch also prepares consistent error logging between WK1 and WK2 as WK2 NetworkProcess
724         will issue more and more errors in places different from WK1.
725         This is the reason for SubresourceLoader changes in this patch and DTL/didFail/preflightFailure changes.
726
727         Update ImageLoader error message to be more general than CORS.
728
729         * loader/CrossOriginPreflightChecker.cpp:
730         (WebCore::CrossOriginPreflightChecker::doPreflight): Add some more logging for consistency between WK1 and WK2.
731         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse): Ditto.
732         * loader/DocumentThreadableLoader.cpp:
733         (WebCore::DocumentThreadableLoader::didFail):
734         (WebCore::DocumentThreadableLoader::preflightFailure):
735         (WebCore::DocumentThreadableLoader::logErrorAndFail):
736         * loader/ImageLoader.cpp:
737         (WebCore::ImageLoader::notifyFinished):
738         * loader/SubresourceLoader.cpp:
739         (WebCore::SubresourceLoader::didFail):
740         * loader/ThreadableLoader.cpp:
741         (WebCore::ThreadableLoader::logError):
742         * loader/cache/CachedResource.cpp:
743         (WebCore::CachedResource::load):
744         * loader/cache/CachedResourceRequestInitiators.cpp:
745         (WebCore::CachedResourceRequestInitiators::CachedResourceRequestInitiators):
746         * loader/cache/CachedResourceRequestInitiators.h:
747         * page/EventSource.cpp:
748         (WebCore::EventSource::connect):
749         (WebCore::EventSource::didFail):
750         * xml/XMLHttpRequest.cpp:
751         (WebCore::XMLHttpRequest::didFail):
752
753 2018-04-25  Zalan Bujtas  <zalan@apple.com>
754
755         [LFC] Implement Layout::Box functions.
756         https://bugs.webkit.org/show_bug.cgi?id=184974
757
758         Reviewed by Antti Koivisto.
759
760         * layout/layouttree/LayoutBlockContainer.h:
761         * layout/layouttree/LayoutBox.cpp:
762         (WebCore::Layout::Box::Box):
763         (WebCore::Layout::Box::~Box):
764         (WebCore::Layout::Box::establishesFormattingContext const):
765         (WebCore::Layout::Box::establishesBlockFormattingContext const):
766         (WebCore::Layout::Box::isRelativelyPositioned const):
767         (WebCore::Layout::Box::isStickyPositioned const):
768         (WebCore::Layout::Box::isAbsolutelyPositioned const):
769         (WebCore::Layout::Box::isFixedPositioned const):
770         (WebCore::Layout::Box::isFloatingPositioned const):
771         (WebCore::Layout::Box::containingBlock const):
772         (WebCore::Layout::Box::isDescendantOf const):
773         (WebCore::Layout::Box::isAnonymous const):
774         (WebCore::Layout::Box::isInlineBlockBox const):
775         (WebCore::Layout::Box::isBlockLevelBox const):
776         (WebCore::Layout::Box::isInlineLevelBox const):
777         (WebCore::Layout::Box::isBlockContainerBox const):
778         (WebCore::Layout::Box::isInitialContainingBlock const):
779         (WebCore::Layout::Box::nextInFlowSibling const):
780         (WebCore::Layout::Box::nextInFlowOrFloatingSibling const):
781         (WebCore::Layout::Box::previousInFlowSibling const):
782         (WebCore::Layout::Box::previousInFlowOrFloatingSibling const):
783         (WebCore::Layout::Box::setParent):
784         (WebCore::Layout::Box::setNextSibling):
785         (WebCore::Layout::Box::setPreviousSibling):
786         (WebCore::Layout::Box::isOverflowVisible const):
787         * layout/layouttree/LayoutBox.h:
788         (WebCore::Layout::Box::establishesInlineFormattingContext const):
789         (WebCore::Layout::Box::isInFlow const):
790         (WebCore::Layout::Box::isPositioned const):
791         (WebCore::Layout::Box::isInFlowPositioned const):
792         (WebCore::Layout::Box::isOutOfFlowPositioned const):
793         (WebCore::Layout::Box::isFloatingOrOutOfFlowPositioned const):
794         (WebCore::Layout::Box::parent const):
795         (WebCore::Layout::Box::nextSibling const):
796         (WebCore::Layout::Box::previousSibling const):
797         (WebCore::Layout::Box::weakPtrFactory const):
798         * layout/layouttree/LayoutContainer.h:
799         * layout/layouttree/LayoutInlineBox.h:
800         * layout/layouttree/LayoutInlineContainer.h:
801
802 2018-04-25  Per Arne Vollan  <pvollan@apple.com>
803
804         [Win] Crash under WebCore::SimpleLineLayout::generateLineBoxTree
805         https://bugs.webkit.org/show_bug.cgi?id=184953
806
807         This is possibly a MSVC compiler bug, since a simple rearrangement of the code fixes the crash.
808         The crash is only happening in release builds, which also is an indication of this being a
809         compiler issue.
810
811         Reviewed by Zalan Bujtas.
812
813         No new tests, covered by existing tests.
814
815         * rendering/SimpleLineLayoutFunctions.cpp:
816         (WebCore::SimpleLineLayout::generateLineBoxTree):
817
818 2018-04-25  Dean Jackson  <dino@apple.com>
819
820         Make a better flag for system preview, and disable it where necessary
821         https://bugs.webkit.org/show_bug.cgi?id=184968
822         <rdar://problem/39686506>
823
824         Reviewed by Eric Carlson.
825
826         Use USE(SYSTEM_PREVIEW).
827
828         * html/HTMLAnchorElement.cpp:
829         (WebCore::HTMLAnchorElement::isSystemPreviewLink const):
830         * html/HTMLAnchorElement.h:
831         * html/HTMLImageElement.cpp:
832         * html/HTMLImageElement.h:
833         * html/HTMLPictureElement.cpp:
834         * html/HTMLPictureElement.h:
835         * rendering/RenderImage.cpp:
836         (WebCore::RenderImage::paintIntoRect):
837         * rendering/RenderTheme.cpp:
838         * rendering/RenderTheme.h:
839         * testing/Internals.cpp:
840         (WebCore::Internals::systemPreviewRelType):
841         (WebCore::Internals::isSystemPreviewLink const):
842         (WebCore::Internals::isSystemPreviewImage const):
843
844 2018-04-25  Zalan Bujtas  <zalan@apple.com>
845
846         Fix project file after r230931.
847
848         * WebCore.xcodeproj/project.pbxproj:
849
850 2018-04-25  Miguel Gomez  <magomez@igalia.com>
851
852         [GTK] fast/repaint/fixed-scale.html failing since r230479 "[TexMap] TextureMapperLayer unnecessarily duplicates state in GraphicsLayerTransform"
853         https://bugs.webkit.org/show_bug.cgi?id=184780
854
855         Reviewed by Žan Doberšek.
856
857         Initialize the anchorPoint to (0.5, 0.5, 0) in TextureMapperLayer::State.
858
859         Covered by existent tests.
860
861         * platform/graphics/texmap/TextureMapperLayer.h:
862
863 2018-04-25  Carlos Garcia Campos  <cgarcia@igalia.com>
864
865         [GTK] Implement MouseEvent.buttons
866         https://bugs.webkit.org/show_bug.cgi?id=184913
867
868         Reviewed by Žan Doberšek.
869
870         Add helper function to get the state modifier of a GDK button.
871
872         * platform/gtk/GtkUtilities.cpp:
873         (WebCore::stateModifierForGdkButton):
874         * platform/gtk/GtkUtilities.h:
875
876 2018-04-24  Ryosuke Niwa  <rniwa@webkit.org>
877
878         Release assert in ScriptController::canExecuteScripts via CachedSVGFont::ensureCustomFontData during
879         Document::updateStyleIfNeeded
880         https://bugs.webkit.org/show_bug.cgi?id=184950
881
882         Reviewed by Zalan Bujtas.
883
884         Convert an existing ScriptDisallowedScope::EventAllowedScope which only disables the debug assertions
885         by ScriptDisallowedScope::DisableAssertionsInScope which also disables the release assertion.
886
887         Because SVG font is loaded in a document isolated from the rest of the page (m_externalSVGDocument),
888         there is no security implication to execute scripts in this isolated document.
889
890         Unfortunately, no new tests. I could never make CachedSVGFont::ensureCustomFontData to get called inside
891         style resolution with m_externalSVGDocument set to nullptr after many attempts. Even EventAllowedScope
892         I added 13 months ago in r211965, which this patch replaces by DisableAssertionsInScope, is not utilized
893         by the existing layout tests since removing the assertion doesn't cause any layout test to hit an assertion.
894
895         * dom/ScriptDisallowedScope.h: Updated the comment.
896         * loader/cache/CachedSVGFont.cpp:
897         (WebCore::CachedSVGFont::ensureCustomFontData): Replaced the asssertion.
898
899 2018-04-24  Simon Fraser  <simon.fraser@apple.com>
900
901         visitedDependentColor() should take a CSSPropertyID
902         https://bugs.webkit.org/show_bug.cgi?id=184949
903
904         Reviewed by Sam Weinig.
905         
906         Change RenderStyle::colorIncludingFallback(), RenderStyle::visitedDependentColor()
907         and RenderElement::selectionColor() to take CSSPropertyID rather than int.
908
909         No behavior change.
910
911         * rendering/RenderElement.cpp:
912         (WebCore::RenderElement::selectionColor const):
913         * rendering/RenderElement.h:
914         * rendering/RenderTableCell.cpp:
915         (WebCore::RenderTableCell::computeCollapsedStartBorder const):
916         (WebCore::RenderTableCell::computeCollapsedEndBorder const):
917         (WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
918         (WebCore::RenderTableCell::computeCollapsedAfterBorder const):
919         * rendering/style/RenderStyle.cpp:
920         (WebCore::RenderStyle::colorIncludingFallback const):
921         (WebCore::RenderStyle::visitedDependentColor const):
922         * rendering/style/RenderStyle.h:
923
924 2018-04-24  Simon Fraser  <simon.fraser@apple.com>
925
926         Add a new "color-filter" CSS property as an experimental feature
927         https://bugs.webkit.org/show_bug.cgi?id=184940
928         rdar://problem/39664904
929
930         Reviewed by Jon Lee.
931         
932         Add a new CSS property called "color-filter" as an experimental feature (off by default).
933         
934         This property specifies a list of filter functions (as specified in https://drafts.fxtf.org/filter-effects/#supported-filter-functions)
935         to CSS colors, allowing authors to modify the provided page colors, for example to improve accessibility.
936         Filters that move pixels (i.e. blur() and drop-shadow()) are invalid in this property.
937         
938         Colors will be mapped through the filter functions just before paint time, and gradient stop colors will also be mapped.
939         
940         This patch adds support for parsing color-filter.
941
942         Test: css3/color-filters/color-filter-parsing.html
943
944         * css/CSSComputedStyleDeclaration.cpp:
945         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
946         * css/CSSProperties.json:
947         * css/parser/CSSParser.cpp:
948         (WebCore::CSSParserContext::CSSParserContext):
949         (WebCore::operator==):
950         * css/parser/CSSParserMode.h:
951         * css/parser/CSSPropertyParser.cpp:
952         (WebCore::CSSPropertyParser::parseSingleValue):
953         * css/parser/CSSPropertyParserHelpers.cpp:
954         (WebCore::CSSPropertyParserHelpers::isColorFilterFunction):
955         (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
956         (WebCore::CSSPropertyParserHelpers::consumeFilter):
957         * css/parser/CSSPropertyParserHelpers.h:
958         * page/Settings.yaml:
959         * rendering/style/RenderStyle.cpp:
960         (WebCore::RenderStyle::changeRequiresRepaint const):
961         * rendering/style/RenderStyle.h:
962         (WebCore::RenderStyle::mutableColorFilter):
963         (WebCore::RenderStyle::colorFilter const):
964         (WebCore::RenderStyle::hasColorFilter const):
965         (WebCore::RenderStyle::setColorFilter):
966         (WebCore::RenderStyle::initialColorFilter):
967         * rendering/style/StyleRareInheritedData.cpp:
968         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
969         (WebCore::StyleRareInheritedData::operator== const):
970         (WebCore::StyleRareInheritedData::hasColorFilters const):
971         * rendering/style/StyleRareInheritedData.h:
972
973 2018-04-24  Simon Fraser  <simon.fraser@apple.com>
974
975         shape-outside and filter styles occur twice in the result of getComputedStyle
976         https://bugs.webkit.org/show_bug.cgi?id=184931
977
978         Reviewed by Antti Koivisto.
979
980         CSSPropertyShapeOutside and CSSPropertyFilter were duplicated in the list of computedProperties[]
981         used by getComputedStyle. Remove the duplication.
982         
983         Tested by existing tests.
984
985         * css/CSSComputedStyleDeclaration.cpp:
986
987 2018-04-24  Basuke Suzuki  <Basuke.Suzuki@sony.com>
988
989         [Curl] Extract proxy settings into a separate class to hold advanced information.
990         https://bugs.webkit.org/show_bug.cgi?id=184714
991
992         It was simplely structure to hold proxy setting. To support advanced feature of proxy
993         such as authentication, more inteligent object is required to store intermediate state
994         or errors. That's why we've introduced new class for that purpose.
995
996         Reviewed by Youenn Fablet.
997
998         No new tests because there's no new behavior.
999
1000         * platform/Curl.cmake:
1001         * platform/network/curl/CurlContext.cpp:
1002         (WebCore::CurlHandle::enableProxyIfExists):
1003         (WebCore::CurlContext::ProxyInfo::url const): Deleted.
1004         (WebCore::CurlContext::setProxyInfo): Deleted.
1005         * platform/network/curl/CurlContext.h:
1006         (WebCore::CurlContext::proxySettings const):
1007         (WebCore::CurlContext::setProxySettings):
1008         (WebCore::CurlContext::setProxyUserPass):
1009         (WebCore::CurlContext::proxyInfo const): Deleted.
1010         (WebCore::CurlContext::setProxyInfo): Deleted.
1011         * platform/network/curl/CurlProxySettings.cpp: Added.
1012         (WebCore::CurlProxySettings::CurlProxySettings):
1013         (WebCore::CurlProxySettings::rebuildUrl):
1014         (WebCore::CurlProxySettings::setUserPass):
1015         (WebCore::protocolIsInSocksFamily):
1016         (WebCore::getProxyPort):
1017         (WebCore::createProxyUrl):
1018         * platform/network/curl/CurlProxySettings.h: Added.
1019         (WebCore::CurlProxySettings::CurlProxySettings):
1020         (WebCore::CurlProxySettings::isEmpty const):
1021         (WebCore::CurlProxySettings::mode const):
1022         (WebCore::CurlProxySettings::url const):
1023         (WebCore::CurlProxySettings::ignoreHosts const):
1024         (WebCore::CurlProxySettings::user const):
1025         (WebCore::CurlProxySettings::password const):
1026         * platform/network/curl/CurlRequest.cpp:
1027         (WebCore::CurlRequest::didReceiveHeader):
1028         * platform/network/curl/CurlResponse.h:
1029         (WebCore::CurlResponse::isolatedCopy const):
1030         * platform/network/curl/ResourceResponseCurl.cpp:
1031         (WebCore::ResourceResponse::ResourceResponse):
1032
1033 2018-04-24  Youenn Fablet  <youenn@apple.com>
1034
1035         Throw in case of PeerConnection created for detached documents
1036         https://bugs.webkit.org/show_bug.cgi?id=184921
1037         <rdar://problem/39629216>
1038
1039         Reviewed by Eric Carlson.
1040
1041         Add a check to ensure that page is not null when creating a peer connection backend.
1042         In that case, the peer connection constructor will later on throw.
1043         The same for setConfiguration is done.
1044         Behavior is consistent with Chrome.
1045
1046         Test: webrtc/pc-detached-document.html
1047
1048         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
1049         (WebCore::createLibWebRTCPeerConnectionBackend):
1050         (WebCore::LibWebRTCPeerConnectionBackend::LibWebRTCPeerConnectionBackend):
1051         (WebCore::LibWebRTCPeerConnectionBackend::setConfiguration):
1052         (WebCore::libWebRTCProvider): Deleted.
1053         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
1054
1055 2018-04-24  John Wilander  <wilander@apple.com>
1056
1057         From-Origin: Support for 'same' and 'same-site' response header, nested frame origin check
1058         https://bugs.webkit.org/show_bug.cgi?id=184560
1059         <rdar://problem/38901344>
1060
1061         Reviewed by Youenn Fablet and Daniel Bates.
1062
1063         Tests: http/tests/from-origin/document-from-origin-same-accepted.html
1064                http/tests/from-origin/document-from-origin-same-blocked.html
1065                http/tests/from-origin/document-from-origin-same-site-accepted.html
1066                http/tests/from-origin/document-from-origin-same-site-blocked.html
1067                http/tests/from-origin/document-nested-from-origin-same-accepted.html
1068                http/tests/from-origin/document-nested-from-origin-same-blocked.html
1069                http/tests/from-origin/fetch-data-iframe-from-origin-same-blocked.html
1070                http/tests/from-origin/fetch-from-origin-same-accepted.html
1071                http/tests/from-origin/fetch-from-origin-same-blocked.html
1072                http/tests/from-origin/fetch-from-origin-same-site-accepted.html
1073                http/tests/from-origin/fetch-from-origin-same-site-blocked.html
1074                http/tests/from-origin/fetch-iframe-from-origin-same-accepted.html
1075                http/tests/from-origin/fetch-iframe-from-origin-same-blocked.html
1076                http/tests/from-origin/image-about-blank-from-origin-same-blocked.html
1077                http/tests/from-origin/image-from-origin-same-accepted.html
1078                http/tests/from-origin/image-from-origin-same-blocked.html
1079                http/tests/from-origin/image-from-origin-same-site-accepted.html
1080                http/tests/from-origin/image-from-origin-same-site-blocked.html
1081                http/tests/from-origin/redirect-document-from-origin-same-blocked.html
1082                http/tests/from-origin/redirect-fetch-from-origin-same-blocked.html
1083                http/tests/from-origin/redirect-image-from-origin-same-blocked.html
1084                http/tests/from-origin/redirect-script-from-origin-same-blocked.html
1085                http/tests/from-origin/redirect-xhr-from-origin-same-blocked.html
1086                http/tests/from-origin/sandboxed-sub-frame-from-origin-same-blocked.html
1087                http/tests/from-origin/sandboxed-sub-frame-nested-cross-origin-from-origin-same-blocked.html
1088                http/tests/from-origin/sandboxed-sub-frame-nested-same-origin-from-origin-same-blocked.html
1089                http/tests/from-origin/script-from-origin-same-accepted.html
1090                http/tests/from-origin/script-from-origin-same-blocked.html
1091                http/tests/from-origin/script-from-origin-same-site-accepted.html
1092                http/tests/from-origin/script-from-origin-same-site-blocked.html
1093                http/tests/from-origin/top-frame-document-from-origin-same-accepted.php
1094                http/tests/from-origin/xhr-from-origin-same-accepted.html
1095                http/tests/from-origin/xhr-from-origin-same-blocked.html
1096                http/tests/from-origin/xhr-from-origin-same-site-accepted.html
1097                http/tests/from-origin/xhr-from-origin-same-site-blocked.html
1098
1099         * loader/SubresourceLoader.cpp:
1100         (WebCore::SubresourceLoader::didFail):
1101             Outputs the error's localized description in a console message except when the destination
1102             is FetchOptions::Destination::Serviceworker or FetchOptions::Destination::EmptyString.
1103         * page/RuntimeEnabledFeatures.h:
1104         (WebCore::RuntimeEnabledFeatures::setFromOriginResponseHeaderEnabled):
1105         (WebCore::RuntimeEnabledFeatures::fromOriginResponseHeaderEnabled const):
1106             Added From-Origin support as an experimental feature.
1107         * platform/network/HTTPHeaderNames.in:
1108             Added From-Origin.
1109         * platform/network/HTTPParsers.cpp:
1110         (WebCore::parseFromOriginHeader):
1111             Parses the From-Origin header, currently supporting 'Same' and 'Same-Site.'
1112         * platform/network/HTTPParsers.h:
1113
1114 2018-04-24  Antti Koivisto  <antti@apple.com>
1115
1116         Rename LayoutCtx.h/cpp to LayoutContext.h/cpp
1117         https://bugs.webkit.org/show_bug.cgi?id=184922
1118
1119         Reviewed by Zalan Bujtas.
1120
1121         To achieve this the existing LayoutContext class is renamed to FrameViewLayoutContext.
1122
1123         * Sources.txt:
1124         * WebCore.xcodeproj/project.pbxproj:
1125         * layout/LayoutContext.cpp: Copied from Source/WebCore/layout/LayoutCtx.cpp.
1126         * layout/LayoutContext.h: Copied from Source/WebCore/layout/LayoutCtx.h.
1127         * layout/LayoutCtx.cpp: Removed.
1128         * layout/LayoutCtx.h: Removed.
1129         * page/FrameView.cpp:
1130         (WebCore::FrameView::shouldDeferScrollUpdateAfterContentSizeChange):
1131         (WebCore::FrameView::updateLayoutViewport):
1132         (WebCore::FrameView::updateLayerPositionsAfterScrolling):
1133         (WebCore::FrameView::updateCompositingLayersAfterScrolling):
1134         (WebCore::FrameView::availableContentSizeChanged):
1135         * page/FrameView.h:
1136         * page/FrameViewLayoutContext.cpp: Copied from Source/WebCore/page/LayoutContext.cpp.
1137         (WebCore::LayoutScope::LayoutScope):
1138         (WebCore::FrameViewLayoutContext::FrameViewLayoutContext):
1139         (WebCore::FrameViewLayoutContext::~FrameViewLayoutContext):
1140         (WebCore::FrameViewLayoutContext::layout):
1141         (WebCore::FrameViewLayoutContext::runOrScheduleAsynchronousTasks):
1142         (WebCore::FrameViewLayoutContext::runAsynchronousTasks):
1143         (WebCore::FrameViewLayoutContext::flushAsynchronousTasks):
1144         (WebCore::FrameViewLayoutContext::reset):
1145         (WebCore::FrameViewLayoutContext::needsLayout const):
1146         (WebCore::FrameViewLayoutContext::setNeedsLayout):
1147         (WebCore::FrameViewLayoutContext::enableSetNeedsLayout):
1148         (WebCore::FrameViewLayoutContext::disableSetNeedsLayout):
1149         (WebCore::FrameViewLayoutContext::scheduleLayout):
1150         (WebCore::FrameViewLayoutContext::unscheduleLayout):
1151         (WebCore::FrameViewLayoutContext::scheduleSubtreeLayout):
1152         (WebCore::FrameViewLayoutContext::layoutTimerFired):
1153         (WebCore::FrameViewLayoutContext::convertSubtreeLayoutToFullLayout):
1154         (WebCore::FrameViewLayoutContext::setSubtreeLayoutRoot):
1155         (WebCore::FrameViewLayoutContext::canPerformLayout const):
1156         (WebCore::FrameViewLayoutContext::applyTextSizingIfNeeded):
1157         (WebCore::FrameViewLayoutContext::updateStyleForLayout):
1158         (WebCore::FrameViewLayoutContext::handleLayoutWithFrameFlatteningIfNeeded):
1159         (WebCore::FrameViewLayoutContext::startLayoutAtMainFrameViewIfNeeded):
1160         (WebCore::FrameViewLayoutContext::layoutDelta const):
1161         (WebCore::FrameViewLayoutContext::addLayoutDelta):
1162         (WebCore::FrameViewLayoutContext::layoutDeltaMatches):
1163         (WebCore::FrameViewLayoutContext::layoutState const):
1164         (WebCore::FrameViewLayoutContext::pushLayoutState):
1165         (WebCore::FrameViewLayoutContext::pushLayoutStateForPaginationIfNeeded):
1166         (WebCore::FrameViewLayoutContext::popLayoutState):
1167         (WebCore::FrameViewLayoutContext::checkLayoutState):
1168         (WebCore::FrameViewLayoutContext::frame const):
1169         (WebCore::FrameViewLayoutContext::view const):
1170         (WebCore::FrameViewLayoutContext::renderView const):
1171         (WebCore::FrameViewLayoutContext::document const):
1172         (WebCore::LayoutContext::LayoutContext): Deleted.
1173         (WebCore::LayoutContext::~LayoutContext): Deleted.
1174         (WebCore::LayoutContext::layout): Deleted.
1175         (WebCore::LayoutContext::runOrScheduleAsynchronousTasks): Deleted.
1176         (WebCore::LayoutContext::runAsynchronousTasks): Deleted.
1177         (WebCore::LayoutContext::flushAsynchronousTasks): Deleted.
1178         (WebCore::LayoutContext::reset): Deleted.
1179         (WebCore::LayoutContext::needsLayout const): Deleted.
1180         (WebCore::LayoutContext::setNeedsLayout): Deleted.
1181         (WebCore::LayoutContext::enableSetNeedsLayout): Deleted.
1182         (WebCore::LayoutContext::disableSetNeedsLayout): Deleted.
1183         (WebCore::LayoutContext::scheduleLayout): Deleted.
1184         (WebCore::LayoutContext::unscheduleLayout): Deleted.
1185         (WebCore::LayoutContext::scheduleSubtreeLayout): Deleted.
1186         (WebCore::LayoutContext::layoutTimerFired): Deleted.
1187         (WebCore::LayoutContext::convertSubtreeLayoutToFullLayout): Deleted.
1188         (WebCore::LayoutContext::setSubtreeLayoutRoot): Deleted.
1189         (WebCore::LayoutContext::canPerformLayout const): Deleted.
1190         (WebCore::LayoutContext::applyTextSizingIfNeeded): Deleted.
1191         (WebCore::LayoutContext::updateStyleForLayout): Deleted.
1192         (WebCore::LayoutContext::handleLayoutWithFrameFlatteningIfNeeded): Deleted.
1193         (WebCore::LayoutContext::startLayoutAtMainFrameViewIfNeeded): Deleted.
1194         (WebCore::LayoutContext::layoutDelta const): Deleted.
1195         (WebCore::LayoutContext::addLayoutDelta): Deleted.
1196         (WebCore::LayoutContext::layoutDeltaMatches): Deleted.
1197         (WebCore::LayoutContext::layoutState const): Deleted.
1198         (WebCore::LayoutContext::pushLayoutState): Deleted.
1199         (WebCore::LayoutContext::pushLayoutStateForPaginationIfNeeded): Deleted.
1200         (WebCore::LayoutContext::popLayoutState): Deleted.
1201         (WebCore::LayoutContext::checkLayoutState): Deleted.
1202         (WebCore::LayoutContext::frame const): Deleted.
1203         (WebCore::LayoutContext::view const): Deleted.
1204         (WebCore::LayoutContext::renderView const): Deleted.
1205         (WebCore::LayoutContext::document const): Deleted.
1206         * page/FrameViewLayoutContext.h: Copied from Source/WebCore/page/LayoutContext.h.
1207         (WebCore::LayoutContext::startDisallowingLayout): Deleted.
1208         (WebCore::LayoutContext::endDisallowingLayout): Deleted.
1209         (WebCore::LayoutContext::layoutPhase const): Deleted.
1210         (WebCore::LayoutContext::isLayoutNested const): Deleted.
1211         (WebCore::LayoutContext::isLayoutPending const): Deleted.
1212         (WebCore::LayoutContext::isInLayout const): Deleted.
1213         (WebCore::LayoutContext::isInRenderTreeLayout const): Deleted.
1214         (WebCore::LayoutContext::inPaintableState const): Deleted.
1215         (WebCore::LayoutContext::layoutCount const): Deleted.
1216         (WebCore::LayoutContext::subtreeLayoutRoot const): Deleted.
1217         (WebCore::LayoutContext::clearSubtreeLayoutRoot): Deleted.
1218         (WebCore::LayoutContext::resetFirstLayoutFlag): Deleted.
1219         (WebCore::LayoutContext::didFirstLayout const): Deleted.
1220         (WebCore::LayoutContext::setNeedsFullRepaint): Deleted.
1221         (WebCore::LayoutContext::needsFullRepaint const): Deleted.
1222         (WebCore::LayoutContext::isPaintOffsetCacheEnabled const): Deleted.
1223         (WebCore::LayoutContext::layoutDisallowed const): Deleted.
1224         (WebCore::LayoutContext::isLayoutSchedulingEnabled const): Deleted.
1225         (WebCore::LayoutContext::inAsynchronousTasks const): Deleted.
1226         (WebCore::LayoutContext::disablePaintOffsetCache): Deleted.
1227         (WebCore::LayoutContext::enablePaintOffsetCache): Deleted.
1228         * page/LayoutContext.cpp: Removed.
1229         * page/LayoutContext.h: Removed.
1230         * rendering/LayoutState.cpp:
1231         (WebCore::LayoutState::LayoutState):
1232         (WebCore::LayoutState::computePaginationInformation):
1233         (WebCore::LayoutState::establishLineGrid):
1234         (WebCore::LayoutStateDisabler::LayoutStateDisabler):
1235         * rendering/LayoutState.h:
1236
1237 2018-04-24  Mark Lam  <mark.lam@apple.com>
1238
1239         Need to acquire the VM lock before calling toNumber on a JSValue.
1240         https://bugs.webkit.org/show_bug.cgi?id=184924
1241         <rdar://problem/39690679>
1242
1243         Reviewed by Saam Barati.
1244
1245         * bridge/objc/objc_utility.mm:
1246         (JSC::Bindings::convertValueToObjcValue):
1247
1248 2018-04-24  Tadeu Zagallo  <tzagallo@apple.com>
1249
1250         REGRESSION(r221839): Fix requests with FormData containing empty files
1251         https://bugs.webkit.org/show_bug.cgi?id=184490
1252         <rdar://problem/39385169>
1253
1254         Reviewed by Geoffrey Garen.
1255
1256         We should not append the blob to the FormData when it is a file but has no path. It broke
1257         the submission since the request was failing to read the file in FormDataStreamCFNet.h:156
1258
1259         Test: http/tests/local/formdata/send-form-data-with-empty-file.html
1260
1261         * platform/network/FormData.cpp:
1262         (WebCore::FormData::appendMultiPartFileValue):
1263
1264 2018-04-24  Zalan Bujtas  <zalan@apple.com>
1265
1266         Fix project file after r230931.
1267
1268         * WebCore.xcodeproj/project.pbxproj:
1269
1270 2018-04-24  Jer Noble  <jer.noble@apple.com>
1271
1272         Don't add system framework paths to FRAMEWORK_SEARCH_PATHS
1273         https://bugs.webkit.org/show_bug.cgi?id=184786
1274
1275         Reviewed by Tim Horton.
1276
1277         * Configurations/WebCore.xcconfig:
1278         * DerivedSources.make:
1279         * WebCore.xcodeproj/project.pbxproj:
1280
1281 2018-04-24  Zan Dobersek  <zdobersek@igalia.com>
1282
1283         [CoordGraphics] Remove dead fixed layer code
1284         https://bugs.webkit.org/show_bug.cgi?id=184912
1285
1286         Reviewed by Michael Catanzaro.
1287
1288         Remove CoordinatedGraphicsLayer::setFixedToViewport() and the
1289         corresponding attribute on the CoordinatedGraphicsLayerState struct.
1290         The method is not called anywhere since r230952.
1291
1292         CoordinatedGraphicsState struct also loses the scrollPosition attribute
1293         that also isn't used anymore.
1294
1295         Changes to GraphicsLayerTextureMapper class mirror those made to
1296         CoordinatedGraphicsLayer, removing support for the fixed-to-viewport
1297         attribute. This too was not called from anywhere.
1298
1299         All that enables us removing fixed-to-viewport handling in the
1300         TextureMapperLayer class. Along with related changes in the
1301         CoordinatedGraphicsScene class, we're able to remove a bunch of methods
1302         and member variables that are not used or needed anymore.
1303
1304         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
1305         (WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
1306         (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
1307         (WebCore::GraphicsLayerTextureMapper::setFixedToViewport): Deleted.
1308         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
1309         * platform/graphics/texmap/TextureMapperLayer.cpp:
1310         (WebCore::TextureMapperLayer::computeTransformsRecursive):
1311         (WebCore::TextureMapperLayer::setFixedToViewport): Deleted.
1312         (WebCore::TextureMapperLayer::isAncestorFixedToViewport const): Deleted.
1313         (WebCore::TextureMapperLayer::setScrollPositionDeltaIfNeeded): Deleted.
1314         * platform/graphics/texmap/TextureMapperLayer.h:
1315         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1316         (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
1317         (WebCore::CoordinatedGraphicsLayer::syncLayerState):
1318         (WebCore::CoordinatedGraphicsLayer::setFixedToViewport): Deleted.
1319         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1320         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
1321         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
1322
1323 2018-04-24  Zan Dobersek  <zdobersek@igalia.com>
1324
1325         [CoordGraphics] Remove unused fixed layout functionality
1326         https://bugs.webkit.org/show_bug.cgi?id=184908
1327
1328         Reviewed by Carlos Garcia Campos.
1329
1330         Ports using the CoordinatedGraphics subsystem don't expose fixed layout
1331         support. As such, we're able to remove a lot of unused code and
1332         unnecessary USE(COORDINATED_GRAPHICS) special cases in generic sections
1333         in both WebCore and WebKit.
1334
1335         With fixed layout not available for use to users of the GTK+ and WPE
1336         ports, we can remove the ScrollingCoordinatorCoordinatedGraphics
1337         implementation, making room for an implementation that inherits from
1338         AsyncScrollingCoordinator in the future. For that purpose the
1339         ScrollingCoordinator::create() function is moved into the
1340         ScrollingCoordinatorCoordinatedGraphics.cpp file already.
1341
1342         This also enables removing delegatedScrollRequested() method from
1343         HostWindow and the inheriting ChromeClient interface.
1344
1345         * loader/EmptyClients.h:
1346         * page/Chrome.cpp:
1347         (WebCore::Chrome::delegatedScrollRequested): Deleted.
1348         * page/Chrome.h:
1349         * page/ChromeClient.h:
1350         * page/scrolling/ScrollingCoordinator.cpp:
1351         (WebCore::ScrollingCoordinator::create):
1352         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
1353         (WebCore::ScrollingCoordinator::create):
1354         (WebCore::ScrollingCoordinatorCoordinatedGraphics::ScrollingCoordinatorCoordinatedGraphics): Deleted.
1355         (WebCore::ScrollingCoordinatorCoordinatedGraphics::attachToStateTree): Deleted.
1356         (WebCore::ScrollingCoordinatorCoordinatedGraphics::detachFromStateTree): Deleted.
1357         (WebCore::ScrollingCoordinatorCoordinatedGraphics::clearStateTree): Deleted.
1358         (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeLayer): Deleted.
1359         (WebCore::ScrollingCoordinatorCoordinatedGraphics::updateNodeViewportConstraints): Deleted.
1360         (WebCore::ScrollingCoordinatorCoordinatedGraphics::requestScrollPositionUpdate): Deleted.
1361         * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h: Removed.
1362         * platform/HostWindow.h:
1363
1364 2018-04-24  Daniel Bates  <dabates@apple.com>
1365
1366         Attempt to fix the Apple Internal build following r230922
1367         (https://bugs.webkit.org/show_bug.cgi?id=184737)
1368
1369         Cast the return value of std::map::size() to a size_t before logging it with format specifier
1370         "%zu". std::map::size() returns a size_type. According to <http://en.cppreference.com/w/cpp/container/map>
1371         size_type is "usually a size_t", but it may not be. An Apple Internal debug builder reports
1372         that size_type = unsigned int != unsigned long = size_t.
1373
1374         * Modules/mediasource/SourceBuffer.cpp:
1375         (WebCore::SourceBuffer::provideMediaData):
1376
1377 2018-04-24  Zan Dobersek  <zdobersek@igalia.com>
1378
1379         [CoordGraphics] Avoid painting backing stores for zero-opacity layers
1380         https://bugs.webkit.org/show_bug.cgi?id=184143
1381
1382         Reviewed by Carlos Garcia Campos.
1383
1384         Skip generating backing stores for layers that have zero opacity and do
1385         not animate the opacity value. In the current CoordinatedGraphics system
1386         this can end up saving loads of memory on Web content that deploys a
1387         large number of such elements.
1388
1389         * platform/graphics/texmap/TextureMapperLayer.h:
1390         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1391         (WebCore::CoordinatedGraphicsLayer::shouldHaveBackingStore const):
1392
1393 2018-04-24  Daniel Bates  <dabates@apple.com>
1394
1395         Attempt to fix the Apple Internal build following r230944
1396         (https://bugs.webkit.org/show_bug.cgi?id=159464)
1397
1398         * platform/network/mac/CookieJarMac.mm:
1399
1400 2018-04-24  Daniel Bates  <dabates@apple.com>
1401
1402         Another attempt to fix the Mac and iOS build following r230944
1403         (https://bugs.webkit.org/show_bug.cgi?id=159464)
1404
1405         * platform/network/mac/CookieJarMac.mm:
1406         (WebCore::policyProperties):
1407
1408 2018-04-24  Daniel Bates  <dabates@apple.com>
1409
1410         Attempt to fix the Mac and iOS build following r230944
1411         (https://bugs.webkit.org/show_bug.cgi?id=159464)
1412
1413         * platform/network/mac/CookieJarMac.mm:
1414         (WebCore::policyProperties):
1415
1416 2018-04-23  Daniel Bates  <dabates@apple.com>
1417
1418         Implement Same-Site cookies
1419         https://bugs.webkit.org/show_bug.cgi?id=159464
1420         <rdar://problem/27196358>
1421
1422         Reviewed by Brent Fulgham.
1423
1424         Implements support for Same-Site cookies as per <https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00>.
1425         The implementation is materially consistent with the spec. though implements the computation
1426         for a document's "site for cookies" indirectly as part of loading its frame. This is done to
1427         avoid traversing the frame tree on each subresource request initiated by the document or one
1428         of its workers. We take advantage of the fact that Web Workers and Service Workers use their
1429         host document's loader to load resources on their behalf to use the correct "site for cookies"
1430         for requests (e.g. fetch()) initiating by them without the need to duplicate and store the
1431         host document's "site for cookies" in the worker's script execution context.
1432
1433         The implementation differs from the spec. in the handling of about: URLs and the empty URL
1434         and makes the implementation in WebKit match the behavior of Chrome and Firefox as well as
1435         consistent with origin inheritance as described in <https://html.spec.whatwg.org/multipage/browsers.html#origin>
1436         (16 April 2018). Specifically, requests to about:blank, about:srcdoc and the empty URL ("")
1437         are treated as same-site because these URLs inherit their origin from their owner.
1438
1439         Tests: http/tests/cookies/same-site/fetch-after-navigating-iframe-in-cross-origin-page.html
1440                http/tests/cookies/same-site/fetch-after-top-level-navigation-from-cross-origin-page.html
1441                http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html
1442                http/tests/cookies/same-site/fetch-cookies-set-in-about-blank-iframe.html
1443                http/tests/cookies/same-site/fetch-in-about-blank-page.html
1444                http/tests/cookies/same-site/fetch-in-cross-origin-iframe.html
1445                http/tests/cookies/same-site/fetch-in-cross-origin-page.html
1446                http/tests/cookies/same-site/fetch-in-cross-origin-service-worker.html
1447                http/tests/cookies/same-site/fetch-in-cross-origin-worker.html
1448                http/tests/cookies/same-site/fetch-in-same-origin-page.html
1449                http/tests/cookies/same-site/fetch-in-same-origin-service-worker.html
1450                http/tests/cookies/same-site/fetch-in-same-origin-srcdoc-iframe.html
1451                http/tests/cookies/same-site/fetch-in-same-origin-worker.html
1452                http/tests/cookies/same-site/popup-cross-site-post.html
1453                http/tests/cookies/same-site/popup-cross-site.html
1454                http/tests/cookies/same-site/popup-same-site-post.html
1455                http/tests/cookies/same-site/popup-same-site-via-cross-site-redirect.html
1456                http/tests/cookies/same-site/popup-same-site-via-same-site-redirect.html
1457                http/tests/cookies/same-site/popup-same-site.html
1458
1459         * Sources.txt: Add source file SameSiteInfo.cpp.
1460         * WebCore.xcodeproj/project.pbxproj: Add source files SameSiteInfo.{cpp, h}.
1461         * dom/Document.cpp:
1462         (WebCore::Document::initSecurityContext): Modified to call SecurityPolicy::shouldInheritSecurityOriginFromOwner().
1463         (WebCore::Document::shouldInheritContentSecurityPolicyFromOwner const): Ditto.
1464         (WebCore::shouldInheritSecurityOriginFromOwner): Deleted; moved to SecurityPolicy.
1465         * dom/Document.h:
1466         (WebCore::Document::firstPartyForSameSiteCookies const): Added.
1467         (WebCore::Document::setFirstPartyForSameSiteCookies): Added.
1468         * loader/CookieJar.cpp:
1469         (WebCore::sameSiteInfo): Returns the same-site info for the request used to load the specified document.
1470         (WebCore::cookies): Pass the same-site info down to the platform.
1471         (WebCore::cookieRequestHeaderFieldProxy): Ditto.
1472         (WebCore::setCookies): Ditto.
1473         (WebCore::cookieRequestHeaderFieldValue): Ditto.
1474         (WebCore::getRawCookies): Ditto.
1475         * loader/DocumentLoader.cpp:
1476         (WebCore::DocumentLoader::willSendRequest): Add same-site info to the request.
1477         (WebCore::DocumentLoader::startLoadingMainResource): Update a FIXME comment to explain that
1478         we can simplify ResourceRequestBase if we can remove the call to addExtraFieldsToMainResourceRequest()
1479         here. Specifically, we would not need to differentiate between a request with an unspecified
1480         same-site state (default state of a new request) from a request whose same-site state has
1481         been explicitly set if we can assume that the same-site state of a request is set exactly
1482         once. In absence of this guarantee we need an "unspecified" state to avoid overriding existing
1483         same-site information computed with a null initiating document (the case of a new address bar
1484         initiated load) from a load initiated by the document associated with this loader.
1485         * loader/FrameLoader.cpp:
1486         (WebCore::FrameLoader::setFirstPartyForCookies): Modified to also update the first party for
1487         same-site cookies ("site for cookies").
1488         (WebCore::FrameLoader::load): Add same-site info to the request.
1489         (WebCore::FrameLoader::reload): Ditto.
1490         (WebCore::FrameLoader::setOriginalURLForDownloadRequest): Ditto.
1491         (WebCore::FrameLoader::addExtraFieldsToRequest): If the request does not already have
1492         same-site info then compute it and add it to the request. Mark main frame main resource
1493         requests as a "top-site".
1494         (WebCore::FrameLoader::addSameSiteInfoToRequestIfNeeded): Implements the "'Same-site' and 'cross-site'
1495         Requests" algorithm from <https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-2.1>.
1496         (WebCore::createWindow): Add same-site info to the request.
1497         * loader/FrameLoader.h:
1498         * loader/ResourceLoader.cpp:
1499         (WebCore::ResourceLoader::init): Ditto.
1500         * page/DOMWindow.cpp:
1501         (WebCore::DOMWindow::createWindow): Ditto.
1502         * page/SecurityPolicy.cpp:
1503         (WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner): Moved from Document.cpp.
1504         * page/SecurityPolicy.h:
1505         * platform/CookiesStrategy.h:
1506         * platform/network/CacheValidation.cpp:
1507         (WebCore::headerValueForVary): Pass the same-site info down to the platform.
1508         * platform/network/CookieRequestHeaderFieldProxy.h:
1509         (WebCore::CookieRequestHeaderFieldProxy::encode const): Encode same-site bits.
1510         (WebCore::CookieRequestHeaderFieldProxy::decode): Decode same-site bits.
1511         * platform/network/PlatformCookieJar.h:
1512         * platform/network/ResourceRequestBase.cpp:
1513         (WebCore::ResourceRequestBase::setAsIsolatedCopy): Added.
1514         (WebCore::ResourceRequestBase::isSameSite const): Added.
1515         (WebCore::ResourceRequestBase::setIsSameSite): Added.
1516         (WebCore::ResourceRequestBase::isTopSite const): Added.
1517         (WebCore::ResourceRequestBase::setIsTopSite): Added.
1518         (WebCore::equalIgnoringHeaderFields):
1519         * platform/network/ResourceRequestBase.h:
1520         (WebCore::ResourceRequestBase::isSameSiteUnspecified const): Added. See comment for DocumentLoader::startLoadingMainResource()
1521         for more details.
1522         (WebCore::registrableDomainsAreEqual): Added.
1523         (WebCore::ResourceRequestBase::encodeBase const): Encode same-site bits.
1524         (WebCore::ResourceRequestBase::decodeBase): Decode same-site bits.
1525         * platform/network/SameSiteInfo.cpp: Added.
1526         (WebCore::SameSiteInfo::create):
1527         * platform/network/SameSiteInfo.h: Added.
1528         (WebCore::SameSiteInfo::encode const):
1529         (WebCore::SameSiteInfo::decode):
1530         * platform/network/cf/CookieJarCFNet.cpp:
1531         (WebCore::setCookiesFromDOM): Pass Same-Site info down.
1532         (WebCore::cookiesForDOM): Ditto.
1533         (WebCore::cookieRequestHeaderFieldValue): Ditto.
1534         (WebCore::getRawCookies): Ditto.
1535         * platform/network/cf/ResourceRequestCFNet.cpp:
1536         (WebCore::siteForCookies): Added.
1537         (WebCore::ResourceRequest::doUpdatePlatformRequest): Update platform request with same-site info.
1538         (WebCore::ResourceRequest::doUpdateResourceRequest): Ditto.
1539         * platform/network/cocoa/ResourceRequestCocoa.mm:
1540         (WebCore::ResourceRequest::doUpdateResourceRequest): Ditto.
1541         (WebCore::siteForCookies): Added.
1542         (WebCore::ResourceRequest::doUpdatePlatformRequest): Update platform request with same-site info.
1543         * platform/network/curl/CookieJarCurl.cpp:
1544         (WebCore::cookiesForDOM): Pass Same-Site info down.
1545         (WebCore::setCookiesFromDOM): Ditto.
1546         (WebCore::cookieRequestHeaderFieldValue): Ditto.
1547         (WebCore::getRawCookies): Ditto.
1548         * platform/network/curl/CookieJarCurl.h:
1549         * platform/network/curl/CookieJarCurlDatabase.cpp:
1550         (WebCore::CookieJarCurlDatabase::setCookiesFromDOM const): Ditto.
1551         (WebCore::CookieJarCurlDatabase::cookiesForDOM const): Ditto.
1552         (WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const): Ditto.
1553         (WebCore::CookieJarCurlDatabase::getRawCookies const): Ditto.
1554         * platform/network/curl/CookieJarCurlDatabase.h:
1555         * platform/network/curl/ResourceHandleCurl.cpp:
1556         (WebCore::ResourceHandle::createCurlRequest): Ditto.
1557         * platform/network/mac/CookieJarMac.mm:
1558         (WebCore::cookiesForURL): Added; shared function to return the cookies based on the specified criterion. 
1559         (WebCore::setHTTPCookiesForURL): Moved from the bottom of the file to top to be closer to the other
1560         CFNetwork helper functions. Modified to support fetching same-site cookies.
1561         (WebCore::httpCookiesForURL): Moved to be under setHTTPCookiesForURL(). Modified to call cookiesForURL().
1562         Note the SPI used in cookiesForURL() apply the same criterion for whether to fetch secure cookies as we
1563         were computing here. That is, the CFNetwork SPI only returns secure cookies if the specified URL's scheme
1564         case-insensitively matches "https".
1565         (WebCore::cookiesInPartitionForURL): Wrote in terms of cookiesForURL().
1566         (WebCore::cookiesForSession): Pass the Same-Site info.
1567         (WebCore::cookiesForDOM): Ditto.
1568         (WebCore::cookieRequestHeaderFieldValue): Ditto.
1569         (WebCore::setCookiesFromDOM): Ditto.
1570         (WebCore::getRawCookies): Ditto.
1571         (WebCore::deleteCookie): Pass std::nullopt for the Same-Site info so that we do not consider the SameSite
1572         attribute when fetching cookies to delete.
1573         * platform/network/soup/CookieJarSoup.cpp:
1574         (WebCore::setCookiesFromDOM): Pass the Same-Site info.
1575         (WebCore::cookiesForDOM): Ditto.
1576         (WebCore::cookieRequestHeaderFieldValue): Ditto.
1577         (WebCore::getRawCookies): Ditto.
1578         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1579         (WebCore::createPageForServiceWorker): Set the first party for same site cookies ("site for cookies") to
1580         the script URL.
1581         * xml/XSLTProcessor.cpp:
1582         (WebCore::XSLTProcessor::createDocumentFromSource): Copy the first party for same-site cookies to the
1583         new document.
1584
1585 2018-04-23  Youenn Fablet  <youenn@apple.com>
1586
1587         Make WebLoaderStrategy send to NetworkResourceLoader necessary parameters to handle full loads in NetworkProcess
1588         https://bugs.webkit.org/show_bug.cgi?id=184763
1589
1590         Reviewed by Chris Dumez.
1591
1592         No change of behavior yet since we do not use these parameters in NetworkProcess yet.
1593
1594         Add PreflightPolicy and CSP response headers as ResourceLoaderOptions.
1595         This allows passing them from DocumentThreadableLoader to WebLoaderStrategy.
1596
1597         Allow getting the original headers from a SubresourceLoader.
1598         This allows passing them from DocumentThreadableLoader down to WebLoaderStrategy.
1599
1600         * Modules/fetch/FetchLoader.cpp:
1601         (WebCore::FetchLoader::startLoadingBlobURL):
1602         (WebCore::FetchLoader::start):
1603         * loader/DocumentThreadableLoader.cpp:
1604         (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
1605         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
1606         (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
1607         * loader/ResourceLoaderOptions.h:
1608         * loader/SubresourceLoader.cpp:
1609         (WebCore::SubresourceLoader::originalHeaders const):
1610         * loader/SubresourceLoader.h:
1611         * loader/ThreadableLoader.cpp:
1612         (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions):
1613         (WebCore::ThreadableLoaderOptions::isolatedCopy const):
1614         * loader/ThreadableLoader.h:
1615         * page/EventSource.cpp:
1616         (WebCore::EventSource::connect):
1617         * xml/XMLHttpRequest.cpp:
1618         (WebCore::XMLHttpRequest::createRequest):
1619
1620 2018-04-23  Michael Catanzaro  <mcatanzaro@igalia.com>
1621
1622         [WPE][GTK] Remove WlUniquePtr<wl_display> footgun
1623         https://bugs.webkit.org/show_bug.cgi?id=184405
1624
1625         Reviewed by Carlos Garcia Campos.
1626
1627         WlUniquePtr<wl_display> is a pretty big footgun because there are two different destruction
1628         functions -- wl_display_disconnect() and wl_display_destroy() -- and which one you need to
1629         use depends on how the wl_display() was created, and WebKit uses both in different places.
1630         So WlUniquePtr<wl_display> is pretty unsafe. See bug #176490 for an example of fun caused
1631         by using it incorrectly.
1632
1633         Let's use std::unique_ptr with custom deleter functors instead.
1634
1635         * platform/graphics/wayland/WlUniquePtr.h:
1636
1637 2018-04-23  Antti Koivisto  <antti@apple.com>
1638
1639         REGRESSION (r220112): reCAPTCHA images render off screen on Twitch.tv app Log In or Sign Up
1640         https://bugs.webkit.org/show_bug.cgi?id=182859
1641         <rdar://problem/37595065>
1642
1643         Reviewed by Zalan Bujtas.
1644
1645         Roll out this change from the trunk as the issue it fixed no longer occurs.
1646
1647         * css/MediaQueryEvaluator.cpp:
1648         (WebCore::orientationEvaluate):
1649         (WebCore::aspectRatioEvaluate):
1650         (WebCore::heightEvaluate):
1651         (WebCore::widthEvaluate):
1652         * page/FrameView.cpp:
1653         (WebCore::FrameView::layoutSizeForMediaQuery const): Deleted.
1654         * page/FrameView.h:
1655         * page/LayoutContext.cpp:
1656         (WebCore::LayoutContext::handleLayoutWithFrameFlatteningIfNeeded):
1657
1658 2018-04-23  Daniel Bates  <dabates@apple.com>
1659
1660         Another attempt to fix the Windows build following r230921
1661         (https://bugs.webkit.org/show_bug.cgi?id=159464)
1662
1663         Pass dictionary key name using a string instead of a constant and pass CFURL* to
1664         siteForCookies().
1665
1666         * platform/network/cf/ResourceRequestCFNet.cpp:
1667         (WebCore::ResourceRequest::doUpdatePlatformRequest):
1668         (WebCore::ResourceRequest::doUpdateResourceRequest):
1669
1670 2018-04-23  Zalan Bujtas  <zalan@apple.com>
1671
1672         [LayoutFormattingContext] Initial commit.
1673         https://bugs.webkit.org/show_bug.cgi?id=184896
1674
1675         Reviewed by Antti Koivisto.
1676
1677         This is the initial commit of the new layout component -class definitions only (and mostly public functions).
1678         See the header files (and Tools/LayoutReloaded project) for more information.
1679
1680         // Top level layout.
1681         rootContainer = TreeBuilder::createLayoutTree(document);
1682         rootDisplayBox = new Display::Box();
1683         rootDisplayBox->setSize(viewportSize);
1684         layoutContext = new LayoutContext(rootContainer, rootDisplayBox);
1685         layoutContext->layout(rootContainer);
1686
1687         Driven by build time flag (currently off). Not testable yet.
1688
1689         * Configurations/FeatureDefines.xcconfig:
1690         * Sources.txt:
1691         * WebCore.xcodeproj/project.pbxproj:
1692         * layout/BlockFormatting/BlockFormattingContext.cpp: Added.
1693         * layout/BlockFormatting/BlockFormattingContext.h: Added.
1694         * layout/BlockFormatting/BlockFormattingState.cpp: Added.
1695         * layout/BlockFormatting/BlockFormattingState.h: Added.
1696         * layout/BlockFormatting/BlockMarginCollapse.cpp: Added.
1697         * layout/BlockFormatting/BlockMarginCollapse.h: Added.
1698         * layout/DisplayTree/DisplayBox.cpp: Added.
1699         * layout/DisplayTree/DisplayBox.h: Added.
1700         * layout/FloatingContext.cpp: Added.
1701         * layout/FloatingContext.h: Added.
1702         * layout/FloatingState.cpp: Added.
1703         * layout/FloatingState.h: Added.
1704         * layout/FormattingContext.cpp: Added.
1705         * layout/FormattingContext.h: Added.
1706         * layout/FormattingState.cpp: Added.
1707         * layout/FormattingState.h: Added.
1708         * layout/InlineFormatting/InlineFormattingContext.cpp: Added.
1709         * layout/InlineFormatting/InlineFormattingContext.h: Added.
1710         * layout/InlineFormatting/InlineFormattingState.cpp: Added.
1711         * layout/InlineFormatting/InlineFormattingState.h: Added.
1712         * layout/LayoutCtx.cpp: Added.
1713         * layout/LayoutCtx.h: Added.
1714         * layout/LayoutTree/LayoutBlockContainer.cpp: Added.
1715         * layout/LayoutTree/LayoutBlockContainer.h: Added.
1716         * layout/LayoutTree/LayoutBox.cpp: Added.
1717         * layout/LayoutTree/LayoutBox.h: Added.
1718         * layout/LayoutTree/LayoutContainer.cpp: Added.
1719         * layout/LayoutTree/LayoutContainer.h: Added.
1720         * layout/LayoutTree/LayoutCtx.h: Added.
1721         * layout/LayoutTree/LayoutInlineBox.cpp: Added.
1722         * layout/LayoutTree/LayoutInlineBox.h: Added.
1723         * layout/LayoutTree/LayoutInlineContainer.cpp: Added.
1724         * layout/LayoutTree/LayoutInlineContainer.h: Added.
1725
1726 2018-04-23  Daniel Bates  <dabates@apple.com>
1727
1728         Attempt to fix the Mac and iOS build after r230921
1729         (https://bugs.webkit.org/show_bug.cgi?id=159464)
1730
1731         Pass strings for the dictionary key names instead of using an extern constant as the
1732         latter may not be available on all systems.
1733
1734         * platform/network/mac/CookieJarMac.mm:
1735         (WebCore::setHTTPCookiesForURL):
1736
1737 2018-04-23  Daniel Bates  <dabates@apple.com>
1738
1739         Attempt to fix the build after r230921
1740         (https://bugs.webkit.org/show_bug.cgi?id=159464)
1741
1742         Pass Same-Site info through.
1743
1744         * platform/network/cf/CookieJarCFNet.cpp:
1745         (WebCore::cookieRequestHeaderFieldValue):
1746         * platform/network/curl/CookieJarCurl.cpp:
1747         (WebCore::cookieRequestHeaderFieldValue):
1748         * platform/network/curl/CookieJarCurlDatabase.cpp:
1749         (WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const):
1750         * platform/network/soup/CookieJarSoup.cpp:
1751         (WebCore::cookieRequestHeaderFieldValue):
1752
1753 2018-04-23  Ryan Haddad  <ryanhaddad@apple.com>
1754
1755         Unreviewed, speculative macOS build fix attempt.
1756
1757         * Modules/mediasource/SourceBuffer.cpp:
1758         (WebCore::SourceBuffer::provideMediaData):
1759
1760 2018-04-23  Daniel Bates  <dabates@apple.com>
1761
1762         Implement Same-Site cookies
1763         https://bugs.webkit.org/show_bug.cgi?id=159464
1764         <rdar://problem/27196358>
1765
1766         Reviewed by Brent Fulgham.
1767
1768         Implements support for Same-Site cookies as per <https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00>.
1769         The implementation is materially consistent with the spec. though implements the computation
1770         for a document's "site for cookies" indirectly as part of loading its frame. This is done to
1771         avoid traversing the frame tree on each subresource request initiated by the document or one
1772         of its workers. We take advantage of the fact that Web Workers and Service Workers use their
1773         host document's loader to load resources on their behalf to use the correct "site for cookies"
1774         for requests (e.g. fetch()) initiating by them without the need to duplicate and store the
1775         host document's "site for cookies" in the worker's script execution context.
1776
1777         The implementation differs from the spec. in the handling of about: URLs and the empty URL
1778         and makes the implementation in WebKit match the behavior of Chrome and Firefox as well as
1779         consistent with origin inheritance as described in <https://html.spec.whatwg.org/multipage/browsers.html#origin>
1780         (16 April 2018). Specifically, requests to about:blank, about:srcdoc and the empty URL ("")
1781         are treated as same-site because these URLs inherit their origin from their owner.
1782
1783         Tests: http/tests/cookies/same-site/fetch-after-navigating-iframe-in-cross-origin-page.html
1784                http/tests/cookies/same-site/fetch-after-top-level-navigation-from-cross-origin-page.html
1785                http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html
1786                http/tests/cookies/same-site/fetch-cookies-set-in-about-blank-iframe.html
1787                http/tests/cookies/same-site/fetch-in-about-blank-page.html
1788                http/tests/cookies/same-site/fetch-in-cross-origin-iframe.html
1789                http/tests/cookies/same-site/fetch-in-cross-origin-page.html
1790                http/tests/cookies/same-site/fetch-in-cross-origin-service-worker.html
1791                http/tests/cookies/same-site/fetch-in-cross-origin-worker.html
1792                http/tests/cookies/same-site/fetch-in-same-origin-page.html
1793                http/tests/cookies/same-site/fetch-in-same-origin-service-worker.html
1794                http/tests/cookies/same-site/fetch-in-same-origin-srcdoc-iframe.html
1795                http/tests/cookies/same-site/fetch-in-same-origin-worker.html
1796                http/tests/cookies/same-site/popup-cross-site-post.html
1797                http/tests/cookies/same-site/popup-cross-site.html
1798                http/tests/cookies/same-site/popup-same-site-post.html
1799                http/tests/cookies/same-site/popup-same-site-via-cross-site-redirect.html
1800                http/tests/cookies/same-site/popup-same-site-via-same-site-redirect.html
1801                http/tests/cookies/same-site/popup-same-site.html
1802
1803         * Sources.txt: Add source file SameSiteInfo.cpp.
1804         * WebCore.xcodeproj/project.pbxproj: Add source files SameSiteInfo.{cpp, h}.
1805         * dom/Document.cpp:
1806         (WebCore::Document::initSecurityContext): Modified to call SecurityPolicy::shouldInheritSecurityOriginFromOwner().
1807         (WebCore::Document::shouldInheritContentSecurityPolicyFromOwner const): Ditto.
1808         (WebCore::shouldInheritSecurityOriginFromOwner): Deleted; moved to SecurityPolicy.
1809         * dom/Document.h:
1810         (WebCore::Document::firstPartyForSameSiteCookies const): Added.
1811         (WebCore::Document::setFirstPartyForSameSiteCookies): Added.
1812         * loader/CookieJar.cpp:
1813         (WebCore::sameSiteInfo): Returns the same-site info for the request used to load the specified document.
1814         (WebCore::cookies): Pass the same-site info down to the platform.
1815         (WebCore::cookieRequestHeaderFieldProxy): Ditto.
1816         (WebCore::setCookies): Ditto.
1817         (WebCore::cookieRequestHeaderFieldValue): Ditto.
1818         (WebCore::getRawCookies): Ditto.
1819         * loader/DocumentLoader.cpp:
1820         (WebCore::DocumentLoader::willSendRequest): Add same-site info to the request.
1821         (WebCore::DocumentLoader::startLoadingMainResource): Update a FIXME comment to explain that
1822         we can simplify ResourceRequestBase if we can remove the call to addExtraFieldsToMainResourceRequest()
1823         here. Specifically, we would not need to differentiate between a request with an unspecified
1824         same-site state (default state of a new request) from a request whose same-site state has
1825         been explicitly set if we can assume that the same-site state of a request is set exactly
1826         once. In absence of this guarantee we need an "unspecified" state to avoid overriding existing
1827         same-site information computed with a null initiating document (the case of a new address bar
1828         initiated load) from a load initiated by the document associated with this loader.
1829         * loader/FrameLoader.cpp:
1830         (WebCore::FrameLoader::setFirstPartyForCookies): Modified to also update the first party for
1831         same-site cookies ("site for cookies").
1832         (WebCore::FrameLoader::load): Add same-site info to the request.
1833         (WebCore::FrameLoader::reload): Ditto.
1834         (WebCore::FrameLoader::setOriginalURLForDownloadRequest): Ditto.
1835         (WebCore::FrameLoader::addExtraFieldsToRequest): If the request does not already have
1836         same-site info then compute it and add it to the request. Mark main frame main resource
1837         requests as a "top-site".
1838         (WebCore::FrameLoader::addSameSiteInfoToRequestIfNeeded): Implements the "'Same-site' and 'cross-site'
1839         Requests" algorithm from <https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00#section-2.1>.
1840         (WebCore::createWindow): Add same-site info to the request.
1841         * loader/FrameLoader.h:
1842         * loader/ResourceLoader.cpp:
1843         (WebCore::ResourceLoader::init): Ditto.
1844         * page/DOMWindow.cpp:
1845         (WebCore::DOMWindow::createWindow): Ditto.
1846         * page/SecurityPolicy.cpp:
1847         (WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner): Moved from Document.cpp.
1848         * page/SecurityPolicy.h:
1849         * platform/CookiesStrategy.h:
1850         * platform/network/CacheValidation.cpp:
1851         (WebCore::headerValueForVary): Pass the same-site info down to the platform.
1852         * platform/network/CookieRequestHeaderFieldProxy.h:
1853         (WebCore::CookieRequestHeaderFieldProxy::encode const): Encode same-site bits.
1854         (WebCore::CookieRequestHeaderFieldProxy::decode): Decode same-site bits.
1855         * platform/network/PlatformCookieJar.h:
1856         * platform/network/ResourceRequestBase.cpp:
1857         (WebCore::ResourceRequestBase::setAsIsolatedCopy): Added.
1858         (WebCore::ResourceRequestBase::isSameSite const): Added.
1859         (WebCore::ResourceRequestBase::setIsSameSite): Added.
1860         (WebCore::ResourceRequestBase::isTopSite const): Added.
1861         (WebCore::ResourceRequestBase::setIsTopSite): Added.
1862         (WebCore::equalIgnoringHeaderFields):
1863         * platform/network/ResourceRequestBase.h:
1864         (WebCore::ResourceRequestBase::isSameSiteUnspecified const): Added. See comment for DocumentLoader::startLoadingMainResource()
1865         for more details.
1866         (WebCore::registrableDomainsAreEqual): Added.
1867         (WebCore::ResourceRequestBase::encodeBase const): Encode same-site bits.
1868         (WebCore::ResourceRequestBase::decodeBase): Decode same-site bits.
1869         * platform/network/SameSiteInfo.cpp: Added.
1870         (WebCore::SameSiteInfo::create):
1871         * platform/network/SameSiteInfo.h: Added.
1872         (WebCore::SameSiteInfo::encode const):
1873         (WebCore::SameSiteInfo::decode):
1874         * platform/network/cf/CookieJarCFNet.cpp:
1875         (WebCore::setCookiesFromDOM): Pass Same-Site info down.
1876         (WebCore::cookiesForDOM): Ditto.
1877         (WebCore::cookieRequestHeaderFieldValue): Ditto.
1878         (WebCore::getRawCookies): Ditto.
1879         * platform/network/cf/ResourceRequestCFNet.cpp:
1880         (WebCore::siteForCookies): Added.
1881         (WebCore::ResourceRequest::doUpdatePlatformRequest): Update platform request with same-site info.
1882         (WebCore::ResourceRequest::doUpdateResourceRequest): Ditto.
1883         * platform/network/cocoa/ResourceRequestCocoa.mm:
1884         (WebCore::ResourceRequest::doUpdateResourceRequest): Ditto.
1885         (WebCore::siteForCookies): Added.
1886         (WebCore::ResourceRequest::doUpdatePlatformRequest): Update platform request with same-site info.
1887         * platform/network/curl/CookieJarCurl.cpp:
1888         (WebCore::cookiesForDOM): Pass Same-Site info down.
1889         (WebCore::setCookiesFromDOM): Ditto.
1890         (WebCore::cookieRequestHeaderFieldValue): Ditto.
1891         (WebCore::getRawCookies): Ditto.
1892         * platform/network/curl/CookieJarCurl.h:
1893         * platform/network/curl/CookieJarCurlDatabase.cpp:
1894         (WebCore::CookieJarCurlDatabase::setCookiesFromDOM const): Ditto.
1895         (WebCore::CookieJarCurlDatabase::cookiesForDOM const): Ditto.
1896         (WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const): Ditto.
1897         (WebCore::CookieJarCurlDatabase::getRawCookies const): Ditto.
1898         * platform/network/curl/CookieJarCurlDatabase.h:
1899         * platform/network/curl/ResourceHandleCurl.cpp:
1900         (WebCore::ResourceHandle::createCurlRequest): Ditto.
1901         * platform/network/mac/CookieJarMac.mm:
1902         (WebCore::cookiesForURL): Added; shared function to return the cookies based on the specified criterion.
1903         (WebCore::setHTTPCookiesForURL): Moved from the bottom of the file to top to be closer to the other
1904         CFNetwork helper functions. Modified to support fetching same-site cookies.
1905         (WebCore::httpCookiesForURL): Moved to be under setHTTPCookiesForURL(). Modified to call cookiesForURL().
1906         Note the SPI used in cookiesForURL() apply the same criterion for whether to fetch secure cookies as we
1907         were computing here. That is, the CFNetwork SPI only returns secure cookies if the specified URL's scheme
1908         case-insensitively matches "https".
1909         (WebCore::cookiesInPartitionForURL): Wrote in terms of cookiesForURL().
1910         (WebCore::cookiesForSession): Pass the Same-Site info.
1911         (WebCore::cookiesForDOM): Ditto.
1912         (WebCore::cookieRequestHeaderFieldValue): Ditto.
1913         (WebCore::setCookiesFromDOM): Ditto.
1914         (WebCore::getRawCookies): Ditto.
1915         (WebCore::deleteCookie): Pass std::nullopt for the Same-Site info so that we do not consider the SameSite
1916         attribute when fetching cookies to delete.
1917         * platform/network/soup/CookieJarSoup.cpp:
1918         (WebCore::setCookiesFromDOM): Pass the Same-Site info.
1919         (WebCore::cookiesForDOM): Ditto.
1920         (WebCore::cookieRequestHeaderFieldValue): Ditto.
1921         (WebCore::getRawCookies): Ditto.
1922         * workers/service/context/ServiceWorkerThreadProxy.cpp:
1923         (WebCore::createPageForServiceWorker): Set the first party for same site cookies ("site for cookies") to
1924         the script URL.
1925         * xml/XSLTProcessor.cpp:
1926         (WebCore::XSLTProcessor::createDocumentFromSource): Copy the first party for same-site cookies to the
1927         new document.
1928
1929 2018-04-23  Chris Dumez  <cdumez@apple.com>
1930
1931         HTML String load cannot be prevented by responding 'Cancel' asynchronously in decidePolicyForNavigationAction
1932         https://bugs.webkit.org/show_bug.cgi?id=184848
1933         <rdar://problem/39145306>
1934
1935         Reviewed by Brady Eidson.
1936
1937         When calling loadHTMLString on a WebView, we end up doing a load for 'about:blank'
1938         with substitute data. In such case, we want to do a regular asynchronous policy
1939         delegate check, there is no reason we need it to be synchronous. Update our check
1940         to make sure we only do a synchronous policy check for initial 'about:blank' loads
1941         that do not have substitute data.
1942
1943         * loader/PolicyChecker.cpp:
1944         (WebCore::PolicyChecker::checkNavigationPolicy):
1945
1946 2018-04-23  Wenson Hsieh  <wenson_hsieh@apple.com>
1947
1948         [Extra zoom mode] 100vw is roughly half of the viewport width in extra zoom mode
1949         https://bugs.webkit.org/show_bug.cgi?id=184871
1950         <rdar://problem/39477595>
1951
1952         Reviewed by Andy Estes.
1953
1954         Currently, when computing CSS viewport units, we use ViewportConfiguration::initialScaleIgnoringContentSize().
1955         This method computes an initial scale from the layout width and height without relying on any information
1956         derived from the current content size. This is done to ensure that the content size and viewport dimensions for
1957         CSS viewport units should not be simultaneously dependent on each other.
1958
1959         Since shrink-to-fit heuristics depend on content size, we currently assume that shrink-to-fit is disabled when
1960         computing initialScaleIgnoringContentSize, by always passing in `false` for `shouldIgnoreScalingConstraints`.
1961         However, in extra zoom mode, the opposite is true: since we force both `m_canIgnoreScalingConstraints` and
1962         `m_forceHorizontalShrinkToFit` to be `true` in this mode, we will always try to shrink-to-fit regardless of
1963         content size.
1964
1965         Because of this shrink-to-fit disparity between `initialScale` and `initialScaleIgnoringContentSize`, viewport
1966         units in extra zoom mode are currently computed assuming an initial scale set by the page, whereas the real
1967         viewport is scaled to fit, which causes any lengths computed in terms of vw and vh to be incorrect. To fix this,
1968         we introduce a version of shouldIgnoreScalingConstraints() that returns `true` iff scaling constraints are
1969         always ignored, regardless of content size. We then use this in initialScaleIgnoringContentSize, instead of
1970         always passing in `false` for `shouldIgnoreScalingConstraints`.
1971
1972         Test: fast/css/extrazoom/viewport-units-shrink-to-fit.html
1973
1974         * page/ViewportConfiguration.cpp:
1975         (WebCore::ViewportConfiguration::shouldIgnoreScalingConstraintsRegardlessOfContentSize const):
1976         (WebCore::ViewportConfiguration::initialScaleIgnoringContentSize const):
1977         * page/ViewportConfiguration.h:
1978
1979 2018-04-23  Zalan Bujtas  <zalan@apple.com>
1980
1981         [Simple line layout] Generate inline boxtree using simple line layout runs.
1982         https://bugs.webkit.org/show_bug.cgi?id=184833
1983
1984         Reviewed by Antti Koivisto.
1985
1986         RenderBlockFlow::ensureLineBoxes triggers line layout on the block content to replace
1987         the simple line layout runs with an inline boxtree. The runs generated by the fast path
1988         should always match the inline tree boxes.
1989         In this patch instead of triggering layout, we just convert the simple line runs to
1990         inline boxes.
1991         Currently, it works with only one, non-paginated text renderer, but we should be
1992         able to extend it to all the simple line layout content.   
1993
1994         Covered by existing tests.
1995
1996         * rendering/InlineBox.h:
1997         (WebCore::InlineBox::setHasHyphen):
1998         (WebCore::InlineBox::setCanHaveLeadingExpansion):
1999         (WebCore::InlineBox::setCanHaveTrailingExpansion):
2000         (WebCore::InlineBox::setForceTrailingExpansion):
2001         (WebCore::InlineBox::setForceLeadingExpansion):
2002         (WebCore::InlineBox::hasHyphen const):
2003         (WebCore::InlineBox::canHaveLeadingExpansion const):
2004         (WebCore::InlineBox::canHaveTrailingExpansion const):
2005         (WebCore::InlineBox::forceTrailingExpansion const):
2006         * rendering/RenderBlockFlow.cpp:
2007         (WebCore::RenderBlockFlow::ensureLineBoxes):
2008         * rendering/RenderBlockFlow.h:
2009         * rendering/SimpleLineLayoutFlowContents.h:
2010         (WebCore::SimpleLineLayout::FlowContents::segmentForRun const):
2011         * rendering/SimpleLineLayoutFunctions.cpp:
2012         (WebCore::SimpleLineLayout::canUseForLineBoxTree):
2013         (WebCore::SimpleLineLayout::initializeInlineBox):
2014         (WebCore::SimpleLineLayout::generateLineBoxTree):
2015         * rendering/SimpleLineLayoutFunctions.h:
2016         * rendering/SimpleLineLayoutResolver.cpp:
2017         (WebCore::SimpleLineLayout::RunResolver::rangeForLine const):
2018         * rendering/SimpleLineLayoutResolver.h:
2019
2020 2018-04-23  Zan Dobersek  <zdobersek@igalia.com>
2021
2022         [CoordGraphics] Remove unused trajectory cruft in CoordinatedLayerTreeHost, CoordinatedGraphicsLayer
2023         https://bugs.webkit.org/show_bug.cgi?id=184881
2024
2025         Reviewed by Michael Catanzaro.
2026
2027         Remove the redundant findFirstDescendantWithContentsRecursively() and
2028         setVisibleContentRectTrajectoryVector() methods on the
2029         CoordinatedGraphicsLayer class.
2030
2031         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2032         (WebCore::CoordinatedGraphicsLayer::findFirstDescendantWithContentsRecursively): Deleted.
2033         (WebCore::CoordinatedGraphicsLayer::setVisibleContentRectTrajectoryVector): Deleted.
2034         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2035
2036 2018-04-23  Zan Dobersek  <zdobersek@igalia.com>
2037
2038         [CoordGraphics] TiledBackingStore unnecessarily tracks alpha support value
2039         https://bugs.webkit.org/show_bug.cgi?id=184880
2040
2041         Reviewed by Michael Catanzaro.
2042
2043         Drop the m_supportsAlpha member from the TiledBackingStore class. The
2044         member value was unused. TiledBackingStore::setSupportsAlpha() method
2045         is removed.
2046
2047         TiledBackingStore::setSupportsAlpha() invalidated the backing store,
2048         so CoordinatedGraphicsLayer::setContentsOpaque() now enforces the same
2049         behavior by manually updating the m_needsDisplay struct. This means
2050         that during the following layer flush the backing store is repainted
2051         in its entirety.
2052
2053         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
2054         (WebCore::CoordinatedGraphicsLayer::setContentsOpaque):
2055         (WebCore::CoordinatedGraphicsLayer::createBackingStore):
2056         * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
2057         (WebCore::TiledBackingStore::TiledBackingStore):
2058         (WebCore::TiledBackingStore::setSupportsAlpha): Deleted.
2059         * platform/graphics/texmap/coordinated/TiledBackingStore.h:
2060
2061 2018-04-23  Thibault Saunier  <tsaunier@igalia.com>
2062
2063         [GStreamer] Start implementing Audio/VideoTrackPrivateGSTreamer::kind method
2064         https://bugs.webkit.org/show_bug.cgi?id=184650
2065
2066         Reviewed by Philippe Normand.
2067
2068         In the playbin3 case we can assume that if the GstStream is selected by default,
2069         it is the Main track of that kind.
2070
2071         No new tests are added as:
2072             * It relies on playbin3 case which support might be compiled out
2073             * we already have a few test that are currently disabled in the mediastream
2074               testsuite. This patch is part of the work to enable them.
2075
2076         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp:
2077         (WebCore::AudioTrackPrivateGStreamer::kind const):
2078         * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.h:
2079         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
2080         (WebCore::VideoTrackPrivateGStreamer::kind const):
2081         * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.h:
2082
2083 2018-04-23  Alicia Boya García  <aboya@igalia.com>
2084
2085         [MSE] Add allSamplesInTrackEnqueued event
2086         https://bugs.webkit.org/show_bug.cgi?id=184737
2087
2088         MediaSource has a .endOfStream() method to signal when there are no more frames
2089         after the ones currently buffered.
2090
2091         This bit of data is important for some multimedia frameworks. For instance, in
2092         GStreamer a stream of frames being decoded should be terminated by a
2093         'end-of-stream' (EOS) event that has a similar meaning. Some GStreamer elements
2094         will expect this event in order to work properly under some circumstances.
2095
2096         Unfortunately currently WebKit provides no mechanism for this: an event of
2097         sorts should be emitted after no more frames are going to be enqueued to signal
2098         the end of the stream. The closest mechanism WebKit has for this is
2099         `markEndOfStream()`, but it's not exactly the same: markEndOfStream() informs
2100         that -- as far as network buffering is concerned -- we are done; but at that
2101         point there may still be (and often are) many frames waiting in the
2102         decodeQueue, so it would be wrong to signal the decoder that there are no more
2103         frames.
2104
2105         This patch introduces a new optional method in SourceBufferPrivate,
2106         `allSamplesInTrackEnqueued(const AtomicString& trackID)` that is called
2107         whenever the MediaSource is in "ended" state (the user has called
2108         `MediaSource.endOfStream()`) and the decodeQueue is empty. Media framework
2109         implementations can use this method to send a EOS event to a decoder that needs
2110         it.
2111
2112         Reviewed by Xabier Rodriguez-Calvar.
2113
2114         * Modules/mediasource/MediaSource.cpp:
2115         (WebCore::MediaSource::streamEndedWithError):
2116         * Modules/mediasource/SourceBuffer.cpp:
2117         (WebCore::SourceBuffer::provideMediaData):
2118         (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued):
2119         (WebCore::SourceBuffer::trySignalAllSamplesEnqueued):
2120         * Modules/mediasource/SourceBuffer.h:
2121         * platform/graphics/SourceBufferPrivate.h:
2122         (WebCore::SourceBufferPrivate::allSamplesInTrackEnqueued):
2123         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
2124         (WebCore::MediaSourceClientGStreamerMSE::allSamplesInTrackEnqueued):
2125         * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
2126         * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
2127         (WebCore::PlaybackPipeline::allSamplesInTrackEnqueued):
2128         * platform/graphics/gstreamer/mse/PlaybackPipeline.h:
2129         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
2130         (WebCore::SourceBufferPrivateGStreamer::allSamplesInTrackEnqueued):
2131         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
2132
2133 2018-04-23  Ms2ger  <Ms2ger@igalia.com>
2134
2135         Avoid uninitialized memory read.
2136         https://bugs.webkit.org/show_bug.cgi?id=184505
2137         <rdar://problem/39348325>
2138
2139         Reviewed by Dean Jackson.
2140
2141         Test: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-bounds.html
2142
2143         * html/ImageBitmap.cpp:
2144         (WebCore::croppedSourceRectangleWithFormatting):
2145
2146 2018-04-23  Zan Dobersek  <zdobersek@igalia.com>
2147
2148         [TexMap] Drop RefCounted inheritance off of TextureMapperBackingStore
2149         https://bugs.webkit.org/show_bug.cgi?id=184810
2150
2151         Reviewed by Carlos Garcia Campos.
2152
2153         Turn TextureMapperBackingStore into a simple interface that doesn't
2154         inherit from RefCounted<>. Instead, push that inheritance off to the
2155         classes that implement the TextureMapperBackingStore interface. This
2156         narrows down the purpose of TextureMapperBackingStore towards a simple
2157         interface that TextureMapper algorithms can work with.
2158
2159         TextureMapperLayer has its m_backingStore member variable turn into
2160         a simple pointer instead of a RefPtr<>. Setter method and call sites of
2161         that method are updated to reflect that.
2162
2163         TextureMapperTiledBackingStore now inherits from RefCounted<> directly,
2164         instead of through TextureMapperBackingStore.
2165
2166         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
2167         (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
2168         (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
2169         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
2170         * platform/graphics/texmap/TextureMapperBackingStore.h:
2171         * platform/graphics/texmap/TextureMapperLayer.cpp:
2172         (WebCore::TextureMapperLayer::setBackingStore):
2173         * platform/graphics/texmap/TextureMapperLayer.h:
2174         * platform/graphics/texmap/TextureMapperTiledBackingStore.h:
2175
2176 2018-04-22  Zan Dobersek  <zdobersek@igalia.com>
2177
2178         [AsyncScrolling] Add generic ScrollingThread implementation
2179         https://bugs.webkit.org/show_bug.cgi?id=184809
2180
2181         Reviewed by Yusuke Suzuki.
2182
2183         Add a generic ScrollingThread implementation that internally uses
2184         RunLoop facilities to run the scrolling thread and dispatch
2185         callbacks on that thread.
2186
2187         ScrollingThread::initializeRunLoop() retrieves address of the
2188         thread-specific RunLoop and signals the Condition object.
2189         ScrollingThread::wakeUpRunLoop() uses RunLoop::dispatch() to schedule
2190         callback dispatches on the scrolling thread.
2191
2192         ScrollingThread::createThreadIfNeeded() mimics Cocoa implementation and
2193         waits for the RunLoop address to be retrieved before continuing.
2194
2195         * SourcesGTK.txt: Add to build.
2196         * SourcesWPE.txt: Ditto.
2197         * page/scrolling/ScrollingThread.cpp:
2198         (WebCore::ScrollingThread::createThreadIfNeeded):
2199         * page/scrolling/ScrollingThread.h:
2200         * page/scrolling/generic/ScrollingThreadGeneric.cpp: Added.
2201         (WebCore::ScrollingThread::initializeRunLoop):
2202         (WebCore::ScrollingThread::wakeUpRunLoop):
2203
2204 2018-04-22  Zan Dobersek  <zdobersek@igalia.com>
2205
2206         [CoordinatedGraphics] Unused contentsSize, coveredRect attributes in CoordinatedGraphicsState
2207         https://bugs.webkit.org/show_bug.cgi?id=184811
2208
2209         Reviewed by Carlos Garcia Campos.
2210
2211         Remove the unused contentsSize and coveredRect attributes on the
2212         CoordinatedGraphicsState struct. CoordinatedGraphicsLayer::coverRect()
2213         method is now unused and can also be removed.
2214
2215         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
2216         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
2217
2218 2018-04-21  Daniel Bates  <dabates@apple.com>
2219
2220         Cleanup CookieRequestHeaderFieldProxy
2221         https://bugs.webkit.org/show_bug.cgi?id=184868
2222
2223         Remove extraneous whitespace that I inadvertently added.
2224
2225         * platform/network/CookieRequestHeaderFieldProxy.h:
2226         (WebCore::CookieRequestHeaderFieldProxy::decode):
2227
2228 2018-04-21  Daniel Bates  <dabates@apple.com>
2229
2230         Cleanup CookieRequestHeaderFieldProxy
2231         https://bugs.webkit.org/show_bug.cgi?id=184868
2232
2233         Reviewed by Youenn Fablet.
2234
2235         Simplify the struct CookieRequestHeaderFieldProxy and make it consistent with other structs.
2236         Among other changes, remove constructors for CookieRequestHeaderFieldProxy as they are
2237         unnecessary as all supported compilers support non-static data member initializers (NSDMI)
2238         for aggregates, remove prefix "m_" from the name of fields as this is struct exists for
2239         convenience and offers no encapsulation and simplify decoding logic of this struct.
2240
2241         No functionality changed. So, no new tests.
2242
2243         * loader/CookieJar.cpp:
2244         (WebCore::cookieRequestHeaderFieldProxy):
2245         * platform/network/CookieRequestHeaderFieldProxy.h:
2246         (WebCore::CookieRequestHeaderFieldProxy::encode const):
2247         (WebCore::CookieRequestHeaderFieldProxy::decode):
2248         (WebCore::CookieRequestHeaderFieldProxy::CookieRequestHeaderFieldProxy): Deleted.
2249         * platform/network/SocketStreamHandleImpl.cpp:
2250         (WebCore::cookieDataForHandshake):
2251         * platform/network/cf/CookieJarCFNet.cpp:
2252         (WebCore::cookieRequestHeaderFieldValue):
2253         * platform/network/curl/CookieJarCurl.cpp:
2254         (WebCore::cookieRequestHeaderFieldValue):
2255         * platform/network/curl/CookieJarCurlDatabase.cpp:
2256         (WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const):
2257         * platform/network/mac/CookieJarMac.mm:
2258         (WebCore::cookieRequestHeaderFieldValue):
2259         * platform/network/soup/CookieJarSoup.cpp:
2260         (WebCore::cookieRequestHeaderFieldValue):
2261
2262 2018-04-21  Antoine Quint  <graouts@apple.com>
2263
2264         [Modern Media Controls] Show a loading indicator after pressing the play button in compact mode
2265         https://bugs.webkit.org/show_bug.cgi?id=184863
2266         <rdar://problem/38939468>
2267
2268         Reviewed by Dean Jackson.
2269
2270         We now display a loading indicator after pressing the play button when in compact mode. We also update the
2271         behavior to use assets provided through WebKitAdditions (see webkit.org/b/184862) for the play button and
2272         the invalid icon. Additionally, we always show a 20% opaque black overlay in the background while any piece
2273         of user interface is up.
2274
2275         * Modules/modern-media-controls/controls/compact-activity-indicator.css: Added.
2276         (button.compact-activity-indicator > picture): The loading indicator asset is a sprite made of 23 frames, so
2277         we specify the mask size (since all buttons are rendered via a mask) to be 23 * 100% the rendered size. The
2278         display of the loading indicator is performed with a first intro animation which runs once through the first
2279         8 frames and then a continuously looping animation going through the remaining frames. We use a frames()
2280         timing function to achieve the frame-by-frame effect while using only from/to keyframe animations. When we
2281         fade out, we use a simply opacity fade, which is combined with the spinning animation. We use CSS variables
2282         to encode both animations so they can be used combined or one at a time without redefining the whole animation
2283         property.
2284         (button.compact-activity-indicator.spins > picture): Use the "spins" animation variable when spinning.
2285         (button.compact-activity-indicator.spins.fades-out > picture): Combine the "spins" and "fades-out" animation
2286         variables when fading out.
2287         (@keyframes compact-activity-indicator-intro): Animation going through the first 8 frames of the loading indicator.
2288         (@keyframes compact-activity-indicator-loop): Animation going through the remaining frames of the loading indicator.
2289         (@keyframes compact-activity-indicator-fades-out): Animation fading opacity from 1 to 0.
2290         * Modules/modern-media-controls/controls/compact-activity-indicator.js: Added.
2291         (CompactActivityIndicator):
2292         (CompactActivityIndicator.prototype.show): Add the "spins" CSS class to show the control spinning with the intro animation.
2293         (CompactActivityIndicator.prototype.hide): Add the "fades-out" CSS class to hide the control, removing both this class and
2294         the "spins" class when the fade-out animation completes.
2295         * Modules/modern-media-controls/controls/compact-media-controls.css: Added.
2296         (.media-controls.compact:before): Add a 20% black overlay over the video frame to provide contrast for controls.
2297         (.media-controls.compact button): Ensure buttons are sized to use the entire video frame so that their hit region
2298         comprises the whole video frame.
2299         (.media-controls.compact button > picture): Override default blending styles for a simple solid white mask.
2300         (.media-controls.compact button:active > picture): Turn off the scale down effect when pressing a button.
2301         * Modules/modern-media-controls/controls/compact-media-controls.js: Expose a "state" property for the compact media controls,
2302         which can be exlusively one of three: "paused", "pending" and "invalid".
2303         (CompactMediaControls.):
2304         (CompactMediaControls.prototype.get state):
2305         (CompactMediaControls.prototype.set state):
2306         (CompactMediaControls.prototype.layout): In the "paused" state, show the play button. In the "pending" state show
2307         the loading indicator. In the "invalid" state show the invalid button.
2308         (CompactMediaControls.prototype.get placard): Deleted.
2309         (CompactMediaControls.prototype.set placard): Deleted.
2310         * Modules/modern-media-controls/js-files:
2311         * Modules/modern-media-controls/media/compact-media-controls-support.js: Added.
2312         (CompactMediaControlsSupport.prototype.get mediaEvents):
2313         (CompactMediaControlsSupport.prototype.handleEvent): Make the controls enter the "paused" state when receiving a "pause"
2314         event. Make the controls enter the "invalid" state when receiving an "error" event. 
2315         (CompactMediaControlsSupport.prototype.enable):
2316         (CompactMediaControlsSupport.prototype.disable):
2317         (CompactMediaControlsSupport.prototype.buttonWasPressed): Play the media when pressing the play button and make the controls
2318         enter the "pending" state. When pressing the loading indicator, pause the media and make the controls enter the "paused" state.
2319         (CompactMediaControlsSupport.prototype._buttons):
2320         (CompactMediaControlsSupport):
2321         * Modules/modern-media-controls/media/media-controller.js:
2322         (MediaController.prototype._supportingObjectClasses): Only use CompactMediaControlsSupport as a media controller supporting object
2323         in the compact mode.
2324         * Modules/modern-media-controls/media/placard-support.js:
2325         (PlacardSupport.prototype.get mediaEvents): This media controller support object no longer needs to deal with compact mode.
2326         * Modules/modern-media-controls/media/playback-support.js:
2327         (PlaybackSupport.prototype.syncControl): This media controller support object no longer needs to deal with compact mode.
2328         (PlaybackSupport):
2329
2330 2018-04-21  Antoine Quint  <graouts@apple.com>
2331
2332         [Modern Media Controls] Obtain compact mode icons through WebKitAdditions
2333         https://bugs.webkit.org/show_bug.cgi?id=184862
2334         <rdar://problem/39621645>
2335
2336         Reviewed by Jon Lee.
2337
2338         * Modules/modern-media-controls/controls/button.js:
2339         (Button.prototype._updateImageMetrics): Handle PDF assets where the image source's intrinsic size needs
2340         to be adjusted for the device pixel density.
2341         (Button):
2342         * Modules/modern-media-controls/controls/icon-service.js: Expect three additional icons provided through
2343         WebKitAdditions, including two in the PDF format, so we add support for this format.
2344         * WebCore.xcodeproj/project.pbxproj: Copy additional assets from the WebKitAdditions build directory should
2345         any be present.
2346
2347 2018-04-21  Dean Jackson  <dino@apple.com>
2348
2349         Expose whether you've build with the Apple Internal SDK
2350         https://bugs.webkit.org/show_bug.cgi?id=184864
2351
2352         Reviewed by Wenson Hsieh.
2353
2354         Internals API to let a test know if it is running with the
2355         Apple internal SDK.
2356
2357         * testing/Internals.cpp:
2358         (WebCore::usingAppleInternalSDK const):
2359         * testing/Internals.h:
2360         * testing/Internals.idl:
2361
2362 2018-04-20  Nan Wang  <n_wang@apple.com>
2363
2364         AX: AOM does not work with DOM Level 1 events
2365         https://bugs.webkit.org/show_bug.cgi?id=184847
2366
2367         Reviewed by Chris Fleizach.
2368
2369         Added the accessibility events to the HTML attribute names.
2370
2371         Test cases are added to the existing layout tests.
2372
2373         * html/HTMLAttributeNames.in:
2374         * html/HTMLElement.cpp:
2375         (WebCore::HTMLElement::createEventHandlerNameMap):
2376
2377 2018-04-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2378
2379         REGRESSION(r228088): [SOUP] Check TLS errors for WebSockets on GTlsConnection::accept-certificate
2380         https://bugs.webkit.org/show_bug.cgi?id=184804
2381
2382         Reviewed by Michael Catanzaro.
2383
2384         * platform/network/soup/SocketStreamHandleImpl.h: Add a public url getter.
2385         * platform/network/soup/SocketStreamHandleImplSoup.cpp:
2386         (WebCore::acceptCertificateCallback): Call SoupNetworkSession::checkTLSErrors() to decide whether to accept the
2387         certificate or not.
2388         (WebCore::connectProgressCallback): Receive the SocketStreamHandle and pass it to acceptCertificateCallback callback.
2389         (WebCore::socketClientEventCallback): Ditto.
2390         (WebCore::SocketStreamHandleImpl::create): Always connect to network events.
2391         (WebCore::wssConnectionAcceptCertificateCallback): Deleted.
2392         (WebCore::wssSocketClientEventCallback): Deleted.
2393
2394 2018-04-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2395
2396         [SOUP] Do TLS error checking on GTlsConnection::accept-certificate
2397         https://bugs.webkit.org/show_bug.cgi?id=184480
2398
2399         Reviewed by Michael Catanzaro.
2400
2401         * platform/network/soup/ResourceError.h: Change tlsError to recieve a failing URL instead of a SoupRequest,
2402         since the request was only used to get the failing URL.
2403         * platform/network/soup/ResourceErrorSoup.cpp:
2404         (WebCore::ResourceError::tlsError): Use the given failing URL.
2405         * platform/network/soup/SoupNetworkSession.cpp:
2406         (WebCore::SoupNetworkSession::SoupNetworkSession): Use ssl-strict when creating the SoupSession to handle the
2407         certificates ourselves by connecting to GTlsConnection::accept-certificate.
2408         (WebCore::SoupNetworkSession::checkTLSErrors): Updated to receive a URL, certificate and errors instead of
2409         receiving a SoupRequest and SoupMessage and extract the url, certirficate and errors from them. Also return the
2410         optional error directly instead of using a completion handler since the function is always synchronous.
2411         * platform/network/soup/SoupNetworkSession.h:
2412
2413 2018-04-20  Tim Horton  <timothy_horton@apple.com>
2414
2415         Adjust geolocation feature flag
2416         https://bugs.webkit.org/show_bug.cgi?id=184856
2417
2418         Reviewed by Wenson Hsieh.
2419
2420         * Configurations/FeatureDefines.xcconfig:
2421
2422 2018-04-20  Chris Dumez  <cdumez@apple.com>
2423
2424         Unreviewed attempt to fix Windows build after r230875.
2425
2426         * platform/network/cf/CookieJarCFNet.cpp:
2427         (WebCore::cookieRequestHeaderFieldValue):
2428         * platform/network/curl/CookieJarCurlDatabase.cpp:
2429
2430 2018-04-20  Chris Dumez  <cdumez@apple.com>
2431
2432         REGRESSION (r229828): web view doesn’t update or respond to resizing until client calls policy decision handler
2433         https://bugs.webkit.org/show_bug.cgi?id=184210
2434         <rdar://problem/39072354>
2435
2436         Reviewed by Wenson Hsieh.
2437
2438         r229828 tried to have some API tests happy on iOS by freezing the layer tree
2439         during the navigation policy decision. However, this is observable by the client
2440         application and a regression from when the policy delegate was synchronous.
2441
2442         To address the issue, this patch reverts r229828 and instead updates the iOS
2443         API tests to wait for the next presentation update after navigating
2444         before interacting with the view.
2445
2446         * loader/FrameLoaderClient.h:
2447         * loader/PolicyChecker.cpp:
2448         (WebCore::PolicyChecker::checkNavigationPolicy):
2449
2450 2018-04-20  Brent Fulgham  <bfulgham@apple.com>
2451
2452         Limit cookie header access to Network process
2453         https://bugs.webkit.org/show_bug.cgi?id=184764
2454         <rdar://problem/36785285>
2455
2456         Reviewed by Youenn Fablet.
2457
2458         Revise the handling of cookie request headers so that we don't interact with them in the
2459         WebContent process. They are only needed for interaction with the server and the network
2460         process, so we should limit their scope to just the Network process.
2461
2462         Instead, we should handle a token that represents the cookie headers in the WebContent
2463         process, which can be converted to the relevant cookie data in the network process when
2464         needed.
2465
2466         * Modules/websockets/WebSocketChannel.cpp:
2467         (WebCore::WebSocketChannel::didOpenSocketStream):
2468         * Modules/websockets/WebSocketHandshake.cpp:
2469         (WebCore::WebSocketHandshake::clientHandshakeMessage const):
2470         (WebCore::WebSocketHandshake::clientHandshakeRequest const):
2471         (WebCore::WebSocketHandshake::clientHandshakeCookieRequestHeaderFieldProxy const):
2472         (WebCore::WebSocketHandshake::clientHandshakeMessage): Deleted.
2473         (WebCore::WebSocketHandshake::clientHandshakeRequest): Deleted.
2474         * Modules/websockets/WebSocketHandshake.h:
2475         * WebCore.xcodeproj/project.pbxproj:
2476         * loader/CookieJar.cpp:
2477         (WebCore::cookieRequestHeaderFieldProxy):
2478         * loader/CookieJar.h:
2479         * platform/network/CookieRequestHeaderFieldProxy.h: Added.
2480         (WebCore::CookieRequestHeaderFieldProxy::CookieRequestHeaderFieldProxy):
2481         (WebCore::CookieRequestHeaderFieldProxy::isolatedCopy const):
2482         (WebCore::CookieRequestHeaderFieldProxy::encode const):
2483         (WebCore::CookieRequestHeaderFieldProxy::decode):
2484         * platform/network/PlatformCookieJar.h:
2485         * platform/network/SocketStreamHandle.cpp:
2486         (WebCore::SocketStreamHandle::sendHandshake):
2487         * platform/network/SocketStreamHandle.h:
2488         * platform/network/SocketStreamHandleImpl.cpp:
2489         (WebCore::SocketStreamHandleImpl::platformSendHandshake):
2490         * platform/network/cf/SocketStreamHandleImpl.h:
2491         * platform/network/curl/CookieJarCurl.cpp:
2492         (WebCore::cookieRequestHeaderFieldValue):
2493         * platform/network/curl/CookieJarCurl.h:
2494         * platform/network/curl/SocketStreamHandleImpl.h:
2495         * platform/network/mac/CookieJarMac.mm:
2496         (WebCore::cookieRequestHeaderFieldValue):
2497         * platform/network/soup/CookieJarSoup.cpp:
2498         (WebCore::cookieRequestHeaderFieldValue):
2499         * platform/network/soup/SocketStreamHandleImpl.h:
2500
2501 2018-04-20  Daniel Bates  <dabates@apple.com>
2502
2503         Hide Strong Password label when text field is too narrow
2504         https://bugs.webkit.org/show_bug.cgi?id=184785
2505         <rdar://problem/38183939>
2506
2507         Reviewed by Zalan Bujtas.
2508
2509         We accomplish this illusion by allowing the text field's decorations to wrap, specifying flex
2510         shrink factors, a flex basis and hiding overflow. Hiding overflow is accomplished by a
2511         combination of setting "overflow: hidden", "text-overflow: clip", and patching RenderTextControlSingleLine::layout()
2512         to ensure that the height of the container element is equal to the intrinsic height of the
2513         inner elements. Because the container is a flex box and we want to vertically center its
2514         contents we also need to fix up the y-position of the container element as it may have flexed
2515         as a result of forcing its height to match the intrinsic height of the inner elements.
2516
2517         * css/html.css:
2518         (input::-webkit-strong-password-auto-fill-button): Specify a flex-shrink factor and prevent
2519         wrapping of the "Strong Password" text when flexed.
2520         * html/shadow/TextControlInnerElements.cpp:
2521         (WebCore::TextControlInnerContainer::TextControlInnerContainer): Register for a custom style
2522         resolution callback so that we can style the container if it is a Strong Password or Strong
2523         Confirmation Password text field. Ideally we could accomplish this effect with a user agent-
2524         specific pseudo class together with a selector definition in the user agent style sheet,
2525         html.css. Unfortunately the style resolver does not seem to apply pseudo classes to
2526         shadow DOM pseudo elements (why?). Therefore we use a custom style resolution callback to
2527         achieve the same effect.
2528         (WebCore::isStrongPasswordTextField): Returns whether the specified DOM element is a Strong
2529         Password text field.
2530         (WebCore::TextControlInnerContainer::resolveCustomStyle): Conditionally apply CSS properties
2531         "flex-wrap: wrap" and overflow: hidden" if the shadow host of this container is a Strong
2532         Password text field.
2533         (WebCore::TextControlInnerElement::resolveCustomStyle): Conditionally style the inner text
2534         if the shadow host of this container is a Strong Password text field. We need to apply these
2535         styles here as opposed to in html.css for the same reason we need to apply the styles to
2536         the container in a custom style resolution callback. See the comments for TextControlInnerContainer()
2537         above for more details
2538         * html/shadow/TextControlInnerElements.h:
2539         * rendering/RenderTextControlSingleLine.cpp:
2540         (WebCore::resetOverriddenHeight): Added. Incorporates the logic from setNeedsLayoutOnAncestors().
2541         (WebCore::RenderTextControlSingleLine::layout): Override the height of the container element to
2542         match the height of the inner elements when this text field is a Strong Password field. We cache
2543         the container's logical top before adjusting its height so that we can restore it after performing
2544         a second layout of this renderer. This is needed because we vertically center the elements in this
2545         renderer and adjusting the height of the container may cause it to flex and re-position along its
2546         cross axis when the container's height is taller than the inner element's height (e.g. the "Strong
2547         Password" label wraps to the next line). This re-positioning causes a noticeable jitter when
2548         transitioning from a field that has a visible "Strong Password" label to one that does not. Caching
2549         and restoring the logical top of the container element avoids this jitter.
2550         (WebCore::setNeedsLayoutOnAncestors): Deleted. Moved its implementation into resetOverriddenHeight().
2551
2552 2018-04-20  Dean Jackson  <dino@apple.com>
2553
2554         Render a badge on system preview images
2555         https://bugs.webkit.org/show_bug.cgi?id=184854
2556         <rdar://problem/39615154>
2557
2558         Reviewed by Tim Horton.
2559
2560         At paint time, if a RenderImage is an image element
2561         which is identified as a system preview, then draw
2562         a little badge in the top right corner.
2563
2564         It is expected that platforms will override the
2565         default rendering with something that identifies
2566         how a system preview will operate. e.g. QuickLook
2567         on Apple systems.
2568
2569         Test: system-preview/badge.html
2570
2571         * rendering/RenderImage.cpp:
2572         (WebCore::RenderImage::paintIntoRect): If we are
2573         a system preview, call RenderTheme to draw a badge.
2574         * rendering/RenderTheme.cpp:
2575         (WebCore::RenderTheme::paintSystemPreviewBadge): A default
2576         implementation that draws a red circle.
2577         * rendering/RenderTheme.h:
2578
2579 2018-04-20  Brian Burg  <bburg@apple.com>
2580
2581         Web Inspector: remove some dead code in IdentifiersFactory
2582         https://bugs.webkit.org/show_bug.cgi?id=184839
2583
2584         Reviewed by Timothy Hatcher.
2585
2586         * inspector/InspectorController.cpp:
2587         (WebCore::InspectorController::setProcessId): Deleted.
2588         * inspector/InspectorController.h:
2589
2590 2018-04-20  Chris Dumez  <cdumez@apple.com>
2591
2592         Use WindowProxy in DOMWindow.idl
2593         https://bugs.webkit.org/show_bug.cgi?id=184820
2594
2595         Reviewed by Sam Weinig.
2596
2597         Use WindowProxy in DOMWindow.idl to match the specification more closely.
2598
2599         * bindings/js/JSWindowProxy.h:
2600         * bindings/js/WindowProxy.cpp:
2601         (WebCore::WindowProxy::window const):
2602         * bindings/js/WindowProxy.h:
2603         * bindings/scripts/CodeGeneratorJS.pm:
2604         (NativeToJSValueDOMConvertNeedsState):
2605         * dom/Document.cpp:
2606         * dom/Document.h:
2607         * dom/Document.idl:
2608         * page/DOMWindow.cpp:
2609         (WebCore::DOMWindow::focus):
2610         (WebCore::DOMWindow::self const):
2611         (WebCore::DOMWindow::opener const):
2612         (WebCore::DOMWindow::parent const):
2613         (WebCore::DOMWindow::top const):
2614         (WebCore::DOMWindow::open):
2615         * page/DOMWindow.h:
2616         * page/DOMWindow.idl:
2617         * testing/Internals.cpp:
2618         (WebCore::Internals::openDummyInspectorFrontend):
2619         * testing/Internals.h:
2620         * testing/Internals.idl:
2621
2622 2018-04-20  Chris Dumez  <cdumez@apple.com>
2623
2624         Update cross-origin SecurityError messages to not include the target origin
2625         https://bugs.webkit.org/show_bug.cgi?id=184803
2626         <rdar://problem/39547724>
2627
2628         Reviewed by Sam Weinig.
2629
2630         No new tests, rebaselined existing tests.
2631
2632         * bindings/js/JSDOMBindingSecurity.cpp:
2633         (WebCore::canAccessDocument):
2634         (WebCore::BindingSecurity::shouldAllowAccessToFrame):
2635         (WebCore::BindingSecurity::shouldAllowAccessToDOMWindow):
2636         * page/DOMWindow.cpp:
2637         (WebCore::DOMWindow::crossDomainAccessErrorMessage):
2638         (WebCore::DOMWindow::isInsecureScriptAccess):
2639         * page/DOMWindow.h:
2640         * page/Location.cpp:
2641         (WebCore::Location::reload):
2642
2643 2018-04-20  Chris Nardi  <cnardi@chromium.org>
2644
2645         Update HSL/HSLA parsing to match CSS Color 4
2646         https://bugs.webkit.org/show_bug.cgi?id=180528
2647         <rdar://problem/35926675>
2648
2649         CSS Color 4 specifies a comma optional syntax for HSL/HSLA, as well as allowing angle values for the
2650         hue and percent alpha values. Update our parsing to match this.
2651
2652         Reviewed by Simon Fraser.
2653
2654         This change also updates the import of WPT css-color to test the changes.
2655
2656         Tests: LayoutTests/imported/w3c/web-platform-tests/css/css-color/hsl{a}-{001-008}.html
2657
2658         * css/parser/CSSPropertyParserHelpers.cpp:
2659         (WebCore::CSSPropertyParserHelpers::parseHSLParameters):
2660         (WebCore::CSSPropertyParserHelpers::parseColorFunction):
2661         (WebCore::CSSPropertyParserHelpers::consumeColor):
2662         * platform/graphics/Color.cpp:
2663         (WebCore::calcHue):
2664         (WebCore::makeRGBAFromHSLA):
2665
2666 2018-04-20  Wenson Hsieh  <wenson_hsieh@apple.com>
2667
2668         [Extra zoom mode] Injected bundle form client should be notified when editing text fields
2669         https://bugs.webkit.org/show_bug.cgi?id=184822
2670         <rdar://problem/38807319>
2671
2672         Reviewed by Tim Horton.
2673
2674         Export the constructor and destructor of UserTypingGestureIndicator for use in WebKit (see WebPage.cpp).
2675
2676         Test: fast/forms/extrazoom/edit-text-field-calls-injected-bundle.html
2677
2678         * dom/UserTypingGestureIndicator.h:
2679
2680 2018-04-18  Jer Noble  <jer.noble@apple.com>
2681
2682         Don't put build products into WK_ALTERNATE_WEBKIT_SDK_PATH for engineering builds
2683         https://bugs.webkit.org/show_bug.cgi?id=184762
2684
2685         Reviewed by Dan Bernstein.
2686
2687         * Configurations/WebCore.xcconfig:
2688         * WebCore.xcodeproj/project.pbxproj:
2689
2690 2018-04-20  Daniel Bates  <dabates@apple.com>
2691
2692         Remove code for compilers that did not support NSDMI for aggregates
2693         https://bugs.webkit.org/show_bug.cgi?id=184599
2694
2695         Reviewed by Per Arne Vollan.
2696
2697         Remove workaround for earlier Visual Studio versions that did not support non-static data
2698         member initializers (NSDMI) for aggregates. We have since updated all the build.webkit.org
2699         and EWS bots to a newer version that supports this feature.
2700
2701         * Modules/cache/CacheQueryOptions.h:
2702         (WebCore::CacheQueryOptions::CacheQueryOptions): Deleted.
2703         * dom/Node.h:
2704         (WebCore::Node::InsertionType::InsertionType): Deleted.
2705         (WebCore::Node::RemovalType::RemovalType): Deleted.
2706         * html/canvas/CanvasStyle.h:
2707         (WebCore::CanvasStyle::CMYKAColor::CMYKAColor): Deleted.
2708         * page/EventHandler.h:
2709         (WebCore::EventHandler::DragTargetResponse::DragTargetResponse): Deleted.
2710         * page/animation/CSSAnimationController.h:
2711         (WebCore::AnimationUpdate::AnimationUpdate): Deleted.
2712         * platform/graphics/FontSelectionAlgorithm.h:
2713         (WebCore::FontSelectionRequest::tied const):
2714         (WebCore::FontSelectionRequest::FontSelectionRequest): Deleted.
2715         (WebCore::FontSelectionCapabilities::FontSelectionCapabilities): Deleted.
2716         * platform/mediastream/IceCandidate.h:
2717         (WebCore::IceCandidate::IceCandidate): Deleted.
2718         * platform/text/StringWithDirection.h:
2719         (WebCore::StringWithDirection::StringWithDirection): Deleted.
2720         * rendering/MarkedText.h:
2721         (WebCore::MarkedText::MarkedText): Deleted.
2722         * style/StyleUpdate.h:
2723         (WebCore::Style::ElementUpdate::ElementUpdate): Deleted.
2724         (WebCore::Style::ElementUpdates::ElementUpdates): Deleted.
2725         (WebCore::Style::TextUpdate::TextUpdate): Deleted.
2726
2727 2018-04-20  Youenn Fablet  <youenn@apple.com>
2728
2729         WebPage sometimes incorrectly rules out PDF as a mime type that can be showed
2730         https://bugs.webkit.org/show_bug.cgi?id=184369
2731
2732         Reviewed by Chris Dumez.
2733
2734         WebPage does need to check for plugins at reception of the response.
2735         In that case, the page URL is the URL from which we are navigating out.
2736         Add plugin API to check for plugin availability with an extra URL parameter to cover that case.
2737
2738         Covered by API test.
2739
2740         * plugins/PluginData.cpp:
2741         (WebCore::PluginData::supportsWebVisibleMimeTypeForURL const):
2742         (WebCore::PluginData::supportsWebVisibleMimeType const):
2743         * plugins/PluginData.h:
2744
2745 2018-04-20  Daniel Bates  <dabates@apple.com>
2746
2747         Remove Strong Password decoration when text field type changes
2748         https://bugs.webkit.org/show_bug.cgi?id=184795
2749         <rdar://problem/38325108>
2750
2751         Reviewed by Antti Koivisto.
2752
2753         Remove the Strong Password decoration when the text field's type changes to avoid interfering
2754         with web sites that allow a person to show/hide their password.
2755
2756         Test: fast/forms/auto-fill-button/hide-strong-password-when-field-type-changes.html
2757
2758         * html/HTMLInputElement.cpp:
2759         (WebCore::HTMLInputElement::updateType):
2760
2761 2018-04-20  Javier Fernandez  <jfernandez@igalia.com>
2762
2763         Update Alignment shorthands to the spec now that they are not ambiguous
2764         https://bugs.webkit.org/show_bug.cgi?id=184812
2765
2766         Reviewed by Antti Koivisto.
2767
2768         Now that the issue [1] about the syntax ambiguity has been resolved we
2769         don't need to use the custom syntax anymore. The Alignment shorthands
2770         use now the simple syntax, defined based on the longhands' syntax.
2771
2772         Since we allow all the values valid for each longhand, we'll update
2773         in this CL the corresponding web platform tests. Additionally, this CL
2774         updates also the shorthand serialization tests [2], which didn't
2775         consider the new value 'legacy' for justify-items (and place-items) due
2776         to the bug [3] Firefox still has pending to be fixed.
2777
2778         [1] https://github.com/w3c/csswg-drafts/issues/1001
2779         [2] css/css-align/default-alignment/shorthand-serialization-001.html
2780         [3] https://bugzilla.mozilla.org/show_bug.cgi?id=1363875
2781
2782         Tests: imported/w3c/web-platform-tests/css/css-align/default-alignment/shorthand-serialization-001.html
2783                imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-computed-001.html
2784                imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-used-001.html
2785                imported/w3c/web-platform-tests/css/css-align/gaps/gap-normal-used-002.html
2786
2787         * css/parser/CSSPropertyParser.cpp:
2788         (WebCore::CSSPropertyParser::consumePlaceContentShorthand): Using the justify-content and align-content parsing logic to parse the shorthand.
2789         (WebCore::CSSPropertyParser::consumePlaceItemsShorthand): Using the justify-items and align-items parsing logic to parse the shorthand.
2790         (WebCore::CSSPropertyParser::consumePlaceSelfShorthand): Using the justify-self and align-self parsing logic to parse the shorthand.
2791
2792 2018-04-20  Daniel Bates  <dabates@apple.com>
2793
2794         Unreviewed, rolling out r230117.
2795
2796         Broke find-in-page for PDFs
2797
2798         Reverted changeset:
2799
2800         "ASSERTION FAILED: ASSERT(!containsImage ||
2801         MIMETypeRegistry::isSupportedImageResourceMIMEType([resource
2802         MIMEType])) in -[NSPasteboard(WebExtras)
2803         _web_writePromisedRTFDFromArchive:containsImage:]"
2804         https://bugs.webkit.org/show_bug.cgi?id=184161
2805         https://trac.webkit.org/changeset/230117
2806
2807 2018-04-20  Eric Carlson  <eric.carlson@apple.com>
2808
2809         Pausing should clear m_waitingToEnterFullscreen
2810         https://bugs.webkit.org/show_bug.cgi?id=184831
2811         <rdar://problem/39602852>
2812
2813         Reviewed by Jer Noble.
2814
2815         * html/HTMLMediaElement.cpp:
2816         (WebCore::HTMLMediaElement::pause): Clear m_waitingToEnterFullscreen
2817
2818 2018-04-20  Eric Carlson  <eric.carlson@apple.com>
2819
2820         [Extra zoom mode] Disable CA transactions while setting up for fullscreen
2821         https://bugs.webkit.org/show_bug.cgi?id=184817
2822         <rdar://problem/39596075>
2823
2824         Reviewed by Jer Noble.
2825
2826         This was tested manually as it is not possible to write an automated test for this.
2827
2828         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
2829         (VideoFullscreenInterfaceAVKit::doSetup): Move the call to disable CA transactions outside
2830         of the EXTRA_ZOOM_MODE check, the [CATransaction commit] was already unguarded.
2831
2832 2018-04-20  Youenn Fablet  <youenn@apple.com>
2833
2834         Make PluginData cache its web visible plugins
2835         https://bugs.webkit.org/show_bug.cgi?id=184421
2836
2837         Reviewed by Chris Dumez.
2838
2839         Buffer visible plugins until the page URL changes.
2840         For that purpose, we now cache the visible plugins and the URL it was computed from in PluginData.
2841
2842         Update plugin info provider API to pass the URL used to check for plugin visibility.
2843
2844         No observable change of behavior.
2845
2846         * loader/EmptyClients.cpp:
2847         * plugins/PluginData.cpp:
2848         (WebCore::PluginData::webVisiblePlugins const):
2849         (WebCore::PluginData::publiclyVisiblePlugins const):
2850         (WebCore::PluginData::supportsMimeType const):
2851         * plugins/PluginData.h:
2852         * plugins/PluginInfoProvider.h:
2853
2854 2018-04-20  Chris Dumez  <cdumez@apple.com>
2855
2856         Unreviewed build fix after r230840.
2857
2858         * bindings/js/JSWindowProxy.cpp:
2859         (WebCore::JSWindowProxy::attachDebugger):
2860
2861 2018-04-20  Chris Dumez  <cdumez@apple.com>
2862
2863         Unreviewed attempt to fix the Windows build after r230831.
2864
2865         * bindings/js/JSWindowProxy.cpp:
2866         (WebCore::JSWindowProxy::create):
2867         (WebCore::JSWindowProxy::attachDebugger):
2868
2869 2018-04-20  Chris Nardi  <cnardi@chromium.org>
2870
2871         Omit default value when serializing font-feature-settings
2872         https://bugs.webkit.org/show_bug.cgi?id=182382
2873
2874         Reviewed by Myles C. Maxfield.
2875
2876         According to the shortest-serialization principle [1], values should be omitted if their omission
2877         wouldn't change the value of reparsing. As "1"/"on" is the default value for font-feature-settings,
2878         omit this when serializing, matching the behavior of Firefox and Chrome.
2879
2880         [1]: https://github.com/w3c/csswg-drafts/issues/1564
2881
2882         Updated css3/font-feature-settings-parsing.html, fast/css/inherited-properties-rare-text.html,
2883         and fast/text/font-face-javascript.html.
2884
2885         * css/CSSFontFeatureValue.cpp:
2886         (WebCore::CSSFontFeatureValue::customCSSText const):
2887
2888 2018-04-19  Alexey Proskuryakov  <ap@apple.com>
2889
2890         More WK_ALTERNATE_FRAMEWORKS_DIR adoption in WebCore
2891         https://bugs.webkit.org/show_bug.cgi?id=184805
2892
2893         Reviewed by Dan Bernstein.
2894
2895         * Configurations/WebCoreTestShim.xcconfig:
2896         * Configurations/WebCoreTestSupport.xcconfig:
2897
2898 2018-04-19  Brady Eidson  <beidson@apple.com>
2899
2900         Make back forward cache work with process swapping.
2901         <rdar://problem/38676604> and https://bugs.webkit.org/show_bug.cgi?id=184793
2902
2903         Reviewed by Chris Dumez.
2904
2905         Covered by API tests.
2906
2907         * loader/FrameLoader.cpp:
2908         (WebCore::FrameLoader::loadWithNavigationAction):
2909         (WebCore::FrameLoader::load):
2910         (WebCore::FrameLoader::loadWithDocumentLoader):
2911         (WebCore::FrameLoader::reloadWithOverrideEncoding):
2912         (WebCore::FrameLoader::reload):
2913         (WebCore::FrameLoader::commitProvisionalLoad):
2914         (WebCore::FrameLoader::loadDifferentDocumentItem):
2915         * loader/FrameLoader.h:
2916
2917 2018-04-19  Chris Dumez  <cdumez@apple.com>
2918
2919         Rename JSDOMWindowProxy to JSWindowProxy
2920         https://bugs.webkit.org/show_bug.cgi?id=184797
2921
2922         Reviewed by Sam Weinig.
2923
2924         Rename JSDOMWindowProxy to JSWindowProxy for consistency with WindowProxy.
2925
2926         * Sources.txt:
2927         * WebCore.xcodeproj/project.pbxproj:
2928         * bindings/IDLTypes.h:
2929         * bindings/js/JSBindingsAllInOne.cpp:
2930         * bindings/js/JSDOMConvertWindowProxy.h:
2931         * bindings/js/JSDOMWindowBase.cpp:
2932         (WebCore::JSDOMWindowBase::JSDOMWindowBase):
2933         (WebCore::JSDOMWindowBase::finishCreation):
2934         (WebCore::JSDOMWindowBase::proxy const):
2935         (WebCore::toJSDOMWindow):
2936         * bindings/js/JSDOMWindowBase.h:
2937         * bindings/js/JSDOMWindowCustom.cpp:
2938         (WebCore::JSDOMWindow::toWrapped):
2939         * bindings/js/JSEventTargetCustom.cpp:
2940         (WebCore::JSEventTarget::toWrapped):
2941         * bindings/js/JSRemoteDOMWindowBase.cpp:
2942         (WebCore::JSRemoteDOMWindowBase::JSRemoteDOMWindowBase):
2943         (WebCore::toJSRemoteDOMWindow):
2944         * bindings/js/JSRemoteDOMWindowBase.h:
2945         * bindings/js/JSWindowProxy.cpp: Renamed from Source/WebCore/bindings/js/JSDOMWindowProxy.cpp.
2946         (WebCore::JSWindowProxy::JSWindowProxy):
2947         (WebCore::JSWindowProxy::finishCreation):
2948         (WebCore::JSWindowProxy::create):
2949         (WebCore::JSWindowProxy::destroy):
2950         (WebCore::JSWindowProxy::setWindow):
2951         (WebCore::JSWindowProxy::attachDebugger):
2952         (WebCore::JSWindowProxy::wrapped const):
2953         (WebCore::JSWindowProxy::toWrapped):
2954         (WebCore::toJS):
2955         (WebCore::toJSWindowProxy):
2956         * bindings/js/JSWindowProxy.h: Renamed from Source/WebCore/bindings/js/JSDOMWindowProxy.h.
2957         (WebCore::toJS):
2958         (WebCore::toJSWindowProxy):
2959         * bindings/js/ScriptController.cpp:
2960         (WebCore::ScriptController::initScriptForWindowProxy):
2961         * bindings/js/ScriptController.h:
2962         * bindings/js/WindowProxy.cpp:
2963         (WebCore::WindowProxy::createJSWindowProxy):
2964         (WebCore::WindowProxy::jsWindowProxiesAsVector const):
2965         (WebCore::WindowProxy::createJSWindowProxyWithInitializedScript):
2966         * bindings/js/WindowProxy.h:
2967         (WebCore::WindowProxy::jsWindowProxy):
2968         (WebCore::WindowProxy::existingJSWindowProxy const):
2969         * bindings/scripts/CodeGeneratorJS.pm:
2970         (AddToIncludesForIDLType):
2971         (GenerateHeader):
2972         (GenerateOverloadDispatcher):
2973         (GenerateImplementation):
2974         * bindings/scripts/test/JS/JSTestObj.cpp:
2975         (WebCore::jsTestObjPrototypeFunctionOverloadedMethodOverloadDispatcher):
2976         * page/Frame.cpp:
2977         * page/csp/ContentSecurityPolicy.cpp:
2978         (WebCore::ContentSecurityPolicy::didCreateWindowProxy const):
2979         * page/csp/ContentSecurityPolicy.h:
2980
2981 2018-04-19  Dirk Schulze  <krit@webbkit.org>
2982
2983         Introduce SVGGeometryElement interface
2984         https://bugs.webkit.org/show_bug.cgi?id=184768
2985
2986         Reviewed by Antti Koivisto.
2987
2988         Start implementing SVGGeometryElement interface from SVG2.
2989         https://svgwg.org/svg2-draft/types.html#InterfaceSVGGeometryElement
2990
2991         Start with SVGPathElement only for now. Also, just inferface gets implemented
2992         by this patch. No new functionality like isPointInFill yet.
2993         Fix getPointAtLength and make it more restrictive. This follows the spec and
2994         all other implementations.
2995
2996         Added additional test scenarios to existing tests.
2997
2998         * CMakeLists.txt:
2999         * DerivedSources.make:
3000         * Sources.txt:
3001         * WebCore.xcodeproj/project.pbxproj:
3002         * bindings/scripts/CodeGeneratorJS.pm:
3003         (GetGnuVTableOffsetForType):
3004         * svg/SVGAllInOne.cpp:
3005         * svg/SVGGeometryElement.cpp: Added.
3006         (WebCore::SVGGeometryElement::SVGGeometryElement):
3007         (WebCore::SVGGeometryElement::isSupportedAttribute):
3008         (WebCore::SVGGeometryElement::parseAttribute):
3009         (WebCore::SVGGeometryElement::svgAttributeChanged):
3010         (WebCore::SVGGeometryElement::createElementRenderer):
3011         * svg/SVGGeometryElement.h: Added.
3012         * svg/SVGGeometryElement.idl: Added.
3013         * svg/SVGGradientElement.cpp:
3014         * svg/SVGPathElement.cpp:
3015         (WebCore::SVGPathElement::SVGPathElement):
3016         (WebCore::SVGPathElement::parseAttribute):
3017         (WebCore::SVGPathElement::svgAttributeChanged):
3018         (WebCore::SVGPathElement::insertedIntoAncestor):
3019         (WebCore::SVGPathElement::removedFromAncestor):
3020         * svg/SVGPathElement.h:
3021         * svg/SVGPathElement.idl:
3022
3023 2018-04-19  Tadeu Zagallo  <tzagallo@apple.com>
3024
3025         REGRESSION(r227340): ArrayBuffers were not being serialized when sent via MessagePorts
3026         https://bugs.webkit.org/show_bug.cgi?id=184254
3027         <rdar://problem/39140200>
3028
3029         Reviewed by Daniel Bates.
3030
3031         Add a new encoding method to SerializedScriptValue that includes ArrayBuffers.
3032
3033         Test: workers/message-port.html
3034
3035         * bindings/js/SerializedScriptValue.h:
3036         (WebCore::SerializedScriptValue::encode const):
3037         (WebCore::SerializedScriptValue::decode):
3038         * dom/messageports/MessageWithMessagePorts.h:
3039         (WebCore::MessageWithMessagePorts::encode const):
3040         (WebCore::MessageWithMessagePorts::decode):
3041
3042 2018-04-19  David Kilzer  <ddkilzer@apple.com>
3043
3044         Enable Objective-C weak references
3045         <https://webkit.org/b/184789>
3046         <rdar://problem/39571716>
3047
3048         Reviewed by Dan Bernstein.
3049
3050         * Configurations/Base.xcconfig:
3051         (CLANG_ENABLE_OBJC_WEAK): Enable.
3052
3053 2018-04-19  Antti Koivisto  <antti@apple.com>
3054
3055         Don't use RenderTreeBuilder::current() in RenderTreeUpdater
3056         https://bugs.webkit.org/show_bug.cgi?id=184794
3057
3058         Reviewed by Zalan Bujtas.
3059
3060         Pass the builder as a parameter where needed.
3061
3062         * rendering/updating/RenderTreeUpdater.cpp:
3063         (WebCore::RenderTreeUpdater::updateElementRenderer):
3064         (WebCore::RenderTreeUpdater::updateTextRenderer):
3065         (WebCore::RenderTreeUpdater::tearDownRenderers):
3066         (WebCore::RenderTreeUpdater::tearDownRenderer):
3067         (WebCore::RenderTreeUpdater::tearDownTextRenderer):
3068         (WebCore::RenderTreeUpdater::tearDownLeftoverPaginationRenderersIfNeeded):
3069         (WebCore::RenderTreeUpdater::tearDownLeftoverShadowHostChildren):
3070         * rendering/updating/RenderTreeUpdater.h:
3071         * rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
3072         (WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
3073         (WebCore::RenderTreeUpdater::GeneratedContent::removeBeforePseudoElement):
3074         (WebCore::RenderTreeUpdater::GeneratedContent::removeAfterPseudoElement):
3075         * rendering/updating/RenderTreeUpdaterGeneratedContent.h:
3076
3077 2018-04-19  Eric Carlson  <eric.carlson@apple.com>
3078
3079         Runtime logging during GC can cause crash
3080         https://bugs.webkit.org/show_bug.cgi?id=184792
3081         <rdar://problem/39567927>
3082
3083         Reviewed by Jer Noble.
3084
3085         Test: media/destructor-logging-crash.html
3086
3087         * dom/Document.cpp:
3088         (WebCore::Document::~Document): Clear the logger observer immediately so anything logged
3089         as a side effect of the destructor won't cause a problem.
3090         (WebCore::Document::didLogMessage): Create the ConsoleMessage in a task.
3091         * dom/Document.h:
3092
3093 2018-04-19  Youenn Fablet  <youenn@apple.com>
3094
3095         Web Inspector backend should get headers & cookies from network process separately from resource requests
3096         https://bugs.webkit.org/show_bug.cgi?id=184396
3097         <rdar://problem/38877384>
3098
3099         Reviewed by Brian Burg.
3100
3101         Add two new loader strategies to get response and network metrics directly from
3102         NetworkProcess based on resource loader identifier.
3103         Use these methods in InspectorNetworkAgent when response/metrics might be filtered.
3104
3105         Covered by existing tests, in particular http/tests/inspector/network/fetch-network-data.html which would fail
3106         without this since we are now setting the sourceOrigin for NetworkResourceLoader, which is used to sanitize response headers.
3107
3108         * inspector/agents/InspectorNetworkAgent.cpp:
3109         (WebCore::InspectorNetworkAgent::didReceiveResponse):
3110         (WebCore::InspectorNetworkAgent::didFinishLoading):
3111         * loader/LoaderStrategy.cpp:
3112         (WebCore::LoaderStrategy::responseFromResourceLoaIdentifier):
3113         (WebCore::LoaderStrategy::networkMetricsFromResourceLoaIdentifier):
3114         * loader/LoaderStrategy.h:
3115
3116 2018-04-19  Wenson Hsieh  <wenson_hsieh@apple.com>
3117
3118         [Extra zoom mode] Add a mechanism to extend the height of the layout viewport in extra zoom mode
3119         https://bugs.webkit.org/show_bug.cgi?id=184782
3120         <rdar://problem/38346712>
3121
3122         Reviewed by Tim Horton.
3123
3124         Add a new helper on FrameView to compute an expanded layout viewport size, as well as a new setting for the
3125         height expansion factor when computing visual viewport dimensions. See WebKit/ChangeLog for more detail.
3126
3127         Test: fast/visual-viewport/extrazoom/layout-viewport-after-scrolling-and-resizing.html
3128
3129         * page/FrameView.cpp:
3130         (WebCore::FrameView::expandedLayoutViewportSize):
3131         * page/FrameView.h:
3132         * page/Settings.yaml:
3133
3134 2018-04-19  Chris Dumez  <cdumez@apple.com>
3135
3136         REGRESSION (r229133): decidePolicyForNavigationAction not called for loading an HTML string
3137         https://bugs.webkit.org/show_bug.cgi?id=184209
3138         <rdar://problem/39145306>
3139
3140         Reviewed by Ryosuke Niwa.
3141
3142         In r229133, we stopped doing navigation policy checks for about:blank because about:blank
3143         loads need to happen synchronously for Web-compatibility. However, this regressed loading
3144         an HTML string in a WebView because in such cases, the URL is also about:blank with
3145         substitute data.
3146
3147         In this patch, we take a more conservative approach and restore policy checking for
3148         'about:blank' but using synchronous IPC.
3149
3150         * loader/PolicyChecker.cpp:
3151         (WebCore::PolicyChecker::checkNavigationPolicy):
3152
3153 2018-04-19  Chris Nardi  <cnardi@chromium.org>
3154
3155         Support calc() in webkit-gradient and cross-fade
3156         https://bugs.webkit.org/show_bug.cgi?id=182225
3157
3158         Reviewed by Simon Fraser.
3159
3160         calc() was previously unsupported in webkit-gradient and webkit-cross-fade, but both should take calc() values.
3161         Update the code to support calc() values.
3162
3163         Tests: LayoutTests/css3/calc/cross-fade-calc.html
3164                LayoutTests/css3/calc/webkit-gradient-calc.html
3165
3166         * css/parser/CSSPropertyParserHelpers.cpp:
3167         (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
3168         (WebCore::CSSPropertyParserHelpers::consumeCrossFade):
3169
3170 2018-04-17  Filip Pizlo  <fpizlo@apple.com>
3171
3172         The InternalFunction hierarchy should be in IsoSubspaces
3173         https://bugs.webkit.org/show_bug.cgi?id=184721
3174
3175         Reviewed by Saam Barati.
3176
3177         No new tests because no new behavior.
3178
3179         * bindings/js/WebCoreJSClientData.cpp:
3180         (WebCore::JSVMClientData::JSVMClientData):
3181         * bindings/js/WebCoreJSClientData.h:
3182         (WebCore::JSVMClientData::runtimeMethodSpace):
3183         * bridge/runtime_method.cpp:
3184         (JSC::RuntimeMethod::subspaceForImpl):
3185         * bridge/runtime_method.h:
3186
3187 2018-04-19  Brady Eidson  <beidson@apple.com>
3188
3189         Add globally-unique HistoryItem identifiers (and have WebKit2 adopt them).
3190         <rdar://problem/39533949> and https://bugs.webkit.org/show_bug.cgi?id=184750
3191
3192         Reviewed by Ryosuke Niwa.
3193
3194         No new tests (Refactor, no behavior change).
3195
3196         In WebCore, we:
3197         - Add a process-unique "BackForwardItemIdentifier"
3198         - Make all HistoryItems have such an identifier as a member
3199
3200         * WebCore.xcodeproj/project.pbxproj:
3201
3202         * history/BackForwardItemIdentifier.h: Added.
3203         (WebCore::BackForwardItemIdentifier::logString const):
3204         (WebCore::operator==):
3205         (WebCore::BackForwardItemIdentifier::encode const):
3206         (WebCore::BackForwardItemIdentifier::decode):
3207         (WebCore::BackForwardItemIdentifier::hash const):
3208         (WTF::BackForwardItemIdentifierHash::hash):
3209         (WTF::BackForwardItemIdentifierHash::equal):
3210         (WTF::HashTraits<WebCore::BackForwardItemIdentifier>::emptyValue):
3211         (WTF::HashTraits<WebCore::BackForwardItemIdentifier>::constructDeletedValue):
3212         (WTF::HashTraits<WebCore::BackForwardItemIdentifier>::isDeletedValue):
3213
3214         * history/HistoryItem.cpp:
3215         (WebCore::HistoryItem::generateSequenceNumber):
3216         (WebCore::HistoryItem::HistoryItem):
3217         (WebCore::generateSequenceNumber): Deleted.
3218
3219         * history/HistoryItem.h:
3220         (WebCore::HistoryItem::create):
3221         (WebCore::HistoryItem::identifier const):
3222
3223 2018-04-19  Nan Wang  <n_wang@apple.com>
3224
3225         AX: AOM: respect the accessibility setting for dispatching the accessible events
3226         https://bugs.webkit.org/show_bug.cgi?id=184619
3227
3228         Reviewed by Ryosuke Niwa.
3229
3230         Added accessibilityEventsEnabled as a setting on the page.
3231
3232         Test: accessibility/ios-simulator/accessibility-events-setting.html
3233
3234         * accessibility/AccessibilityObject.cpp:
3235         (WebCore::AccessibilityObject::shouldDispatchAccessibilityEvent const):
3236         * page/Settings.yaml:
3237         * testing/InternalSettings.cpp:
3238         (WebCore::InternalSettings::Backup::Backup):
3239         (WebCore::InternalSettings::Backup::restoreTo):
3240         (WebCore::InternalSettings::setAccessibilityEventsEnabled):
3241         * testing/InternalSettings.h:
3242         * testing/InternalSettings.idl:
3243
3244 2018-04-18  Jer Noble  <jer.noble@apple.com>
3245
3246         Fix build when WK_ALTERNATE_FRAMEWORKS_DIR is set to non-empty value
3247         https://bugs.webkit.org/show_bug.cgi?id=184693
3248         <rdar://problem/39491884>
3249
3250         Reviewed by Tim Horton.
3251
3252         * Configurations/WebCore.xcconfig:
3253
3254 2018-04-19  Eric Stobbart  <ericstobbart@gmail.com>
3255
3256         Change MediaSource WebCore to return NewObject for SourceBuffers
3257         https://bugs.webkit.org/show_bug.cgi?id=184642
3258
3259         Reviewed by Chris Dumez.
3260
3261         Minor change inline with IDL documentation
3262
3263         * Modules/mediasource/MediaSource.cpp:
3264         (WebCore::MediaSource::addSourceBuffer):
3265         (): Deleted.
3266         * Modules/mediasource/MediaSource.h:
3267         * Modules/mediasource/MediaSource.idl:
3268
3269 2018-04-19  Yusuke Suzuki  <utatane.tea@gmail.com>
3270
3271         Unreviewed, build fix for Ubuntu LTS GCC
3272         https://bugs.webkit.org/show_bug.cgi?id=184756
3273
3274         The variable name "windowProxy" (with auto&) conflicts with the function name "windowProxy".
3275
3276         * bindings/js/ScriptController.cpp:
3277         (WebCore::ScriptController::updateDocument):
3278         (WebCore::ScriptController::collectIsolatedContexts):
3279
3280 2018-04-19  Manuel Rego Casasnovas  <rego@igalia.com>
3281
3282         Caret rendered at incorrect location inside empty table cell
3283         https://bugs.webkit.org/show_bug.cgi?id=85385
3284
3285         Reviewed by Zalan Bujtas.
3286
3287         This is based on a previous patch by Shezan Baig <shezbaig.wk@gmail.com>.
3288
3289         This fixes the position of the caret in empty cells,
3290         that was painted lower than expected
3291         (and then modified when you start to edit the cell).
3292
3293         Ensures that editable table cells have at least one line when
3294         they are laid out. This ensures that the cell's intrinsic before/after
3295         padding is calculated correctly, which results in the caret location
3296         being calculated correctly.
3297
3298         Test: editing/caret/caret-in-empty-cell.html
3299
3300         * rendering/RenderTableCell.cpp:
3301         (WebCore::RenderTableCell::hasLineIfEmpty): Override method to consider
3302         that it has an an empty line if the table cell is editable.
3303         * rendering/RenderTableCell.h:
3304
3305 2018-04-18  Daniel Bates  <dabates@apple.com>
3306
3307         Cleanup TextControlInnerElements
3308         https://bugs.webkit.org/show_bug.cgi?id=184475
3309
3310         Reviewed by Antti Koivisto.
3311
3312         Clean up TextControlInnerElement::resolveCustomStyle(), move the implementation of
3313         TextControlPlaceholderElement::create() from the header to the cpp file, replace
3314         fancy comments to demarcate classes with MARK: so that they show up in Xcode's
3315         function menu.
3316
3317         * html/shadow/TextControlInnerElements.cpp:
3318         (WebCore::TextControlInnerElement::resolveCustomStyle):
3319         (WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement):
3320         (WebCore::TextControlPlaceholderElement::create):
3321         * html/shadow/TextControlInnerElements.h:
3322
3323 2018-04-18  Chris Dumez  <cdumez@apple.com>
3324
3325         Rename WindowProxyController to WindowProxy
3326         https://bugs.webkit.org/show_bug.cgi?id=184756
3327
3328         Reviewed by Sam Weinig.
3329
3330         Rename WindowProxyController to WindowProxy for clarity. When the IDL uses WindowProxy, the implementation
3331         needed use WindowProxyController type, which was a bit confusing.
3332
3333         * Sources.txt:
3334         * WebCore.xcodeproj/project.pbxproj:
3335         * bindings/js/DOMWrapperWorld.cpp:
3336         (WebCore::DOMWrapperWorld::~DOMWrapperWorld):
3337         (WebCore::DOMWrapperWorld::clearWrappers):
3338         * bindings/js/DOMWrapperWorld.h:
3339         (WebCore::DOMWrapperWorld::didCreateWindowProxy):
3340         (WebCore::DOMWrapperWorld::didDestroyWindowProxy):
3341         * bindings/js/JSBindingsAllInOne.cpp:
3342         * bindings/js/JSDOMWindowBase.cpp:
3343         (WebCore::toJS):
3344         * bindings/js/JSDOMWindowProxy.cpp:
3345         (WebCore::toJS):
3346         (WebCore::toJSDOMWindowProxy):
3347         * bindings/js/JSDOMWindowProxy.h:
3348         (WebCore::toJS):
3349         (WebCore::toJSDOMWindowProxy):
3350         * bindings/js/ScriptCachedFrameData.cpp:
3351         (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
3352         (WebCore::ScriptCachedFrameData::restore):
3353         * bindings/js/ScriptController.cpp:
3354         (WebCore::ScriptController::evaluateInWorld):
3355         (WebCore::ScriptController::loadModuleScriptInWorld):
3356         (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
3357         (WebCore::ScriptController::evaluateModule):
3358         (WebCore::ScriptController::setupModuleScriptHandlers):
3359         (WebCore::ScriptController::windowProxy):
3360         (WebCore::ScriptController::enableEval):
3361         (WebCore::ScriptController::enableWebAssembly):
3362         (WebCore::ScriptController::disableEval):
3363         (WebCore::ScriptController::disableWebAssembly):
3364         (WebCore::ScriptController::updateDocument):
3365         (WebCore::ScriptController::collectIsolatedContexts):
3366         (WebCore::ScriptController::windowScriptNPObject):
3367         (WebCore::ScriptController::executeIfJavaScriptURL):
3368         * bindings/js/ScriptController.h:
3369         (WebCore::ScriptController::globalObject):
3370         * bindings/js/ScriptControllerMac.mm:
3371         (WebCore::ScriptController::windowScriptObject):
3372         * bindings/js/ScriptState.cpp:
3373         (WebCore::mainWorldExecState):
3374         * bindings/js/WindowProxy.cpp: Renamed from Source/WebCore/bindings/js/WindowProxyController.cpp.
3375         (WebCore::WindowProxy::WindowProxy):
3376         (WebCore::WindowProxy::~WindowProxy):
3377         (WebCore::WindowProxy::destroyJSWindowProxy):
3378         (WebCore::WindowProxy::createJSWindowProxy):
3379         (WebCore::WindowProxy::jsWindowProxiesAsVector const):
3380         (WebCore::WindowProxy::createJSWindowProxyWithInitializedScript):
3381         (WebCore::WindowProxy::clearJSWindowProxiesNotMatchingDOMWindow):
3382         (WebCore::WindowProxy::setDOMWindow):
3383         (WebCore::WindowProxy::attachDebugger):
3384         * bindings/js/WindowProxy.h: Renamed from Source/WebCore/bindings/js/WindowProxyController.h.
3385         (WebCore::WindowProxy::jsWindowProxies const):
3386         (WebCore::WindowProxy::releaseJSWindowProxies):
3387         (WebCore::WindowProxy::setJSWindowProxies):
3388         (WebCore::WindowProxy::jsWindowProxy):
3389         (WebCore::WindowProxy::existingJSWindowProxy const):
3390         (WebCore::WindowProxy::globalObject):
3391         * loader/FrameLoader.cpp:
3392         (WebCore::FrameLoader::clear):
3393         (WebCore::FrameLoader::dispatchDidClearWindowObjectInWorld):
3394         * page/AbstractFrame.cpp:
3395         (WebCore::AbstractFrame::AbstractFrame):
3396         * page/AbstractFrame.h:
3397         (WebCore::AbstractFrame::windowProxy):
3398         (WebCore::AbstractFrame::windowProxy const):
3399         * page/Page.cpp:
3400         (WebCore::Page::setDebugger):
3401         * page/RemoteDOMWindow.cpp:
3402         (WebCore::RemoteDOMWindow::self const):
3403         (WebCore::RemoteDOMWindow::top const):
3404         (WebCore::RemoteDOMWindow::opener const):
3405         (WebCore::RemoteDOMWindow::parent const):
3406         * page/RemoteDOMWindow.h:
3407
3408 2018-04-18  Chris Dumez  <cdumez@apple.com>
3409
3410         Set RemoteDOMWindow's initial opener
3411         https://bugs.webkit.org/show_bug.cgi?id=184716
3412
3413         Reviewed by Sam Weinig.
3414
3415         Add support for WindowProxy type in the IDL. The implementation should
3416         return a WindowProxyController and toJS() will take care of converting
3417         this into a JSValue via JSDOMWindowProxy.
3418
3419         No new tests, rebaselined existing test.
3420
3421         * WebCore.xcodeproj/project.pbxproj:
3422         * bindings/IDLTypes.h:
3423         * bindings/js/JSDOMConvertWindowProxy.h: Added.
3424         (WebCore::JSConverter<IDLWindowProxy>::convert):
3425         * bindings/js/JSDOMWindowBase.cpp:
3426         (WebCore::toJS):
3427         * bindings/js/JSDOMWindowBase.h:
3428         (WebCore::toJS):
3429         * bindings/js/JSDOMWindowProxy.cpp:
3430         (WebCore::toJS):
3431         (WebCore::toJSDOMWindowProxy):
3432         * bindings/js/JSDOMWindowProxy.h:
3433         (WebCore::toJS):
3434         (WebCore::toJSDOMWindowProxy):
3435         * bindings/js/JSRemoteDOMWindowBase.cpp:
3436         * bindings/js/JSRemoteDOMWindowBase.h:
3437         * bindings/scripts/CodeGenerator.pm:
3438         (IsBuiltinType):
3439         * bindings/scripts/CodeGeneratorJS.pm:
3440         (AddToIncludesForIDLType):
3441         (GetBaseIDLType):
3442         * page/RemoteDOMWindow.cpp:
3443         (WebCore::RemoteDOMWindow::self const):
3444         (WebCore::RemoteDOMWindow::top const):
3445         (WebCore::RemoteDOMWindow::opener const):
3446         (WebCore::RemoteDOMWindow::parent const):
3447         * page/RemoteDOMWindow.h:
3448         * page/RemoteDOMWindow.idl:
3449         * page/RemoteFrame.h:
3450
3451 2018-04-18  Dean Jackson  <dino@apple.com>
3452
3453         Detect system preview links
3454         https://bugs.webkit.org/show_bug.cgi?id=184753
3455         <rdar://problem/39500514>
3456
3457         Reviewed by Antoine Quint.
3458
3459         Detect a special type of link anchor, which we're calling System Previews.
3460         Ultimately this will allow WebKit to present such links in a special
3461         way.
3462
3463         A System Preview link is an <a> element, with a rel attribute that
3464         includes "system-preview". It has a single element child, which is
3465         either an <img> or a <picture>.
3466
3467         Test: system-preview/detection.html
3468
3469         * html/HTMLAnchorElement.cpp:
3470         (WebCore::HTMLAnchorElement::relList): Add braces.
3471         (WebCore::HTMLAnchorElement::isSystemPreviewLink const): New
3472         function.
3473         * html/HTMLAnchorElement.h:
3474
3475         * html/HTMLImageElement.cpp:
3476         (WebCore::HTMLImageElement::isSystemPreviewImage const): Ask the
3477         parent if it is a system preview link.
3478         * html/HTMLImageElement.h:
3479         * html/HTMLPictureElement.cpp:
3480         (WebCore::HTMLPictureElement::isSystemPreviewImage const): Ditto.
3481         * html/HTMLPictureElement.h:
3482
3483         * testing/Internals.cpp: Testing helpers.
3484         (WebCore::Internals::systemPreviewRelType):
3485         (WebCore::Internals::isSystemPreviewLink const):
3486         (WebCore::Internals::isSystemPreviewImage const):
3487         * testing/Internals.h:
3488         * testing/Internals.idl:
3489
3490 2018-04-18  Antti Koivisto  <antti@apple.com>
3491
3492         :active pseudo class doesn't deactivate when using pressure sensitive trackpad
3493         https://bugs.webkit.org/show_bug.cgi?id=181680
3494
3495         Reviewed by Beth Dakin.
3496
3497         Trackpad sends a mouse force event with force of zero after mouse up event. This causes the element under cursor
3498         activate again.
3499
3500         Even a fake event test doesn't appear to be currently possible as TestRunner crashes if you try to send mouseForceChanged.
3501         All the tests using it are skipped.
3502
3503         * page/EventHandler.cpp:
3504         (WebCore::EventHandler::handleMouseForceEvent):
3505
3506         Don't add HitTestRequest::Active if the force of the force event is zero.
3507
3508 2018-04-18  Megan Gardner  <megan_gardner@apple.com>
3509
3510         Ensure correct screen sizes
3511         https://bugs.webkit.org/show_bug.cgi?id=184757
3512         
3513         Reviewed by Wenson Hsieh.
3514         
3515         Make sure that the screen sizes are actually correct.
3516
3517         Not currently testable, will add tests when it is.
3518
3519         * platform/ios/PlatformScreenIOS.mm:
3520
3521 2018-04-18  Nan Wang  <n_wang@apple.com>
3522
3523         AX: [macOS] WebKit hangs when triggering an alert from an AOM increment event
3524         https://bugs.webkit.org/show_bug.cgi?id=184742
3525
3526         Reviewed by Chris Fleizach.
3527
3528         Made increment and decrement actions on the macOS to be async. So that VoiceOver
3529         won't hang indefinitely if performing the actions causes an alert or other modal
3530         behaviors.
3531
3532         Test: accessibility/mac/async-increment-decrement-action.html
3533
3534         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3535         (-[WebAccessibilityObjectWrapper accessibilityPerformIncrementAction]):
3536         (-[WebAccessibilityObjectWrapper _accessibilityPerformIncrementAction]):
3537         (-[WebAccessibilityObjectWrapper accessibilityPerformDecrementAction]):
3538         (-[WebAccessibilityObjectWrapper _accessibilityPerformDecrementAction]):
3539         (-[WebAccessibilityObjectWrapper accessibilityPerformAction:]):
3540
3541 2018-04-18  Youenn Fablet  <youenn@apple.com>
3542
3543         MediaResourceLoader should set its fetch destination
3544         https://bugs.webkit.org/show_bug.cgi?id=184746
3545
3546         Reviewed by Eric Carlson.
3547
3548         Covered by updated test.
3549
3550         * loader/MediaResourceLoader.cpp:
3551         (WebCore::MediaResourceLoader::requestResource):
3552
3553 2018-04-18  Jer Noble  <jer.noble@apple.com>
3554
3555         Fix runtime errors in simulator while playing media
3556         https://bugs.webkit.org/show_bug.cgi?id=184751
3557
3558         Reviewed by Eric Carlson.
3559
3560         AVURLAssetHTTPCookiesKey may not be present, and AVPlayer may not respond to certain methods.
3561
3562         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3563         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
3564         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
3565         (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback):
3566         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
3567
3568 2018-04-18  Jer Noble  <jer.noble@apple.com>
3569
3570         Ignore ASSERT when setting AVAudioSessionCategory returns an error on simulator.
3571         https://bugs.webkit.org/show_bug.cgi?id=184698
3572
3573         Reviewed by Eric Carlson.
3574
3575         * platform/audio/ios/AudioSessionIOS.mm:
3576         * platform/audio/mac/AudioSessionMac.cpp:
3577
3578 2018-04-18  Sihui Liu  <sihui_liu@apple.com>
3579
3580         REGRESSION: Using the reload button while offline pushes identical pages onto the back/forward list
3581         https://bugs.webkit.org/show_bug.cgi?id=184570
3582         <rdar://problem/34807323>
3583
3584         Reviewed by Chris Dumez.
3585
3586         Set FrameLoadType properly when error occurs in reload.
3587
3588         tests: Tools/TestWebKitAPI/Tests/WebKitCocoa/LoadAlternateHTMLString.mm
3589
3590         * loader/FrameLoader.cpp:
3591         (WebCore::FrameLoader::load):
3592
3593 2018-04-18  Chris Dumez  <cdumez@apple.com>
3594
3595         Add support for converting a local window to a remote window
3596         https://bugs.webkit.org/show_bug.cgi?id=184515
3597         <rdar://problem/39011318>
3598
3599         Reviewed by Ryosuke Niwa.
3600
3601         Add initial support for process-swapping when navigating cross-origin as a result
3602         of a window.open(). The window object returned by window.open() is initially same
3603         origin and is for about:blank. The navigation cross-origin then happens and the
3604         JS wrappers for the window then point to a cross-origin window which is remote (i.e.
3605         hosted in another WebProcess).
3606
3607         The RemoteDOMWindow exposed to JS looks like a regular cross-origin Window with a few
3608         exceptions due to our incomplete implementation (e.g. w.location returns null) and 
3609         most of its API is currently not functional. The RemoteDOMWindow API will be implemented
3610         in a follow-up by relying on IPC.
3611
3612         Test: http/tests/navigation/process-swap-window-open.html
3613
3614         * bindings/js/JSDOMGlobalObject.cpp:
3615         (WebCore::JSDOMGlobalObject::scriptExecutionContext const):
3616         * bindings/js/JSDOMPromiseDeferred.h:
3617         * bindings/js/JSDOMWindowProperties.cpp:
3618         (WebCore::JSDOMWindowProperties::getOwnPropertySlot):
3619         * bindings/js/JSDOMWindowProxy.cpp:
3620         (WebCore::JSDOMWindowProxy::finishCreation):
3621         (WebCore::JSDOMWindowProxy::create):
3622         * bindings/js/JSDOMWindowProxy.h:
3623         * bindings/js/JSDOMWrapper.cpp:
3624         (WebCore::JSDOMObject::JSDOMObject):
3625         * bindings/js/JSDOMWrapper.h:
3626         * bindings/js/WindowProxyController.cpp:
3627         (WebCore::WindowProxyController::createWindowProxy):
3628         (WebCore::WindowProxyController::setDOMWindowForWindowProxy):
3629         * bridge/objc/WebScriptObject.mm:
3630         (-[WebScriptObject _isSafeScript]):
3631         Teach more of our bindings code about RemoteDOMWindows.
3632
3633         * dom/Document.cpp:
3634         (WebCore::Document::createDOMWindow):
3635         * loader/FrameLoaderClient.h:
3636         Add FrameLoaderClient function to notify the client when a DOMWindow is constructed in
3637         the frame. This is needed for WebKit2 to link the old window to its new representation
3638         in the new WebProcess.
3639
3640 2018-04-17  Zan Dobersek  <zdobersek@igalia.com>
3641
3642         [CMake] Add and enable the ENABLE_CSS_ANIMATIONS_LEVEL_2 feature define
3643         https://bugs.webkit.org/show_bug.cgi?id=184681
3644
3645         Reviewed by Carlos Garcia Campos.
3646
3647         * Sources.txt: Include CSSAnimationTriggerScrollValue.cpp in the build.
3648         * WebCore.xcodeproj/project.pbxproj: Remove CSSAnimationTriggerScrollValue.cpp
3649         build target now that it's built via Sources.txt.
3650
3651 2018-04-17  Zan Dobersek  <zdobersek@igalia.com>
3652
3653         [CoordGraphics] CoordinatedImageBacking can simplify image drawing
3654         https://bugs.webkit.org/show_bug.cgi?id=183986
3655
3656         Reviewed by Michael Catanzaro.
3657
3658         In CoordinatedImageBacking::update(), when drawing the image into a
3659         freshly-created image backing, we can avoid save-and-restoring the
3660         painting context. We also don't have to clip it, since the clipping area
3661         is the same as the image (and buffer) bounds. Since the buffer is
3662         initialized to transparent color, we can use the CompositeCopy operator
3663         to just copy image data into the destination since there's nothing to
3664         paint the source over.
3665
3666         No new tests -- no change in functionality.
3667
3668         * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp:
3669         (WebCore::CoordinatedImageBacking::update):
3670
3671 2018-04-17  Michael Catanzaro  <mcatanzaro@igalia.com>
3672
3673         [GTK] Webkit should spoof as Safari on a Mac for Outlook.com
3674         https://bugs.webkit.org/show_bug.cgi?id=184573
3675
3676         Reviewed by Carlos Alberto Lopez Perez.
3677
3678         Add quirk for outlook.live.com.
3679
3680         * platform/UserAgentQuirks.cpp:
3681         (WebCore::urlRequiresMacintoshPlatform):
3682
3683 2018-04-17  Mark Lam  <mark.lam@apple.com>
3684
3685         Templatize CodePtr/Refs/FunctionPtrs with PtrTags.
3686         https://bugs.webkit.org/show_bug.cgi?id=184702
3687         <rdar://problem/35391681>
3688
3689         Reviewed by Filip Pizlo and Saam Barati.
3690
3691         No new tests. This is covered by existing tests.
3692
3693         * WebCore.xcodeproj/project.pbxproj:
3694         * css/ElementRuleCollector.cpp:
3695         (WebCore::ElementRuleCollector::ruleMatches):
3696         * cssjit/CSSPtrTag.h: Added.
3697         * cssjit/CompiledSelector.h:
3698         * cssjit/FunctionCall.h:
3699         (WebCore::FunctionCall::FunctionCall):
3700         (WebCore::FunctionCall::setFunctionAddress):
3701         (WebCore::FunctionCall::prepareAndCall):
3702         * cssjit/SelectorCompiler.cpp:
3703         (WebCore::SelectorCompiler::compileSelector):
3704         (WebCore::SelectorCompiler::SelectorFragment::appendUnoptimizedPseudoClassWithContext):
3705         (WebCore::SelectorCompiler::addPseudoClassType):
3706         (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
3707         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeFunctionCallValueMatching):
3708         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementFunctionCallTest):
3709         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateContextFunctionCallTest):
3710         * cssjit/SelectorCompiler.h:
3711         (WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
3712         (WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
3713         (WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
3714         (WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
3715         * dom/SelectorQuery.cpp:
3716         (WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const):
3717         (WebCore::SelectorDataList::execute const):
3718         * dom/SelectorQuery.h:
3719
3720 2018-04-17  Tadeu Zagallo  <tzagallo@apple.com>
3721
3722         Retain MessagePortChannel for transfer when disentangling ports
3723         https://bugs.webkit.org/show_bug.cgi?id=184502
3724         <rdar://problem/39372771>
3725
3726         Reviewed by Geoffrey Garen.
3727
3728         MessagePortChannels should be retained while ports are being transferred, but that was only
3729         happening when sending a port through another port, but not when sending it through a worker.
3730
3731         Test: workers/worker-to-worker.html
3732
3733         * dom/messageports/MessagePortChannel.cpp:
3734         (WebCore::MessagePortChannel::entanglePortWithProcess):
3735         (WebCore::MessagePortChannel::disentanglePort):
3736         (WebCore::MessagePortChannel::postMessageToRemote):
3737         (WebCore::MessagePortChannel::takeAllMessagesForPort):
3738
3739 2018-04-17  Tadeu Zagallo  <tzagallo@apple.com>
3740
3741         References from CSSStyleDeclaration to CSSValues should be weak
3742         https://bugs.webkit.org/show_bug.cgi?id=180280
3743         <rdar://problem/35804869>
3744
3745         Reviewed by Geoffrey Garen.
3746
3747         No new tests - used the existing test to verify the leak
3748
3749         * css/DeprecatedCSSOMValue.h:
3750         (WebCore::DeprecatedCSSOMValue::weakPtrFactory):
3751         * css/PropertySetCSSStyleDeclaration.cpp:
3752         (WebCore::PropertySetCSSStyleDeclaration::wrapForDeprecatedCSSOM):
3753         * css/PropertySetCSSStyleDeclaration.h:
3754
3755 2018-04-17  Jonathan Bedard  <jbedard@apple.com>
3756
3757         Unreviewed rollout of r230632. Regression in memory usage.
3758
3759         That bug tracked in https://bugs.webkit.org/show_bug.cgi?id=184569.
3760
3761         Tests: animations/animation-internals-api-multiple-keyframes.html
3762                animations/animation-internals-api.html
3763                transitions/transition-drt-api-delay.html
3764                transitions/transition-drt-api.html
3765
3766         * page/RuntimeEnabledFeatures.h:
3767         * testing/Internals.cpp:
3768         (WebCore::Internals::pseudoElement): Deleted.
3769         * testing/Internals.h:
3770         * testing/Internals.idl:
3771
3772 2018-04-17  Tadeu Zagallo  <tzagallo@apple.com>
3773
3774         Do not unregister MessagePorts on deallocation if it has been disentangled
3775         https://bugs.webkit.org/show_bug.cgi?id=184285
3776         <rdar://problem/39256714>
3777
3778         Reviewed by Darin Adler.
3779
3780         Test: workers/message-port-gc.html
3781
3782         * dom/MessagePort.cpp:
3783         (WebCore::MessagePort::deref const):
3784
3785 2018-04-17  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3786
3787         [Curl] Fix timing of reporting error to the client
3788         https://bugs.webkit.org/show_bug.cgi?id=184707
3789
3790         Before checking the result code, check the status of callback invocation and
3791         do the right thing.
3792
3793         Reviewed by Youenn Fablet.
3794
3795         No new tests because there's no new behavior.
3796
3797         * platform/network/curl/CurlRequest.cpp:
3798         (WebCore::CurlRequest::didCompleteTransfer):
3799         * platform/network/curl/CurlRequest.h:
3800         (WebCore::CurlRequest::needToInvokeDidReceiveResponse const):
3801
3802 2018-04-17  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3803
3804         [Curl] Export authentication information to be used by the client.
3805         https://bugs.webkit.org/show_bug.cgi?id=184709
3806
3807         Just added getters for username and password member variables.
3808
3809         Reviewed by Alex Christensen.
3810
3811         No new tests because there's no new behavior.
3812
3813         * platform/network/curl/CurlRequest.h:
3814         (WebCore::CurlRequest::user const):
3815         (WebCore::CurlRequest::password const):
3816
3817 2018-04-17  Chris Dumez  <cdumez@apple.com>
3818
3819         REGRESSION (r229831): CMD-clicking an iCloud web app link unexpectedly opens that link in a new tab and the current tab
3820         https://bugs.webkit.org/show_bug.cgi?id=184678
3821         <rdar://problem/39422122>
3822
3823         Reviewed by Alex Christensen.
3824
3825         Frament navigations need to happen synchronously for Web-compatibility. Because of this,
3826         r225657 added code to make sure that if the client does not make the navigation policy
3827         decision synchronously for frament navigations, then we'll stop waiting for the client
3828         and proceed with the navigation. However, r229831 make the navigation policy decision
3829         IPC decision, meaning that even if the client responds synchronously, it would be
3830         asynchronously from WebCore's point of view. As a result, we would always ignore the
3831         client's policy decision when doing a fragment navigation.
3832
3833         This is an issue on iclould.com because the web-app links are fragment URLs. When you
3834         CMD+click one of these link, we do the navigation policy check. As a result of this
3835         check, Safari responds IGNORE to the policy decision and instead decides to load the
3836         link in a new tab (because CMD key is pressed). Due to the bug mentioned above, we
3837         would not obey the IGNORE policy decision from Safari and load the link in the current
3838         tab, even though Safari would already be loading it in a new tab.
3839
3840         To address the issue, I reintroduced a synchronous code path for navigation policy
3841         decision making, backed by synchronous IPC. This synchronous code path is now used for
3842         fragment navigations to restore pre-r229831 behavior. If the client does not answer
3843         synchronously, we'll proceed with the navigation anyway, as was happening pre-r229831.
3844
3845         Test: http/tests/navigation/fragment-navigation-policy-ignore.html
3846
3847         * loader/EmptyClients.cpp:
3848         (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
3849         * loader/EmptyFrameLoaderClient.h:
3850         * loader/FrameLoader.cpp:
3851         (WebCore::FrameLoader::loadURL):
3852         (WebCore::FrameLoader::loadWithDocumentLoader):
3853         * loader/FrameLoaderClient.h:
3854         * loader/PolicyChecker.cpp:
3855         (WebCore::PolicyChecker::checkNavigationPolicy):
3856         * loader/PolicyChecker.h:
3857
3858 2018-04-17  Matt Lewis  <jlewis3@apple.com>
3859
3860         Unreviewed, rolling out r230713.
3861
3862         This caused internal build failures.
3863
3864         Reverted changeset:
3865
3866         "Implement checked cast for DDResultRef once
3867         DDResultGetTypeID() is available"
3868         https://bugs.webkit.org/show_bug.cgi?id=184554
3869         https://trac.webkit.org/changeset/230713
3870
3871 2018-04-17  Chris Dumez  <cdumez@apple.com>
3872
3873         Add bindings code for RemoteDOMWindow
3874         https://bugs.webkit.org/show_bug.cgi?id=184653
3875
3876         Reviewed by Ryosuke Niwa.
3877
3878         Add bindings code for RemoteDOMWindow. A RemoteDOMWindow behaves exactly like a cross-origin
3879         DOMWindow, which is backed by a RemoteDOMWindow object instead of a DOMWindow one. Since
3880         a RemoteDOMWindow is always cross origin, we do not need cross-origin checks and the bindings
3881         code is identical to the DOMWindow code paths from cross-origin handling.
3882
3883         No new tests, this code will be used and tested via Bug 184515.
3884
3885         * CMakeLists.txt:
3886         * DerivedSources.make:
3887         * Sources.txt:
3888         * WebCore.xcodeproj/project.pbxproj:
3889         * bindings/js/JSBindingsAllInOne.cpp:
3890         * bindings/js/JSDOMWindowCustom.cpp:
3891         (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
3892         (WebCore::JSDOMWindow::getOwnPropertySlot):
3893         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
3894         (WebCore::addCrossOriginWindowOwnPropertyNames):
3895         * bindings/js/JSDOMWindowCustom.h:
3896
3897         * bindings/js/JSRemoteDOMWindowBase.cpp: Added.
3898         (WebCore::JSRemoteDOMWindowBase::JSRemoteDOMWindowBase):
3899         (WebCore::JSRemoteDOMWindowBase::destroy):
3900         (WebCore::JSRemoteDOMWindowBase::javaScriptRuntimeFlags):
3901         (WebCore::toJS):
3902         (WebCore::toJSRemoteDOMWindow):
3903         * bindings/js/JSRemoteDOMWindowBase.h: Added.
3904         JSRemoteDOMWindow unfortunately currently needs to be a global object because of:
3905         1. a JSProxy's target needs to be a JSGlobalObject currently
3906         2. The 'structure()->setGlobalObject(vm, &window);' call in
3907            JSDOMWindowProxy::setWindow(VM&, JSDOMGlobalObject&) which requires a JSGlobalObject.
3908         Ideally, this wouldn't be the case in the future but this would require some code refactoring.
3909         Our DOM global objects normally subclass JSDOMGlobalObject so I decided to subclass JSDOMGlobalObject,
3910         which brings some things our bindings code expect. However, subclassing JSDOMGlobalObject directly is
3911         problematic because it does not hold the m_wrapped implementation pointer. To address this issue, all
3912         our our DOM global objects have a JS*Base base class which subclasses JSDOMGlobalObject and stores the
3913         m_wrapped implementation pointer. I followed the same pattern here.
3914
3915         (WebCore::toJS):
3916         * bindings/js/JSRemoteDOMWindowCustom.cpp: Added.
3917         (WebCore::JSRemoteDOMWindow::getOwnPropertySlot):
3918         (WebCore::JSRemoteDOMWindow::getOwnPropertySlotByIndex):
3919         (WebCore::JSRemoteDOMWindow::put):
3920         (WebCore::JSRemoteDOMWindow::putByIndex):
3921         (WebCore::JSRemoteDOMWindow::deleteProperty):
3922         (WebCore::JSRemoteDOMWindow::deletePropertyByIndex):
3923         (WebCore::JSRemoteDOMWindow::getOwnPropertyNames):
3924         (WebCore::JSRemoteDOMWindow::defineOwnProperty):
3925         (WebCore::JSRemoteDOMWindow::getPrototype):
3926         (WebCore::JSRemoteDOMWindow::preventExtensions):
3927         (WebCore::JSRemoteDOMWindow::toStringName):
3928         * bindings/scripts/CodeGeneratorJS.pm:
3929         (IsDOMGlobalObject):
3930         (GenerateHeader):
3931         (GenerateOverloadDispatcher):
3932         (GenerateImplementation):
3933         * page/RemoteDOMWindow.idl: Added.
3934
3935 2018-04-17  David Kilzer  <ddkilzer@apple.com>
3936
3937         Implement checked cast for DDResultRef once DDResultGetTypeID() is available
3938         <https://webkit.org/b/184554>
3939         <rdar://problem/36241894>
3940
3941         Reviewed by Brent Fulgham.
3942
3943         * editing/cocoa/DataDetection.mm:
3944         (WebCore::detectItemAtPositionWithRange): Implement checked cast
3945         for DDResultRef.
3946
3947 2018-04-17  Said Abou-Hallawa  <sabouhallawa@apple.com>
3948
3949         Animated GIF imagery with finite looping are falling one loop short
3950         https://bugs.webkit.org/show_bug.cgi?id=183153
3951
3952         Reviewed by Simon Fraser.
3953
3954         The Netscape Looping Application Extension is a block which may be added
3955         to a GIF file to tell the viewer to loop through the entire GIF frames.
3956         This is communicated through two bytes designated for the "loopCount" in
3957         this block.
3958
3959         The entire block may not be found in the GIF, in which case the GIF is 
3960         supposed to animate its entire frames only once.
3961
3962         If the block exists and loopCount = 0, this means the image has to loop
3963         through its frames indefinitely.
3964
3965         If the block exist and loopCount > 0, this should mean the image has to
3966         loop through its frames loopCount + 1 times. The extra loop seems to be
3967         the consensus among most of the GIF generators and viewers. For example,