Missing from r237634
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-10-31  Zalan Bujtas  <zalan@apple.com>
2
3         Missing from r237634
4
5         * layout/inlineformatting/InlineFormattingState.cpp:
6         (WebCore::Layout::InlineFormattingState::formattingContext):
7
8 2018-10-31  Zalan Bujtas  <zalan@apple.com>
9
10         [LFC] Do not pass LayoutState& to compute* and layout* functions
11         https://bugs.webkit.org/show_bug.cgi?id=191100
12
13         Reviewed by Antti Koivisto.
14
15         Reduce noise by removing LayoutState& parameter where possible.
16
17         * layout/FormattingContext.cpp:
18         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
19         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
20         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
21         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
22         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
23         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
24         * layout/FormattingContext.h:
25         * layout/FormattingContextGeometry.cpp:
26         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
27         * layout/LayoutFormattingState.cpp:
28         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
29         * layout/blockformatting/BlockFormattingContext.cpp:
30         (WebCore::Layout::BlockFormattingContext::layout const):
31         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
32         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
33         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
34         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
35         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
36         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
37         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
38         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
39         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
40         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
41         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
42         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
43         * layout/blockformatting/BlockFormattingContext.h:
44         * layout/inlineformatting/InlineFormattingContext.cpp:
45         (WebCore::Layout::InlineFormattingContext::layout const):
46         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
47         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
48         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
49         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
50         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
51         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
52         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
53         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
54         * layout/inlineformatting/InlineFormattingContext.h:
55
56 2018-10-31  Zalan Bujtas  <zalan@apple.com>
57
58         [LFC] FormattingContext class should take FormattingState&
59         https://bugs.webkit.org/show_bug.cgi?id=191099
60
61         Reviewed by Antti Koivisto.
62
63         This is in preparation for not passing LayoutState& into every layout functions.
64         FormattingContext has FormattingState now and LayoutState can be acquired through FormattingState.
65         LayoutState <- FormattingState <- FormattingContext
66
67         * layout/FormattingContext.cpp:
68         (WebCore::Layout::FormattingContext::FormattingContext):
69         (WebCore::Layout::FormattingContext::formattingState const):
70         (WebCore::Layout::FormattingContext::layoutState const):
71         * layout/FormattingContext.h:
72         * layout/FormattingState.cpp:
73         (WebCore::Layout::FormattingState::FormattingState):
74         * layout/FormattingState.h:
75         (WebCore::Layout::FormattingState::layoutState const):
76         * layout/LayoutFormattingState.h:
77         * layout/blockformatting/BlockFormattingContext.cpp:
78         (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
79         * layout/blockformatting/BlockFormattingContext.h:
80         * layout/blockformatting/BlockFormattingState.cpp:
81         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
82         (WebCore::Layout::BlockFormattingState::formattingContext):
83         (WebCore::Layout::BlockFormattingState::formattingContext const): Deleted.
84         * layout/blockformatting/BlockFormattingState.h:
85         * layout/inlineformatting/InlineFormattingContext.cpp:
86         (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
87         * layout/inlineformatting/InlineFormattingContext.h:
88         * layout/inlineformatting/InlineFormattingState.cpp:
89         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
90         (WebCore::Layout::InlineFormattingState::formattingContext):
91         (WebCore::Layout::InlineFormattingState::formattingContext const): Deleted.
92         * layout/inlineformatting/InlineFormattingState.h:
93
94 2018-10-31  Zalan Bujtas  <zalan@apple.com>
95
96         [LFC] The *FormattingState class should provide the *FormattingContext.
97         https://bugs.webkit.org/show_bug.cgi?id=191089
98
99         Reviewed by Antti Koivisto.
100
101         BlockFormattingState provides the BlockFormattingContext object, while InlineFormattingState provides the InlineFormattingContext.
102
103         * layout/FormattingContext.cpp:
104         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
105         * layout/FormattingState.h:
106         * layout/LayoutFormattingState.cpp:
107         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
108         (WebCore::Layout::LayoutState::formattingContext const): Deleted.
109         * layout/LayoutFormattingState.h:
110         * layout/blockformatting/BlockFormattingContext.cpp:
111         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
112         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
113         * layout/blockformatting/BlockFormattingState.cpp:
114         (WebCore::Layout::BlockFormattingState::formattingContext const):
115         * layout/blockformatting/BlockFormattingState.h:
116         * layout/inlineformatting/InlineFormattingContext.cpp:
117         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
118         * layout/inlineformatting/InlineFormattingState.cpp:
119         (WebCore::Layout::InlineFormattingState::formattingContext const):
120         * layout/inlineformatting/InlineFormattingState.h:
121
122 2018-10-31  Zalan Bujtas  <zalan@apple.com>
123
124         [LFC] Rename LayoutContext to LayoutState
125         https://bugs.webkit.org/show_bug.cgi?id=191080
126
127         Reviewed by Antti Koivisto.
128
129         LayoutContext naming was a bit misleading since none of the other *FormattingContext classes (BlockFormattingContext etc) hold states.
130         (LayoutContext.cpp -> LayoutFormattingState.cpp because LayoutState.cpp name is already taken.)
131
132         Now the current state is as follows:
133
134         LayoutState has
135         1. Layout tree
136         2. State content for each formatting subtrees
137         3. Display tree
138
139         * Sources.txt:
140         * WebCore.xcodeproj/project.pbxproj:
141         * layout/FormattingContext.cpp:
142         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
143         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
144         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
145         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
146         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
147         (WebCore::Layout::FormattingContext::mapBoxToAncestor):
148         (WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
149         (WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
150         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
151         * layout/FormattingContext.h:
152         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
153         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
154         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
155         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
156         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
157         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
158         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
159         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
160         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
161         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
162         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
163         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
164         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
165         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
166         * layout/FormattingContextGeometry.cpp:
167         (WebCore::Layout::contentHeightForFormattingContextRoot):
168         (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight):
169         (WebCore::Layout::FormattingContext::Geometry::computedMinHeight):
170         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
171         (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
172         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
173         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
174         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
175         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
176         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
177         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
178         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
179         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
180         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
181         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
182         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
183         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
184         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
185         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
186         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
187         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
188         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
189         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
190         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
191         * layout/FormattingState.cpp:
192         (WebCore::Layout::FormattingState::FormattingState):
193         * layout/FormattingState.h:
194         (WebCore::Layout::FormattingState::setInstrinsicWidthConstraints):
195         (WebCore::Layout::FormattingState::instrinsicWidthConstraints const):
196         * layout/LayoutFormattingState.cpp: Renamed from Source/WebCore/layout/LayoutContext.cpp.
197         (WebCore::Layout::LayoutState::LayoutState):
198         (WebCore::Layout::LayoutState::initializeRoot):
199         (WebCore::Layout::LayoutState::updateLayout):
200         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
201         (WebCore::Layout::LayoutState::displayBoxForLayoutBox const):
202         (WebCore::Layout::LayoutState::styleChanged):
203         (WebCore::Layout::LayoutState::markNeedsUpdate):
204         (WebCore::Layout::LayoutState::formattingStateForBox const):
205         (WebCore::Layout::LayoutState::establishedFormattingState const):
206         (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded):
207         (WebCore::Layout::LayoutState::formattingContext const):
208         * layout/LayoutFormattingState.h: Renamed from Source/WebCore/layout/LayoutContext.h.
209         (WebCore::Layout::LayoutState::setInQuirksMode):
210         (WebCore::Layout::LayoutState::hasDisplayBox const):
211         (WebCore::Layout::LayoutState::inQuirksMode const):
212         * layout/Verification.cpp:
213         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
214         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
215         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
216         (WebCore::Layout::verifyAndOutputSubtree):
217         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
218         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const): Deleted.
219         * layout/blockformatting/BlockFormattingContext.cpp:
220         (WebCore::Layout::BlockFormattingContext::layout const):
221         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
222         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
223         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
224         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
225         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
226         (WebCore::Layout::hasPrecomputedMarginTop):
227         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
228         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
229         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
230         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
231         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
232         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
233         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
234         * layout/blockformatting/BlockFormattingContext.h:
235         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
236         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
237         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
238         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
239         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
240         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
241         (WebCore::Layout::isStretchedToInitialContainingBlock):
242         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
243         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
244         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
245         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
246         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
247         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
248         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
249         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
250         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop):
251         * layout/blockformatting/BlockFormattingState.cpp:
252         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
253         * layout/blockformatting/BlockFormattingState.h:
254         * layout/blockformatting/BlockInvalidation.cpp:
255         (WebCore::Layout::computeUpdateType):
256         (WebCore::Layout::computeUpdateTypeForAncestor):
257         (WebCore::Layout::BlockInvalidation::invalidate):
258         * layout/blockformatting/BlockInvalidation.h:
259         * layout/blockformatting/BlockMarginCollapse.cpp:
260         (WebCore::Layout::isMarginTopCollapsedWithParent):
261         (WebCore::Layout::isMarginBottomCollapsedThrough):
262         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild):
263         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop):
264         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop):
265         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom):
266         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
267         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom):
268         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
269         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild):
270         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom):
271         * layout/displaytree/DisplayBox.h:
272         * layout/floats/FloatAvoider.cpp:
273         (WebCore::Layout::FloatAvoider::FloatAvoider):
274         * layout/floats/FloatAvoider.h:
275         * layout/floats/FloatBox.cpp:
276         (WebCore::Layout::FloatBox::FloatBox):
277         * layout/floats/FloatBox.h:
278         * layout/floats/FloatingContext.cpp:
279         (WebCore::Layout::FloatingContext::positionForFloat const):
280         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
281         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
282         * layout/floats/FloatingContext.h:
283         (WebCore::Layout::FloatingContext::layoutState const):
284         (WebCore::Layout::FloatingContext::layoutContext const): Deleted.
285         * layout/floats/FloatingState.cpp:
286         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
287         (WebCore::Layout::FloatingState::FloatingState):
288         (WebCore::Layout::FloatingState::constraints const):
289         * layout/floats/FloatingState.h:
290         (WebCore::Layout::FloatingState::create):
291         (WebCore::Layout::FloatingState::layoutState const):
292         (WebCore::Layout::FloatingState::layoutContext const): Deleted.
293         * layout/inlineformatting/InlineFormattingContext.cpp:
294         (WebCore::Layout::InlineFormattingContext::layout const):
295         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
296         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
297         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
298         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
299         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
300         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
301         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
302         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
303         * layout/inlineformatting/InlineFormattingContext.h:
304         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
305         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
306         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
307         * layout/inlineformatting/InlineFormattingState.cpp:
308         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
309         * layout/inlineformatting/InlineFormattingState.h:
310         * layout/inlineformatting/InlineInvalidation.cpp:
311         (WebCore::Layout::InlineInvalidation::invalidate):
312         * layout/inlineformatting/InlineInvalidation.h:
313         * layout/inlineformatting/InlineLineBreaker.cpp:
314         (WebCore::Layout::InlineLineBreaker::InlineLineBreaker):
315         (WebCore::Layout::InlineLineBreaker::runWidth const):
316         * layout/inlineformatting/InlineLineBreaker.h:
317         * layout/layouttree/LayoutTreeBuilder.cpp:
318         (WebCore::Layout::outputInlineRuns):
319         (WebCore::Layout::outputLayoutTree):
320         (WebCore::Layout::showLayoutTree):
321         * layout/layouttree/LayoutTreeBuilder.h:
322         * page/FrameViewLayoutContext.cpp:
323         (WebCore::layoutUsingFormattingContext):
324
325 2018-10-30  Wenson Hsieh  <wenson_hsieh@apple.com>
326
327         [Cocoa] Attachment dropped from one web view to another is missing its file wrapper
328         https://bugs.webkit.org/show_bug.cgi?id=190530
329         <rdar://problem/45232149>
330
331         Reviewed by Tim Horton.
332
333         Add support for copying and pasting attachment elements across web views by encoding and adding file wrapper
334         data as subresources in the web archive when writing selected web content to the pasteboard, and then decoding
335         and creating NSFileWrappers upon reading web content.
336
337         Test: WKAttachmentTests.CopyAndPasteBetweenWebViews
338
339         * WebCore.xcodeproj/project.pbxproj:
340         * editing/Editor.cpp:
341         (WebCore::Editor::registerAttachments):
342         * editing/Editor.h:
343
344         Add registerAttachments(), which registers _WKAttachments in the UI process given a list of
345         SerializedAttachmentData. This behaves similarly to registerAttachmentIdentifiers(), but differs in that (1) it
346         sends serialized file wrapper data, and (2) it sends a list of serialized attachments, rather than information
347         about just a single attachment.
348
349         * editing/SerializedAttachmentData.h:
350
351         Introduce SerializedAttachmentData, a struct containing information needed to serialize and deserialize an
352         attachment. These are used both when writing attachment data to the pasteboard, and when consuming attachment
353         data upon paste.
354
355         * editing/cocoa/WebContentReaderCocoa.mm:
356         (WebCore::replaceRichContentWithAttachments):
357
358         Add a step when pasting rich content with attachments, to collect and send serialized attachments to the client.
359         Also, drive-by fix: don't WTFMove() the Ref here if it's still going to be used below.
360
361         * html/HTMLAttachmentElement.cpp:
362         (WebCore::HTMLAttachmentElement::archiveResourceURL):
363         * html/HTMLAttachmentElement.h:
364
365         Add a static helper function to compute a URL that represents the data for the given attachment identifier, for
366         use in a web archive resource.
367
368         * loader/archive/cf/LegacyWebArchive.cpp:
369         (WebCore::addSubresourcesForAttachmentElementsIfNecessary):
370
371         Add a helper function to create and append ArchiveResources representing attachment element data when writing
372         attachments to the pasteboard via web archive data.
373
374         (WebCore::LegacyWebArchive::create):
375         * page/EditorClient.h:
376         (WebCore::EditorClient::registerAttachments):
377         (WebCore::EditorClient::serializedAttachmentDataForIdentifiers):
378
379 2018-10-30  David Kilzer  <ddkilzer@apple.com>
380
381         XSLTProcessor should limit max transform depth
382         <https://webkit.org/b/191075>
383         <rdar://problem/45531453>
384
385         Reviewed by Alex Christensen.
386
387         Test: fast/xsl/xslt-max-depth.html
388
389         * xml/SoftLinkLibxslt.cpp: Add macro for `xsltMaxDepth` global.
390         * xml/SoftLinkLibxslt.h: Ditto.
391         * xml/XSLTProcessorLibxslt.cpp:
392         (WebCore::XSLTProcessor::transformToString): Set `xsltMaxDepth`
393         to 1000.  Default in libxslt.dylib is 3000.
394
395 2018-10-30  Jim Mason  <jmason@ibinx.com>
396
397         [GTK] Scrollbars not following gtk-primary-button-warps-slider setting
398         https://bugs.webkit.org/show_bug.cgi?id=191067
399
400         Reviewed by Michael Catanzaro.
401
402         * platform/gtk/ScrollbarThemeGtk.cpp:
403         (WebCore::ScrollbarThemeGtk::handleMousePressEvent):
404
405 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
406
407         Clean up some obsolete MAX_ALLOWED macros
408         https://bugs.webkit.org/show_bug.cgi?id=190916
409
410         Reviewed by Tim Horton.
411
412         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
413         (WebCore::exernalDeviceDisplayNameForPlayer):
414         * platform/mac/PlatformEventFactoryMac.mm:
415         (WebCore::globalPointForEvent):
416         (WebCore::pointForEvent):
417         (WebCore::mouseButtonForEvent):
418         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
419
420 2018-10-30  Ali Juma  <ajuma@chromium.org>
421
422         Calling window.open("", "_self") allows working around restrictions on window.close()
423         https://bugs.webkit.org/show_bug.cgi?id=191073
424
425         Reviewed by Chris Dumez.
426
427         Do not treat a re-used frame in DOMWindow::createWindow as having been opened by DOM.
428
429         Test: fast/dom/Window/window-open-self-disallow-close.html
430
431         * page/DOMWindow.cpp:
432         (WebCore::DOMWindow::createWindow):
433
434 2018-10-30  Andy Estes  <aestes@apple.com>
435
436         [Payment Request] Implement PaymentResponse.retry()
437         https://bugs.webkit.org/show_bug.cgi?id=190985
438
439         Reviewed by Daniel Bates.
440
441         Implemented the retry() method on PaymentResponse as specified in the Payment Request API
442         W3C Editor's Draft of 24 October 2018.
443
444         See https://w3c.github.io/payment-request/#retry-method for details.
445
446         Tests: http/tests/paymentrequest/payment-response-rejects-if-not-active.https.html
447                http/tests/paymentrequest/payment-response-retry-method.https.html
448
449         * Modules/applepay/PaymentCoordinator.h:
450         (WebCore::PaymentCoordinator::client): Added. Returns m_client.
451         * Modules/applepay/PaymentCoordinatorClient.h:
452         (WebCore::PaymentCoordinatorClient::isMockPaymentCoordinator const): Added. Used to downcast
453         a PaymentCoordinatorClient to a MockPaymentCoordinator.
454         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
455         (WebCore::ApplePayPaymentHandler::computeTotalAndLineItems const): Made const.
456         (WebCore::ApplePayPaymentHandler::computeErrors const): Broke this function into
457         computeAddressErrors, computePayerErrors, and computePaymentMethodErrors, then modified this
458         function to call those functions. Exceptions thrown by computePaymentMethodErrors are ignored.
459         (WebCore::ApplePayPaymentHandler::computeAddressErrors const): Added.
460         (WebCore::ApplePayPaymentHandler::computePayerErrors const): Added.
461         (WebCore::ApplePayPaymentHandler::computePaymentMethodErrors const): Added.
462         (WebCore::ApplePayPaymentHandler::complete): Added ASSERTs to verify whether result is a
463         final result.
464         (WebCore::ApplePayPaymentHandler::retry): Computed PaymentErrors from PaymentValidationErrors,
465         ensured the PaymentAuthorizationResult was non-final by adding an unknown error if necessary,
466         and called PaymentCoordinator::completePaymentSession.
467         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
468         * Modules/paymentrequest/PaymentHandler.h:
469         * Modules/paymentrequest/PaymentRequest.cpp:
470         (WebCore::PaymentRequest::show): Changed to call settleShowPromise.
471         (WebCore::PaymentRequest::abortWithException): Changed to abort PaymentResponse's retry
472         promise, if present, instead of PaymentResponse's show promise.
473         (WebCore::PaymentRequest::settleShowPromise): Added. Settles m_showPromise then sets it to
474         std::nullopt.
475         (WebCore::PaymentRequest::closeActivePaymentHandler): Added. Hides the active payment
476         handler then sets it to std::nullopt.
477         (WebCore::PaymentRequest::stop): Stopped calling abortWithException, since that function
478         might settle PaymentResponse's retry promise. PaymentResponse is now an ActiveDOMObject and
479         will settle its own promise in its implementation of stop.
480         (WebCore::PaymentRequest::abort): Changed to throw an InvalidStateError if there is a
481         pending retry promise and to call abortWithException instead of stop.
482         (WebCore::PaymentRequest::completeMerchantValidation): Changed to call abortWithException
483         instead of stop.
484         (WebCore::PaymentRequest::settleDetailsPromise): Ditto.
485         (WebCore::PaymentRequest::accept): Updated the existing PaymentResponse, if present, rather
486         than creating a new one. Settled the existing PaymentResponse's retry promise, if present,
487         rather than the show promise.
488         (WebCore::PaymentRequest::complete): Changed to throw an AbortError if there is no longer an
489         active payment handler.
490         (WebCore::PaymentRequest::retry): Changed to throw an AbortError if there is no longer an
491         active payment handler, and to call PaymentHandler::retry if there is.
492         (WebCore::PaymentRequest::cancel): Changed to call abortWithException instead of stop.
493         * Modules/paymentrequest/PaymentRequest.h:
494         * Modules/paymentrequest/PaymentRequest.idl:
495         * Modules/paymentrequest/PaymentResponse.cpp:
496         (WebCore::PaymentResponse::PaymentResponse):
497         (WebCore::PaymentResponse::finishConstruction): Pending activities create strong references
498         to |this|, so they cannot be created in constructors without relaxing adoption requirements.
499         Added this function so that the pending activity can be created after the PaymentResponse is
500         created and adopted.
501         (WebCore::PaymentResponse::~PaymentResponse):
502         (WebCore::PaymentResponse::complete): Updated to throw an AbortError or InvalidStateError
503         when necessary.
504         (WebCore::PaymentResponse::retry): Implemented. Throws an AbortError or InvalidStateError
505         when necessary, otherwise calls PaymentRequest::retry and stores the retry promise in
506         m_retryPromise.
507         (WebCore::PaymentResponse::abortWithException): Added. Rejects the retry promise with
508         |exception|, clears the pending activity, and sets m_state to Completed.
509         (WebCore::PaymentResponse::settleRetryPromise): Added. Settles the retry promise and sets it
510         to std::nullopt.
511         (WebCore::PaymentResponse::canSuspendForDocumentSuspension const): Added. Returns true if
512         there is no pending activity.
513         (WebCore::PaymentResponse::stop): Added. Rejects the retry promise with AbortError, clears
514         the pending activity, and sets m_state to Stopped.
515         * Modules/paymentrequest/PaymentResponse.h: Changed create to call finishConstruction and
516         made PaymentResponse an ActiveDOMObject instead of a ContextDestructionObserver.
517         * testing/Internals.cpp:
518         (WebCore::Internals::Internals): Changed to only create a MockPaymentCoordinator for main frames.
519         (WebCore::Internals::mockPaymentCoordinator): Changed to get the MockPaymentCoordinator by
520         downcasting the page's payment coordinator client.
521         * testing/Internals.h:
522         * testing/Internals.idl:
523         * testing/MockPaymentCoordinator.cpp:
524         (WebCore::MockPaymentCoordinator::completePaymentSession): Changed to only increment
525         hideCount for final results.
526         * testing/MockPaymentCoordinator.h:
527         (isType): Added so that PaymentCoordinatorClients can be downcasted to MockPaymentCoordinators.
528
529 2018-10-30  Zalan Bujtas  <zalan@apple.com>
530
531         [iOS] Use the mainframe view size to compute window.outerWidth/height.
532         https://bugs.webkit.org/show_bug.cgi?id=191070
533         <rdar://problem/42368377>
534
535         Reviewed by Tim Horton.
536
537         Use a more reasonable value for window.outerWidth and height.
538         (WKWebView's frame rect -> drawing area sizing -> WebPage's view size -> FrameView size)
539
540         * page/DOMWindow.cpp:
541         (WebCore::DOMWindow::outerHeight const):
542         (WebCore::DOMWindow::outerWidth const):
543
544 2018-10-30  Andy Estes  <aestes@apple.com>
545
546         [Apple Pay] PaymentRequest.canMakePayment() should resolve to true whenever Apple Pay is available
547         https://bugs.webkit.org/show_bug.cgi?id=191039
548
549         Reviewed by Megan Gardner.
550
551         During a recent Web Payments WG F2F, we decided that canMakePayment() should return true
552         whenever the user agent supports one or more of the specified payment methods, even if those
553         payment methods do not have active instruments.
554
555         Change WebKit's implementation of canMakePayment() for Apple Pay to resolve with the value
556         of ApplePaySession.canMakePayments() rather than ApplePaySession.canMakePaymentsWithActiveCard().
557
558         Added a test case to http/tests/paymentrequest/payment-request-canmakepayment-method.https.html.
559
560         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
561         (WebCore::ApplePayPaymentHandler::canMakePayment):
562         (WebCore::shouldDiscloseApplePayCapability): Deleted.
563         * testing/MockPaymentCoordinator.cpp:
564         (WebCore::MockPaymentCoordinator::canMakePayments):
565         (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
566         * testing/MockPaymentCoordinator.h:
567         * testing/MockPaymentCoordinator.idl:
568
569 2018-10-30  Sihui Liu  <sihui_liu@apple.com>
570
571         Add a deprecation warning to console for Web SQL
572         https://bugs.webkit.org/show_bug.cgi?id=190936
573
574         Reviewed by Ryosuke Niwa.
575
576         No new tests. Just adding a console message.
577
578         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
579         (WebCore::DOMWindowWebDatabase::openDatabase):
580
581 2018-10-30  Sihui Liu  <sihui_liu@apple.com>
582
583         IndexedDB: iteration of cursors skip records if updated or deleted
584         https://bugs.webkit.org/show_bug.cgi?id=190917
585         <rdar://problem/35250410>
586
587         Reviewed by Chris Dumez.
588
589         When object store has changes, we cleared cached records and reset the SQLite statement, 
590         updating the boundary to the next key in cursor's direction. Therefore, the cursor could 
591         jump to the next key after update or deletion.
592         We should cache those records before changing the statement.
593
594         Test: storage/indexeddb/cursor-update-while-iterating.html
595
596         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
597         (WebCore::IDBServer::SQLiteIDBCursor::objectStoreRecordsChanged):
598         (WebCore::IDBServer::SQLiteIDBCursor::fetch):
599         * Modules/indexeddb/server/SQLiteIDBCursor.h:
600
601 2018-10-29  Zalan Bujtas  <zalan@apple.com>
602
603         [LFC][IFC] Introduce InlineFormattingContextGeometry class
604         https://bugs.webkit.org/show_bug.cgi?id=191054
605
606         Reviewed by Antti Koivisto.
607
608         This is in preparation for inline-block support.
609
610         Move float and inline-block elements layout to layoutFormattingContextRoot().
611         computeWidthAndHeightForInlineBox takes care of replaced elements.
612
613         * Sources.txt:
614         * WebCore.xcodeproj/project.pbxproj:
615         * layout/inlineformatting/InlineFormattingContext.cpp:
616         (WebCore::Layout::InlineFormattingContext::layout const):
617         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
618         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
619         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const): Deleted.
620         * layout/inlineformatting/InlineFormattingContext.h:
621         * layout/inlineformatting/InlineFormattingContextGeometry.cpp: Added.
622         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
623         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
624
625 2018-10-28  Antoine Quint  <graouts@apple.com>
626
627         [Web Animations] Implement the update animations and send events procedure
628         https://bugs.webkit.org/show_bug.cgi?id=191013
629         <rdar://problem/45620495>
630
631         Reviewed by Dean Jackson.
632
633         While we implemented the various parts of what the Web Animations specification refers to as the "update animations and send events"
634         procedure, we did not implement it as one function and in the correct order, specifically updating animations and sending events in
635         two separate tasks. We now have a single method on DocumentTimeline which runs as the DisplayRefreshMonitor fires to update each
636         "relevant" animation with the current time, perform a microtask checkpoint and dispatch events.
637
638         Implementing this procedure allowed us to make several enhancements:
639
640         1. We introduce the concept of a "relevant" animation, which is essentially an animation that is either pending or playing. All animations
641         in a different state are no longer owned by the DocumentTimeline and can thus be destroyed if the developer doesn't hold references in JS.
642         Maintaining such a list guarantees that we're only updating animations that would have changed state since the last time the "update animations
643         and send events" procedure was run. Note that DeclarativeAnimation instances are also considered to be relevant if they have queued DOM events
644         to dispatch as they could otherwise be destroyed before they can fully dispatch them.
645
646         2. We no longer conflate the timing model and effects. Until now the way we would update animations was to go through all elements for which
647         we had a registered animation, invalidate their style and finally forcing a style update on the document. We had a separate data structure where
648         we help animations without targets so we update these as well in a separate pass, in order to make sure that promises and events would fire for
649         them as expected. We now let the "update animations and send events" procedure update the timing of all relevant animations and let individual
650         animation effects invalidate their style as needed, the document style invalidation happening naturally without DocumentTimeline forcing it. 
651
652         3. We use a single step to schedule the update of animations, which is to register for a display refresh monitor update provided a "relevant"
653         animation is known since the previous update. Until now we first had an "timing model invalidation" task scheduled upon any change of an animation's
654         timing model, which would then create a timer to the earliest moment any listed animation would require an update, finally registering a display
655         refresh monitor update, which used at least GenericTaskQueue<Timer> and potentially two, whereas we use none right now.
656
657         4. We allow for a display refresh monitor update to be canceled should the number of "relevant" animations since the last update goes back to 0.
658
659         To facilitate all of this, we have changed the m_animations ListHashSet to contain only the "relevant" animations, and no longer every animation created
660         that has this DocumentTimeline set as their "timeline" property. To keep this list current, every single change that changes a given animation's timing
661         ends up calling AnimationTimeline::animationTimingDidChange() passing the animation as the sole parameter and adding this animation to m_animations. We
662         immediately schedule a display refresh monitor update if one wasn't already scheduled. Then, when running the "update animations and send events"
663         procedure, we call a new WebAnimation::tick() method on each of those animations, which updates this animation's effect and relevance, using the newly
664         computed relevance to identify whether this animation should be kept in the m_animations ListHashSet.
665
666         This is only the first step towards a more efficient update and ownership model of animations by the document timeline since animations created as CSS
667         Animations and CSS Transitions are committed through CSS have dedicated data structures that are not updated in this particular patch, but this will be
668         addressed in a followup to keep this already significant patch smaller. Another issue that will be addressed later is the ability to not schedule display
669         refresh monitor udpates when only accelerated animations are running.
670
671         * animation/AnimationTimeline.cpp:
672         (WebCore::AnimationTimeline::animationTimingDidChange): Called by animations when any aspect of their timing model changes. The provided animation is then
673         added to the m_animations list unless its timeline is no longer this timeline.
674         (WebCore::AnimationTimeline::removeAnimation): Remove the provided animation from m_animations and remove any animation registered on the element-specific
675         animation lists if this animation has an effect with a target.
676         (WebCore::AnimationTimeline::animationWasAddedToElement): We no longer need to worry about the m_animationsWithoutTarget data structure since we removed it.
677         (WebCore::removeCSSTransitionFromMap): Fix a bug where we would remove any CSSTransition in the provided map that had a matching transition-property instead
678         of checking the CSSTransition registered for this transition-property was indeed the provided CSSTransition. The other code changes in this patch made this
679         code now cause regressions in the Web Platform Tests.
680         (WebCore::AnimationTimeline::animationWasRemovedFromElement): Stop updating m_animationsWithoutTarget since it no longer exists.
681         (WebCore::AnimationTimeline::elementWasRemoved):
682         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Fix a small error that caused a regression in the Web Platform Tests where we could attempt to
683         call setBackingAnimation() on a nullptr instead of a valid CSSAnimation.
684         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
685         (WebCore::AnimationTimeline::addAnimation): Deleted.
686         * animation/AnimationTimeline.h:
687         (WebCore::AnimationTimeline::hasElementAnimations const): Deleted.
688         (WebCore::AnimationTimeline:: const): Deleted.
689         (WebCore::AnimationTimeline::elementToAnimationsMap): Deleted.
690         (WebCore::AnimationTimeline::elementToCSSAnimationsMap): Deleted.
691         (WebCore::AnimationTimeline::elementToCSSTransitionsMap): Deleted.
692         * animation/CSSTransition.cpp:
693         (WebCore::CSSTransition::canBeListed const): Deleted.
694         * animation/CSSTransition.h:
695         * animation/DeclarativeAnimation.cpp:
696         (WebCore::DeclarativeAnimation::tick): Call the superclass's method and queue any necessary DOM events reflecting the timing model changes.
697         (WebCore::DeclarativeAnimation::needsTick const): Call the superclass's method and return true also if we have pending events since otherwise this animation
698         could be removed from m_animations on its AnimationTimeline and potentially destroyed before the GenericEventQueue had a chance to dispatch all events.
699         (WebCore::DeclarativeAnimation::startTime const): We removed the custom binding for this IDL property and renamed the method from bindingsStartTime to startTime.
700         (WebCore::DeclarativeAnimation::setStartTime): We removed the custom binding for this IDL property and renamed the method from setBindingsStartTime to setStartTime.
701         (WebCore::DeclarativeAnimation::bindingsStartTime const): Deleted.
702         (WebCore::DeclarativeAnimation::setBindingsStartTime): Deleted.
703         * animation/DeclarativeAnimation.h:
704         * animation/DocumentAnimationScheduler.cpp:
705         (WebCore::DocumentAnimationScheduler::unscheduleWebAnimationsResolution): Add a method to mark that we no longer need a display refresh monitor update for this
706         document's animation timeline. This is called when m_animations becomes empty.
707         * animation/DocumentAnimationScheduler.h:
708         * animation/DocumentTimeline.cpp:
709         (WebCore::DocumentTimeline::DocumentTimeline):
710         (WebCore::DocumentTimeline::detachFromDocument): Stop clearing two task queues and a timer that no longer exist and instead only clear the task queue to clear
711         the cached current time, which we queue any time we generate a new one (see DocumentTimeline::currentTime).
712         (WebCore::DocumentTimeline::getAnimations const): Use isRelevant() instead of canBeListed().
713         (WebCore::DocumentTimeline::updateThrottlingState):
714         (WebCore::DocumentTimeline::suspendAnimations):
715         (WebCore::DocumentTimeline::resumeAnimations):
716         (WebCore::DocumentTimeline::numberOfActiveAnimationsForTesting const):
717         (WebCore::DocumentTimeline::currentTime): Queue a task in the new m_currentTimeClearingTaskQueue task queue to clear the current time that we've generated and cached
718         in the next run loop (provided all pending JS execution has also completed). 
719         (WebCore::DocumentTimeline::maybeClearCachedCurrentTime):
720         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Schedule a display refresh monitor update if we are not suspended and have "relevant" animations.
721         (WebCore::DocumentTimeline::animationTimingDidChange): Call scheduleAnimationResolutionIfNeeded() after calling the superclass's implementation.
722         (WebCore::DocumentTimeline::removeAnimation): Call unscheduleAnimationResolution() if the list of "relevant" animations is now empty.
723         (WebCore::DocumentTimeline::unscheduleAnimationResolution): Unschedule a pending display refresh monitor update.
724         (WebCore::DocumentTimeline::animationResolutionTimerFired):
725         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Implement the "update animations and send events" procedure as specified by the Web Animations spec.
726         During this procedure, we call tick() on all animations listed in m_animations and create a list of animations to remove from that list if this animation is no
727         longer relevant following the call to tick().
728         (WebCore::DocumentTimeline::enqueueAnimationPlaybackEvent):
729         (WebCore::DocumentTimeline::timingModelDidChange): Deleted.
730         (WebCore::DocumentTimeline::scheduleInvalidationTaskIfNeeded): Deleted.
731         (WebCore::DocumentTimeline::performInvalidationTask): Deleted.
732         (WebCore::DocumentTimeline::updateAnimationSchedule): Deleted.
733         (WebCore::DocumentTimeline::animationScheduleTimerFired): Deleted.
734         (WebCore::DocumentTimeline::updateAnimations): Deleted.
735         (WebCore::compareAnimationPlaybackEvents): Deleted.
736         (WebCore::DocumentTimeline::performEventDispatchTask): Deleted.
737         * animation/DocumentTimeline.h:
738         * animation/WebAnimation.cpp: The majority of the changes to this class is that we call the new timingDidChange() method when any code that modifies the timing model
739         is run. We also remove methods to set the pending play and pause tasks as well as the animation's start time and hold time since any time we're changing these instance
740         variables, we later already have a call to update the timing model and we were doing more work than needed. As a result we no longer need an internal method to set the
741         start time and can stop requiring a custom IDL binding for the "startTime" property.
742         (WebCore::WebAnimation::effectTimingPropertiesDidChange):
743         (WebCore::WebAnimation::setEffect):
744         (WebCore::WebAnimation::setEffectInternal):
745         (WebCore::WebAnimation::setTimeline):
746         (WebCore::WebAnimation::setTimelineInternal):
747         (WebCore::WebAnimation::startTime const):
748         (WebCore::WebAnimation::setStartTime):
749         (WebCore::WebAnimation::silentlySetCurrentTime):
750         (WebCore::WebAnimation::setCurrentTime):
751         (WebCore::WebAnimation::setPlaybackRate):
752         (WebCore::WebAnimation::cancel):
753         (WebCore::WebAnimation::resetPendingTasks):
754         (WebCore::WebAnimation::finish):
755         (WebCore::WebAnimation::timingDidChange): New method called any time a timing property changed where we run the "update the finished state" procedure and notify the
756         animation's timeline that its timing changed so that it can be considered the next time the "update animations and send events" procedure runs.
757         (WebCore::WebAnimation::invalidateEffect):
758         (WebCore::WebAnimation::updateFinishedState): Update the animation's relevance after running the procedure as specified.
759         (WebCore::WebAnimation::play):
760         (WebCore::WebAnimation::runPendingPlayTask):
761         (WebCore::WebAnimation::pause):
762         (WebCore::WebAnimation::runPendingPauseTask):
763         (WebCore::WebAnimation::needsTick const):
764         (WebCore::WebAnimation::tick): New method called during the "update animations and send events" procedure where we run the "update the finished state" procedure and run
765         the pending play and pause tasks.
766         (WebCore::WebAnimation::resolve):
767         (WebCore::WebAnimation::updateRelevance):
768         (WebCore::WebAnimation::computeRelevance):
769         (WebCore::WebAnimation::timingModelDidChange): Deleted.
770         (WebCore::WebAnimation::setHoldTime): Deleted.
771         (WebCore::WebAnimation::bindingsStartTime const): Deleted.
772         (WebCore::WebAnimation::setBindingsStartTime): Deleted.
773         (WebCore::WebAnimation::setTimeToRunPendingPlayTask): Deleted.
774         (WebCore::WebAnimation::setTimeToRunPendingPauseTask): Deleted.
775         (WebCore::WebAnimation::updatePendingTasks): Deleted.
776         (WebCore::WebAnimation::timeToNextRequiredTick const): Deleted.
777         (WebCore::WebAnimation::runPendingTasks): Deleted.
778         (WebCore::WebAnimation::canBeListed const): Deleted.
779         * animation/WebAnimation.h:
780         (WebCore::WebAnimation::isRelevant const):
781         (WebCore::WebAnimation::hasPendingPlayTask const):
782         (WebCore::WebAnimation::isEffectInvalidationSuspended):
783         * animation/WebAnimation.idl:
784         * dom/Element.cpp:
785         (WebCore::Element::getAnimations): Use isRelevant() instead of canBeListed().
786
787 2018-10-30  Youenn Fablet  <youenn@apple.com>
788
789         LibWebRTCRtpReceiverBackend::getSynchronizationSources should use Vector::append
790         https://bugs.webkit.org/show_bug.cgi?id=191026
791
792         Reviewed by Eric Carlson.
793
794         Covered by updated test.
795
796         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
797         (WebCore::LibWebRTCRtpReceiverBackend::getSynchronizationSources const):
798
799 2018-10-30  Claudio Saavedra  <csaavedra@igalia.com>
800
801         [GTK][WPE] Fixes to the PublicSuffix implementation
802         https://bugs.webkit.org/show_bug.cgi?id=191031
803
804         Reviewed by Michael Catanzaro.
805
806         Covered by existing tests.
807
808         Downcase hostnames before passing it on to the underlying
809         libsoup API. Special case localhost and fix a mixed-up
810         libsoup GError checks. This fixes most of the failures.
811
812         * platform/soup/PublicSuffixSoup.cpp:
813         (WebCore::isPublicSuffix):
814         (WebCore::topPrivatelyControlledDomain):
815
816 2018-10-29  Zalan Bujtas  <zalan@apple.com>
817
818         Missing from r237549
819
820         * layout/blockformatting/BlockFormattingContext.cpp:
821         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
822         (WebCore::Layout::hasPrecomputedMarginTop):
823
824 2018-10-29  Ross Kirsling  <ross.kirsling@sony.com>
825
826         Unreviewed speculative build fix for AppleWin after r237559.
827
828         * PlatformAppleWin.cmake:
829
830 2018-10-29  Justin Michaud  <justin_michaud@apple.com>
831
832         Revert r237347 registered custom properties... https://bugs.webkit.org/show_bug.cgi?id=190039
833         https://bugs.webkit.org/show_bug.cgi?id=190919
834
835         Reviewed by Michael Saboff.
836
837         * css/CSSComputedStyleDeclaration.cpp:
838         (WebCore::ComputedStyleExtractor::customPropertyValue):
839         * css/CSSCustomPropertyValue.cpp:
840         (WebCore::CSSCustomPropertyValue::customCSSText const):
841         (WebCore::CSSCustomPropertyValue::tokens const):
842         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const):
843         (WebCore::CSSCustomPropertyValue::resolveVariableReferences const):
844         (WebCore::CSSCustomPropertyValue::setResolvedTypedValue):
845         (WebCore::CSSCustomPropertyValue::equals const): Deleted.
846         * css/CSSCustomPropertyValue.h:
847         * css/CSSRegisteredCustomProperty.cpp:
848         (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
849         * css/CSSRegisteredCustomProperty.h:
850         * css/CSSVariableData.cpp:
851         (WebCore::CSSVariableData::consumeAndUpdateTokens):
852         (WebCore::CSSVariableData::CSSVariableData):
853         (WebCore::CSSVariableData::checkVariablesForCycles const):
854         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const):
855         (WebCore::CSSVariableData::resolveVariableFallback const):
856         (WebCore::CSSVariableData::resolveVariableReference const):
857         (WebCore::CSSVariableData::resolveVariableReferences const):
858         (WebCore::CSSVariableData::resolveTokenRange const):
859         * css/CSSVariableData.h:
860         (WebCore::CSSVariableData::create):
861         (WebCore::CSSVariableData::createResolved):
862         (WebCore::CSSVariableData::needsVariableResolution const):
863         (WebCore::CSSVariableData::CSSVariableData):
864         * css/CSSVariableReferenceValue.cpp:
865         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const):
866         (WebCore::resolveVariableFallback): Deleted.
867         (WebCore::resolveVariableReference): Deleted.
868         (WebCore::resolveTokenRange): Deleted.
869         (WebCore::CSSVariableReferenceValue::resolveVariableReferences const): Deleted.
870         * css/CSSVariableReferenceValue.h:
871         (WebCore::CSSVariableReferenceValue::create):
872         (WebCore::CSSVariableReferenceValue::variableDataValue const):
873         (WebCore::CSSVariableReferenceValue::equals const):
874         * css/DOMCSSRegisterCustomProperty.cpp:
875         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
876         * css/PropertySetCSSStyleDeclaration.cpp:
877         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
878         * css/StyleBuilderCustom.h:
879         (WebCore::StyleBuilderCustom::applyInitialCustomProperty):
880         (WebCore::StyleBuilderCustom::applyValueCustomProperty):
881         * css/StyleProperties.cpp:
882         (WebCore::MutableStyleProperties::setCustomProperty):
883         * css/StyleProperties.h:
884         * css/StyleResolver.cpp:
885         (WebCore::StyleResolver::State::setStyle):
886         (WebCore::StyleResolver::styleForKeyframe):
887         (WebCore::StyleResolver::styleForPage):
888         (WebCore::StyleResolver::applyMatchedProperties):
889         (WebCore::StyleResolver::applyPropertyToCurrentStyle):
890         (WebCore::StyleResolver::applyProperty):
891         (WebCore::StyleResolver::resolvedVariableValue const):
892         (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
893         (WebCore::StyleResolver::CascadedProperties::Property::apply):
894         (WebCore::StyleResolver::applyCascadedProperties):
895         (WebCore::StyleResolver::applyCascadedCustomProperty): Deleted.
896         * css/StyleResolver.h:
897         * css/parser/CSSParser.cpp:
898         (WebCore::CSSParser::parseValueWithVariableReferences):
899         * css/parser/CSSParser.h:
900         * css/parser/CSSPropertyParser.cpp:
901         (WebCore::CSSPropertyParser::CSSPropertyParser):
902         (WebCore::CSSPropertyParser::parseValueStart):
903         (WebCore::CSSPropertyParser::parseSingleValue):
904         (WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue): Deleted.
905         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): Deleted.
906         (WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies): Deleted.
907         * css/parser/CSSPropertyParser.h:
908         * css/parser/CSSVariableParser.cpp:
909         (WebCore::CSSVariableParser::parseDeclarationValue):
910         * dom/ConstantPropertyMap.cpp:
911         (WebCore::ConstantPropertyMap::setValueForProperty):
912         (WebCore::variableDataForPositivePixelLength):
913         (WebCore::variableDataForPositiveDuration):
914         * rendering/style/RenderStyle.cpp:
915         (WebCore::RenderStyle::checkVariablesInCustomProperties):
916         * rendering/style/RenderStyle.h:
917         (WebCore::RenderStyle::setInheritedCustomPropertyValue):
918         (WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
919         * rendering/style/StyleCustomPropertyData.h:
920         (WebCore::StyleCustomPropertyData::operator== const):
921         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
922         (WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
923
924 2018-10-29  Youenn Fablet  <youenn@apple.com>
925
926         Handle MDNS resolution of candidates through libwebrtc directly
927         https://bugs.webkit.org/show_bug.cgi?id=190681
928
929         Reviewed by Eric Carlson.
930
931         Remove the previous MDNS resolution mechanism.
932         Instead, add support for the AsyncResolver mechanism added to libwebrtc.
933         Covered by current mdns webrtc test that is unflaked.
934
935         * Modules/mediastream/PeerConnectionBackend.cpp:
936         (WebCore::PeerConnectionBackend::addIceCandidate):
937         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
938         (WebCore::LibWebRTCProvider::createPeerConnection):
939         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
940         * testing/MockLibWebRTCPeerConnection.cpp:
941         (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
942         * testing/MockLibWebRTCPeerConnection.h:
943
944 2018-10-29  Devin Rousso  <drousso@apple.com>
945
946         Web Inspector: increase size limits for NetworkResourceData
947         https://bugs.webkit.org/show_bug.cgi?id=191034
948         <rdar://problem/45529852>
949
950         Reviewed by Joseph Pecoraro.
951
952         No tests since no new functionality.
953
954         * inspector/NetworkResourcesData.cpp:
955         All resources: 100MB => 200MB
956         Each resource:  10MB =>  50MB
957
958 2018-10-29  Tim Horton  <timothy_horton@apple.com>
959
960         Modernize WebKit nibs and lprojs for localization's sake
961         https://bugs.webkit.org/show_bug.cgi?id=190911
962         <rdar://problem/45349466>
963
964         Reviewed by Dan Bernstein.
965
966         * PlatformGTK.cmake:
967         * PlatformWPE.cmake:
968         * PlatformWin.cmake:
969         * WebCore.xcodeproj/project.pbxproj:
970         * en.lproj/Localizable.strings: Renamed from Source/WebCore/English.lproj/Localizable.strings.
971         * en.lproj/Localizable.stringsdict: Renamed from Source/WebCore/English.lproj/Localizable.stringsdict.
972         * en.lproj/mediaControlsLocalizedStrings.js: Renamed from Source/WebCore/English.lproj/mediaControlsLocalizedStrings.js.
973         * en.lproj/modern-media-controls-localized-strings.js: Renamed from Source/WebCore/English.lproj/modern-media-controls-localized-strings.js.
974         English->en
975
976 2018-10-29  Tim Horton  <timothy_horton@apple.com>
977
978         Make FindOptionsShowOverlay work on iOS
979         https://bugs.webkit.org/show_bug.cgi?id=190551
980
981         Reviewed by Andy Estes.
982
983         * platform/graphics/GraphicsContext.h:
984         Export some more GraphicsContext methods.
985
986 2018-10-29  Youenn Fablet  <youenn@apple.com>
987
988         Invalid ssrc value in the stats of type 'inbound-rtp'
989         https://bugs.webkit.org/show_bug.cgi?id=190826
990         <rdar://problem/45487435>
991
992         Reviewed by Eric Carlson.
993
994         Value was not initialized in WebCore if missing from libwebrtc.
995         Change value to an optional so that it will not appear if libwebrtc does not expose it.
996         Move integer/boolean values from being initialized to be optional so
997         that we do not expose them to JS if not exposed by libwebrtc.
998
999         Covered by updated tests.
1000
1001         * Modules/mediastream/RTCStatsReport.h:
1002
1003 2018-10-29  Jer Noble  <jer.noble@apple.com>
1004
1005         CRASH in CoreGraphics: ERROR_CGDataProvider_BufferIsNotBigEnough
1006         https://bugs.webkit.org/show_bug.cgi?id=190954
1007
1008         Reviewed by Simon Fraser.
1009
1010         Crash analyitics show that WebProcess will crash in ERROR_CGDataProvider_BufferIsNotBigEnough,
1011         which attempts to fetch the last byte in the image buffer in order to verify that the entire
1012         buffer is readable. Unfortunately, the stack trace generated by this crash does not identify
1013         what CGDataProvider is responsible for the not-big-enough buffer. In order to identify which
1014         CGDataProvider created by WebKit is responsible (if any), we will add our own version of
1015         ERROR_CGDataProvider_BufferIsNotBigEnough, called at CGDataProvider creation time, which should
1016         generate a crash within the responsible stack frame.
1017
1018         (This assumes that the issue is the wrong sized buffer at CGDataProvider creation time, and not
1019         that the buffer itself is reclaimed between creation time and access.)
1020
1021         * WebCore.xcodeproj/project.pbxproj:
1022         * platform/graphics/cg/GraphicsContext3DCG.cpp:
1023         (WebCore::GraphicsContext3D::paintToCanvas):
1024         * platform/graphics/cg/ImageBufferCG.cpp:
1025         (WebCore::ImageBuffer::ImageBuffer):
1026         (WebCore::ImageBuffer::toCFData const):
1027         (WebCore::cfData):
1028         * platform/graphics/cocoa/WebGLLayer.mm:
1029         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
1030         * platform/graphics/cv/PixelBufferConformerCV.cpp:
1031         (WebCore::CVPixelBufferGetBytePointerCallback):
1032         (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
1033         * platform/graphics/cg/ImageUtilitiesCG.h: Added.
1034         (WebCore::verifyImageBufferIsBigEnough):
1035
1036 2018-10-29  David Kilzer  <ddkilzer@apple.com>
1037
1038         Fix clang static analyzer warning in StyleBuilderConverter.h
1039         <https://webkit.org/b/190907>
1040
1041         Reviewed by Antti Koivisto.
1042
1043         Fix the following clang static warning in StyleBuilderConverter.h:
1044             Value stored to 'autoFlow' during its initialization is never read
1045
1046         * css/StyleBuilderConverter.h:
1047         (WebCore::StyleBuilderConverter::convertGridAutoFlow): Move
1048         assignment of RenderStyle::initialGridAutoFlow() to `default`
1049         case.  Make `CSSValueDense` consistent with other cases by
1050         assigning value to `autoFlow` instead of returning early.
1051
1052 2018-10-29  Youenn Fablet  <youenn@apple.com>
1053
1054         Guard H264 simulcast with a runtime flag
1055         https://bugs.webkit.org/show_bug.cgi?id=191025
1056
1057         Reviewed by Eric Carlson.
1058
1059         Add a runtime flag for H264 simulcast and enable libwebrtc field trial based on it.
1060         Covered by existing test.
1061
1062         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
1063         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
1064         * page/RuntimeEnabledFeatures.h:
1065         (WebCore::RuntimeEnabledFeatures::webRTCH264SimulcastEnabled const):
1066         (WebCore::RuntimeEnabledFeatures::setWebRTCH264SimulcastEnabled):
1067
1068 2018-10-29  Zalan Bujtas  <zalan@apple.com>
1069
1070         [LFC][IFC] Compute estimated margin top for inline formatting root's ancestors
1071         https://bugs.webkit.org/show_bug.cgi?id=191018
1072
1073         Reviewed by Antti Koivisto.
1074
1075         <div><img style="float: left"></div>
1076         This inline formatting context (root -> div) inherits the floating context from the parent block formatting context.
1077         Floats are added to the floating context relative to the floating context's root. In order to position this float properly we
1078         need to precompute the ancestor's margin top (stop at the block formatting root boundary).
1079
1080         Test: fast/inline/simple-intruding-floats3.html
1081
1082         * layout/blockformatting/BlockFormattingContext.cpp:
1083         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
1084
1085 2018-10-29  Zalan Bujtas  <zalan@apple.com>
1086
1087         [LFC] Add support for inflow non replaced content height when the box is an inline formatting root.
1088         https://bugs.webkit.org/show_bug.cgi?id=191011
1089
1090         Reviewed by Antti Koivisto.
1091
1092         // 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'
1093         // Height is the bottom edge of the last line box, if the box establishes a inline formatting context with one or more lines
1094
1095         This is temporary until after inline runs transition to the display tree.
1096
1097         Test: fast/inline/simple-intruding-floats2.html
1098
1099         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
1100         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
1101         * layout/inlineformatting/InlineRun.h:
1102         (WebCore::Layout::InlineRun::logicalLeft const):
1103         (WebCore::Layout::InlineRun::logicalRight const):
1104         (WebCore::Layout::InlineRun::logicalTop const):
1105         (WebCore::Layout::InlineRun::logicalBottom const):
1106         (WebCore::Layout::InlineRun::width const):
1107         (WebCore::Layout::InlineRun::height const):
1108         (WebCore::Layout::InlineRun::setWidth):
1109         (WebCore::Layout::InlineRun::setLogicalLeft):
1110         (WebCore::Layout::InlineRun::setLogicalRight):
1111         (WebCore::Layout::InlineRun::moveHorizontally):
1112         (WebCore::Layout::InlineRun::InlineRun):
1113         * layout/inlineformatting/Line.cpp:
1114         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
1115
1116 2018-10-29  Zalan Bujtas  <zalan@apple.com>
1117
1118         [LFC][IFC] Add support for simple intruding floats.
1119         https://bugs.webkit.org/show_bug.cgi?id=190998
1120
1121         Reviewed by Antti Koivisto.
1122
1123         In order to be able to figure out whether a float is intruding on a line, we need to provide the line's final vertical position.
1124         This vertical position must be in the same coordinate system as the float's position is. In case of intruding float,
1125         it is the parent block formatting root's coordinate system (that's where the float lives.)
1126
1127         Test: fast/inline/simple-intruding-float1.html
1128
1129         * layout/blockformatting/BlockFormattingContext.cpp:
1130         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1131         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
1132         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
1133         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
1134         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
1135         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
1136         * layout/blockformatting/BlockFormattingContext.h:
1137         * layout/floats/FloatingState.cpp:
1138         (WebCore::Layout::FloatingState::constraints const):
1139
1140 2018-10-29  Zalan Bujtas  <zalan@apple.com>
1141
1142         [LFC][IFC] Inline layout produces separate runs when float is present.
1143         https://bugs.webkit.org/show_bug.cgi?id=190980
1144
1145         Reviewed by Antti Koivisto.
1146
1147         <div>foo<img src="foobar.jpg" style="float: left">bar</div> produces 2 inline boxes (foo) and (bar) -> current inline code
1148         while it is really just one continuous run (foobar) -> LFC
1149         Adjust verification code to check for such runs.
1150
1151         * layout/Verification.cpp:
1152         (WebCore::Layout::checkForMatchingNonTextRuns):
1153         (WebCore::Layout::checkForMatchingTextRuns):
1154         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
1155         * layout/inlineformatting/InlineRun.h:
1156         (WebCore::Layout::InlineRun::textContext const):
1157
1158 2018-10-29  Youenn Fablet  <youenn@apple.com>
1159
1160         [WebRTC] Enable VP8 by default
1161         https://bugs.webkit.org/show_bug.cgi?id=190672
1162         <rdar://problem/43663785>
1163
1164         Reviewed by Eric Carlson.
1165
1166         No change of behavior.
1167
1168         * page/RuntimeEnabledFeatures.h: Set default value to true.
1169
1170 2018-10-28  Andy Estes  <aestes@apple.com>
1171
1172         [Payment Request] Implement MerchantValidationEvent.methodName
1173         https://bugs.webkit.org/show_bug.cgi?id=190058
1174
1175         Reviewed by Darin Adler.
1176
1177         Implemented MerchantValidationEvent's methodName attribute and MerchantValidationEventInit's
1178         methodName property as specified in the Payment Request API W3C Editor's Draft of
1179         27 September 2018.
1180
1181         Covered by web-platform-tests/payment-request/MerchantValidationEvent/constructor.https.html.
1182
1183         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
1184         (WebCore::ApplePayPaymentHandler::validateMerchant): Passed the payment method identifier
1185         (as a string) to MerchantValidationEvent::create()
1186         * Modules/paymentrequest/MerchantValidationEvent.cpp:
1187         (WebCore::MerchantValidationEvent::create): Validated the methodName before constructing the
1188         event, throwing a RangeError on failure.
1189         (WebCore::MerchantValidationEvent::MerchantValidationEvent):
1190         * Modules/paymentrequest/MerchantValidationEvent.h:
1191         * Modules/paymentrequest/MerchantValidationEvent.idl:
1192
1193 2018-10-27  Antoine Quint  <graouts@apple.com>
1194
1195         [Web Animations] Remove WebAnimation::description()
1196         https://bugs.webkit.org/show_bug.cgi?id=190995
1197
1198         Reviewed by Dean Jackson.
1199
1200         This method is never used.
1201
1202         * animation/WebAnimation.cpp:
1203         (WebCore::WebAnimation::description): Deleted.
1204         * animation/WebAnimation.h:
1205
1206 2018-10-27  Antoine Quint  <graouts@apple.com>
1207
1208         [Web Animations] Move the logic of Document::getAnimations() to DocumentTimeline
1209         https://bugs.webkit.org/show_bug.cgi?id=190994
1210
1211         Reviewed by Dean Jackson.
1212
1213         It would be cleaner to have the logic of document.getAnimations() on the DocumentTimeline instead of the Document, keep more
1214         animation-related code compartmentalized in the animation directory. No change in behavior, so no test update.
1215
1216         * animation/DocumentTimeline.cpp:
1217         (WebCore::DocumentTimeline::getAnimations const):
1218         * animation/DocumentTimeline.h:
1219         * dom/Document.cpp:
1220         (WebCore::Document::getAnimations):
1221
1222 2018-10-27  Antoine Quint  <graouts@apple.com>
1223
1224         [Web Animations] Move bindings methods requiring style flush from CSSAnimation to DeclarativeAnimation
1225         https://bugs.webkit.org/show_bug.cgi?id=190996
1226
1227         Reviewed by Dean Jackson.
1228
1229         Moving all of the IDL bindings methods that require flushing style from CSSAnimation to its superclass
1230         DeclarativeAnimation so we follow the same route in CSSTransition. Note that there was code in
1231         CSSAnimation::bindingsCurrentTime() that was not moved as it proved to not be necessary.
1232
1233         * animation/CSSAnimation.cpp:
1234         (WebCore::CSSAnimation::bindingsPlay):
1235         (WebCore::CSSAnimation::bindingsPause):
1236         (WebCore::CSSAnimation::bindingsStartTime const): Deleted.
1237         (WebCore::CSSAnimation::setBindingsStartTime): Deleted.
1238         (WebCore::CSSAnimation::bindingsCurrentTime const): Deleted.
1239         (WebCore::CSSAnimation::setBindingsCurrentTime): Deleted.
1240         (WebCore::CSSAnimation::bindingsPlayState const): Deleted.
1241         (WebCore::CSSAnimation::bindingsPending const): Deleted.
1242         (WebCore::CSSAnimation::bindingsReady): Deleted.
1243         (WebCore::CSSAnimation::bindingsFinished): Deleted.
1244         (WebCore::CSSAnimation::flushPendingStyleChanges const): Deleted.
1245         * animation/CSSAnimation.h:
1246         * animation/DeclarativeAnimation.cpp:
1247         (WebCore::DeclarativeAnimation::bindingsStartTime const):
1248         (WebCore::DeclarativeAnimation::setBindingsStartTime):
1249         (WebCore::DeclarativeAnimation::bindingsCurrentTime const):
1250         (WebCore::DeclarativeAnimation::setBindingsCurrentTime):
1251         (WebCore::DeclarativeAnimation::bindingsPlayState const):
1252         (WebCore::DeclarativeAnimation::bindingsPending const):
1253         (WebCore::DeclarativeAnimation::bindingsReady):
1254         (WebCore::DeclarativeAnimation::bindingsFinished):
1255         (WebCore::DeclarativeAnimation::bindingsPlay):
1256         (WebCore::DeclarativeAnimation::bindingsPause):
1257         (WebCore::DeclarativeAnimation::flushPendingStyleChanges const):
1258         * animation/DeclarativeAnimation.h:
1259
1260 2018-10-27  Charlie Turner  <cturner@igalia.com>
1261
1262         [EME] Add a logging macro
1263         https://bugs.webkit.org/show_bug.cgi?id=190984
1264
1265         Reviewed by Xabier Rodriguez-Calvar.
1266
1267         No tests since no new functionality.
1268
1269         * Modules/encryptedmedia/MediaKeySession.cpp:
1270         (WebCore::MediaKeySession::MediaKeySession):
1271         (WebCore::MediaKeySession::generateRequest):
1272         (WebCore::MediaKeySession::update):
1273         (WebCore::MediaKeySession::close):
1274         (WebCore::MediaKeySession::remove):
1275         (WebCore::MediaKeySession::sessionClosed):
1276         * Modules/encryptedmedia/MediaKeys.cpp:
1277         (WebCore::MediaKeys::createSession):
1278         * Modules/encryptedmedia/NavigatorEME.cpp:
1279         (WebCore::NavigatorEME::requestMediaKeySystemAccess):
1280         * platform/Logging.h:
1281
1282 2018-10-27  Xabier Rodriguez Calvar  <calvaris@igalia.com>
1283
1284         [GStreamer][EME] Post key received to bus should be done before waking up other threads
1285         https://bugs.webkit.org/show_bug.cgi?id=190822
1286
1287         Reviewed by Philippe Normand.
1288
1289         Notify after posting message to bus.
1290
1291         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
1292         (webkitMediaCommonEncryptionDecryptSinkEventHandler):
1293
1294 2018-10-27  Charlie Turner  <cturner@igalia.com>
1295
1296         Fix release build with -DLOG_DISABLED=0
1297         https://bugs.webkit.org/show_bug.cgi?id=190866
1298
1299         Reviewed by Xabier Rodriguez-Calvar.
1300
1301         No new tests since no functionality changed.
1302
1303         * platform/graphics/Font.cpp:
1304         * platform/graphics/Font.h:
1305         * platform/graphics/FontPlatformData.h:
1306         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1307         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
1308         * platform/graphics/win/FontPlatformDataWin.cpp:
1309
1310 2018-10-26  Commit Queue  <commit-queue@webkit.org>
1311
1312         Unreviewed, rolling out r237458.
1313         https://bugs.webkit.org/show_bug.cgi?id=190973
1314
1315         broke internal iOS builds (Requested by zalan on #webkit).
1316
1317         Reverted changeset:
1318
1319         "Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI"
1320         https://bugs.webkit.org/show_bug.cgi?id=190951
1321         https://trac.webkit.org/changeset/237458
1322
1323 2018-10-26  Antoine Quint  <graouts@apple.com>
1324
1325         [Web Animations] Remove useless internals methods
1326         https://bugs.webkit.org/show_bug.cgi?id=190968
1327
1328         Reviewed by Dean Jackson.
1329
1330         We had a few internals methods added early on in the Web Animations implementation that are no longer
1331         relevant now that the full API is implemented. We can safely remove them now.
1332
1333         * animation/AnimationTimeline.cpp:
1334         (WebCore::AnimationTimeline::setCurrentTime): Deleted.
1335         (WebCore::AnimationTimeline::description): Deleted.
1336         * animation/AnimationTimeline.h:
1337         (WebCore::AnimationTimeline::currentTime):
1338         (WebCore::AnimationTimeline::pause): Deleted.
1339         * animation/DocumentTimeline.cpp:
1340         (WebCore::DocumentTimeline::currentTime):
1341         (WebCore::DocumentTimeline::pause): Deleted.
1342         * animation/DocumentTimeline.h:
1343         * testing/Internals.cpp:
1344         (WebCore::Internals::timelineDescription): Deleted.
1345         (WebCore::Internals::pauseTimeline): Deleted.
1346         (WebCore::Internals::setTimelineCurrentTime): Deleted.
1347         * testing/Internals.h:
1348         * testing/Internals.idl:
1349
1350 2018-10-26  Antoine Quint  <graouts@apple.com>
1351
1352         Web Inspector: Crash in http/tests/inspector/network/resource-response-source-memory-cache-revalidate-expired-only.html
1353         https://bugs.webkit.org/show_bug.cgi?id=190955
1354
1355         Reviewed by Dean Jackson.
1356
1357         We can get in situations when running tests where runtime flags are not consistent throughout the time a test is run since
1358         showing the Web Inspector can cause flags to be re-set after the initial test was loaded. As such, to avoid crashes due to
1359         the ASSERT(!frame().animation().hasAnimations()) in FrameView::didDestroyRenderTree(), we now cancel animations upon teardown
1360         no matter what the value of the runtime flag for the Web Animations CSS Integration on both the DocumentTimeline (if it exists)
1361         and the CSSAnimationController.
1362
1363         * dom/Element.cpp:
1364         (WebCore::Element::removedFromAncestor):
1365         * dom/PseudoElement.cpp:
1366         (WebCore::PseudoElement::clearHostElement):
1367         * page/FrameView.cpp:
1368         (WebCore::FrameView::didDestroyRenderTree):
1369         * rendering/updating/RenderTreeUpdater.cpp:
1370         (WebCore::RenderTreeUpdater::tearDownRenderers):
1371
1372 2018-10-26  Timothy Hatcher  <timothy@apple.com>
1373
1374         Use dark appearance scrollbar when page background is dark or document supports dark mode.
1375         https://bugs.webkit.org/show_bug.cgi?id=190937
1376         rdar://problem/41225839
1377
1378         Reviewed by Beth Dakin.
1379
1380         * page/FrameView.cpp:
1381         (WebCore::FrameView::useDarkAppearance const): Added. Ask the document.
1382         (WebCore::FrameView::paintScrollCorner): Set LocalDefaultSystemAppearance based
1383         on the scrollbar overlay style too.
1384         * page/FrameView.h:
1385         * platform/ScrollableArea.h:
1386         (WebCore::ScrollableArea::useDarkAppearance const): Added. Default to false.
1387         * platform/mac/ScrollAnimatorMac.mm:
1388         (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Added.
1389         Ask the ScrollableArea if a dark appearance is desired.
1390
1391 2018-10-26  Antti Koivisto  <antti@apple.com>
1392
1393         Use random() instead of begin() to limit cache sizes
1394         https://bugs.webkit.org/show_bug.cgi?id=190957
1395
1396         Reviewed by Chris Dumez.
1397
1398         We currently use cache.remove(cache.begin()) pattern to limit sized of various caches.
1399         This is a bad pattern for tables that never rehash (because they have fixed maximum size) as most of the
1400         keys get permanently stuck in the table.
1401
1402         * css/CSSValuePool.cpp:
1403         (WebCore::CSSValuePool::createColorValue):
1404         (WebCore::CSSValuePool::createFontFamilyValue):
1405         (WebCore::CSSValuePool::createFontFaceValue):
1406         * dom/InlineStyleSheetOwner.cpp:
1407         (WebCore::InlineStyleSheetOwner::createSheet):
1408         * dom/SelectorQuery.cpp:
1409         * platform/graphics/FontCascade.cpp:
1410         (WebCore::retrieveOrAddCachedFonts):
1411         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1412         (WebCore::shouldAutoActivateFontIfNeeded):
1413         * platform/mac/PublicSuffixMac.mm:
1414         (WebCore::topPrivatelyControlledDomain):
1415
1416 2018-10-26  Jer Noble  <jer.noble@apple.com>
1417
1418         Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
1419         https://bugs.webkit.org/show_bug.cgi?id=190951
1420         <rdar://problem/45213065>
1421
1422         Reviewed by Alex Christensen.
1423
1424         Request the correct route policy and context from the VideoFullscreenModel.
1425
1426         * platform/cocoa/VideoFullscreenModel.h:
1427         (WebCore::VideoFullscreenModel::requestRouteSharingPolicyAndContextUID):
1428         * platform/cocoa/VideoFullscreenModelVideoElement.h:
1429         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
1430         (WebCore::VideoFullscreenModelVideoElement::requestRouteSharingPolicyAndContextUID):
1431         * platform/ios/VideoFullscreenInterfaceAVKit.h:
1432         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
1433         (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
1434         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
1435         (VideoFullscreenInterfaceAVKit::doSetup):
1436
1437 2018-10-26  Zalan Bujtas  <zalan@apple.com>
1438
1439         [LFC][IFC] Add more inline information to outputLayoutTree
1440         https://bugs.webkit.org/show_bug.cgi?id=190945
1441
1442         Reviewed by Antti Koivisto.
1443
1444         * layout/layouttree/LayoutTreeBuilder.cpp:
1445         (WebCore::Layout::outputInlineRuns):
1446         (WebCore::Layout::outputLayoutBox):
1447
1448 2018-10-26  Zalan Bujtas  <zalan@apple.com>
1449
1450         [LFC][IFC] Layout floats as part of the inline content
1451         https://bugs.webkit.org/show_bug.cgi?id=190942
1452
1453         Reviewed by Antti Koivisto.
1454
1455         Add float handling to InlineFormattingContext::layoutInlineContent.
1456         Note that floats don't actually generate inline runs.
1457
1458         Test: fast/block/basic/inline-content-with-floating-image.html
1459
1460         * layout/blockformatting/BlockFormattingContext.cpp:
1461         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1462         * layout/floats/FloatAvoider.cpp:
1463         (WebCore::Layout::FloatAvoider::FloatAvoider): Check if any mapping is needed.
1464         * layout/inlineformatting/InlineFormattingContext.cpp:
1465         (WebCore::Layout::isTrimmableContent):
1466         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
1467         (WebCore::Layout::trimLeadingRun): Deleted.
1468         * layout/inlineformatting/InlineFormattingContext.h:
1469         (WebCore::Layout::InlineFormattingContext::Line::isClosed const):
1470         * layout/inlineformatting/Line.cpp:
1471         (WebCore::Layout::InlineFormattingContext::Line::init):
1472         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
1473         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight):
1474         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
1475         (WebCore::Layout::InlineFormattingContext::Line::close):
1476
1477 2018-10-26  Zalan Bujtas  <zalan@apple.com>
1478
1479         [LFC][IFC] Adjust current line with float constraints.
1480         https://bugs.webkit.org/show_bug.cgi?id=190940
1481
1482         Reviewed by Antti Koivisto.
1483
1484         * layout/inlineformatting/InlineFormattingContext.cpp:
1485         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
1486         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
1487         * layout/inlineformatting/InlineFormattingContext.h:
1488         * layout/inlineformatting/InlineRun.h:
1489         (WebCore::Layout::InlineRun::moveHorizontally):
1490         * layout/inlineformatting/Line.cpp:
1491         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
1492         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight):
1493
1494 2018-10-26  Zalan Bujtas  <zalan@apple.com>
1495
1496         [LFC][IFC] Compute float box size and position
1497         https://bugs.webkit.org/show_bug.cgi?id=190938
1498
1499         Reviewed by Antti Koivisto.
1500
1501         * layout/inlineformatting/InlineFormattingContext.cpp:
1502         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const):
1503         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
1504         * layout/inlineformatting/InlineFormattingContext.h:
1505
1506 2018-10-26  Zalan Bujtas  <zalan@apple.com>
1507
1508         [LFC][IFC] Add line logical top and bottom
1509         https://bugs.webkit.org/show_bug.cgi?id=190934
1510
1511         Reviewed by Antti Koivisto.
1512
1513         * layout/inlineformatting/InlineFormattingContext.cpp:
1514         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
1515         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
1516         * layout/inlineformatting/InlineFormattingContext.h:
1517         (WebCore::Layout::InlineFormattingContext::Line::isFirstLine const):
1518         (WebCore::Layout::InlineFormattingContext::Line::logicalTop const):
1519         (WebCore::Layout::InlineFormattingContext::Line::logicalBottom const):
1520         * layout/inlineformatting/Line.cpp:
1521         (WebCore::Layout::InlineFormattingContext::Line::init):
1522         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight):
1523         (WebCore::Layout::InlineFormattingContext::Line::close):
1524
1525 2018-10-26  Zalan Bujtas  <zalan@apple.com>
1526
1527         [LFC][IFC] Find floating constraints for a given vertical position
1528         https://bugs.webkit.org/show_bug.cgi?id=190928
1529
1530         Reviewed by Antti Koivisto.
1531
1532         https://www.w3.org/TR/CSS22/visuren.html#inline-formatting
1533
1534         "In general, the left edge of a line box touches the left edge of its containing block and the right edge touches the right edge of its containing block.
1535         However, floating boxes may come between the containing block edge and the line box edge.
1536         Thus, although line boxes in the same inline formatting context generally have the same width
1537         (that of the containing block), they may vary in width if available horizontal space is reduced due to floats."
1538
1539         This patch adds support for retrieving left/right constraints for a given line (vertical position).
1540
1541         * layout/floats/FloatingState.cpp:
1542         (WebCore::Layout::FloatingState::constraints const):
1543         * layout/floats/FloatingState.h:
1544
1545 2018-10-26  Zalan Bujtas  <zalan@apple.com>
1546
1547         [LFC] Inline formatting context has higher priority than block
1548         https://bugs.webkit.org/show_bug.cgi?id=190924
1549
1550         Reviewed by Antti Koivisto.
1551
1552         When an element establishes both inline and block formatting contexts, we need to pick one to
1553         create (and we choose the content driven formatting type (inline)). See example below:
1554
1555         <div style="overflow: hidden">This text should be inside an inlines formatting context.</div>
1556
1557         * layout/LayoutContext.cpp:
1558         (WebCore::Layout::LayoutContext::formattingContext const):
1559
1560 2018-10-26  Ali Juma  <ajuma@chromium.org>
1561
1562         REGRESSION (r237255): Text selection is broken in form fields
1563         https://bugs.webkit.org/show_bug.cgi?id=190899
1564
1565         Reviewed by Ryosuke Niwa.
1566
1567         Fix missing negation when checking for a fully-clipped-out rect. This was causing
1568         RenderObject::computeVisibleRectInContainer to incorrectly early-out.
1569
1570         Test: fast/repaint/text-selection-overflow-hidden.html
1571
1572         * rendering/RenderObject.cpp:
1573         (WebCore::RenderObject::computeVisibleRectInContainer const):
1574
1575 2018-10-25  Chris Dumez  <cdumez@apple.com>
1576
1577         [PSON] Navigating cross-site with locked history but unlocked back/forward list fails to create a new BackForwardListItem
1578         https://bugs.webkit.org/show_bug.cgi?id=190915
1579         <rdar://problem/45059069>
1580
1581         Reviewed by Geoffrey Garen.
1582
1583         * history/PageCache.cpp:
1584         (WebCore::canCacheFrame):
1585         Make sure we do not put into PageCache a page whose main frame is showing the initial empty document.
1586         We usually do not try to put those into PageCache because we do not have a HistoryItem to save the
1587         PageCache entry on. However, when we process-swap on a navigation with the history locked, the new
1588         process has a HistoryItem and is initially showing the initial empty document before continuing
1589         the load from the previous process. Note that saving the initial empty document in PageCache would
1590         lead to crashes later on previous the initial empty document's Window is taken and reused for the
1591         next load.
1592
1593         * loader/FrameLoader.cpp:
1594         (WebCore::FrameLoader::load):
1595         Stop assuming that we're continuing a client-side redirect when lockHistory is Yes. It is
1596         lockBackForwardList that is actually Yes when we're doing a client-side redirect.
1597
1598         * loader/PolicyChecker.cpp:
1599         (WebCore::PolicyChecker::checkNavigationPolicy):
1600         Stop using calling the completion handler with an invalid URL when the policy decision is 'Suspend' and
1601         use 'about:blank' instead. Without this change, FrameLoader::continueLoadAfterNavigationPolicy() would
1602         not load 'about:blank' when its AllowNavigationToInvalidURL parameter is No.
1603
1604 2018-10-25  Devin Rousso  <drousso@apple.com>
1605
1606         Fix build after r237431 for platforms that don't support FULLSCREEN_API
1607
1608         Reviewed by Joseph Pecoraro.
1609
1610         No new tests. No change in behavior.
1611
1612         * inspector/agents/InspectorDOMAgent.cpp:
1613         (WebCore::InspectorDOMAgent::addEventListenersToNode):
1614
1615 2018-10-25  Devin Rousso  <drousso@apple.com>
1616
1617         Web Inspector: display fullscreen enter/exit events in Timelines and Network node waterfalls
1618         https://bugs.webkit.org/show_bug.cgi?id=189874
1619         <rdar://problem/44700000>
1620
1621         Reviewed by Joseph Pecoraro.
1622
1623         Updated existing test: http/tests/inspector/dom/didFireEvent.html
1624
1625         * inspector/agents/InspectorDOMAgent.h:
1626         * inspector/agents/InspectorDOMAgent.cpp:
1627         (WebCore::EventFiredCallback::handleEvent):
1628         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
1629         (WebCore::InspectorDOMAgent::addEventListenersToNode):
1630         (WebCore::InspectorDOMAgent::discardBindings):
1631         (WebCore::InspectorDOMAgent::eventDidResetAfterDispatch): Added.
1632         Prevent the same event from being sent to the frontend more than once.
1633
1634         * dom/Event.cpp:
1635         (WebCore::Event::resetAfterDispatch):
1636
1637         * dom/Document.cpp:
1638         (WebCore::Document::Document):
1639
1640         * inspector/InspectorInstrumentation.h:
1641         (WebCore::InspectorInstrumentation::eventDidResetAfterDispatch): Added.
1642         * inspector/InspectorInstrumentation.cpp:
1643         (WebCore::InspectorInstrumentation::eventDidResetAfterDispatchImpl): Added.
1644
1645 2018-10-25  Michael Catanzaro  <mcatanzaro@igalia.com>
1646
1647         Unreviewed, silence a -Wreturn-type warning
1648
1649         When every return is supposed to be covered by a switch statement, a release assert or CRASH
1650         is required by GCC.
1651
1652         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
1653         (WebCore::LibWebRTCCertificateGenerator::keyParamsFromCertificateType):
1654
1655 2018-10-25  Antoine Quint  <graouts@apple.com>
1656
1657         [Web Animations] Turn Web Animations CSS Integration off by default
1658         https://bugs.webkit.org/show_bug.cgi?id=190901
1659
1660         Reviewed by Dean Jackson.
1661
1662         * page/RuntimeEnabledFeatures.h:
1663
1664 2018-10-25  Jon Davis  <jond@apple.com>
1665
1666         Changed "Under Development" status to use "In Development" instead
1667         https://bugs.webkit.org/show_bug.cgi?id=187615
1668
1669         Reviewed by Joseph Pecoraro.
1670
1671         * features.json: Updated CSS Painting API Level 1 and CSS Properties and Values API Level 1.
1672
1673 2018-10-25  Chris Dumez  <cdumez@apple.com>
1674
1675         REGRESSION (236779) scandinaviandesigns.com product pages auto redirect to product image
1676         https://bugs.webkit.org/show_bug.cgi?id=190891
1677         <rdar://problem/45296796>
1678
1679         Reviewed by Antti Koivisto.
1680
1681         When a radio element gets clicked, we should only fire the 'input' and 'change' if the checked state
1682         of the radio element has changed.
1683
1684         Test: fast/dom/HTMLInputElement/radio-element-fires-change-event-only-when-checked-state-changes.html
1685
1686         * html/RadioInputType.cpp:
1687         (WebCore::RadioInputType::didDispatchClick):
1688
1689 2018-10-25  Joseph Pecoraro  <pecoraro@apple.com>
1690
1691         InspectorCanvas is not getting cleared properly for OffscreenCanvas
1692         https://bugs.webkit.org/show_bug.cgi?id=190894
1693         <rdar://problem/45498435>
1694
1695         Reviewed by Simon Fraser.
1696
1697         Covered by existing tests not crashing with guard malloc.
1698
1699         InspectorCanvasAgents tracks all CanvasRenderingContexts and needs to
1700         remove its reference when the containing CanvasBase goes away. It does
1701         this by registering as a notification observer, but if it can't map
1702         from the CanvasBase back to the rendering context we were failing to
1703         remove our reference. Enforce CanvasBase classes to notify observers
1704         of destruction while they still have their CanvasRenderingContext.
1705
1706         * html/CanvasBase.cpp:
1707         (WebCore::CanvasBase::~CanvasBase):
1708         (WebCore::CanvasBase::notifyObserversCanvasDestroyed):
1709         * html/CanvasBase.h:
1710         Assert that subclasses notify observers of the canvas being destroyed,
1711         since they will need to do this before m_context is cleared.
1712
1713         * html/CustomPaintCanvas.cpp:
1714         (WebCore::CustomPaintCanvas::~CustomPaintCanvas):
1715         * html/OffscreenCanvas.cpp:
1716         (WebCore::OffscreenCanvas::~OffscreenCanvas):
1717         Follow the new expected pattern of notifying observers before clearing
1718         the context. HTMLCanvasElement already followed this pattern.
1719
1720         * inspector/agents/InspectorCanvasAgent.cpp:
1721         (WebCore::InspectorCanvasAgent::canvasDestroyed):
1722         Add an assertion that would catch this earlier.
1723
1724 2018-10-24  Alexey Proskuryakov  <ap@apple.com>
1725
1726         Clean up some obsolete macOS version guards
1727         https://bugs.webkit.org/show_bug.cgi?id=190887
1728
1729         Reviewed by Dan Bernstein.
1730
1731         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1732         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
1733         (WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime const):
1734         (WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck const):
1735         (WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const):
1736
1737 2018-10-24  Tim Horton  <timothy_horton@apple.com>
1738
1739         Attachment filenames with RTL characters should format similar to Finder
1740         https://bugs.webkit.org/show_bug.cgi?id=190736
1741         <rdar://problem/44735946>
1742
1743         Reviewed by Dan Bernstein.
1744
1745         Test: fast/attachment/attachment-title-with-rtl.html
1746
1747         * html/HTMLAttachmentElement.cpp:
1748         (WebCore::HTMLAttachmentElement::attachmentTitleForDisplay const):
1749         * html/HTMLAttachmentElement.h:
1750         Add attachmentTitleForDisplay(), which wraps the non-extension part of
1751         attachmentTitle in BiDi isolates, matching Finder's behavior.
1752
1753         * rendering/RenderThemeIOS.mm:
1754         (WebCore::RenderAttachmentInfo::buildWrappedLines):
1755         (WebCore::RenderAttachmentInfo::RenderAttachmentInfo):
1756         * rendering/RenderThemeMac.mm:
1757         (WebCore::AttachmentLayout::layOutTitle):
1758         Adopt attachmentTitleForDisplay, and ask CoreText to use a subrange of
1759         the original string for the last line, instead of splitting the string
1760         ourselves. This ensures that BiDi control characters are respected
1761         even in the last line of the string.
1762
1763 2018-10-24  Megan Gardner  <megan_gardner@apple.com>
1764
1765         Turn on Conic Gradients
1766         https://bugs.webkit.org/show_bug.cgi?id=190810
1767
1768         Reviewed by Tim Horton.
1769
1770         Added tests previously, only switching feature from experimental to always avaiable.
1771
1772         * Configurations/FeatureDefines.xcconfig:
1773         * css/parser/CSSParserContext.cpp:
1774         (WebCore::CSSParserContext::CSSParserContext):
1775         (WebCore::operator==):
1776         * css/parser/CSSParserContext.h:
1777         (WebCore::CSSParserContextHash::hash):
1778         * css/parser/CSSPropertyParserHelpers.cpp:
1779         (WebCore::CSSPropertyParserHelpers::consumeConicGradient):
1780         * page/Settings.yaml:
1781
1782 2018-10-11  Jiewen Tan  <jiewen_tan@apple.com>
1783
1784         Only report resource timing to parent frame for the first iframe load
1785         https://bugs.webkit.org/show_bug.cgi?id=190498
1786         <rdar://problem/44347398>
1787
1788         Reviewed by Youenn Fablet.
1789
1790         Only the first iframe navigation or the first iframe navigation after about:blank should be reported.
1791         https://www.w3.org/TR/resource-timing-2/#resources-included-in-the-performanceresourcetiming-interface
1792
1793         Test: http/tests/misc/resource-timing-navigation-in-restored-iframe.html
1794
1795         * loader/FrameLoader.cpp:
1796         (WebCore::FrameLoader::loadWithDocumentLoader):
1797         * loader/FrameLoader.h:
1798         (WebCore::FrameLoader::shouldReportResourceTimingToParentFrame):
1799         (WebCore::FrameLoader::setShouldReportResourceTimingToParentFrame): Deleted.
1800         * loader/ResourceTimingInformation.cpp:
1801         (WebCore::ResourceTimingInformation::addResourceTiming):
1802
1803 2018-10-24  Brent Fulgham  <bfulgham@apple.com>
1804
1805         Cure Windows Direct2D Backend of a nasty case of bitrot
1806         https://bugs.webkit.org/show_bug.cgi?id=190875
1807         <rdar://problem/45523268>
1808         
1809         Reviewed by Zalan Bujtas.
1810
1811         The Direct2D backend has drifted out of date with the rest of WebKit.
1812         This patch updates things so we can get a runnable build.
1813         
1814         * platform/graphics/FontPlatformData.h:
1815         * platform/graphics/ImageBuffer.cpp:
1816         (WebCore::ImageBuffer::create):
1817         * platform/graphics/ImageBuffer.h:
1818         * platform/graphics/ImageDecoder.h:
1819         * platform/graphics/ImageSource.cpp:
1820         (WebCore::ImageSource::setTargetContext):
1821         * platform/graphics/opentype/OpenTypeMathData.cpp:
1822         (WebCore::OpenTypeMathData::OpenTypeMathData): Need non-default constructor to make Visual
1823         Studio happy.
1824         * platform/graphics/win/GradientDirect2D.cpp:
1825         (WebCore::Gradient::generateGradient):
1826         * platform/graphics/win/GraphicsContextDirect2D.cpp: Update for new display list implementation.
1827         (WebCore::GraphicsContextPlatformPrivate::setAlpha):
1828         (WebCore::GraphicsContext::savePlatformState):
1829         (WebCore::GraphicsContext::restorePlatformState):
1830         (WebCore::GraphicsContext::drawNativeImage):
1831         (WebCore::GraphicsContext::drawPattern):
1832         (WebCore::GraphicsContext::drawRect):
1833         (WebCore::GraphicsContext::drawLine):
1834         (WebCore::GraphicsContext::drawEllipse):
1835         (WebCore::GraphicsContext::drawPath):
1836         (WebCore::GraphicsContext::fillPath):
1837         (WebCore::GraphicsContext::strokePath):
1838         (WebCore::GraphicsContext::fillRect):
1839         (WebCore::GraphicsContext::platformFillRoundedRect):
1840         (WebCore::GraphicsContext::fillRectWithRoundedHole):
1841         (WebCore::GraphicsContext::clip):
1842         (WebCore::GraphicsContext::clipOut):
1843         (WebCore::GraphicsContext::clipPath):
1844         (WebCore::GraphicsContext::clipBounds const):
1845         (WebCore::GraphicsContext::beginPlatformTransparencyLayer):
1846         (WebCore::GraphicsContext::endPlatformTransparencyLayer):
1847         (WebCore::GraphicsContext::setMiterLimit):
1848         (WebCore::GraphicsContext::clearRect):
1849         (WebCore::GraphicsContext::strokeRect):
1850         (WebCore::GraphicsContext::setLineCap):
1851         (WebCore::GraphicsContext::setLineDash):
1852         (WebCore::GraphicsContext::setLineJoin):
1853         (WebCore::GraphicsContext::scale):
1854         (WebCore::GraphicsContext::rotate):
1855         (WebCore::GraphicsContext::translate):
1856         (WebCore::GraphicsContext::concatCTM):
1857         (WebCore::GraphicsContext::setCTM):
1858         (WebCore::GraphicsContext::getCTM const):
1859         (WebCore::GraphicsContext::roundToDevicePixels):
1860         (WebCore::GraphicsContext::drawLinesForText):
1861         (WebCore::GraphicsContext::setURLForRect):
1862         (WebCore::GraphicsContext::setIsCALayerContext):
1863         (WebCore::GraphicsContext::isCALayerContext const):
1864         (WebCore::GraphicsContext::setIsAcceleratedContext):
1865         (WebCore::GraphicsContext::isAcceleratedContext const):
1866         (WebCore::GraphicsContext::setPlatformShouldAntialias):
1867         (WebCore::GraphicsContext::setPlatformShouldSmoothFonts):
1868         (WebCore::GraphicsContext::setPlatformCompositeOperation):
1869         (WebCore::GraphicsContext::platformFillEllipse):
1870         (WebCore::GraphicsContext::platformStrokeEllipse):
1871         * platform/graphics/win/GraphicsLayerDirect2D.cpp:
1872         (WebCore::GraphicsLayer::create):
1873         (): Deleted.
1874         * platform/graphics/win/ImageBufferDataDirect2D.cpp:
1875         (WebCore::ImageBufferData::putData):
1876         * platform/graphics/win/ImageBufferDataDirect2D.h:
1877         * platform/graphics/win/ImageBufferDirect2D.cpp:
1878         (WebCore::ImageBuffer::createCompatibleBuffer):
1879         (WebCore::ImageBuffer::ImageBuffer):
1880         * platform/graphics/win/ImageDecoderDirect2D.cpp:
1881         (WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties const):
1882         (WebCore::ImageDecoderDirect2D::encodedDataStatus const):
1883         (WebCore::ImageDecoderDirect2D::repetitionCount const):
1884         (WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const):
1885         (WebCore::ImageDecoderDirect2D::frameDurationAtIndex const):
1886         (WebCore::ImageDecoderDirect2D::frameAllowSubsamplingAtIndex const):
1887         (WebCore::ImageDecoderDirect2D::frameHasAlphaAtIndex const):
1888         (WebCore::ImageDecoderDirect2D::createFrameImageAtIndex):
1889         (WebCore::ImageDecoderDirect2D::setData):
1890         (WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties): Deleted.
1891         (WebCore::ImageDecoderDirect2D::createFrameImageAtIndex const): Deleted.
1892         * platform/graphics/win/ImageDecoderDirect2D.h:
1893         * platform/graphics/win/ImageDirect2D.cpp:
1894         (WebCore::BitmapImage::drawFrameMatchingSourceSize):
1895         * platform/graphics/win/PatternDirect2D.cpp:
1896         (WebCore::Pattern::createPlatformPattern const):
1897
1898 2018-10-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
1899
1900         Cleanup: MIMETypeRegistry functions
1901         https://bugs.webkit.org/show_bug.cgi?id=190838
1902
1903         Reviewed by Simon Fraser.
1904
1905         Modernize the initialization of the lists in MIMETypeRegistry. Make the
1906         functions that return these list be self-contained. Use NeverDestroy<> to
1907         allocate the local static variable. Use std::initializer_list() and
1908         makeNeverDestroyed() to initialize NeverDestroy<> variables only once.
1909
1910         supportedImageResourceMIMETypes will be deleted and all the calls to it 
1911         will be replaced by supportedImageMIMETypes because they are identical.
1912
1913         * loader/archive/ArchiveFactory.cpp:
1914         (WebCore::ArchiveFactory::registerKnownArchiveMIMETypes): This function
1915         is called while initializing the supportedNonImageMIMETypes(). So it
1916         should not have a direct call to it. Instead, supportedNonImageMIMETypes
1917         is passed to it.
1918         * loader/archive/ArchiveFactory.h:
1919         * platform/MIMETypeRegistry.cpp:
1920         (WebCore::MIMETypeRegistry::supportedImageMIMETypes):
1921         (WebCore::supportedImageMIMETypesForEncoding):
1922         (WebCore::supportedJavaScriptMIMETypes):
1923         (WebCore::MIMETypeRegistry::supportedNonImageMIMETypes):
1924         (WebCore::MIMETypeRegistry::supportedMediaMIMETypes):
1925         (WebCore::pdfMIMETypes):
1926         (WebCore::MIMETypeRegistry::unsupportedTextMIMETypes):
1927         (WebCore::MIMETypeRegistry::isSupportedImageMIMEType):
1928         (WebCore::MIMETypeRegistry::isSupportedImageMIMETypeForEncoding):
1929         (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType):
1930         (WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType):
1931         (WebCore::MIMETypeRegistry::isSupportedMediaMIMEType):
1932         (WebCore::MIMETypeRegistry::isUnsupportedTextMIMEType):
1933         (WebCore::MIMETypeRegistry::isPDFMIMEType):
1934         (WebCore::MIMETypeRegistry::systemPreviewMIMETypes):
1935         (WebCore::MIMETypeRegistry::isSystemPreviewMIMEType):
1936         (WebCore::initializeSupportedImageMIMETypes): Deleted.
1937         (WebCore::initializeSupportedImageMIMETypesForEncoding): Deleted.
1938         (WebCore::initializeSupportedJavaScriptMIMETypes): Deleted.
1939         (WebCore::initializePDFMIMETypes): Deleted.
1940         (WebCore::initializeSupportedNonImageMimeTypes): Deleted.
1941         (WebCore::initializeSupportedMediaMIMETypes): Deleted.
1942         (WebCore::initializeUnsupportedTextMIMETypes): Deleted.
1943         (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType): Deleted.
1944         (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes): Deleted.
1945         (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Deleted.
1946         (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes): Deleted.
1947         (WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes): Deleted.
1948         (WebCore::MIMETypeRegistry::getPDFMIMETypes): Deleted.
1949         (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes): Deleted.
1950         (WebCore::MIMETypeRegistry::getSystemPreviewMIMETypes): Deleted.
1951         * platform/MIMETypeRegistry.h:
1952         * platform/graphics/Image.cpp:
1953         (WebCore::Image::supportsType):
1954         * platform/graphics/cg/ImageDecoderCG.cpp:
1955         (WebCore::ImageDecoderCG::encodedDataStatus const):
1956         * platform/graphics/cg/UTIRegistry.cpp:
1957         (WebCore::supportedDefaultImageSourceTypes):
1958         (WebCore::isSupportImageSourceType):
1959         (WebCore::allowedImageUTIs): Deleted.
1960         (WebCore::isAllowedImageUTI): Deleted.
1961         * platform/graphics/cg/UTIRegistry.h:
1962         * platform/mac/PasteboardMac.mm:
1963         (WebCore::Pasteboard::write):
1964
1965 2018-10-24  Chris Dumez  <cdumez@apple.com>
1966
1967         [PSON] When navigating back and forth, 'about:blank' shows up in the back/forward list
1968         https://bugs.webkit.org/show_bug.cgi?id=190846
1969         <rdar://problem/45058938>
1970
1971         Reviewed by Antti Koivisto.
1972
1973         When a page gets suspended after a process-swap, we navigate it to about:blank from inside the navigation
1974         policy handler, by overriding the request URL. This normally works fine because we usually process-swap
1975         on standard navigation. However, when we would process-swap on a back/forward navigation, we would end
1976         up using the back/forward navigation load type to do the about:blank load. This would have repercussions
1977         because history navigations update the current history item with the new URL (in this case 'about:blank').
1978         To avoid the issue, switch to a standard load type whenever the client asks us to suspend and we load
1979         'about:blank' as a result.
1980
1981         * loader/FrameLoader.cpp:
1982         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
1983
1984 2018-10-24  Andy Estes  <aestes@apple.com>
1985
1986         [macOS Debug WK2] Layout Test http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html is a flaky failure
1987         https://bugs.webkit.org/show_bug.cgi?id=190650
1988         <rdar://problem/45341914>
1989
1990         Reviewed by Alex Christensen.
1991
1992         In computeErrors, we intend to ignore errors when computing paymentMethodErrors. But we
1993         weren't clearing exceptions generated from calling convert(), so they would end up being
1994         logged as unhandled promise rejections.
1995
1996         Changed ApplePayPaymentHandler::computeErrors() to use a CatchScope to clear exceptions when
1997         decoding paymentMethodErrors.
1998
1999         Also changed ApplePayShippingAddressChangeEventErrorsV3.https.html to catch promise
2000         rejections from calling PaymentRequest.abort().
2001
2002         Covered by existing test.
2003
2004         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2005         (WebCore::ApplePayPaymentHandler::computeErrors const):
2006
2007 2018-10-22  Antti Koivisto  <antti@apple.com>
2008
2009         topPrivatelyControlledDomain is slow
2010         https://bugs.webkit.org/show_bug.cgi?id=190792
2011
2012         Reviewed by Alex Christensen and Chris Dumez.
2013
2014         It calls into some slowish CFNetwork code and ends up showing up in profiles.
2015
2016         * platform/mac/PublicSuffixMac.mm:
2017         (WebCore::topPrivatelyControlledDomain):
2018
2019         Add a cache that avoids calls into frameworks.
2020
2021 2018-10-22  Jer Noble  <jer.noble@apple.com>
2022
2023         Use WeakPtr and GenericTaskQueue within ObjC classes used by MediaPlayerPrivateAVFoundationObjC
2024         https://bugs.webkit.org/show_bug.cgi?id=190790
2025
2026         Reviewed by Alex Christensen.
2027
2028         Move towards using WeakPtr callbacks instead of raw pointers within the utility objects used by
2029         MediaPlayerPrivateAVFoundationObjC. Additionally, accessing WeakPtr off the thread which created
2030         the pointer is not allowed, so use a GenericTaskQueue to schedule callbacks instead. Make 
2031         GenericTaskQueue<Timer> thread-safe by locking around access to m_pendingTasks, and by making 
2032         incrementing the pending task count atomic.
2033
2034         * platform/GenericTaskQueue.cpp:
2035         (WebCore::TaskDispatcher<Timer>::postTask):
2036         (WebCore::TaskDispatcher<Timer>::sharedLock):
2037         (WebCore::TaskDispatcher<Timer>::sharedTimerFired):
2038         (WebCore::TaskDispatcher<Timer>::dispatchOneTask):
2039         (WebCore::TaskDispatcher<Timer>::pendingDispatchers):
2040         * platform/GenericTaskQueue.h:
2041         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2042         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2043         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
2044         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
2045         (-[WebCoreAVFMovieObserver initWithPlayer:]):
2046         (-[WebCoreAVFMovieObserver disconnect]):
2047         (-[WebCoreAVFMovieObserver metadataLoaded]):
2048         (-[WebCoreAVFMovieObserver didEnd:]):
2049         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2050         (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
2051         (-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]):
2052         (-[WebCoreAVFLoaderDelegate initWithPlayer:]):
2053         (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
2054         (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
2055         (-[WebCoreAVFPullDelegate initWithPlayer:]):
2056         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
2057         (-[WebCoreAVFMovieObserver initWithCallback:]): Deleted.
2058         (-[WebCoreAVFLoaderDelegate initWithCallback:]): Deleted.
2059         (-[WebCoreAVFLoaderDelegate setCallback:]): Deleted.
2060         (-[WebCoreAVFPullDelegate initWithCallback:]): Deleted.
2061         (-[WebCoreAVFPullDelegate setCallback:]): Deleted.
2062
2063 2018-10-23  Jer Noble  <jer.noble@apple.com>
2064
2065         TextTrack cues should be updated more often than every 250ms.
2066         https://bugs.webkit.org/show_bug.cgi?id=190827
2067
2068         Reviewed by Eric Carlson.
2069
2070         Test: media/track/track-cue-timing.html
2071
2072         TextTracks cues are recalculated on the playback timer, which fires at least every 250ms.
2073         In addition to this timer, add a method to MediaPlayer to provide a task which will be
2074         performed at a particular media time, and use this new method to request cues be updated
2075         at the next interesting media time. The next interesting time would be either when the
2076         soonest current cue will end, or when the next non-current cue will start, whichever is
2077         earlier.
2078
2079         (Determining the "next non-current cue" requires new API on PODIntervalTree, as that class
2080         does not have iterators per-se.)
2081
2082         * html/HTMLMediaElement.cpp:
2083         (WebCore::compareCueIntervalEndTime):
2084         (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
2085         * platform/PODIntervalTree.h:
2086         * platform/graphics/MediaPlayer.cpp:
2087         (WebCore::MediaPlayer::performTaskAtMediaTime):
2088         * platform/graphics/MediaPlayer.h:
2089         * platform/graphics/MediaPlayerPrivate.h:
2090         (WebCore::MediaPlayerPrivateInterface::performTaskAtMediaTime):
2091         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2092         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2093         (WebCore::MediaPlayerPrivateAVFoundationObjC::performTaskAtMediaTime):
2094         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2095         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2096         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime):
2097
2098 2018-10-23  Fujii Hironori  <Hironori.Fujii@sony.com>
2099
2100         [Win] Assertion fails while destructing local static AtomicString of FontCache::lastResortFallbackFont
2101         https://bugs.webkit.org/show_bug.cgi?id=190748
2102
2103         Reviewed by Myles C. Maxfield.
2104
2105         FontCache::lastResortFallbackFont had local static AtomicString
2106         variables which are not capsuled by NeverDestroyed. Hence, those
2107         variables are destructed on IPC thread when WebProcess exits.
2108
2109         Changed those AtomicString to NeverDestroyed<AtomicString> not to
2110         be destructed on exit.
2111
2112         This change can't be tested automatically because WebKitTestRunner
2113         doesn't support Windows port yet.
2114
2115         * platform/graphics/win/FontCacheWin.cpp:
2116         (WebCore::FontCache::lastResortFallbackFont): Changed
2117         fallbackFonts's type from AtomicString array to
2118         NeverDestroyed<AtomicString> array.
2119
2120 2018-10-23  Justin Fan  <justin_fan@apple.com>
2121
2122         [WebGPU] Rename old GPU* implementation files to GPULegacy* for WebMetal
2123         https://bugs.webkit.org/show_bug.cgi?id=190817
2124
2125         Reviewed by Dean Jackson.
2126
2127         No new tests. No change in behavior.
2128
2129         * [Large list of refactored classes and renamed files]: GPU* is now GPULegacy*
2130
2131 2018-10-23  Ryan Haddad  <ryanhaddad@apple.com>
2132
2133         Unreviewed, rolling out r237261.
2134
2135         The layout test for this change crashes under GuardMalloc.
2136
2137         Reverted changeset:
2138
2139         "Handle MDNS resolution of candidates through libwebrtc
2140         directly"
2141         https://bugs.webkit.org/show_bug.cgi?id=190681
2142         https://trac.webkit.org/changeset/237261
2143
2144 2018-10-23  Truitt Savell  <tsavell@apple.com>
2145
2146         Unreviewed, rolling out r237357.
2147
2148         API test is now failing on all platforms.
2149
2150         Reverted changeset:
2151
2152         "topPrivatelyControlledDomain is slow"
2153         https://bugs.webkit.org/show_bug.cgi?id=190792
2154         https://trac.webkit.org/changeset/237357
2155
2156 2018-10-23  Truitt Savell  <tsavell@apple.com>
2157
2158         Unreviewed, rolling out r237350.
2159
2160         Caused several Crashes cross multiple tests and platforms.
2161
2162         Reverted changeset:
2163
2164         "Use WeakPtr and GenericTaskQueue within ObjC classes used by
2165         MediaPlayerPrivateAVFoundationObjC"
2166         https://bugs.webkit.org/show_bug.cgi?id=190790
2167         https://trac.webkit.org/changeset/237350
2168
2169 2018-10-23  Ryan Haddad  <ryanhaddad@apple.com>
2170
2171         Unreviewed, rolling out r237280.
2172
2173         Causes fast/box-shadow/box-shadow-with-zero-radius.html to
2174         fail on iOS Simulator.
2175
2176         Reverted changeset:
2177
2178         "[CG] Adopt CG SPI for non-even cornered rounded rects"
2179         https://bugs.webkit.org/show_bug.cgi?id=190155
2180         https://trac.webkit.org/changeset/237280
2181
2182 2018-10-23  Antti Koivisto  <antti@apple.com>
2183
2184         topPrivatelyControlledDomain is slow
2185         https://bugs.webkit.org/show_bug.cgi?id=190792
2186
2187         Reviewed by Alex Christensen.
2188
2189         It calls into some slowish CFNetwork code and ends up showing up in profiles.
2190
2191         * platform/mac/PublicSuffixMac.mm:
2192         (WebCore::topPrivatelyControlledDomain):
2193
2194         Add a cache that avoids calls into frameworks.
2195
2196 2018-10-23  Chris Dumez  <cdumez@apple.com>
2197
2198         [PSON] Add support for cross-site client-side redirects
2199         https://bugs.webkit.org/show_bug.cgi?id=190806
2200         <rdar://problem/45047344>
2201
2202         Reviewed by Geoffrey Garen.
2203
2204         Add support for cross-site client-side redirects so that it swaps process and so that the back
2205         forward list looks as expected. To support this, the following changes had to be done:
2206         - The NavigationAction now provides additional information so that the WebProcess can communicate
2207           things about the client-side redirect to the UIProcess: lockHistory / lockBackForwardList and
2208           clientRedirectSourceForHistory.
2209         - If the UIProcess decides to process-swap on a client-side redirect, we pass the client-side
2210           redirect information to the new WebContent process via LoadRequest struct. WebCore then takes
2211           care of setting things up using this information so that it recognizes that it is continuing
2212           a load that is a client side redirect.
2213         - We also need to pass the current BackForwardListItem / HistoryItem to the new WebContent
2214           process so that the new process can truly lock history and keep updating the *current*
2215           HistoryItem, instead of creating a new HistoryItem.
2216         - After a process swap, when we re-construct the WebFrameProxy for the main frame in the new
2217           process, we now set the frame's URL in the UIProcess to the URL it had before we swapped.
2218           Clients such as Safari, rely on the main frame's URL being the expected value (the last
2219           committed load URL) until the next load is committed when receiving didPerformRedirect
2220           calls. Because we are destroying the main frame on process-swapping, we were losing the
2221           last committed URL and Safari would hit assertions.
2222
2223         With this model, the willPerformClientRedirect IPC is still sent from the previous WebProcess
2224         and the didPerformClientRedirect IPC is now sent by the new WebProcess. No change should be
2225         observable from the client's point of view.
2226
2227         * loader/FrameLoadRequest.h:
2228         (WebCore::FrameLoadRequest::setLockHistory):
2229         (WebCore::FrameLoadRequest::setlockBackForwardList):
2230         (WebCore::FrameLoadRequest::clientRedirectSourceForHistory const):
2231         (WebCore::FrameLoadRequest::setClientRedirectSourceForHistory):
2232         * loader/FrameLoader.cpp:
2233         (WebCore::FrameLoader::loadURL):
2234         (WebCore::FrameLoader::load):
2235         * loader/HistoryController.cpp:
2236         (WebCore::HistoryController::updateForRedirectWithLockedBackForwardList):
2237         * loader/HistoryController.h:
2238         * loader/NavigationAction.h:
2239         (WebCore::NavigationAction::lockHistory const):
2240         (WebCore::NavigationAction::setLockHistory):
2241         (WebCore::NavigationAction::lockBackForwardList const):
2242         (WebCore::NavigationAction::setLockBackForwardList):
2243
2244 2018-10-23  Jer Noble  <jer.noble@apple.com>
2245
2246         Use WeakPtr and GenericTaskQueue within ObjC classes used by MediaPlayerPrivateAVFoundationObjC
2247         https://bugs.webkit.org/show_bug.cgi?id=190790
2248
2249         Reviewed by Alex Christensen.
2250
2251         Move towards using WeakPtr callbacks instead of raw pointers within the utility objects used by
2252         MediaPlayerPrivateAVFoundationObjC. Additionally, accessing WeakPtr off the thread which created
2253         the pointer is not allowed, so use a GenericTaskQueue to schedule callbacks instead. Make 
2254         GenericTaskQueue<Timer> thread-safe by locking around access to m_pendingTasks, and by making 
2255         incrementing the pending task count atomic.
2256
2257         * platform/GenericTaskQueue.cpp:
2258         (WebCore::TaskDispatcher<Timer>::postTask):
2259         (WebCore::TaskDispatcher<Timer>::sharedLock):
2260         (WebCore::TaskDispatcher<Timer>::sharedTimerFired):
2261         (WebCore::TaskDispatcher<Timer>::dispatchOneTask):
2262         (WebCore::TaskDispatcher<Timer>::pendingDispatchers):
2263         * platform/GenericTaskQueue.h:
2264         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2265         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2266         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
2267         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
2268         (-[WebCoreAVFMovieObserver initWithPlayer:]):
2269         (-[WebCoreAVFMovieObserver disconnect]):
2270         (-[WebCoreAVFMovieObserver metadataLoaded]):
2271         (-[WebCoreAVFMovieObserver didEnd:]):
2272         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
2273         (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]):
2274         (-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]):
2275         (-[WebCoreAVFLoaderDelegate initWithPlayer:]):
2276         (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]):
2277         (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]):
2278         (-[WebCoreAVFPullDelegate initWithPlayer:]):
2279         (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]):
2280         (-[WebCoreAVFMovieObserver initWithCallback:]): Deleted.
2281         (-[WebCoreAVFLoaderDelegate initWithCallback:]): Deleted.
2282         (-[WebCoreAVFLoaderDelegate setCallback:]): Deleted.
2283         (-[WebCoreAVFPullDelegate initWithCallback:]): Deleted.
2284         (-[WebCoreAVFPullDelegate setCallback:]): Deleted.
2285
2286 2018-10-22  Justin Michaud  <justin_michaud@apple.com>
2287
2288         Registered custom properties should support syntax parameter for <length> and *
2289         https://bugs.webkit.org/show_bug.cgi?id=190039
2290
2291         Reviewed by Antti Koivisto.
2292
2293         Refactor code so that:
2294         - All properties applied in StyleResolver::applyMatchedProperties are only applied once. 
2295         - Custom properties are only resolved once, in StyleResolver, when they are applied to the RenderStyle. They were previously resolved
2296           every time they were referenced, and again in RenderStyle.
2297         - The font-size property is applied after its variable references, but before custom properties that depend on it.
2298         - Cycles are detected at the same time as resolution.
2299         - MutableStyleProperties' custom properties cannot be set from Javascript or WebKitLegacy if they do not parse for the property's type.
2300           If they contain var(--...) references, however, then they can be set because we cannot check if the references are valid from setProperty.
2301           This behaviour matches chrome, but is not documented in the spec. 
2302         - Custom property values have more explicit resolved/unresolved state.
2303         - RenderStyle only ever holds resolved custom properties, and StyleResolver::CascadedProperties only holds unresolved properties.
2304
2305         Tests: css-custom-properties-api/crash.html
2306                css-custom-properties-api/cycles.html
2307                css-custom-properties-api/inline.html
2308
2309         * css/CSSComputedStyleDeclaration.cpp:
2310         (WebCore::ComputedStyleExtractor::customPropertyValue):
2311         * css/CSSCustomPropertyValue.cpp:
2312         (WebCore::CSSCustomPropertyValue::equals const):
2313         (WebCore::CSSCustomPropertyValue::customCSSText const):
2314         (WebCore::CSSCustomPropertyValue::tokens const):
2315         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): Deleted.
2316         (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): Deleted.
2317         (WebCore::CSSCustomPropertyValue::setResolvedTypedValue): Deleted.
2318         * css/CSSCustomPropertyValue.h:
2319         * css/CSSRegisteredCustomProperty.cpp:
2320         (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
2321         * css/CSSRegisteredCustomProperty.h:
2322         * css/CSSStyleSheet.h:
2323         * css/CSSVariableData.cpp:
2324         (WebCore::CSSVariableData::CSSVariableData):
2325         (WebCore::CSSVariableData::consumeAndUpdateTokens): Deleted.
2326         (WebCore::CSSVariableData::checkVariablesForCycles const): Deleted.
2327         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): Deleted.
2328         (WebCore::CSSVariableData::resolveVariableFallback const): Deleted.
2329         (WebCore::CSSVariableData::resolveVariableReference const): Deleted.
2330         (WebCore::CSSVariableData::resolveVariableReferences const): Deleted.
2331         (WebCore::CSSVariableData::resolveTokenRange const): Deleted.
2332         * css/CSSVariableData.h:
2333         (WebCore::CSSVariableData::create):
2334         (WebCore::CSSVariableData::createResolved): Deleted.
2335         (WebCore::CSSVariableData::needsVariableResolution const): Deleted.
2336         (WebCore::CSSVariableData::CSSVariableData): Deleted.
2337         * css/CSSVariableReferenceValue.cpp:
2338         (WebCore::resolveVariableFallback):
2339         (WebCore::resolveVariableReference):
2340         (WebCore::resolveTokenRange):
2341         (WebCore::CSSVariableReferenceValue::resolveVariableReferences const):
2342         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): Deleted.
2343         * css/CSSVariableReferenceValue.h:
2344         (WebCore::CSSVariableReferenceValue::create):
2345         (WebCore::CSSVariableReferenceValue::equals const):
2346         (WebCore::CSSVariableReferenceValue::variableDataValue const): Deleted.
2347         * css/DOMCSSRegisterCustomProperty.cpp:
2348         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
2349         * css/PropertySetCSSStyleDeclaration.cpp:
2350         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
2351         * css/StyleBuilderCustom.h:
2352         (WebCore::StyleBuilderCustom::applyInitialCustomProperty):
2353         (WebCore::StyleBuilderCustom::applyValueCustomProperty):
2354         * css/StyleProperties.cpp:
2355         (WebCore::MutableStyleProperties::setCustomProperty):
2356         * css/StyleProperties.h:
2357         * css/StyleResolver.cpp:
2358         (WebCore::StyleResolver::State::setStyle):
2359         (WebCore::StyleResolver::styleForKeyframe):
2360         (WebCore::StyleResolver::styleForPage):
2361         (WebCore::StyleResolver::applyMatchedProperties):
2362         (WebCore::StyleResolver::applyPropertyToCurrentStyle):
2363         (WebCore::StyleResolver::applyProperty):
2364         (WebCore::StyleResolver::resolvedVariableValue const):
2365         (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
2366         (WebCore::StyleResolver::CascadedProperties::Property::apply):
2367         (WebCore::StyleResolver::applyCascadedCustomProperty):
2368         (WebCore::StyleResolver::applyCascadedProperties):
2369         * css/StyleResolver.h:
2370         * css/parser/CSSParser.cpp:
2371         (WebCore::CSSParser::parseValueWithVariableReferences):
2372         * css/parser/CSSParser.h:
2373         * css/parser/CSSPropertyParser.cpp:
2374         (WebCore::CSSPropertyParser::CSSPropertyParser):
2375         (WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue):
2376         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
2377         (WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies):
2378         (WebCore::CSSPropertyParser::parseValueStart):
2379         (WebCore::CSSPropertyParser::parseSingleValue):
2380         * css/parser/CSSPropertyParser.h:
2381         * css/parser/CSSVariableParser.cpp:
2382         (WebCore::CSSVariableParser::parseDeclarationValue):
2383         * dom/ConstantPropertyMap.cpp:
2384         (WebCore::ConstantPropertyMap::setValueForProperty):
2385         (WebCore::variableDataForPositivePixelLength):
2386         (WebCore::variableDataForPositiveDuration):
2387         * rendering/style/RenderStyle.cpp:
2388         (WebCore::RenderStyle::checkVariablesInCustomProperties): Deleted.
2389         * rendering/style/RenderStyle.h:
2390         (WebCore::RenderStyle::setInheritedCustomPropertyValue):
2391         (WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
2392         * rendering/style/StyleCustomPropertyData.h:
2393         (WebCore::StyleCustomPropertyData::operator== const):
2394         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
2395         (WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
2396         (): Deleted.
2397
2398 2018-10-22  Justin Michaud  <justin_michaud@apple.com>
2399
2400         CSS Paint API should give a 2d rendering context
2401         https://bugs.webkit.org/show_bug.cgi?id=190762
2402
2403         Reviewed by Dean Jackson.
2404
2405         Add a new type of canvas and 2d rendering context to support the CSS Painting API.
2406         Make many of the methods from HTMLCanvasElement virtual functions on CanvasBase, and
2407         remove many of the downcasts in CanvasRenderingContext2DBase as a result.
2408
2409         * CMakeLists.txt:
2410         * DerivedSources.make:
2411         * Sources.txt:
2412         * WebCore.xcodeproj/project.pbxproj:
2413         * bindings/js/JSPaintRenderingContext2DCustom.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h.
2414         (WebCore::root):
2415         (WebCore::JSPaintRenderingContext2DOwner::isReachableFromOpaqueRoots):
2416         (WebCore::JSPaintRenderingContext2D::visitAdditionalChildren):
2417         * bindings/js/WebCoreBuiltinNames.h:
2418         * css/CSSPaintCallback.h:
2419         * css/CSSPaintCallback.idl:
2420         * html/CanvasBase.cpp:
2421         (WebCore::CanvasBase::~CanvasBase):
2422         * html/CanvasBase.h:
2423         (WebCore::CanvasBase::isCustomPaintCanvas const):
2424         * html/CustomPaintCanvas.cpp: Added.
2425         (WebCore::CustomPaintCanvas::create):
2426         (WebCore::CustomPaintCanvas::CustomPaintCanvas):
2427         (WebCore::CustomPaintCanvas::~CustomPaintCanvas):
2428         (WebCore::CustomPaintCanvas::width const):
2429         (WebCore::CustomPaintCanvas::setWidth):
2430         (WebCore::CustomPaintCanvas::height const):
2431         (WebCore::CustomPaintCanvas::setHeight):
2432         (WebCore::CustomPaintCanvas::size const):
2433         (WebCore::CustomPaintCanvas::setSize):
2434         (WebCore::CustomPaintCanvas::getContext):
2435         (WebCore::CustomPaintCanvas::copiedImage const):
2436         (WebCore::CustomPaintCanvas::drawingContext const):
2437         (WebCore::CustomPaintCanvas::existingDrawingContext const):
2438         (WebCore::CustomPaintCanvas::makeRenderingResultsAvailable):
2439         * html/CustomPaintCanvas.h: Copied from Source/WebCore/html/OffscreenCanvas.h.
2440         * html/HTMLCanvasElement.h:
2441         * html/OffscreenCanvas.h:
2442         * html/canvas/CanvasRenderingContext.cpp:
2443         (WebCore::CanvasRenderingContext::wouldTaintOrigin):
2444         * html/canvas/CanvasRenderingContext.h:
2445         (WebCore::CanvasRenderingContext::isPaint const):
2446         * html/canvas/CanvasRenderingContext2DBase.cpp:
2447         (WebCore::DisplayListDrawingContext::DisplayListDrawingContext):
2448         (WebCore::CanvasRenderingContext2DBase::unwindStateStack):
2449         (WebCore::CanvasRenderingContext2DBase::isAccelerated const):
2450         (WebCore::CanvasRenderingContext2DBase::setStrokeStyle):
2451         (WebCore::CanvasRenderingContext2DBase::setFillStyle):
2452         (WebCore::CanvasRenderingContext2DBase::resetTransform):
2453         (WebCore::CanvasRenderingContext2DBase::clearCanvas):
2454         (WebCore::CanvasRenderingContext2DBase::transformAreaToDevice const):
2455         (WebCore::CanvasRenderingContext2DBase::rectContainsCanvas const):
2456         (WebCore::CanvasRenderingContext2DBase::calculateCompositingBufferRect):
2457         (WebCore::CanvasRenderingContext2DBase::compositeBuffer):
2458         (WebCore::CanvasRenderingContext2DBase::createPattern):
2459         (WebCore::CanvasRenderingContext2DBase::didDrawEntireCanvas):
2460         (WebCore::CanvasRenderingContext2DBase::didDraw):
2461         (WebCore::CanvasRenderingContext2DBase::paintRenderingResultsToCanvas):
2462         (WebCore::CanvasRenderingContext2DBase::drawingContext const):
2463         * html/canvas/CanvasRenderingContext2DBase.h:
2464         * html/canvas/PaintRenderingContext2D.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h.
2465         (WebCore::PaintRenderingContext2D::create):
2466         (WebCore::PaintRenderingContext2D::PaintRenderingContext2D):
2467         * html/canvas/PaintRenderingContext2D.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
2468         * html/canvas/PaintRenderingContext2D.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl.
2469         * html/canvas/WebMetalRenderPassAttachmentDescriptor.h:
2470         * platform/graphics/CustomPaintImage.cpp:
2471         (WebCore::CustomPaintImage::doCustomPaint):
2472
2473 2018-10-22  Keith Rollin  <krollin@apple.com>
2474
2475         Use Location = "Relative to Build Products" rather than "Relative to Group"
2476         https://bugs.webkit.org/show_bug.cgi?id=190781
2477
2478         Reviewed by Alexey Proskuryakov.
2479
2480         Almost all Derived Files are included in Xcode projects with the
2481         Location attribute set to "Relative to Group". While this currently
2482         works, the Derived Files can no longer be found when enabling XCBuild
2483         (which has stricter requirements). Fix this by setting the Location
2484         attribute to "Relative to Build Products".
2485
2486         No new tests -- no changed functionality.
2487
2488         * WebCore.xcodeproj/project.pbxproj:
2489
2490 2018-10-22  Zalan Bujtas  <zalan@apple.com>
2491
2492         [LFC][IFC] Add justify text-align support.
2493         https://bugs.webkit.org/show_bug.cgi?id=190779
2494
2495         Reviewed by Antti Koivisto.
2496
2497         Collect expansion opportunities and adjust runs accordingly.
2498
2499         * layout/inlineformatting/InlineFormattingContext.cpp:
2500         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2501         * layout/inlineformatting/InlineFormattingContext.h:
2502         * layout/inlineformatting/InlineRun.h:
2503         (WebCore::Layout::InlineRun::expansionOpportunity):
2504         (WebCore::Layout::InlineRun::TextContext::setStart):
2505         (WebCore::Layout::InlineRun::TextContext::setLength):
2506         (WebCore::Layout::InlineRun::setTextContext):
2507         (WebCore::Layout::InlineRun::createRun): Deleted.
2508         (WebCore::Layout::InlineRun::createTextRun): Deleted.
2509         * layout/inlineformatting/Line.cpp:
2510         (WebCore::Layout::InlineFormattingContext::Line::Line):
2511         (WebCore::Layout::InlineFormattingContext::Line::init):
2512         (WebCore::Layout::InlineFormattingContext::Line::computeExpansionOpportunities):
2513         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
2514         (WebCore::Layout::InlineFormattingContext::Line::justifyRuns):
2515         (WebCore::Layout::InlineFormattingContext::Line::close):
2516         (WebCore::Layout::isNonCollapsedText): Deleted.
2517
2518 2018-10-22  Zalan Bujtas  <zalan@apple.com>
2519
2520         [LFC][IFC] Add (right, center)text-align support.
2521         https://bugs.webkit.org/show_bug.cgi?id=190745
2522
2523         Reviewed by Antti Koivisto.
2524
2525         Adjust the logical left of each run while closing the line.
2526
2527         * layout/Verification.cpp:
2528         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
2529         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
2530         * layout/inlineformatting/InlineFormattingContext.cpp:
2531         (WebCore::Layout::trimLeadingRun):
2532         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2533         * layout/inlineformatting/InlineFormattingContext.h:
2534         (WebCore::Layout::InlineFormattingContext::Line::hasContent const):
2535         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const): Deleted.
2536         * layout/inlineformatting/InlineLineBreaker.cpp:
2537         (WebCore::Layout::InlineLineBreaker::nextRun):
2538         (WebCore::Layout::InlineLineBreaker::splitRun):
2539         * layout/inlineformatting/InlineLineBreaker.h:
2540         * layout/inlineformatting/InlineRun.h:
2541         (WebCore::Layout::InlineRun::setLogicalLeft):
2542         (WebCore::Layout::InlineRun::TextContext::start const):
2543         (WebCore::Layout::InlineRun::createRun):
2544         (WebCore::Layout::InlineRun::createTextRun):
2545         (WebCore::Layout::InlineRun::InlineRun):
2546         (WebCore::Layout::InlineRun::TextContext::TextContext):
2547         (WebCore::Layout::InlineRun::TextContext::position const): Deleted.
2548         * layout/inlineformatting/Line.cpp:
2549         (WebCore::Layout::InlineFormattingContext::Line::Line):
2550         (WebCore::Layout::InlineFormattingContext::Line::init):
2551         (WebCore::Layout::adjustedLineLogicalLeft):
2552         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight):
2553         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
2554         (WebCore::Layout::InlineFormattingContext::Line::close):
2555         (WebCore::Layout::InlineFormattingContext::Line::setConstraints): Deleted.
2556         * layout/layouttree/LayoutTreeBuilder.cpp:
2557         (WebCore::Layout::outputInlineRuns):
2558
2559 2018-10-22  Zalan Bujtas  <zalan@apple.com>
2560
2561         [LFC][IFC] Implement Replaced helper class.
2562         https://bugs.webkit.org/show_bug.cgi?id=190719
2563
2564         Reviewed by Antti Koivisto.
2565
2566         * layout/layouttree/LayoutBox.cpp:
2567         (WebCore::Layout::Box::Box):
2568         * layout/layouttree/LayoutBox.h:
2569         (WebCore::Layout::Box::replaced const):
2570         * layout/layouttree/LayoutReplaced.cpp:
2571         (WebCore::Layout::Replaced::Replaced):
2572         (WebCore::Layout::Replaced::hasIntrinsicWidth const):
2573         (WebCore::Layout::Replaced::hasIntrinsicHeight const):
2574         (WebCore::Layout::Replaced::hasIntrinsicRatio const):
2575         (WebCore::Layout::Replaced::intrinsicWidth const):
2576         (WebCore::Layout::Replaced::intrinsicHeight const):
2577         (WebCore::Layout::Replaced::intrinsicRatio const):
2578         * layout/layouttree/LayoutReplaced.h:
2579         (WebCore::Layout::Replaced::hasIntrinsicWidth const): Deleted.
2580         (WebCore::Layout::Replaced::hasIntrinsicHeight const): Deleted.
2581         (WebCore::Layout::Replaced::hasIntrinsicRatio const): Deleted.
2582         (WebCore::Layout::Replaced::intrinsicWidth const): Deleted.
2583         (WebCore::Layout::Replaced::intrinsicHeight const): Deleted.
2584         (WebCore::Layout::Replaced::intrinsicRatio const): Deleted.
2585         * layout/layouttree/LayoutTreeBuilder.cpp:
2586         (WebCore::Layout::TreeBuilder::createSubTree):
2587
2588 2018-10-22  Zalan Bujtas  <zalan@apple.com>
2589
2590         [LFC][IFC] Block formatting context roots avoid floats.
2591         https://bugs.webkit.org/show_bug.cgi?id=190723
2592
2593         Reviewed by Antti Koivisto.
2594
2595         Inline formatting context roots don't avoid floats (unless they also establish block formatting context).
2596
2597         * layout/blockformatting/BlockFormattingContext.cpp:
2598         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2599
2600 2018-10-20  YUHAN WU  <yuhan_wu@apple.com>
2601
2602         MediaRecorder should fire a stop event when all tracks are ended
2603         https://bugs.webkit.org/show_bug.cgi?id=190642
2604
2605         Reviewed by Youenn Fablet.
2606
2607         This patch only implements to fire the stop event when all tracks are ended.
2608         We will need to fire a dataavailable event when all tracks are ended.
2609
2610         Test: imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-stop.html
2611
2612         * Modules/mediarecorder/MediaRecorder.cpp:
2613         (WebCore::MediaRecorder::MediaRecorder):
2614         (WebCore::MediaRecorder::~MediaRecorder):
2615         (WebCore::MediaRecorder::trackEnded):
2616         * Modules/mediarecorder/MediaRecorder.h:
2617         * Modules/mediarecorder/MediaRecorder.idl:
2618         * WebCore.xcodeproj/project.pbxproj:
2619         * dom/EventNames.h:
2620
2621 2018-10-19  Stephan Szabo  <stephan.szabo@sony.com>
2622
2623         [WinCairo] Search terms are not saved for <input type="search">
2624         https://bugs.webkit.org/show_bug.cgi?id=188174
2625
2626         Reviewed by Fujii Hironori.
2627
2628         No new tests, should be covered by existing tests of search 
2629         inputs.
2630
2631         Add support for saving the search terms for <input
2632         type="search"> to a SQLite database, replacing the
2633         CF-based implementation for Windows and adding support
2634         for non-legacy WebKit.
2635
2636         * PlatformWin.cmake:
2637         * platform/win/SearchPopupMenuDB.cpp: Added.
2638         (WebCore::SearchPopupMenuDB::singleton):
2639         (WebCore::SearchPopupMenuDB::SearchPopupMenuDB):
2640         (WebCore::SearchPopupMenuDB::~SearchPopupMenuDB):
2641         (WebCore::SearchPopupMenuDB::saveRecentSearches):
2642         (WebCore::SearchPopupMenuDB::loadRecentSearches):
2643         (WebCore::SearchPopupMenuDB::checkDatabaseValidity): Use
2644         quick_check pragma to test database status.
2645         (WebCore::SearchPopupMenuDB::deleteAllDatabaseFiles):
2646         (WebCore::SearchPopupMenuDB::openDatabase):
2647         (WebCore::SearchPopupMenuDB::closeDatabase):
2648         (WebCore::SearchPopupMenuDB::verifySchemaVersion): Check
2649         schema version and update for schema changes.
2650         (WebCore::SearchPopupMenuDB::checkSQLiteReturnCode): Check
2651         for error codes that indicate database errors and remove and
2652         recreate the database.
2653         (WebCore::SearchPopupMenuDB::executeSimpleSql):
2654         (WebCore::SearchPopupMenuDB::createPreparedStatement):
2655         * platform/win/SearchPopupMenuDB.h: Added.
2656         * platform/win/SearchPopupMenuWin.cpp:
2657         (WebCore::SearchPopupMenuWin::enabled): Always enable support
2658         for search term popup
2659         (WebCore::SearchPopupMenuWin::saveRecentSearches): Switch from
2660         CF implementation to SQLite database implementation
2661         (WebCore::SearchPopupMenuWin::loadRecentSearches): Switch from
2662         CF implementation to SQLite database implementation
2663         (WebCore::autosaveKey): Deleted.
2664
2665 2018-10-19  Justin Fan  <justin_fan@apple.com>
2666
2667         [WebGPU] Add stubs for WebGPUSwapChain and WebGPURenderingContext
2668         https://bugs.webkit.org/show_bug.cgi?id=190742
2669
2670         Reviewed by Dean Jackson.
2671
2672         Test: updated webgpu-enabled.html to check for WebGPURenderingContext.
2673
2674         Implement support for creating a "webgpu" context from an HTML canvas.
2675
2676         * CMakeLists.txt:
2677         * DerivedSources.make:
2678         * Modules/webgpu/WebGPURenderingContext.cpp: Added.
2679         (WebCore::WebGPURenderingContext::create):
2680         (WebCore::WebGPURenderingContext::WebGPURenderingContext):
2681         * Modules/webgpu/WebGPURenderingContext.h: Added.
2682         * Modules/webgpu/WebGPURenderingContext.idl: Added.
2683         * Modules/webgpu/WebGPUSwapChain.cpp: Added.
2684         (WebCore::WebGPUSwapChain::configure):
2685         (WebCore::WebGPUSwapChain::present):
2686         (WebCore::WebGPUSwapChain::reshape):
2687         (WebCore::WebGPUSwapChain::markLayerComposited):
2688         * Modules/webgpu/WebGPUSwapChain.h: Added.
2689         (WebCore::WebGPUSwapChain::WebGPUSwapChain):
2690         * Modules/webgpu/WebGPUSwapChain.idl: Added.
2691         * Modules/webgpu/WebGPUSwapChainDescriptor.h: Added.
2692         * Modules/webgpu/WebGPUSwapChainDescriptor.idl: Added.
2693         * Sources.txt:
2694         * WebCore.xcodeproj/project.pbxproj:
2695         * bindings/js/WebCoreBuiltinNames.h:
2696         * dom/Document.cpp:
2697         (WebCore::Document::getCSSCanvasContext):
2698         * dom/Document.h:
2699         * dom/Document.idl:
2700         * html/HTMLCanvasElement.cpp:
2701         (WebCore::HTMLCanvasElement::getContext):
2702         (WebCore::HTMLCanvasElement::isWebGPUType):
2703         (WebCore::HTMLCanvasElement::createContextWebGPU):
2704         (WebCore::HTMLCanvasElement::getContextWebGPU):
2705         * html/HTMLCanvasElement.h:
2706         * html/HTMLCanvasElement.idl:
2707         * html/canvas/CanvasRenderingContext.h:
2708         (WebCore::CanvasRenderingContext::isWebGPU const):
2709
2710 2018-10-19  John Wilander  <wilander@apple.com>
2711
2712         Only cap lifetime of persistent cookies created client-side through document.cookie when resource load statistics is enabled
2713         https://bugs.webkit.org/show_bug.cgi?id=190687
2714         <rdar://problem/45349024>
2715
2716         Reviewed by Alex Christensen.
2717
2718         Test: http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js.html
2719
2720         NetworkStorageSession::setCookiesFromDOM() now consults the new
2721         m_shouldCapLifetimeForClientSideCookies member variable before
2722         capping the lifetime of cookies.
2723
2724         * loader/ResourceLoadStatistics.cpp:
2725         (WebCore::ResourceLoadStatistics::toString const):
2726         (WebCore::ResourceLoadStatistics::merge):
2727             Removal of the isMarkedForCookieBlocking member.
2728         * loader/ResourceLoadStatistics.h:
2729             Removal of the isMarkedForCookieBlocking member.
2730         * platform/network/NetworkStorageSession.h:
2731         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
2732         (WebCore::NetworkStorageSession::setShouldCapLifetimeForClientSideCookies):
2733         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
2734             No longer takes the boolean clearFirst parameter and now always clears first.
2735         * platform/network/cocoa/NetworkStorageSessionCocoa.mm:
2736         (WebCore::filterCookies):
2737         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
2738
2739 2018-10-19  Zalan Bujtas  <zalan@apple.com>
2740
2741         [LFC][IFC] RenderReplaced renderer should create InlineBox
2742         https://bugs.webkit.org/show_bug.cgi?id=190720
2743
2744         Reviewed by Antti Koivisto.
2745
2746         * layout/layouttree/LayoutTreeBuilder.cpp:
2747         (WebCore::Layout::TreeBuilder::createSubTree):
2748
2749 2018-10-19  Zalan Bujtas  <zalan@apple.com>
2750
2751         [LFC][IFC] Inline replaced width should default to 300px only if width is auto.
2752         https://bugs.webkit.org/show_bug.cgi?id=190722
2753
2754         Reviewed by Antti Koivisto.
2755
2756         See #5
2757
2758         // 5. Otherwise, if 'width' has a computed value of 'auto', but none of the conditions above are met, then the used value of 'width' becomes 300px.
2759
2760         * layout/FormattingContextGeometry.cpp:
2761         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2762
2763 2018-10-19  Zalan Bujtas  <zalan@apple.com>
2764
2765         [LFC][IFC] Add inline runs to showLayoutTree
2766         https://bugs.webkit.org/show_bug.cgi?id=190718
2767
2768         Reviewed by Antti Koivisto.
2769
2770         * layout/layouttree/LayoutTreeBuilder.cpp:
2771         (WebCore::Layout::outputInlineRuns):
2772         (WebCore::Layout::outputLayoutBox):
2773         (WebCore::Layout::outputLayoutTree):
2774
2775 2018-10-19  Zalan Bujtas  <zalan@apple.com>
2776
2777         [LFC][IFC] Remove the previous version of inline content handling.
2778         https://bugs.webkit.org/show_bug.cgi?id=190716
2779
2780         Reviewed by Antti Koivisto.
2781
2782         * Sources.txt:
2783         * WebCore.xcodeproj/project.pbxproj:
2784         * layout/Verification.cpp:
2785         (WebCore::Layout::areEssentiallyEqual):
2786         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
2787         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
2788         * layout/inlineformatting/InlineFormattingState.h:
2789         (WebCore::Layout::InlineFormattingState::inlineContent):
2790         (WebCore::Layout::InlineFormattingState::addLayoutRuns): Deleted.
2791         (WebCore::Layout::InlineFormattingState::layoutRuns const): Deleted.
2792         * layout/inlineformatting/text/TextUtil.cpp: Renamed from Source/WebCore/layout/inlineformatting/textlayout/TextUtil.cpp.
2793         (WebCore::Layout::TextUtil::TextUtil):
2794         (WebCore::Layout::TextUtil::width const):
2795         (WebCore::Layout::TextUtil::hyphenPositionBefore const):
2796         (WebCore::Layout::TextUtil::textWidth const):
2797         (WebCore::Layout::TextUtil::fixedPitchWidth const):
2798         * layout/inlineformatting/text/TextUtil.h: Renamed from Source/WebCore/layout/inlineformatting/textlayout/TextUtil.h.
2799         * layout/inlineformatting/textlayout/Runs.h: Removed.
2800         * layout/inlineformatting/textlayout/TextContentProvider.cpp: Removed.
2801         * layout/inlineformatting/textlayout/TextContentProvider.h: Removed.
2802         * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp: Removed.
2803         * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h: Removed.
2804         * layout/inlineformatting/textlayout/simple/SimpleTextRunGenerator.cpp: Removed.
2805         * layout/inlineformatting/textlayout/simple/SimpleTextRunGenerator.h: Removed.
2806
2807 2018-10-19  Zalan Bujtas  <zalan@apple.com>
2808
2809         [LFC][IFC] Add generic inline content handling.
2810         https://bugs.webkit.org/show_bug.cgi?id=190713
2811
2812         Reviewed by Antti Koivisto.
2813
2814         layoutInlineContent turns InlineLineBreaker::Run objects into final inline runs by
2815         resolving heading/trailing whitespace, aligment, expansion opportunities etc.
2816         These inline runs are input to the display tree construction.
2817
2818         * Sources.txt:
2819         * WebCore.xcodeproj/project.pbxproj:
2820         * layout/displaytree/DisplayBox.h:
2821         * layout/inlineformatting/InlineFormattingContext.cpp:
2822         (WebCore::Layout::InlineFormattingContext::layout const):
2823         (WebCore::Layout::trimLeadingRun):
2824         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2825         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const):
2826         * layout/inlineformatting/InlineFormattingContext.h:
2827         (WebCore::Layout::InlineFormattingContext::Line::hasContent const):
2828         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const):
2829         (WebCore::Layout::InlineFormattingContext::Line::availableWidth const):
2830         * layout/inlineformatting/InlineFormattingState.h:
2831         (WebCore::Layout::InlineFormattingState::inlineRuns):
2832         (WebCore::Layout::InlineFormattingState::appendInlineRun):
2833         * layout/inlineformatting/InlineLineBreaker.cpp:
2834         (WebCore::Layout::InlineLineBreaker::nextRun):
2835         (WebCore::Layout::InlineLineBreaker::nextLayoutRun): Deleted.
2836         * layout/inlineformatting/InlineLineBreaker.h:
2837         * layout/inlineformatting/InlineRun.h: Added.
2838         (WebCore::Layout::InlineRun::logicalLeft const):
2839         (WebCore::Layout::InlineRun::logicalRight const):
2840         (WebCore::Layout::InlineRun::width const):
2841         (WebCore::Layout::InlineRun::setWidth):
2842         (WebCore::Layout::InlineRun::setLogicalRight):
2843         (WebCore::Layout::InlineRun::TextContext::position const):
2844         (WebCore::Layout::InlineRun::TextContext::length const):
2845         (WebCore::Layout::InlineRun::TextContext::setLength):
2846         (WebCore::Layout::InlineRun::textContext):
2847         (WebCore::Layout::InlineRun::inlineItem const):
2848         (WebCore::Layout::InlineRun::InlineRun):
2849         (WebCore::Layout::InlineRun::TextContext::TextContext):
2850         * layout/inlineformatting/Line.cpp: Added.
2851         (WebCore::Layout::InlineFormattingContext::Line::Line):
2852         (WebCore::Layout::InlineFormattingContext::Line::setConstraints):
2853         (WebCore::Layout::isNonCollapsedText):
2854         (WebCore::Layout::isTrimmableContent):
2855         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
2856         (WebCore::Layout::InlineFormattingContext::Line::close):
2857
2858 2018-10-19  Zalan Bujtas  <zalan@apple.com>
2859
2860         [LFC][IFC] Add generic inline line breaker
2861         https://bugs.webkit.org/show_bug.cgi?id=190698
2862
2863         Reviewed by Antti Koivisto.
2864
2865         InlineLineBreaker takes the inline runs and applies the appropriate line breaking rules on them.
2866         InlineRunProvider::Run objects ->
2867
2868             <foobar><image box><hello>< ><world>
2869
2870         InlineLineBreaker::Run ->
2871
2872             <foobar><image box><hello world>
2873
2874         InlineLineBreaker::Run also contains information whether the run is at the beginning or at the end of the line.
2875
2876         * Sources.txt:
2877         * WebCore.xcodeproj/project.pbxproj:
2878         * layout/LayoutContext.h:
2879         (WebCore::Layout::LayoutContext::hasDisplayBox const):
2880         * layout/inlineformatting/InlineLineBreaker.cpp: Added.
2881         (WebCore::Layout::InlineLineBreaker::InlineLineBreaker):
2882         (WebCore::Layout::InlineLineBreaker::nextLayoutRun):
2883         (WebCore::Layout::InlineLineBreaker::isAtContentEnd const):
2884         (WebCore::Layout::InlineLineBreaker::lineBreakingBehavior):
2885         (WebCore::Layout::InlineLineBreaker::runWidth const):
2886         (WebCore::Layout::InlineLineBreaker::splitRun):
2887         (WebCore::Layout::InlineLineBreaker::adjustSplitPositionWithHyphenation const):
2888         * layout/inlineformatting/InlineLineBreaker.h: Added.
2889         * layout/inlineformatting/textlayout/TextUtil.cpp: Added.
2890         (WebCore::Layout::TextUtil::TextUtil):
2891         (WebCore::Layout::TextUtil::width const):
2892         (WebCore::Layout::TextUtil::hyphenPositionBefore const):
2893         (WebCore::Layout::TextUtil::textWidth const):
2894         (WebCore::Layout::TextUtil::fixedPitchWidth const):
2895         * layout/inlineformatting/textlayout/TextUtil.h: Added.
2896         * layout/layouttree/LayoutBox.cpp:
2897
2898 2018-10-19  Zalan Bujtas  <zalan@apple.com>
2899
2900         [LFC][IFC] Add generic inline run generator.
2901         https://bugs.webkit.org/show_bug.cgi?id=190696
2902
2903         Reviewed by Antti Koivisto.
2904
2905         InlineRunProvider turns the following inline content ->
2906
2907             <span>foo<span>bar</span></span>
2908             <img src="broken.jpg"><span>hello world</span>
2909
2910         into a set of runs ->
2911
2912             <foobar><image box><hello>< ><world>
2913
2914         Note that a text run can overlap multiple inline elements. InlineRunProvider::Run only stores a reference to
2915         the first inline element (continuous content can be accessed by iterating through the InlineContent ListHashSet).
2916         These runs are the input to the line breaking algoritm.
2917
2918         * Sources.txt:
2919         * WebCore.xcodeproj/project.pbxproj:
2920         * layout/inlineformatting/InlineFormattingContext.cpp:
2921         (WebCore::Layout::InlineFormattingContext::layout const):
2922         * layout/inlineformatting/InlineFormattingState.h:
2923         (WebCore::Layout::InlineFormattingState::inlineContent):
2924         * layout/inlineformatting/InlineItem.h: Added.
2925         (WebCore::Layout::InlineItem::layoutBox const):
2926         (WebCore::Layout::InlineItem::style const):
2927         (WebCore::Layout::InlineItemHashFunctions::hash):
2928         (WebCore::Layout::InlineItemHashFunctions::equal):
2929         (WebCore::Layout::InlineItemHashTranslator::hash):
2930         (WebCore::Layout::InlineItemHashTranslator::equal):
2931         (WebCore::Layout::InlineItem::InlineItem):
2932         (WebCore::Layout::InlineItem::type const):
2933         (WebCore::Layout::InlineItem::textContent const):
2934         * layout/inlineformatting/InlineRunProvider.cpp: Added.
2935         (WebCore::Layout::InlineRunProvider::InlineRunProvider):
2936         (WebCore::Layout::InlineRunProvider::append):
2937         (WebCore::Layout::InlineRunProvider::insertBefore):
2938         (WebCore::Layout::InlineRunProvider::remove):
2939         (WebCore::Layout::isWhitespace):
2940         (WebCore::Layout::isSoftLineBreak):
2941         (WebCore::Layout::InlineRunProvider::isContinousContent):
2942         (WebCore::Layout::InlineRunProvider::processInlineTextItem):
2943         (WebCore::Layout::InlineRunProvider::moveToNextNonWhitespacePosition):
2944         (WebCore::Layout::InlineRunProvider::moveToNextBreakablePosition):
2945         * layout/inlineformatting/InlineRunProvider.h: Added.
2946         (WebCore::Layout::InlineRunProvider::Run::type const):
2947         (WebCore::Layout::InlineRunProvider::Run::isText const):
2948         (WebCore::Layout::InlineRunProvider::Run::isWhitespace const):
2949         (WebCore::Layout::InlineRunProvider::Run::isNonWhitespace const):
2950         (WebCore::Layout::InlineRunProvider::Run::isLineBreak const):
2951         (WebCore::Layout::InlineRunProvider::Run::isBox const):
2952         (WebCore::Layout::InlineRunProvider::Run::isFloat const):
2953         (WebCore::Layout::InlineRunProvider::Run::TextContext::start const):
2954         (WebCore::Layout::InlineRunProvider::Run::TextContext::length const):
2955         (WebCore::Layout::InlineRunProvider::Run::TextContext::isCollapsed const):
2956         (WebCore::Layout::InlineRunProvider::Run::TextContext::setStart):
2957         (WebCore::Layout::InlineRunProvider::Run::TextContext::setLength):
2958         (WebCore::Layout::InlineRunProvider::Run::textContext const):
2959         (WebCore::Layout::InlineRunProvider::Run::style const):
2960         (WebCore::Layout::InlineRunProvider::Run::inlineItem const):
2961         (WebCore::Layout::InlineRunProvider::runs const):
2962         (WebCore::Layout::InlineRunProvider::Run::createBoxRun):
2963         (WebCore::Layout::InlineRunProvider::Run::createFloatRun):
2964         (WebCore::Layout::InlineRunProvider::Run::createSoftLineBreakRun):
2965         (WebCore::Layout::InlineRunProvider::Run::createHardLineBreakRun):
2966         (WebCore::Layout::InlineRunProvider::Run::createWhitespaceRun):
2967         (WebCore::Layout::InlineRunProvider::Run::createNonWhitespaceRun):
2968         (WebCore::Layout::InlineRunProvider::Run::Run):
2969         (WebCore::Layout::InlineRunProvider::Run::TextContext::TextContext):
2970         * layout/layouttree/LayoutBox.h:
2971         (WebCore::Layout::Box::isLineBreakBox const):
2972         * layout/layouttree/LayoutInlineBox.cpp:
2973         (WebCore::Layout::InlineBox::InlineBox):
2974         * layout/layouttree/LayoutInlineBox.h:
2975         (WebCore::Layout::InlineBox::hasTextContent const):
2976         (WebCore::Layout::InlineBox::textContent const):
2977         * layout/layouttree/LayoutLineBreakBox.cpp: Copied from Source/WebCore/layout/layouttree/LayoutInlineBox.cpp.
2978         (WebCore::Layout::LineBreakBox::LineBreakBox):
2979         * layout/layouttree/LayoutLineBreakBox.h: Copied from Source/WebCore/layout/layouttree/LayoutInlineBox.cpp.
2980
2981 2018-10-19  Ali Juma  <ajuma@chromium.org>
2982
2983         [IntersectionObserver] Handle zero-area intersections
2984         https://bugs.webkit.org/show_bug.cgi?id=189624
2985
2986         Reviewed by Simon Fraser.
2987
2988         Use edge-inclusive intersection when applying clips and intersecting with the
2989         root, so that two rects that touch each other are considered intersecting even
2990         if the area of their intersection is 0.
2991
2992         Covered by rebased tests in imported/w3c/web-platform-tests/intersection-observer.
2993
2994         * dom/Document.cpp:
2995         (WebCore::computeIntersectionState):
2996         (WebCore::Document::updateIntersectionObservations):
2997         (WebCore::computeIntersectionRects): Deleted.
2998
2999 2018-10-18  Eric Carlson  <eric.carlson@apple.com>
3000
3001         [MediaStream] Allow ports to optionally do screen capture in the UI process
3002         https://bugs.webkit.org/show_bug.cgi?id=190728
3003         <rdar://problem/45376824>
3004
3005         Reviewed by Jer Noble and Tim Horton.
3006
3007         No new tests, covered by existing tests.
3008
3009         * Sources.txt: Add RemoteVideoSample.cpp.
3010         * WebCore.xcodeproj/project.pbxproj: Ditto.
3011
3012         * platform/MediaSample.h:
3013         (WebCore::MediaSample::videoPixelFormat const):
3014
3015         * platform/graphics/RemoteVideoSample.cpp: Added.
3016         (WebCore::RemoteVideoSample::~RemoteVideoSample):
3017         (WebCore::RemoteVideoSample::create):
3018         (WebCore::RemoteVideoSample::RemoteVideoSample):
3019         (WebCore::RemoteVideoSample::surface):
3020         * platform/graphics/RemoteVideoSample.h: Added.
3021         (WebCore::RemoteVideoSample::time const):
3022         (WebCore::RemoteVideoSample::videoFormat const):
3023         (WebCore::RemoteVideoSample::size const):
3024         (WebCore::RemoteVideoSample::encode const):
3025         (WebCore::RemoteVideoSample::decode):
3026         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
3027         * platform/graphics/cv/ImageTransferSessionVT.h:
3028
3029         * platform/mediastream/RealtimeMediaSource.cpp:
3030         (WebCore::RealtimeMediaSource::remoteVideoSampleAvailable): Call observers.
3031         * platform/mediastream/RealtimeMediaSource.h:
3032
3033         * platform/mediastream/RealtimeVideoSource.cpp:
3034         (WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): Dispatch remote samples without
3035         resizing, resize local samples if necessary.
3036         * platform/mediastream/RealtimeVideoSource.h:
3037
3038         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3039         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Don't resize
3040         samples, it will be done in the base class if necessary.
3041
3042         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
3043         (WebCore::DisplayCaptureSourceCocoa::emitFrame): Don't resize samples when running in the UI
3044         process, it will be done in the web process.
3045
3046         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: Remove unneeded include.
3047
3048 2018-10-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
3049
3050         [CG] Adopt CG SPI for non-even cornered rounded rects
3051         https://bugs.webkit.org/show_bug.cgi?id=190155
3052
3053         Reviewed by Simon Fraser.
3054
3055         Instead of creating bezier curves for the non-even corners of the rounded
3056         rects, we should use the optimized SPI provided by CG.
3057
3058         * platform/graphics/cg/PathCG.cpp:
3059         (WebCore::Path::platformAddPathForRoundedRect):
3060
3061 2018-10-18  Justin Michaud  <justin_michaud@apple.com>
3062
3063         Add new image type for CSS painting API
3064         https://bugs.webkit.org/show_bug.cgi?id=190697
3065
3066         Reviewed by Dean Jackson.
3067
3068         Add a new image type for the CSS painting API, and hook it up so it can be drawn.
3069         For now, it uses a WebGL rendering context from OfflineCanvas because that was
3070         easy to hook up. The spec actually calls for a RenderingContext2D, which can be
3071         handled in another patch.
3072
3073         * Sources.txt:
3074         * WebCore.xcodeproj/project.pbxproj:
3075         * css/CSSImageGeneratorValue.cpp:
3076         (WebCore::CSSImageGeneratorValue::image):
3077         (WebCore::CSSImageGeneratorValue::isFixedSize const):
3078         (WebCore::CSSImageGeneratorValue::fixedSize):
3079         (WebCore::CSSImageGeneratorValue::isPending const):
3080         (WebCore::CSSImageGeneratorValue::knownToBeOpaque const):
3081         (WebCore::CSSImageGeneratorValue::loadSubimages):
3082         * css/CSSPaintCallback.h:
3083         * css/CSSPaintCallback.idl:
3084         * css/CSSPaintImageValue.cpp:
3085         (WebCore::CSSPaintImageValue::image):
3086         * css/CSSPaintImageValue.h:
3087         * platform/graphics/CustomPaintImage.cpp: Added.
3088         (WebCore::CustomPaintImage::CustomPaintImage):
3089         (WebCore::CustomPaintImage::doCustomPaint):
3090         (WebCore::CustomPaintImage::draw):
3091         (WebCore::CustomPaintImage::drawPattern):
3092         * platform/graphics/CustomPaintImage.h: Copied from Source/WebCore/css/CSSPaintCallback.h.
3093         * platform/graphics/Image.h:
3094         (WebCore::Image::isCustomPaintImage const):
3095         * platform/graphics/ImageBuffer.h:
3096         * platform/graphics/cairo/CairoOperations.cpp:
3097
3098 2018-10-18  Truitt Savell  <tsavell@apple.com>
3099
3100         Unreviewed, rolling out r237272.
3101
3102         Broke on device iOS builds and Windows builds
3103
3104         Reverted changeset:
3105
3106         "[MediaStream] Allow ports to optionally do screen capture in
3107         the UI process"
3108         https://bugs.webkit.org/show_bug.cgi?id=190728
3109         https://trac.webkit.org/changeset/237272
3110
3111 2018-10-18  Jer Noble  <jer.noble@apple.com>
3112
3113         [MSE] timestampOffset can introduce floating-point rounding errors to incoming samples
3114         https://bugs.webkit.org/show_bug.cgi?id=190590
3115         <rdar://problem/45275626>
3116
3117         Reviewed by Eric Carlson.
3118
3119         Test: media/media-source/media-source-timestampoffset-rounding-error.html
3120
3121         SourceBuffer.timestampOffset is a double property, which, when added to a MediaTime will
3122         result in a double-backed MediaTime as PTS & DTS. This can introduce rounding errors when
3123         these samples are appended as overlapping existing samples. Rather than converting a MediaTime
3124         to double-backed when adding the timestampOffset, convert the offset to a multiple of the
3125         sample's timeBase.
3126
3127         * Modules/mediasource/SourceBuffer.cpp:
3128         (WebCore::SourceBuffer::setTimestampOffset):
3129         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
3130
3131 2018-10-18  Eric Carlson  <eric.carlson@apple.com>
3132
3133         [MediaStream] Allow ports to optionally do screen capture in the UI process
3134         https://bugs.webkit.org/show_bug.cgi?id=190728
3135         <rdar://problem/45376824>
3136
3137         Reviewed by Jer Noble and Tim Horton.
3138
3139         No new tests, covered by existing tests.
3140
3141         * Sources.txt: Add RemoteVideoSample.cpp.
3142         * WebCore.xcodeproj/project.pbxproj: Ditto.
3143
3144         * platform/MediaSample.h:
3145         (WebCore::MediaSample::videoPixelFormat const):
3146
3147         * platform/graphics/RemoteVideoSample.cpp: Added.
3148         (WebCore::RemoteVideoSample::~RemoteVideoSample):
3149         (WebCore::RemoteVideoSample::create):
3150         (WebCore::RemoteVideoSample::RemoteVideoSample):
3151         (WebCore::RemoteVideoSample::surface):
3152         * platform/graphics/RemoteVideoSample.h: Added.
3153         (WebCore::RemoteVideoSample::time const):
3154         (WebCore::RemoteVideoSample::videoFormat const):
3155         (WebCore::RemoteVideoSample::size const):
3156         (WebCore::RemoteVideoSample::encode const):
3157         (WebCore::RemoteVideoSample::decode):
3158         * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h:
3159         * platform/graphics/cv/ImageTransferSessionVT.h:
3160
3161         * platform/mediastream/RealtimeMediaSource.cpp:
3162         (WebCore::RealtimeMediaSource::remoteVideoSampleAvailable): Call observers.
3163         * platform/mediastream/RealtimeMediaSource.h:
3164
3165         * platform/mediastream/RealtimeVideoSource.cpp:
3166         (WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): Dispatch remote samples without
3167         resizing, resize local samples if necessary.
3168         * platform/mediastream/RealtimeVideoSource.h:
3169
3170         * platform/mediastream/mac/AVVideoCaptureSource.mm:
3171         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Don't resize
3172         samples, it will be done in the base class if necessary.
3173
3174         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
3175         (WebCore::DisplayCaptureSourceCocoa::emitFrame): Don't resize samples when running in the UI
3176         process, it will be done in the web process.
3177
3178         * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: Remove unneeded include.
3179
3180 2018-10-18  Jer Noble  <jer.noble@apple.com>
3181
3182         Safari is not able to adapt between H264 streams with EditList and without EditList
3183         https://bugs.webkit.org/show_bug.cgi?id=190638
3184         <rdar://problem/45342208>
3185
3186         Reviewed by Eric Carlson.
3187
3188         Test: media/media-source/media-source-append-overlapping-dts.html
3189
3190         The MSE frame replacement algorithm does not take decode timestamps into account; this can
3191         lead to situations where the replacement algorithm may leave in place frames where the 
3192         presentationTimestamp is less than the replacement frame, but whose decodeTimestamp is
3193         after the replacement frame. When re-enqueuing these frames, they may cause a decode error
3194         if they break the group-of-pictures sequence of the replaced range.
3195
3196         * Modules/mediasource/SampleMap.cpp:
3197         (WebCore::DecodeOrderSampleMap::findSamplesBetweenDecodeKeys):
3198         * Modules/mediasource/SampleMap.h:
3199         * Modules/mediasource/SourceBuffer.cpp:
3200         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
3201
3202 2018-10-18  Per Arne Vollan  <pvollan@apple.com>
3203
3204         [WebVTT] Region parameter and value should be separated by ':'
3205         https://bugs.webkit.org/show_bug.cgi?id=190735
3206
3207         Reviewed by Eric Carlson.
3208
3209         This is specified in https://w3c.github.io/webvtt/#region-settings.
3210
3211         No new tests. Modified existing tests.
3212
3213         * html/track/VTTRegion.cpp:
3214         (WebCore::VTTRegion::setRegionSettings):
3215
3216 2018-10-18  Jer Noble  <jer.noble@apple.com>
3217
3218         Add support for MediaKeyEncryptionScheme
3219         https://bugs.webkit.org/show_bug.cgi?id=190173
3220
3221         Reviewed by Eric Carlson.
3222
3223         Added sub-tests to: media/encrypted-media/mock-navigator-requestMediaKeySystemAccess.html
3224
3225         Add support for the MediaKeyEncryptionScheme extension to EME, as detailed here:
3226         <https://github.com/WICG/encrypted-media-encryption-scheme/blob/master/explainer.md>
3227
3228         As the strings "cenc" and "cbcs" are explicitly lower-case, add support to the bindings generator to keep
3229         those strings as lower-case when converting from IDL.
3230
3231         * CMakeLists.txt:
3232         * DerivedSources.make:
3233         * Modules/encryptedmedia/MediaKeyEncryptionScheme.h:
3234         * Modules/encryptedmedia/MediaKeyEncryptionScheme.idl:
3235         * Modules/encryptedmedia/MediaKeySystemMediaCapability.h:
3236         * Modules/encryptedmedia/MediaKeySystemMediaCapability.idl:
3237         * Sources.txt:
3238         * WebCore.xcodeproj/project.pbxproj:
3239         * bindings/scripts/CodeGenerator.pm:
3240         (WK_ucfirst):
3241         * platform/encryptedmedia/CDMEncryptionScheme.h: Copied from Source/WebCore/testing/MockCDMFactory.idl.
3242         * platform/encryptedmedia/CDMMediaCapability.h:
3243         * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
3244         (WebCore::CDMPrivateFairPlayStreaming::supportsConfiguration const):
3245         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
3246         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
3247         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability):
3248         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
3249         * testing/MockCDMFactory.cpp:
3250         (WebCore::m_supportedEncryptionSchemes):
3251         (WebCore::MockCDM::supportsConfiguration const):
3252         * testing/MockCDMFactory.h:
3253         (WebCore::MockCDMFactory::supportedEncryptionSchemes const):
3254         (WebCore::MockCDMFactory::setSupportedEncryptionSchemes):
3255         * testing/MockCDMFactory.idl:
3256
3257 2018-10-18  Alexey Proskuryakov  <ap@apple.com>
3258
3259         Switch from PLATFORM(IOS) to PLATFORM(IOS_FAMILY)
3260         https://bugs.webkit.org/show_bug.cgi?id=190729
3261
3262         Reviewed by Tim Horton.
3263
3264         * DerivedSources.make:
3265         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
3266         (WebCore::subLocality):
3267         (WebCore::setSubLocality):
3268         (WebCore::subAdministrativeArea):
3269         (WebCore::setSubAdministrativeArea):
3270         * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp:
3271         * Modules/geolocation/Geolocation.cpp:
3272         (WebCore::isRequestFromIBooks):
3273         * Modules/geolocation/GeolocationPosition.h:
3274         * Modules/geolocation/NavigatorGeolocation.cpp:
3275         * Modules/geolocation/NavigatorGeolocation.h:
3276         * Modules/geolocation/ios/GeolocationPositionIOS.mm:
3277         * Modules/mediasession/WebMediaSessionManager.cpp:
3278         * Modules/mediasession/WebMediaSessionManager.h:
3279         * Modules/mediastream/MediaDevicesRequest.cpp:
3280         (WebCore::MediaDevicesRequest::filterDeviceList):
3281         * Modules/plugins/QuickTimePluginReplacement.mm:
3282         (WebCore::JSQuickTimePluginReplacement::timedMetaData const):
3283         (WebCore::JSQuickTimePluginReplacement::accessLog const):
3284         (WebCore::JSQuickTimePluginReplacement::errorLog const):
3285         * Modules/speech/SpeechSynthesis.cpp:
3286         (WebCore::SpeechSynthesis::SpeechSynthesis):
3287         (WebCore::SpeechSynthesis::speak):
3288         * Modules/speech/SpeechSynthesis.h:
3289         * Modules/webaudio/AudioContext.cpp:
3290         * Modules/webaudio/AudioScheduledSourceNode.cpp:
3291         * Modules/webdatabase/Database.cpp:
3292         (WebCore::Database::performOpenAndVerify):
3293         * Modules/webdatabase/DatabaseContext.h:
3294         * Modules/webdatabase/DatabaseManagerClient.h:
3295         * Modules/webdatabase/DatabaseTracker.cpp:
3296         (WebCore::DatabaseTracker::deleteDatabaseFile):
3297         * Modules/webdatabase/DatabaseTracker.h:
3298         * WebCorePrefix.h:
3299         * accessibility/AXObjectCache.cpp:
3300         (WebCore::createFromRenderer):
3301         * accessibility/AccessibilityMediaObject.cpp:
3302         * accessibility/AccessibilityMediaObject.h:
3303         * accessibility/AccessibilityMenuList.cpp:
3304         (WebCore::AccessibilityMenuList::press):
3305         (WebCore::AccessibilityMenuList::isCollapsed const):
3306         * accessibility/AccessibilityObject.cpp:
3307         (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex):
3308         (WebCore::AccessibilityObject::press):
3309         (WebCore::AccessibilityObject::actionVerb const):
3310         * accessibility/AccessibilityObject.h:
3311         * accessibility/AccessibilityRenderObject.cpp:
3312         (WebCore::AccessibilityRenderObject::stringValue const):
3313         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3314         (WebCore::AccessibilityRenderObject::actionVerb const):
3315         * accessibility/AccessibilityTableColumn.cpp:
3316         (WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored const):
3317         * accessibility/AccessibilityTableHeaderContainer.cpp:
3318         (WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored const):
3319         * accessibility/ios/AXObjectCacheIOS.mm:
3320         * accessibility/ios/AccessibilityObjectIOS.mm:
3321         * accessibility/ios/WebAccessibilityObjectWrapperIOS.h:
3322         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3323         * bindings/js/CommonVM.cpp:
3324         (WebCore::commonVMSlow):
3325         * bindings/js/JSCallbackData.h:
3326         (WebCore::JSCallbackData::~JSCallbackData):
3327         * bindings/js/JSDOMWindowBase.cpp:
3328         (WebCore::JSDOMWindowBase::shouldInterruptScriptBeforeTimeout):
3329         * bindings/js/ScriptController.cpp:
3330         (WebCore::ScriptController::initializeThreading):
3331         * bridge/objc/objc_class.mm:
3332         (JSC::Bindings::ObjcClass::fieldNamed const):
3333         * crypto/CommonCryptoUtilities.h:
3334         * crypto/mac/CryptoKeyRSAMac.cpp:
3335         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
3336         (WebCore::masterKeyAccountNameForCurrentApplication):
3337         (WebCore::createAndStoreMasterKey):
3338         * css/CSSComputedStyleDeclaration.cpp:
3339         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3340         * css/CSSProperties.json:
3341         * css/CSSStyleDeclaration.cpp:
3342         * css/CSSValueKeywords.in:
3343         * css/MediaQueryEvaluator.cpp:
3344         (WebCore::prefersReducedMotionEvaluate):
3345         * css/StyleBuilderConverter.h:
3346         * css/html.css:
3347         (video):
3348         (input, textarea, keygen, select, button):
3349         (#if defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY):
3350         (#if defined(ENABLE_INPUT_TYPE_DATE) && ENABLE_INPUT_TYPE_DATE):
3351         (#endif):
3352         (#if defined(ENABLE_DATALIST_ELEMENT) && ENABLE_DATALIST_ELEMENT):
3353         (textarea):
3354         (input:matches([type="radio"], [type="checkbox"])):
3355         (input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::-webkit-file-upload-button, button):
3356         (input[type="range"]::-webkit-slider-thumb, input[type="range"]::-webkit-media-slider-thumb):
3357         (#if !(defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY)):
3358         (input[type="checkbox"]):
3359         (#endif // defined(ENABLE_INPUT_TYPE_COLOR) && ENABLE_INPUT_TYPE_COLOR):
3360         (#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS): Deleted.
3361         (#if !(defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS)): Deleted.