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