Place Fontconfig-specific RefPtr specializations in RefPtrFontconfig.h
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-11-05  Zan Dobersek  <zdobersek@igalia.com>
2
3         Place Fontconfig-specific RefPtr specializations in RefPtrFontconfig.h
4         https://bugs.webkit.org/show_bug.cgi?id=191267
5
6         Reviewed by Michael Catanzaro.
7
8         Move the Fontconfig-specific RefPtr specialization declarations from
9         RefPtrCairo.h to RefPtrFontconfig.h, with definitions moved to the new
10         RefPtrFontconfig.cpp implementation file. These specializations are
11         not tied to Cairo in any way.
12
13         * platform/FreeType.cmake:
14         * platform/graphics/FontPlatformData.h:
15         * platform/graphics/cairo/RefPtrCairo.cpp:
16         * platform/graphics/cairo/RefPtrCairo.h:
17         * platform/graphics/freetype/FontCacheFreeType.cpp:
18         * platform/graphics/freetype/RefPtrFontconfig.cpp: Added.
19         (WTF::refIfNotNull):
20         (WTF::derefIfNotNull):
21         * platform/graphics/freetype/RefPtrFontconfig.h: Copied from Source/WebCore/platform/graphics/cairo/RefPtrCairo.h.
22
23 2018-11-05  Don Olmstead  <don.olmstead@sony.com>
24
25         [CMake] Fix WebCore/Modules includes
26         https://bugs.webkit.org/show_bug.cgi?id=191287
27
28         Reviewed by Fujii Hironori.
29
30         No new tests. No change in behavior.
31
32         Add in applicationmanifest to the list of includes and sort the
33         modules directory.
34
35         * CMakeLists.txt:
36
37 2018-11-05  Myles C. Maxfield  <mmaxfield@apple.com>
38
39         Cache glyph paths and share underline skipping code between all the ports
40         https://bugs.webkit.org/show_bug.cgi?id=191239
41
42         Reviewed by Alex Christensen.
43
44         I was hoping that caching the glyph paths was going to be a performance progression,
45         but it turns out that the additional overhead of WebCore::Path compensated for it.
46         In total, the performance is the same (my testing says that this patch is a 1%
47         progression, but that's within the noise).
48
49         Because the ink skipping logic is now shared among all ports, Windows now gets it for
50         free.
51
52         Test: PerformanceTests/Layout/underline.html
53
54         * platform/graphics/Font.cpp:
55         (WebCore::Font::pathForGlyph const):
56         * platform/graphics/Font.h:
57         * platform/graphics/FontCascade.cpp:
58         (WebCore::computeUnderlineType):
59         (WebCore::GlyphIterationState::GlyphIterationState):
60         (WebCore::findIntersectionPoint):
61         (WebCore::updateX):
62         (WebCore::findPathIntersections):
63         (WebCore::GlyphToPathTranslator::GlyphToPathTranslator):
64         (WebCore::GlyphToPathTranslator::containsMorePaths):
65         (WebCore::GlyphToPathTranslator::path):
66         (WebCore::GlyphToPathTranslator::extents):
67         (WebCore::GlyphToPathTranslator::underlineType):
68         (WebCore::GlyphToPathTranslator::advance):
69         (WebCore::FontCascade::dashesForIntersectionsWithRect const):
70         * platform/graphics/FontCascade.h:
71         * platform/graphics/GlyphMetricsMap.h:
72         (WebCore::GlyphMetricsMap::existingMetricsForGlyph):
73         (WebCore::GlyphMetricsMap::GlyphMetricsPage::existingMetricsForGlyph const):
74         (WebCore::GlyphMetricsMap<std::optional<Path>>::unknownMetrics):
75         * platform/graphics/TextRun.h:
76         * platform/graphics/cairo/FontCairo.cpp:
77         (WebCore::Font::platformPathForGlyph const):
78         (WebCore::GlyphIterationState::GlyphIterationState): Deleted.
79         (WebCore::findIntersectionPoint): Deleted.
80         (WebCore::updateX): Deleted.
81         (WebCore::findPathIntersections): Deleted.
82         (): Deleted.
83         (WebCore::CairoGlyphToPathTranslator::path): Deleted.
84         (WebCore::CairoGlyphToPathTranslator::extents): Deleted.
85         (WebCore::CairoGlyphToPathTranslator::underlineType): Deleted.
86         (WebCore::CairoGlyphToPathTranslator::advance): Deleted.
87         (WebCore::FontCascade::dashesForIntersectionsWithRect const): Deleted.
88         * platform/graphics/cocoa/FontCascadeCocoa.mm:
89         (WebCore::GlyphIterationState::GlyphIterationState): Deleted.
90         (WebCore::findIntersectionPoint): Deleted.
91         (WebCore::updateX): Deleted.
92         (WebCore::findPathIntersections): Deleted.
93         (): Deleted.
94         (WebCore::MacGlyphToPathTranslator::path): Deleted.
95         (WebCore::MacGlyphToPathTranslator::extents): Deleted.
96         (WebCore::MacGlyphToPathTranslator::underlineType): Deleted.
97         (WebCore::MacGlyphToPathTranslator::advance): Deleted.
98         (WebCore::FontCascade::dashesForIntersectionsWithRect const): Deleted.
99         * platform/graphics/cocoa/FontCocoa.mm:
100         (WebCore::Font::platformPathForGlyph const):
101         * rendering/TextDecorationPainter.cpp:
102         (WebCore::drawSkipInkUnderline):
103         (WebCore::TextDecorationPainter::paintTextDecoration):
104
105 2018-11-05  Myles C. Maxfield  <mmaxfield@apple.com>
106
107         Clean up text decoration drawing code
108         https://bugs.webkit.org/show_bug.cgi?id=191245
109
110         Reviewed by Zalan Bujtas.
111
112         This is some general clean up of the text decorations code. There is no behavior change.
113
114         This patch modifies GraphicsContext::drawLineForText() & friends to accept a FloatRect instead of a FloatPoint + float width.
115         This is helpful because it allows for easier bounding box calculations.
116         This patch also removes some redundant computations that the skip:ink codepath was performing.
117         This patch also refactors the wavy decoration parameters to not use out params.
118
119         No new tests because there is no behavior change.
120
121         * platform/graphics/GraphicsContext.cpp:
122         (WebCore::GraphicsContext::computeUnderlineBoundsForText):
123         (WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText):
124         * platform/graphics/GraphicsContext.h:
125         * platform/graphics/GraphicsContextImpl.h:
126         * platform/graphics/cg/GraphicsContextCG.cpp:
127         (WebCore::GraphicsContext::drawLineForText):
128         (WebCore::GraphicsContext::drawLinesForText):
129         * platform/graphics/displaylists/DisplayListItems.cpp:
130         (WebCore::DisplayList::DrawLinesForText::apply const):
131         (WebCore::DisplayList::DrawLinesForText::localBounds const):
132         (WebCore::DisplayList::operator<<):
133         * platform/graphics/displaylists/DisplayListItems.h:
134         (WebCore::DisplayList::DrawLinesForText::create):
135         (WebCore::DisplayList::DrawLinesForText::thickness const):
136         (WebCore::DisplayList::DrawLinesForText::DrawLinesForText):
137         * platform/graphics/displaylists/DisplayListRecorder.cpp:
138         (WebCore::DisplayList::Recorder::drawLinesForText):
139         * platform/graphics/displaylists/DisplayListRecorder.h:
140         * rendering/InlineTextBox.cpp:
141         (WebCore::InlineTextBox::paintMarkedTextDecoration):
142         (WebCore::InlineTextBox::paintCompositionUnderline const):
143         * rendering/SimpleLineLayoutFunctions.cpp:
144         (WebCore::SimpleLineLayout::paintFlow):
145         * rendering/TextDecorationPainter.cpp:
146         (WebCore::strokeWavyTextDecoration):
147         (WebCore::translateIntersectionPointsToSkipInkBoundaries):
148         (WebCore::TextDecorationPainter::TextDecorationPainter):
149         (WebCore::TextDecorationPainter::paintTextDecoration):
150         (WebCore::drawSkipInkUnderline): Deleted.
151         * rendering/TextDecorationPainter.h:
152         (WebCore::TextDecorationPainter::setInlineTextBox):
153         (WebCore::TextDecorationPainter::setWidth):
154         (WebCore::TextDecorationPainter::setFont): Deleted.
155         (WebCore::TextDecorationPainter::setBaseline): Deleted.
156         * style/InlineTextBoxStyle.cpp:
157         (WebCore::getWavyStrokeParameters):
158         (WebCore::visualOverflowForDecorations):
159         * style/InlineTextBoxStyle.h:
160
161 2018-11-05  Myles C. Maxfield  <mmaxfield@apple.com>
162
163         Fix the Windows build after r237835
164         https://bugs.webkit.org/show_bug.cgi?id=191242
165
166         Reviewed by Simon Fraser.
167
168         * rendering/style/TextDecorationThickness.h:
169         (WebCore::TextDecorationThickness::operator== const):
170
171 2018-11-05  Wenson Hsieh  <wenson_hsieh@apple.com>
172
173         [iOS] Swatch appears squished and off-center in inputs of type color
174         https://bugs.webkit.org/show_bug.cgi?id=191279
175         <rdar://problem/45816319>
176
177         Reviewed by Tim Horton.
178
179         This patch makes some small adjustments to color inputs on iOS to bring them closer to the intended design.
180         See comments below for more details.
181
182         Tests:  fast/forms/color/color-input-uses-color-well-appearance.html
183                 fast/forms/color/input-appearance-color.html
184
185         * css/html.css:
186
187         Adjust the UA stylesheet for color inputs on iOS.
188
189         * rendering/RenderTheme.cpp:
190         (WebCore::RenderTheme::paintDecorations):
191
192         When painting decorations for `ColorWellPart`, treat it as a standard button instead of the square button
193         appearance.
194
195         (WebCore::RenderTheme::colorInputStyleSheet const):
196
197         Add `-webkit-appearance: color-well;` to the stylesheet for color inputs. Previously, this was special-cased on
198         iOS, where color input elements had appearances of `textfield`; however, this patch makes some adjustments to
199         RenderThemeIOS, allowing us to use `color-well` on iOS.
200
201         * rendering/RenderTheme.h:
202         (WebCore::RenderTheme::platformUsesColorWellAppearance const): Deleted.
203
204         Remove this from RenderTheme. This is no longer necessary, since all platforms now use
205         `-webkit-appearance: color-well;`.
206
207         * rendering/RenderThemeIOS.h:
208         * rendering/RenderThemeIOS.mm:
209         (WebCore::RenderThemeIOS::adjustButtonStyle const):
210
211         When painting buttons for color inputs, don't add rounded corners that are present by default for regular
212         buttons.
213
214 2018-11-05  Eric Carlson  <eric.carlson@apple.com>
215
216         [MediaStream] An audio track should be muted when capture is interrupted by the OS.
217         https://bugs.webkit.org/show_bug.cgi?id= 191283
218          <rdar://problem/45773103>
219
220         Reviewed by Jon Lee.
221
222         Test: fast/mediastream/media-stream-track-interrupted.html
223
224         * platform/mediastream/RealtimeMediaSource.cpp:
225         (WebCore::RealtimeMediaSource::setInterruptedForTesting):
226         * platform/mediastream/RealtimeMediaSource.h:
227         * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
228         (WebCore::CoreAudioCaptureSource::beginInterruption):
229         (WebCore::CoreAudioCaptureSource::endInterruption):
230         * testing/Internals.cpp:
231         (WebCore::Internals::setMediaStreamSourceInterrupted):
232         * testing/Internals.h:
233         * testing/Internals.idl:
234
235 2018-11-05  Myles C. Maxfield  <mmaxfield@apple.com>
236
237         Parsing support for text-underline-offset and text-decoration-thickness
238         https://bugs.webkit.org/show_bug.cgi?id=191242
239
240         Reviewed by Simon Fraser.
241
242         Before we can implement the properties properly, we have to parse them.
243
244         https://github.com/w3c/csswg-drafts/issues/3118#issuecomment-432297480 describes the grammar:
245         text-underline-position: auto | [ [ under | from-font] || [ left | right ] ]
246         text-underline-offset: auto | <length>
247         text-decoration-thickness: auto | from-font | <length>
248
249         This patch also takes the opportunity to update the grammar of text-underline-position to match the spec,
250         and to add an alias to the unprefixed version.
251
252         We still don't support the left and right values on text-underline-position. We should add those eventually.
253
254         Tests: fast/css3-text/css3-text-decoration/text-decoration-thickness-parse.html
255                fast/css3-text/css3-text-decoration/text-underline-offset-parse.html
256
257         * WebCore.xcodeproj/project.pbxproj:
258         * css/CSSComputedStyleDeclaration.cpp:
259         (WebCore::textUnderlineOffsetToCSSValue):
260         (WebCore::textDecorationThicknessToCSSValue):
261         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
262         * css/CSSPrimitiveValueMappings.h:
263         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
264         (WebCore::CSSPrimitiveValue::operator TextUnderlinePosition const):
265         (WebCore::CSSPrimitiveValue::operator OptionSet<TextUnderlinePosition> const): Deleted.
266         * css/CSSProperties.json:
267         * css/CSSValueKeywords.in:
268         * css/StyleBuilderConverter.h:
269         (WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
270         (WebCore::StyleBuilderConverter::convertTextUnderlineOffset):
271         (WebCore::StyleBuilderConverter::convertTextDecorationThickness):
272         * css/StyleResolver.cpp:
273         (WebCore::shouldApplyPropertyInParseOrder):
274         * css/parser/CSSPropertyParser.cpp:
275         (WebCore::consumeTextUnderlineOffset):
276         (WebCore::consumeTextDecorationThickness):
277         (WebCore::CSSPropertyParser::parseSingleValue):
278         * rendering/style/RenderStyle.h:
279         (WebCore::RenderStyle::textUnderlinePosition const):
280         (WebCore::RenderStyle::textUnderlineOffset const):
281         (WebCore::RenderStyle::textDecorationThickness const):
282         (WebCore::RenderStyle::setTextUnderlinePosition):
283         (WebCore::RenderStyle::setTextUnderlineOffset):
284         (WebCore::RenderStyle::setTextDecorationThickness):
285         (WebCore::RenderStyle::initialTextUnderlinePosition):
286         (WebCore::RenderStyle::initialTextUnderlineOffset):
287         (WebCore::RenderStyle::initialTextDecorationThickness):
288         * rendering/style/RenderStyleConstants.h:
289         * rendering/style/StyleRareInheritedData.cpp:
290         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
291         (WebCore::StyleRareInheritedData::operator== const):
292         * rendering/style/StyleRareInheritedData.h:
293         * rendering/style/TextDecorationThickness.h: Added.
294         (WebCore::TextDecorationThickness::createWithAuto):
295         (WebCore::TextDecorationThickness::createFromFont):
296         (WebCore::TextDecorationThickness::createWithLength):
297         (WebCore::TextDecorationThickness::isAuto const):
298         (WebCore::TextDecorationThickness::isFromFont const):
299         (WebCore::TextDecorationThickness::isLength const):
300         (WebCore::TextDecorationThickness::setLengthValue):
301         (WebCore::TextDecorationThickness::lengthValue const):
302         (WebCore::TextDecorationThickness::operator== const):
303         (WebCore::TextDecorationThickness::operator!= const):
304         (WebCore::TextDecorationThickness::TextDecorationThickness):
305         (WebCore::operator<<):
306         * rendering/style/TextUnderlineOffset.h: Added.
307         (WebCore::TextUnderlineOffset::createWithAuto):
308         (WebCore::TextUnderlineOffset::createWithLength):
309         (WebCore::TextUnderlineOffset::isAuto const):
310         (WebCore::TextUnderlineOffset::isLength const):
311         (WebCore::TextUnderlineOffset::setLengthValue):
312         (WebCore::TextUnderlineOffset::lengthValue const):
313         (WebCore::TextUnderlineOffset::lengthOr const):
314         (WebCore::TextUnderlineOffset::operator== const):
315         (WebCore::TextUnderlineOffset::operator!= const):
316         (WebCore::TextUnderlineOffset::TextUnderlineOffset):
317         (WebCore::operator<<):
318         * style/InlineTextBoxStyle.cpp:
319         (WebCore::computeUnderlineOffset):
320         * style/InlineTextBoxStyle.h:
321
322 2018-11-05  Myles C. Maxfield  <mmaxfield@apple.com>
323
324         Spelling dots are drawn in the wrong place
325         https://bugs.webkit.org/show_bug.cgi?id=190764
326
327         Reviewed by Dean Jackson.
328
329         - Dots should not be clipped.
330         - Dots should be horizontally centered.
331         - Dots should be drawn behind the text.
332         - Distance from the baseline to the top of the dot should be 11.035% of font size.
333         - Dot diameter should be 13.247% of the font size.
334         - Distance between the dots (right side of the left dot to left side of the right dot) should be 9.457% of the font size.
335         - The "font size" used in these calculations should be clamped so it's 10px <= font size <= 40px.
336
337         Tests: editing/spelling/spelling-dots-position-2.html
338                editing/spelling/spelling-dots-position-3.html
339                editing/spelling/spelling-dots-position.html
340                editing/spelling/spelling-dots-repaint.html
341
342         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
343         (WebCore::colorForMarkerLineStyle): Align iOS and macOS implementations.
344         (WebCore::GraphicsContext::drawDotsForDocumentMarker): Place the dots correctly.
345         * rendering/InlineFlowBox.cpp:
346         (WebCore::InlineFlowBox::addToLine): The KnownToHaveNoOverflow flag should be cleared if the element has spelling dots,
347             because there is no guarantee the spelling dots will lie inside the layout rect of the element.
348         (WebCore::InlineFlowBox::addTextBoxVisualOverflow): Update the repaint rects to include splling dot positions.
349         * rendering/InlineFlowBox.h: Comments should explain why, not say what.
350         * rendering/InlineTextBox.cpp:
351         (WebCore::InlineTextBox::paint): Draw the dots behind the text.
352         (WebCore::InlineTextBox::hasMarkers const): Convenience.
353         (WebCore::InlineTextBox::paintPlatformDocumentMarkers): Refactor bounds information into a helper function.
354         (WebCore::InlineTextBox::calculateUnionOfAllDocumentMarkerBounds const): Use for repaint rect calculation.
355         (WebCore::InlineTextBox::calculateDocumentMarkerBounds const): Place the dots correctly.
356         (WebCore::InlineTextBox::paintPlatformDocumentMarker): Call the helper method.
357         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const):
358         (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers): Deleted.
359         * rendering/InlineTextBox.h: Declare the helper methods.
360         * rendering/SimpleLineLayout.cpp: Simple line layout doesn't know how to paint spelling dots, so make the presence of
361             spelling dots opt us out of SLL.
362         (WebCore::SimpleLineLayout::canUseForWithReason):
363         * rendering/SimpleLineLayoutCoverage.cpp:
364         (WebCore::SimpleLineLayout::printReason):
365         * rendering/SimpleLineLayoutCoverage.h: Add a new opt-out reason.
366
367 2018-11-05  Dean Jackson  <dino@apple.com>
368
369         Attempted build fix.
370
371         * dom/messageports/MessagePortChannelRegistry.cpp:
372
373 2018-11-05  Chris Dumez  <cdumez@apple.com>
374
375         Crash under DOMWindow::postMessageTimerFired()
376         https://bugs.webkit.org/show_bug.cgi?id=191217
377         <rdar://problem/40888466>
378
379         Reviewed by Geoffrey Garen.
380
381         Protect the frame in DOMWindow::postMessageTimerFired() before calling dispatchEvent() as dispatching the
382         event may cause JS to run and this JS may cause the frame to be destroyed, in which case we will crash
383         when trying to use the frame on the next line.
384
385         Test: fast/dom/Window/remove-frame-in-message-event-handler.html
386
387         * page/DOMWindow.cpp:
388         (WebCore::DOMWindow::postMessageTimerFired):
389
390 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
391
392         [GStreamer] Fix EncodedImage timestamps to match what libWebRTC expects
393         https://bugs.webkit.org/show_bug.cgi?id=190035
394
395         Reviewed by Philippe Normand.
396
397         We can't rely on GStreamer timestamps to pass to EncodedImages after encoding
398         because libWebRTC doesn't use the timestamp we fed it but does
399         some computation on the input timestamp in the images we pass in before it passes
400         them back to the encoder. Then internally LibWebRTC relies on those exact timestamps
401         passed into the encoder to do checks and compute RTP timestamps so we need to carefully
402         pass the exact timestamps to LibWebRTC (in practice we still use GStreamer timestamps in
403         all the GStreamer processing pipelines as the WebRTC object basically wraps the "same"
404         `GstSample` all around, but we are not synced on the clock anyway).
405
406         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
407         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp:
408         (WebCore::LibWebRTCVideoFrameFromGStreamerSample):
409         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.h:
410         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
411         (WebCore::GStreamerVideoDecoder::newSampleCallback):
412         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
413         (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
414         (WebCore::GStreamerVideoEncoder::newSampleCallback):
415
416 2018-11-05  Wenson Hsieh  <wenson_hsieh@apple.com>
417
418         [iOS] Changing view scale sometimes does not zoom the page to the new initial scale when the page is zoomed in when ignoring meta viewport
419         https://bugs.webkit.org/show_bug.cgi?id=191226
420         <rdar://problem/45781765>
421
422         Reviewed by Tim Horton.
423
424         When `_setViewScale:` SPI is used to adjust the layout scale factor of the page, we multiply minimum, initial
425         and maximum scales by the given layout scale factor to adjust for a larger or smaller minimum layout size.
426         However, in the case where the layout size scale factor is greater than 1 and we're also forcing the viewport to
427         be scalable, we override the default minimum scale with 1 (i.e. `forceAlwaysUserScalableMinimumScale`). This
428         means that the might be off by a small margin due to rounding error when computing the content width and view
429         width (see: r237743).
430
431         This means that in the case where (1) the viewport is forced to be user-scalable, and (2) we're ignoring meta
432         viewport parameters, and (3) `_viewScale` exceeds 1, we may end up computing a slightly different minimum scale
433         than the default minimum scale multiplied by the layout size scale factor; subsequently, the page scale factor
434         will be slightly different from initial scale, such that we'll no longer zoom to the new initial scale when
435         changing view scale.
436
437         This patch adjusts `forceAlwaysUserScalableMinimumScale` and `forceAlwaysUserScalableMaximumScale` to take the
438         current layout scale factor into account when computing min and max scales when the viewport is forced to be
439         always scalable.
440
441         Test: fast/viewport/ios/minimum-scale-after-changing-view-scale.html
442
443         * page/ViewportConfiguration.cpp:
444         (WebCore::ViewportConfiguration::minimumScale const):
445         * page/ViewportConfiguration.h:
446         (WebCore::ViewportConfiguration::maximumScale const):
447         (WebCore::ViewportConfiguration::forceAlwaysUserScalableMaximumScale const):
448         (WebCore::ViewportConfiguration::forceAlwaysUserScalableMinimumScale const):
449
450         Turn these from constant values to const functions on ViewportConfiguration, which factor in the current
451         viewport layout size scale factor.
452
453 2018-11-05  Dean Jackson  <dino@apple.com>
454
455         Expose a constructor for PointerEvent from PlatformTouchEvent
456         https://bugs.webkit.org/show_bug.cgi?id=191238
457         <rdar://problem/45795682>
458
459         Reviewed by Antoine Quint.
460
461         Implement a constructor that takes a PlatformTouchEvent to
462         create a PointerEvent. At the moment the code to call this
463         constructor will live in WebKitAdditions, so no new tests
464         yet.
465
466         * SourcesCocoa.txt: Add PointerEventIOS.cpp.
467         * WebCore.xcodeproj/project.pbxproj: Ditto.
468         * dom/EventNames.h: Add macros for pointerdown, pointermove,
469              pointerup, pointercancel.
470         * dom/PointerEvent.cpp: Remove JSC namespace.
471         * dom/PointerEvent.h: Add create and constructor that takes
472              a PlatformTouchEvent.
473         * dom/ios/PointerEventIOS.cpp: Added.
474
475 2018-11-05  Ryan Haddad  <ryanhaddad@apple.com>
476
477         Unreviewed, rolling out r237785.
478
479         Introduced layout test and API test failures on macOS and iOS.
480
481         Reverted changeset:
482
483         "[iOS] Issue initial paint soon after the visuallyNonEmpty
484         milestone is fired."
485         https://bugs.webkit.org/show_bug.cgi?id=191078
486         https://trac.webkit.org/changeset/237785
487
488 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
489
490         [GStreamer][WebRTC] Error out when simulcast is activated
491         https://bugs.webkit.org/show_bug.cgi?id=190678
492
493         Reviewed by Philippe Normand.
494
495         Implementing it is not for now yet.
496
497         Tests for simulcast have been disabled as they now fail (instead of crashing).
498
499         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
500         (WebCore::GStreamerVideoEncoder::InitEncode):
501
502 2018-11-05  Youenn Fablet  <youenn@apple.com>
503
504         RealtimeOutgoingAudioSource subclasses should observe its source when fully constructed
505         https://bugs.webkit.org/show_bug.cgi?id=191241
506
507         Reviewed by Eric Carlson.
508
509         Moving the logic to observe the audio source to the point where the
510         RealtimeOutgoingAudioSource subclass is fully initialized.
511         Covered by existing tests.
512
513         * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
514         (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
515         (WebCore::RealtimeOutgoingAudioSource::observeSource):
516         * platform/mediastream/RealtimeOutgoingAudioSource.h:
517         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
518         (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::RealtimeOutgoingAudioSourceLibWebRTC):
519         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
520         (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa):
521
522 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
523
524         [GStreamer][WebRTC] Add webrtcencoder bin to cleanup and refactor the way we set encoders
525         https://bugs.webkit.org/show_bug.cgi?id=190674
526
527         Reviewed by Philippe Normand.
528
529         webrtcencoder is a simple GstBin with a set of well known GStreamer encoders which
530         it can use to implement encoding for different formats exposing a trimmed down unified API.
531
532         It also adds proper handling of H264 profiles.
533
534         The added files follow GStreamer coding style as we aim at upstreaming the element
535         in the future.
536
537         This is a refactoring so current tests already cover it.
538
539         * platform/GStreamer.cmake:
540         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
541         (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements):
542         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp: Added.
543         (gst_webrtc_video_encoder_get_property):
544         (gst_webrtc_video_encoder_set_bitrate):
545         (gst_webrtc_video_encoder_set_format):
546         (gst_webrtc_video_encoder_set_property):
547         (register_known_encoder):
548         (setup_x264enc):
549         (setup_vp8enc):
550         (setup_openh264enc):
551         (set_bitrate_kbit_per_sec):
552         (set_bitrate_bit_per_sec):
553         (gst_webrtc_video_encoder_class_init):
554         (gst_webrtc_video_encoder_init):
555         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.h: Added.
556         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
557         (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
558         (WebCore::GStreamerVideoEncoder::InitEncode):
559         (WebCore::GStreamerVideoEncoder::createEncoder):
560         (WebCore::GStreamerVideoEncoder::AddCodecIfSupported):
561         (WebCore::GStreamerVideoEncoder::ImplementationName const):
562         (WebCore::GStreamerVideoEncoder::SetRestrictionCaps):
563
564 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
565
566         [GStreamer][WebRTC] properly mark H.264 stream type in the "decoder"
567         https://bugs.webkit.org/show_bug.cgi?id=190676
568
569         Reviewed by Philippe Normand.
570
571         Avoiding to have h264parse make assumption (which might be wrong at some
572         point).
573
574         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
575         (WebCore::GStreamerVideoDecoder::GetCapsForFrame):
576
577 2018-11-05  Thibault Saunier  <tsaunier@igalia.com>
578
579         [GStreamer] Do not sync libwerbtc stream on the clock
580         https://bugs.webkit.org/show_bug.cgi?id=190677
581
582         The approach here is basically to let libwebrtc do all the
583         synchronisation for us, and the same way as it is done in apple ports,
584         we basically try to display what libwebrtc outputs as fast as possible.
585
586         Reviewed by Philippe Normand.
587
588         Manually tested
589
590         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
591         (WebCore::setSyncOnSink):
592         (WebCore::MediaPlayerPrivateGStreamer::syncOnClock):
593         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
594         (WebCore::MediaPlayerPrivateGStreamer::load):
595         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
596
597 2018-11-05  Ali Juma  <ajuma@chromium.org>
598
599         [IntersectionObserver] Fix isIntersecting computation when 0 is not a threshold
600         https://bugs.webkit.org/show_bug.cgi?id=191210
601
602         Reviewed by Simon Fraser.
603
604         isIntersecting should be false if the intersection ratio is smaller than the
605         smallest threshold value. Update the computation of isIntersecting to depend on
606         the current thresholdIndex.
607
608         Test: imported/w3c/web-platform-tests/intersection-observer/initial-observation-with-threshold-expected.html
609
610         * dom/Document.cpp:
611         (WebCore::Document::updateIntersectionObservations):
612
613 2018-11-05  Rob Buis  <rbuis@igalia.com>
614
615         Remove some virtual methods in CachedRawResource
616         https://bugs.webkit.org/show_bug.cgi?id=191251
617
618         Reviewed by Frédéric Wang.
619
620         Since CachedRawResource is final no need to introduce new virtual
621         methods in CachedRawResource. This patch also removes an outdated
622         comment and forward declaration.
623
624         No new tests since no change in functionality.
625
626         * loader/cache/CachedRawResource.h:
627
628 2018-11-05  Philippe Normand  <pnormand@igalia.com>
629
630         [GStreamer] Move elements registration to GStreamerCommon
631         https://bugs.webkit.org/show_bug.cgi?id=191189
632
633         Reviewed by Xabier Rodriguez-Calvar.
634
635         It was a bit odd to have this in the base player class and to have
636         sub-classes calling a static function of the super-class.
637
638         Covered by existing tests.
639
640         * platform/graphics/gstreamer/GStreamerCommon.cpp:
641         (WebCore::initializeGStreamerAndRegisterWebKitElements):
642         * platform/graphics/gstreamer/GStreamerCommon.h:
643         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
644         (WebCore::MediaPlayerPrivateGStreamer::isAvailable):
645         (WebCore::MediaPlayerPrivateGStreamer::loadFull):
646         (WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes):
647         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
648         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
649         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
650         (WebCore::MediaPlayerPrivateGStreamerMSE::registerMediaEngine):
651         (WebCore::MediaPlayerPrivateGStreamerMSE::load):
652         (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected):
653         (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
654
655 2018-11-04  Rob Buis  <rbuis@igalia.com>
656
657         Remove ENABLE_OPENCL fully
658         https://bugs.webkit.org/show_bug.cgi?id=191172
659
660         Reviewed by Yusuke Suzuki.
661
662         Forgot to simplify this, no need for applyAll anymore
663         since it just calls apply.
664
665         No new tests since no change in functionality.
666
667         * platform/graphics/filters/FilterEffect.h:
668         (WebCore::FilterEffect::applyAll): Deleted.
669         * rendering/svg/RenderSVGResourceFilter.cpp:
670         (WebCore::RenderSVGResourceFilter::postApplyResource):
671
672 2018-11-04  Zalan Bujtas  <zalan@apple.com>
673
674         [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
675         https://bugs.webkit.org/show_bug.cgi?id=191078
676         <rdar://problem/45736178>
677
678         Reviewed by Antti Koivisto.
679
680         1. Improve visuallyNonEmpty milestone confidence level.
681             Ignore whitespace and non visible text content.
682             Parsing the main document should not necessarily fire the milestone. Check if there's any pending scripts/css/font loading.
683             Check if the html/body is actually visible.
684
685         2. Issue initial paint soon after the milestone fires.
686             Use a 0ms timer to flush the initial paint.
687             Throttle additional flushes for 500ms (remove the non-initial 1.5 throttling)
688
689         3. Suspend optional style recalcs and layouts while painting is being throttled.
690            When parsing yields we initiate a 0ms style recalc/layout timer.
691            These optional layouts produce content that we have no intention to paint. 
692
693         * dom/Document.cpp:
694         (WebCore::Document::scheduleStyleRecalc):
695         (WebCore::Document::shouldScheduleLayout):
696         * page/ChromeClient.h:
697         * page/FrameView.cpp:
698         (WebCore::FrameView::resetLayoutMilestones):
699         (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
700         (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):
701         (WebCore::FrameView::updateIsVisuallyNonEmpty):
702         * page/FrameView.h:
703         (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount): Ignore whitespace characters. Some pages start with plenty of whitespace only content.
704         * platform/graphics/FontCascade.h:
705         * rendering/RenderText.cpp: Check whether the text is actually visible at this point.
706         (WebCore::RenderText::RenderText):
707
708 2018-11-04  Zalan Bujtas  <zalan@apple.com>
709
710         [LFC][BFC] Add support for percentage height in quirks mode.
711         https://bugs.webkit.org/show_bug.cgi?id=191232
712
713         Reviewed by Antti Koivisto.
714
715         In quirks mode, we go and travers the containing block chain to find a block level
716         box with fixed height value to resolve the percentage value.
717
718         Test: fast/block/basic/quirk-mode-percent-height.html
719
720         * layout/FormattingContextGeometry.cpp:
721         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue):
722         * layout/Verification.cpp:
723         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
724
725 2018-11-04  Zalan Bujtas  <zalan@apple.com>
726
727         [LFC][BCF] Add support for block level non-replaced inflow height percentage
728         https://bugs.webkit.org/show_bug.cgi?id=191229
729
730         Reviewed by Antti Koivisto.
731
732         Test: fast/block/basic/child-block-level-box-with-height-percent.html
733
734         * layout/FormattingContext.h:
735         * layout/FormattingContextGeometry.cpp:
736         (WebCore::Layout::FormattingContext::Geometry::computedHeightValue):
737         (WebCore::Layout::computedHeightValue): Deleted.
738         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
739         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
740
741 2018-11-04  Youenn Fablet  <youenn@apple.com>
742
743         RealtimeOutgoingAudioSource should use DestructionThread::Main
744         https://bugs.webkit.org/show_bug.cgi?id=191230
745
746         Reviewed by Eric Carlson.
747
748         Covered by imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-replaceTrack.https.html
749         that should no longer crash in debug.
750
751         * platform/mediastream/RealtimeOutgoingAudioSource.h:
752
753 2018-11-04  Youenn Fablet  <youenn@apple.com>
754
755         IDB should allow storing RTCCertificate
756         https://bugs.webkit.org/show_bug.cgi?id=191077
757
758         Reviewed by Chris Dumez.
759
760         Add support for serialization/deserialization of RTCCertificate.
761         Store the origin in RTCCertificate and make sure that a certificate
762         with a different origin cannot be used to create a RTCPeerConnection.
763
764         Test: imported/w3c/web-platform-tests/webrtc/RTCCertificate-postMessage.html
765
766         * Modules/mediastream/PeerConnectionBackend.cpp:
767         (WebCore::PeerConnectionBackend::generateCertificate):
768         * Modules/mediastream/RTCCertificate.cpp:
769         (WebCore::RTCCertificate::create):
770         (WebCore::RTCCertificate::RTCCertificate):
771         * Modules/mediastream/RTCCertificate.h:
772         (WebCore::RTCCertificate::origin const):
773         * Modules/mediastream/RTCPeerConnection.cpp:
774         (WebCore::RTCPeerConnection::certificatesFromConfiguration):
775         * Modules/mediastream/RTCPeerConnection.h:
776         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp:
777         (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::RTCCertificateGeneratorCallback):
778         (WebCore::LibWebRTCCertificateGenerator::generateCertificate):
779         * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.h:
780         * bindings/js/SerializedScriptValue.cpp:
781         (WebCore::CloneSerializer::dumpIfTerminal):
782         (WebCore::CloneDeserializer::CachedString::takeString):
783         (WebCore::CloneDeserializer::readRTCCertificate):
784         (WebCore::CloneDeserializer::readTerminal):
785
786 2018-11-04  Youenn Fablet  <youenn@apple.com>
787
788         Add support for RTCMuxPolicy
789         https://bugs.webkit.org/show_bug.cgi?id=191188
790
791         Reviewed by Eric Carlson.
792
793         Add support for RTCMuxPolicy dictionary option for both constructor and setConfiguration.
794         Make sure setConfiguration throws if trying to change this policy.
795         Pipe this parameter up to libwebrtc.
796         Covered by rebased test.
797
798         * Modules/mediastream/RTCConfiguration.h:
799         * Modules/mediastream/RTCConfiguration.idl:
800         * Modules/mediastream/RTCPeerConnection.cpp:
801         (WebCore::iceServersFromConfiguration):
802         (WebCore::RTCPeerConnection::initializeConfiguration):
803         (WebCore::RTCPeerConnection::setConfiguration):
804         * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
805         (WebCore::rtcpMuxPolicyfromConfiguration):
806         (WebCore::configurationFromMediaEndpointConfiguration):
807         * WebCore.xcodeproj/project.pbxproj:
808         * platform/mediastream/MediaEndpointConfiguration.cpp:
809         (WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration):
810         * platform/mediastream/MediaEndpointConfiguration.h:
811         * platform/mediastream/RTCPMuxPolicy.h: Added.
812
813 2018-11-03  Devin Rousso  <drousso@apple.com>
814
815         Web Inspector: Canvas: capture changes to <canvas> that would affect the recorded context
816         https://bugs.webkit.org/show_bug.cgi?id=190854
817
818         Reviewed by Matt Baker.
819
820         Updated existing tests: inspector/canvas/recording-2d.html
821                                 inspector/canvas/recording-bitmaprenderer.html
822                                 inspector/canvas/recording-webgl.html
823
824         * html/HTMLCanvasElement.idl:
825         Apply `CallTracingCallback=recordCanvasAction` to the `width` and `height` attributes so
826         that they are recorded through the same path as `CanvasRenderingContext`.
827
828         * html/CanvasBase.h:
829         * html/CanvasBase.cpp:
830         (WebCore::CanvasBase::callTracingActive const): Added.
831
832         * bindings/js/CallTracer.h:
833         * bindings/js/CallTracer.cpp:
834         (WebCore::CallTracer::recordCanvasAction):
835
836
837 2018-11-03  Andy Estes  <aestes@apple.com>
838
839         [Payment Request] PaymentResponse.retry()'s errorFields should be optional
840         https://bugs.webkit.org/show_bug.cgi?id=191212
841
842         Reviewed by Youenn Fablet.
843
844         Per WebIDL, the errorFields argument to PaymentResponse.retry() should be optional. See
845         <https://github.com/w3c/payment-request/issues/804> for details.
846
847         Added test case to http/tests/paymentrequest/payment-response-retry-method.https.html.
848
849         * Modules/paymentrequest/PaymentResponse.idl:
850
851 2018-11-02  Zalan Bujtas  <zalan@apple.com>
852
853         [LFC][BFC] Resolve percentage height values.
854         https://bugs.webkit.org/show_bug.cgi?id=191224
855
856         Reviewed by Antti Koivisto.
857
858         10.5 Content height: the 'height' property
859         The percentage is calculated with respect to the height of the generated box's containing block.
860         If the height of the containing block is not specified explicitly (i.e., it depends on content height),
861         and this element is not absolutely positioned, the used height is calculated as if 'auto' was specified.
862
863         https://www.w3.org/TR/CSS22/visudet.html#propdef-height
864
865         Test: fast/block/basic/height-percentage-simple.html
866
867         * layout/FormattingContextGeometry.cpp:
868         (WebCore::Layout::isHeightAuto):
869         (WebCore::Layout::computedHeightValue):
870         (WebCore::Layout::contentHeightForFormattingContextRoot):
871         (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight):
872         (WebCore::Layout::FormattingContext::Geometry::computedMinHeight):
873         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
874         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
875         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
876         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
877
878 2018-11-03  Eric Carlson  <eric.carlson@apple.com>
879
880         [MediaStream] enumerateDevices should not expose devices that are not available to getUserMedia
881         https://bugs.webkit.org/show_bug.cgi?id=191177
882         <rdar://problem/45747873>
883
884         Reviewed by Jer Noble.
885
886         Test: http/tests/media/media-stream/enumerate-devices-iframe-allow-attribute.html
887
888         * Modules/mediastream/MediaDevicesRequest.cpp:
889         (WebCore::MediaDevicesRequest::start): Only expose devices that are available to gUM.
890
891         * Modules/mediastream/UserMediaController.cpp:
892         (WebCore::isSecure): Moved from UserMediaRequest.cpp.
893         (WebCore::isAllowedToUse): Ditto.
894         (WebCore::UserMediaController::canCallGetUserMedia): Modified from UserMediaRequest.cpp.
895         (WebCore::UserMediaController::logGetUserMediaDenial): Log reason for denial.
896         * Modules/mediastream/UserMediaController.h:
897
898         * Modules/mediastream/UserMediaRequest.cpp:
899         (WebCore::UserMediaRequest::start): Use UserMediaController::canCallGetUserMedia.
900         (WebCore::isSecure): Deleted.
901         (WebCore::isAllowedToUse): Deleted.
902         (WebCore::canCallGetUserMedia): Deleted.
903
904 2018-11-02  Justin Michaud  <justin_michaud@apple.com>
905
906         Add new global object and preliminary Worklets support for CSS painting api
907         https://bugs.webkit.org/show_bug.cgi?id=190979
908
909         Reviewed by Chris Dumez.
910
911         Test: fast/css-custom-paint/worklet.html
912
913         Add a new ScriptExecutionContext and global object to run worklets in. This is mostly copy+paste
914         from Workers, but without any of the threading. Worklet.addModule does not yet support loading scripts
915         or doing cross origin checking. There are quite a few parts of the ScriptExecutionContext api that are
916         left as ASSERT_NOT_REACHED().
917
918         * CMakeLists.txt:
919         * DerivedSources.make:
920         * Sources.txt:
921         * WebCore.xcodeproj/project.pbxproj:
922         * bindings/js/JSDOMGlobalObject.cpp:
923         (WebCore::JSDOMGlobalObject::scriptExecutionContext const):
924         * bindings/js/JSPaintWorkletGlobalScopeCustom.cpp: Renamed from Source/WebCore/bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp.
925         (WebCore::JSPaintWorkletGlobalScope::visitAdditionalChildren):
926         (WebCore::JSPaintWorkletGlobalScope::registerPaint):
927         * bindings/js/JSWorkletGlobalScopeBase.cpp: Added.
928         (WebCore::JSWorkletGlobalScopeBase::JSWorkletGlobalScopeBase):
929         (WebCore::JSWorkletGlobalScopeBase::finishCreation):
930         (WebCore::JSWorkletGlobalScopeBase::clearDOMGuardedObjects):
931         (WebCore::JSWorkletGlobalScopeBase::visitChildren):
932         (WebCore::JSWorkletGlobalScopeBase::destroy):
933         (WebCore::JSWorkletGlobalScopeBase::scriptExecutionContext const):
934         (WebCore::JSWorkletGlobalScopeBase::supportsRichSourceInfo):
935         (WebCore::JSWorkletGlobalScopeBase::shouldInterruptScript):
936         (WebCore::JSWorkletGlobalScopeBase::shouldInterruptScriptBeforeTimeout):
937         (WebCore::JSWorkletGlobalScopeBase::javaScriptRuntimeFlags):
938         (WebCore::toJS):
939         (WebCore::toJSWorkletGlobalScope):
940         * bindings/js/JSWorkletGlobalScopeBase.h: Added.
941         (WebCore::JSWorkletGlobalScopeBase::wrapped const):
942         (WebCore::JSWorkletGlobalScopeBase::proxy const):
943         (WebCore::JSWorkletGlobalScopeBase::createStructure):
944         (WebCore::toJS):
945         * bindings/js/ScriptState.cpp:
946         (WebCore::execStateFromWorkerGlobalScope):
947         (WebCore::execStateFromWorkletGlobalScope):
948         * bindings/js/ScriptState.h:
949         * bindings/js/WebCoreBuiltinNames.h:
950         * bindings/scripts/CodeGeneratorJS.pm:
951         (IsDOMGlobalObject):
952         (ShouldUseGlobalObjectPrototype):
953         (GenerateHeader):
954         (GenerateRuntimeEnableConditionalStringForExposed):
955         (GenerateImplementation):
956         * bindings/scripts/preprocess-idls.pl:
957         * css/CSSPaintImageValue.cpp:
958         (WebCore::CSSPaintImageValue::image):
959         * css/DOMCSSPaintWorklet.cpp:
960         (WebCore::DOMCSSPaintWorklet::ensurePaintWorklet):
961         (WebCore::DOMCSSPaintWorklet::ensurePaintWorkletGlobalScope): Deleted.
962         * css/DOMCSSPaintWorklet.h:
963         * css/DOMCSSPaintWorklet.idl:
964         * dom/Document.cpp:
965         (WebCore::Document::ensureCSSPaintWorklet):
966         (WebCore::Document::setCSSPaintWorkletGlobalScope):
967         (WebCore::Document::ensureCSSPaintWorkletGlobalScope): Deleted.
968         * dom/Document.h:
969         (WebCore::Document::getCSSPaintWorkletGlobalScope):
970         * dom/EventTargetFactory.in:
971         * dom/ScriptExecutionContext.cpp:
972         (WebCore::ScriptExecutionContext::vm):
973         (WebCore::ScriptExecutionContext::execState):
974         * dom/ScriptExecutionContext.h:
975         (WebCore::ScriptExecutionContext::isWorkletGlobalScope const):
976         * inspector/agents/worker/WorkerDebuggerAgent.cpp:
977         (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
978         * inspector/agents/worker/WorkerRuntimeAgent.cpp:
979         (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
980         * platform/graphics/CustomPaintImage.cpp:
981         (WebCore::CustomPaintImage::CustomPaintImage):
982         (WebCore::CustomPaintImage::doCustomPaint):
983         * platform/graphics/CustomPaintImage.h:
984         * worklets/PaintWorkletGlobalScope.cpp: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
985         (WebCore::PaintWorkletGlobalScope::create):
986         (WebCore::PaintWorkletGlobalScope::PaintWorkletGlobalScope):
987         (WebCore::PaintWorkletGlobalScope::devicePixelRatio):
988         (WebCore::PaintWorkletGlobalScope::addRegisteredPaint):
989         * worklets/PaintWorkletGlobalScope.h: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.h.
990         * worklets/PaintWorkletGlobalScope.idl: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
991         * worklets/Worklet.cpp: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
992         (WebCore::Worklet::create):
993         (WebCore::Worklet::Worklet):
994         (WebCore::Worklet::addModule):
995         * worklets/Worklet.h: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp.
996         * worklets/Worklet.idl: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
997         * worklets/WorkletConsoleClient.cpp: Copied from Source/WebCore/inspector/agents/worker/WorkerDebuggerAgent.cpp.
998         (WebCore::WorkletConsoleClient::WorkletConsoleClient):
999         (WebCore::WorkletConsoleClient::messageWithTypeAndLevel):
1000         (WebCore::WorkletConsoleClient::count):
1001         (WebCore::WorkletConsoleClient::time):
1002         (WebCore::WorkletConsoleClient::timeEnd):
1003         (WebCore::WorkletConsoleClient::profile):
1004         (WebCore::WorkletConsoleClient::profileEnd):
1005         (WebCore::WorkletConsoleClient::takeHeapSnapshot):
1006         (WebCore::WorkletConsoleClient::timeStamp):
1007         (WebCore::WorkletConsoleClient::record):
1008         (WebCore::WorkletConsoleClient::recordEnd):
1009         * worklets/WorkletConsoleClient.h: Added.
1010         * worklets/WorkletGlobalScope.cpp: Added.
1011         (WebCore::WorkletGlobalScope::WorkletGlobalScope):
1012         (WebCore::WorkletGlobalScope::~WorkletGlobalScope):
1013         (WebCore::WorkletGlobalScope::evaluate):
1014         (WebCore::WorkletGlobalScope::isJSExecutionForbidden const):
1015         (WebCore::WorkletGlobalScope::disableEval):
1016         (WebCore::WorkletGlobalScope::disableWebAssembly):
1017         (WebCore::WorkletGlobalScope::completeURL const):
1018         (WebCore::WorkletGlobalScope::logExceptionToConsole):
1019         (WebCore::WorkletGlobalScope::addConsoleMessage):
1020         (WebCore::WorkletGlobalScope::addMessage):
1021         * worklets/WorkletGlobalScope.h: Added.
1022         (WebCore::WorkletGlobalScope::isPaintWorkletGlobalScope const):
1023         (WebCore::WorkletGlobalScope::identifier const):
1024         (WebCore::WorkletGlobalScope::script):
1025         (WebCore::WorkletGlobalScope::jsRuntimeFlags const):
1026         (isType):
1027         * worklets/WorkletGlobalScope.idl: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl.
1028         * worklets/WorkletScriptController.cpp: Added.
1029         (WebCore::WorkletScriptController::WorkletScriptController):
1030         (WebCore::WorkletScriptController::~WorkletScriptController):
1031         (WebCore::WorkletScriptController::forbidExecution):
1032         (WebCore::WorkletScriptController::isExecutionForbidden const):
1033         (WebCore::WorkletScriptController::disableEval):
1034         (WebCore::WorkletScriptController::disableWebAssembly):
1035         (WebCore::WorkletScriptController::initScriptWithSubclass):
1036         (WebCore::WorkletScriptController::initScript):
1037         (WebCore::WorkletScriptController::evaluate):
1038         (WebCore::WorkletScriptController::setException):
1039         * worklets/WorkletScriptController.h: Added.
1040         (WebCore::WorkletScriptController::workletGlobalScopeWrapper):
1041         (WebCore::WorkletScriptController::vm):
1042         (WebCore::WorkletScriptController::initScriptIfNeeded):
1043
1044 2018-11-02  Myles C. Maxfield  <mmaxfield@apple.com>
1045
1046         Clean up drawLineForDocumentMarker()
1047         https://bugs.webkit.org/show_bug.cgi?id=191215
1048
1049         Reviewed by Zalan Bujtas.
1050
1051         In preparation for https://bugs.webkit.org/show_bug.cgi?id=190764, I need to do a little bit of refactoring.
1052         This patch has no behavior change; it just does the following:
1053
1054         1. Renames drawLineForDocumentMarker() to drawDotsForDocumentMarker(), because 2 of the 3 implementations draw dots
1055         2. Moves our implementation back into GraphicsContext, because it's simpler and  GraphicsContext is already platform-
1056                specific.
1057         3. The signature used to accept a location and a width, but without a height, it's difficult to know what the bounding
1058                box is. In particular, knowing the bounding box must be possible without a GraphicsContext. So, I've modified
1059                the signature to accept a rectangle instead. The GraphicsContext draws only within this rectangle.
1060
1061         No new tests because there is no behavior change.
1062
1063         * platform/graphics/GraphicsContext.h:
1064         * platform/graphics/GraphicsContextImpl.h:
1065         * platform/graphics/cairo/CairoOperations.cpp:
1066         (WebCore::Cairo::drawDotsForDocumentMarker):
1067         (WebCore::Cairo::drawLineForDocumentMarker): Deleted.
1068         * platform/graphics/cairo/CairoOperations.h:
1069         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1070         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
1071         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
1072         * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
1073         (WebCore::GraphicsContextImplCairo::drawDotsForDocumentMarker):
1074         (WebCore::GraphicsContextImplCairo::drawLineForDocumentMarker): Deleted.
1075         * platform/graphics/cairo/GraphicsContextImplCairo.h:
1076         * platform/graphics/cocoa/FontCascadeCocoa.mm:
1077         * platform/graphics/cocoa/GraphicsContextCocoa.mm:
1078         (WebCore::colorForMarkerLineStyle):
1079         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
1080         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
1081         * platform/graphics/displaylists/DisplayListItems.cpp:
1082         (WebCore::DisplayList::Item::sizeInBytes):
1083         (WebCore::DisplayList::DrawDotsForDocumentMarker::apply const):
1084         (WebCore::DisplayList::DrawDotsForDocumentMarker::localBounds const):
1085         (WebCore::DisplayList::operator<<):
1086         (WebCore::DisplayList::DrawLineForDocumentMarker::apply const): Deleted.
1087         (WebCore::DisplayList::DrawLineForDocumentMarker::localBounds const): Deleted.
1088         * platform/graphics/displaylists/DisplayListItems.h:
1089         (WebCore::DisplayList::DrawDotsForDocumentMarker::create):
1090         (WebCore::DisplayList::DrawDotsForDocumentMarker::rect const):
1091         (WebCore::DisplayList::DrawDotsForDocumentMarker::DrawDotsForDocumentMarker):
1092         (WebCore::DisplayList::DrawLineForDocumentMarker::create): Deleted.
1093         (WebCore::DisplayList::DrawLineForDocumentMarker::point const): Deleted.
1094         (WebCore::DisplayList::DrawLineForDocumentMarker::width const): Deleted.
1095         (WebCore::DisplayList::DrawLineForDocumentMarker::DrawLineForDocumentMarker): Deleted.
1096         * platform/graphics/displaylists/DisplayListRecorder.cpp:
1097         (WebCore::DisplayList::Recorder::drawDotsForDocumentMarker):
1098         (WebCore::DisplayList::Recorder::drawLineForDocumentMarker): Deleted.
1099         * platform/graphics/displaylists/DisplayListRecorder.h:
1100         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
1101         (Nicosia::CairoOperationRecorder::drawDotsForDocumentMarker):
1102         (Nicosia::CairoOperationRecorder::drawLineForDocumentMarker): Deleted.
1103         * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
1104         * platform/graphics/win/GraphicsContextCGWin.cpp:
1105         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
1106         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
1107         * platform/graphics/win/GraphicsContextDirect2D.cpp:
1108         (WebCore::GraphicsContext::drawDotsForDocumentMarker):
1109         (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted.
1110         * rendering/InlineTextBox.cpp:
1111         (WebCore::InlineTextBox::paintPlatformDocumentMarker):
1112         * rendering/RenderTheme.cpp:
1113         (WebCore::RenderTheme::drawLineForDocumentMarker): Deleted.
1114         * rendering/RenderTheme.h:
1115         * rendering/RenderThemeCocoa.h:
1116         * rendering/RenderThemeCocoa.mm:
1117         (WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Deleted.
1118         * rendering/RenderThemeIOS.h:
1119         * rendering/RenderThemeIOS.mm:
1120         (WebCore::RenderThemeIOS::colorForMarkerLineStyle): Deleted.
1121         * rendering/RenderThemeMac.h:
1122         * rendering/RenderThemeMac.mm:
1123         (WebCore::RenderThemeMac::colorForMarkerLineStyle): Deleted.
1124
1125 2018-11-02  Ali Juma  <ajuma@chromium.org>
1126
1127         requestAnimationFrame causes bad location of position:fixed inside overflow:auto and iframe
1128         https://bugs.webkit.org/show_bug.cgi?id=176243
1129
1130         Reviewed by Simon Fraser.
1131
1132         When a new layer tree is committed to the UIProcess, the positions of layers for fixed
1133         or sticky nodes in the newly-committed tree can be stale, because of scrolling that has
1134         happened in the UIProcess since the tree was updated in the WebProcess. To handle this,
1135         RemoteLayerTreeDrawingAreaProxy::commitLayerTree updates the positions of these layers
1136         by calling RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling, which
1137         leads to a recursive traversal of the ScrollingTree to update each such layer. However,
1138         since ScrollingTreeFrameScrollingNodeIOS didn't implement updateLayersAfterAncestorChange,
1139         this traversal never descended into scrolling nodes within an iframe, so the layers for
1140         these nodes were left with stale positions.
1141
1142         Implement ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange so that
1143         fixed and sticky layers within an iframe do get their positions updated when a new layer
1144         tree is committed.
1145
1146         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
1147         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
1148         (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange):
1149
1150 2018-11-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1151
1152         [iOS] Changing view scale sometimes does not zoom the page to the new initial scale, when the page is at initial scale
1153         https://bugs.webkit.org/show_bug.cgi?id=191180
1154         <rdar://problem/45744786>
1155
1156         Reviewed by Simon Fraser.
1157
1158         When computing the minimum scale in ViewportConfiguration::minimumScale, if our content width or height is
1159         shorter than the view width or height, then we recompute the minimum scale such that the content dimensions will
1160         fill the bounds of the view by setting the minimum scale to the view width or height divided by the content
1161         width or height.
1162
1163         Suppose the minimum scale is equal to some value `s`; additionally, let `w_c` denote the content width and `w_v`
1164         denote the view width (as integers). If `w_v / s` is not an integral value, the computed content width `w_c` may
1165         be rounded, such that `w_v / w_c` is not precisely equal to `s`. In the case that `w_v / w_c` is ever so
1166         slightly larger than `s`, we will end up overriding the minimum scale `s` with `w_v / w_c`.
1167
1168         As a result, specifying a viewport with a decimal `minimum-scale` will sometimes cause the computed minimum
1169         scale of the viewport (and platform view) to be very slightly different from the minimum scale. The new layout
1170         test below exercises this scenario, specifying a viewport with minimum and initial scales of 0.94 that results
1171         in `ViewportConfiguration::minimumScale` returning 0.94158.
1172
1173         With the `WebPage::setViewportConfigurationViewLayoutSize` check added in r237127, this means setting
1174         `_viewScale:` when the page is at initial scale sometimes doesn't zoom the page to the new initial scale when it
1175         should, since the page scale factor and the initial scale are different enough such that
1176         `areEssentiallyEqualAsFloat` returns false.
1177
1178         This patch addresses these issues by snapping to the minimum scale if the computed scale that fits content
1179         dimensions to view dimensions results in a minimum scale that is close enough to the configuration's minimum
1180         scale, such that the difference can be attributed to rounding error when computing content or view dimensions.
1181
1182         Test: fast/viewport/ios/viewport-minimum-and-initial-scale.html
1183
1184         * page/ViewportConfiguration.cpp:
1185         (WebCore::ViewportConfiguration::minimumScale const):
1186
1187 2018-11-02  Philippe Normand  <pnormand@igalia.com>
1188
1189         [GTK][WPE] Unreviewed, another --no-video --no-web-audio build fix following r237677
1190
1191         * inspector/agents/InspectorDOMAgent.cpp:
1192         (WebCore::InspectorDOMAgent::addEventListenersToNode):
1193
1194 2018-11-02  Daniel Bates  <dabates@apple.com>
1195
1196         [iOS] Normalize character string based on key code
1197         https://bugs.webkit.org/show_bug.cgi?id=191120
1198
1199         Reviewed by Tim Horton.
1200
1201         Following r236417 (https://bugs.webkit.org/show_bug.cgi?id=189604) we always have a valid key code
1202         for a special key (e.g. page up) and can simplify the character string normalization code.
1203
1204         No functionality changed. So, no new tests.
1205
1206         * platform/ios/WebEvent.mm:
1207         (normalizedStringWithAppKitCompatibilityMapping): Modified to take a key code and wrote algorithm
1208         in terms of it.
1209
1210         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
1211         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
1212         Pass the key code for the event to normalizedStringWithAppKitCompatibilityMapping().
1213
1214 2018-11-02  Daniel Bates  <dabates@apple.com>
1215
1216         [iOS] WebKit should dispatch DOM events when a modifier key is pressed
1217         https://bugs.webkit.org/show_bug.cgi?id=190487
1218
1219         Reviewed by Tim Horton.
1220
1221         Add support for modifier flags change events.
1222
1223         * platform/ios/PlatformEventFactoryIOS.mm:
1224         (WebCore::modifiersForEvent): Modifier keys do not have an associated character and do not
1225         participate in key repeat.
1226         (WebCore::keyIdentifierForKeyEvent): Identify modifier keys, returning "Unidentified" if
1227         the modifier key is unidentified. This matches the behavior on Mac.
1228         (WebCore::keyForKeyEvent): Identify modifier keys, returning the empty string if the modifier
1229         key is unidentified. This matches the behavior on Mac.
1230         (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):
1231         * platform/ios/WebEvent.h:
1232
1233         * platform/ios/WebEvent.mm:
1234         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]):
1235         (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]):
1236         Modifier keys do not have an associated character and do not participate in key repeat.
1237
1238         (-[WebEvent _eventDescription]): Modified to print a description for a keydown or keyup event
1239         that represents a modifier flags change.
1240         (-[WebEvent characters]): Modifier keys do not have an associated character. Assert this
1241         invariant as it is a programming error. On Mac, the same operation would result in a
1242         NSInternalInconsistencyException exception being raised.
1243         (-[WebEvent charactersIgnoringModifiers]): Ditto.
1244
1245 2018-11-02  Ali Juma  <ajuma@chromium.org>
1246
1247         Allow cross-document intersection observing
1248         https://bugs.webkit.org/show_bug.cgi?id=165746
1249
1250         Reviewed by Simon Fraser.
1251
1252         Add logic to compute the intersection between the viewport and an element in a
1253         subframe.
1254
1255         Add a FloatRect version of ScrollView::rootViewToContents, and FloatRect versions
1256         of the methods it calls.
1257
1258         Test: http/tests/intersection-observer/intermediate-frame-changes.html
1259         Also covered by rebased tests in imported/w3c/web-platform-tests/intersection-observer.
1260
1261         * dom/Document.cpp:
1262         (WebCore::computeClippedRectInRootContentsSpace):
1263         (WebCore::computeIntersectionState):
1264         (WebCore::Document::updateIntersectionObservations):
1265         * page/FrameView.cpp:
1266         (WebCore::FrameView::viewportContentsChanged):
1267         (WebCore::FrameView::convertFromContainingViewToRenderer const):
1268         (WebCore::FrameView::convertFromContainingView const):
1269         * page/FrameView.h:
1270         * platform/ScrollView.cpp:
1271         (WebCore::ScrollView::viewToContents const):
1272         (WebCore::ScrollView::contentsToView const):
1273         (WebCore::ScrollView::rootViewToContents const):
1274         * platform/ScrollView.h:
1275         * platform/Widget.cpp:
1276         (WebCore::Widget::convertFromRootView const):
1277         (WebCore::Widget::convertFromContainingView const):
1278         * platform/Widget.h:
1279
1280 2018-11-02  Rob Buis  <rbuis@igalia.com>
1281
1282         Remove ENABLE_OPENCL fully
1283         https://bugs.webkit.org/show_bug.cgi?id=191172
1284
1285         Reviewed by Yusuke Suzuki.
1286
1287         No new tests since no change in functionality.
1288
1289         * platform/graphics/filters/FilterEffect.h:
1290         (WebCore::FilterEffect::hasResult const):
1291         (WebCore::FilterEffect::applyAll):
1292         (WebCore::FilterEffect::openCLImage): Deleted.
1293         (WebCore::FilterEffect::setOpenCLImage): Deleted.
1294
1295 2018-11-02  Zalan Bujtas  <zalan@apple.com>
1296
1297         [LFC][IFC] Add support for intrinsic width calculation
1298         https://bugs.webkit.org/show_bug.cgi?id=191144
1299
1300         Reviewed by Antti Koivisto.
1301
1302         This is the inline formatting version of the shrink-to-fit computation. It generates inline runs
1303         and uses InlineLineBreaker to compute min/max width. This is very similar to ::layout.
1304
1305         Test: fast/inline/simple-shrink-to-fit-inline-block.html
1306
1307         * layout/inlineformatting/InlineFormattingContext.cpp:
1308         (WebCore::Layout::InlineFormattingContext::layout const):
1309         (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const):
1310         (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const):
1311         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1312         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const):
1313         (WebCore::Layout::InlineFormattingContext::collectInlineContent const):
1314         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
1315         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const): Deleted.
1316         * layout/inlineformatting/InlineFormattingContext.h:
1317
1318 2018-11-02  Zalan Bujtas  <zalan@apple.com>
1319
1320         [LFC][BFC] BlockFormattingContext::instrinsicWidthConstraints logic should look similar to ::layout
1321         https://bugs.webkit.org/show_bug.cgi?id=191181
1322
1323         Reviewed by Antti Koivisto.
1324
1325         * layout/blockformatting/BlockFormattingContext.cpp:
1326         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
1327
1328 2018-11-02  Zalan Bujtas  <zalan@apple.com>
1329
1330         [LFC] Align shrink-to-fit width computation with the layout implementation.
1331         https://bugs.webkit.org/show_bug.cgi?id=191179
1332
1333         Reviewed by Antti Koivisto.
1334
1335         There are many similarities between layout and shrink-to-fit.
1336         They both operate on formatting roots only (shrink-to-fit -> float, out-of-flow, inline-block) and in both cases
1337         the algoritm depends on what type of formatting context the element establishes.
1338
1339         This patch is in preparation for transforming the "shrink-to-fit" width computation to make it behave more like layout.
1340         With this change the instrinsicWidthConstraints() computation happens in the formatting context that the element establishes (similar to layout).
1341
1342         * layout/FormattingContext.cpp:
1343         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
1344         * layout/FormattingContext.h:
1345         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
1346         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
1347         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1348         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1349         * layout/FormattingContextGeometry.cpp:
1350         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1351         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
1352         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1353         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
1354         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
1355         * layout/blockformatting/BlockFormattingContext.cpp:
1356         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
1357         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
1358         * layout/blockformatting/BlockFormattingContext.h:
1359         * layout/inlineformatting/InlineFormattingContext.cpp:
1360         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1361         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
1362         * layout/inlineformatting/InlineFormattingContext.h:
1363         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1364         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
1365
1366 2018-11-01  Antoine Quint  <graouts@apple.com>
1367
1368         [Web Animations] Make document.getAnimations() return declarative animations in the correct order
1369         https://bugs.webkit.org/show_bug.cgi?id=191153
1370
1371         Reviewed by Dean Jackson.
1372
1373         The Web Animations spec has the notion of "composite order" which determines the order in which animations should
1374         be returned when document.getAnimations() is called. The CSS Transitions and CSS Animations specifications also
1375         determine the composite order of their respective animation classes, as well as the notion of "owning element",
1376         the element that was the animation target when specified through style, prior to any manipulation via the Web
1377         Animations API. We implement these two notions so that we can pass the document.getAnimations() tests for
1378         declarative animations.
1379
1380         It is important that we have the notion of an "owning element" since when a CSS Transition or CSS Animation is
1381         modified via the Web Animations API in a way that an animation created through CSS we must consider no longer
1382         as a declarative animation but as a regular Web Animation. In this patch, we remove the DeclarativeAnimation's
1383         target(), which returned a reference, to owningElement(), which returns a pointer and return nullptr once the
1384         declarative animation has been modified.
1385
1386         In order to also keep a correct count of declarative animations applied to elements, we correctly add transitions
1387         that have completed to a list of completed transitions, as specified by the CSS Transitions spec. We have had this
1388         list declared in AnimationTimeline.h for a while but never actually did the work to add items to it. Thanks to that,
1389         AnimationTimeline::updateCSSTransitionsForElement() now correctly accounts for completed transitions so that they
1390         may be canceled if overridden with a new animation, correctly removing their "owning element".
1391
1392         Finally, now that we have saner lists of animations per classes, we can apply the right sorting routines to match
1393         the composite order for CSS Transitions, CSS Animations and Web Animations, keeping a list of all animations created
1394         in order as the final criterion for sorting.
1395
1396         * animation/AnimationTimeline.cpp:
1397         (WebCore::AnimationTimeline::animationTimingDidChange): Make sure this animation is tracked on the list of all animations
1398         created for this timeline in the order in which they were created, which is needed to sort animations correctly when
1399         document.getAnimations() is called.
1400         (WebCore::AnimationTimeline::animationWasAddedToElement): We've removed the relevantMapForAnimation() method which we used
1401         to determine which map we should add an animation to based on its class and instead have code that accounts for not just
1402         the animation's class, but also whether it has an owning element since a valid owning element is required to qualify as
1403         a CSS Transition or CSS Animation, regardless of the animation's original class.
1404         (WebCore::removeAnimationFromMapForElement): Adding this helper to remove an animation from the provided animation map so
1405         that animationWasRemovedFromElement() can call this with all of the various animation maps.
1406         (WebCore::AnimationTimeline::animationWasRemovedFromElement): Check all of the various animation maps to see which may
1407         contain the animation we're trying to remove as the owning element might have been cleared by the time this function is
1408         called and looking at the animation's class would not be sufficient to determine which animation map the animation was in.
1409         (WebCore::AnimationTimeline::removeDeclarativeAnimationFromListsForOwningElement): New function in which the logic from
1410         animationWasRemovedFromElement() that dealt with removing animations from the list of running CSS Animations/Transitions as
1411         well as completed CSS Transitions was factored out. This allowed us to also call this function from
1412         DeclarativeAnimation::disassociateFromOwningElement().
1413         (WebCore::AnimationTimeline::elementWasRemoved): We no longer need to remove an animation as canceling it will remove it
1414         correctly when DocumentTimeline::updateAnimationsAndSendEvents() is called.
1415         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Call cancelDeclarativeAnimation() instead of the removed
1416         cancelOrRemoveDeclarativeAnimation() when a CSS Animation should be canceled.
1417         (WebCore::AnimationTimeline::ensureRunningTransitionsByProperty): Now that we correctly remove transitions from the list
1418         of running transitions once they've completed or have been canceled, we need a helper to always get a valid map of running
1419         transitions for a given element as that map can be cleared while updateCSSTransitionsForElement() is running. 
1420         (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Call cancelDeclarativeAnimation() instead of the removed
1421         cancelOrRemoveDeclarativeAnimation() when a CSS Transition should be canceled. Additionally we always get the list of running
1422         transitions for a given element as it can be cleared by a prior cancelation.
1423         (WebCore::AnimationTimeline::cancelDeclarativeAnimation): New function replacing cancelOrRemoveDeclarativeAnimation() in which
1424         we call the new DeclarativeAnimation::cancelFromStyle() function on the provided animation and then remove the animation from
1425         all known lists, including the new list of all animations. We do this final part so that the animation gets re-added as if it
1426         were a new animation since canceling a declarative animation via a style change removes its declarative-ness. This guarantees
1427         that a declarative animation that is canceled through style but then resumed through the Web Animations API sorts after any
1428         declarative animation with an owning element.
1429         (WebCore::AnimationTimeline::relevantMapForAnimation): Deleted.
1430         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Deleted.
1431         * animation/AnimationTimeline.h:
1432         (WebCore::AnimationTimeline::timingModelDidChange): Deleted. This was left over in the patch where we implemented the "update
1433         animations and send events" procedure.
1434         (WebCore::AnimationTimeline::animations const): Deleted.
1435         * animation/CSSAnimation.cpp:
1436         (WebCore::CSSAnimation::create): Some refactoring to make the handling of a declarative animation's owning element part of the
1437         DeclarativeAnimation constructor.
1438         * animation/CSSTransition.cpp:
1439         (WebCore::CSSTransition::create): Some refactoring to make the handling of a declarative animation's owning element part of the
1440         DeclarativeAnimation constructor.
1441         * animation/DeclarativeAnimation.cpp:
1442         (WebCore::DeclarativeAnimation::DeclarativeAnimation):
1443         (WebCore::DeclarativeAnimation::tick): Make sure we disassociate from the animation's owning element once we transition from a
1444         relevant state to an idle state. This will catch any changes made via the Web Animations API to a declarative animation when the
1445         "update animations and send events" procedure is run.
1446         (WebCore::DeclarativeAnimation::disassociateFromOwningElement): Remove this animation from the list of declarative animations on
1447         the associated timeline and make owningElement() nullptr so that document.getAnimations() will know to sort this animation with other
1448         Web Animations created via the Web Animations API.
1449         (WebCore::DeclarativeAnimation::initialize):
1450         (WebCore::DeclarativeAnimation::cancelFromStyle): New method called from AnimationTimeline::cancelDeclarativeAnimation() which
1451         cancels the animation but also disassociates it from its owning element.
1452         (WebCore::DeclarativeAnimation::invalidateDOMEvents):
1453         (WebCore::DeclarativeAnimation::enqueueDOMEvent):
1454         * animation/DeclarativeAnimation.h:
1455         (WebCore::DeclarativeAnimation::owningElement const):
1456         (WebCore::DeclarativeAnimation::target const): Deleted.
1457         * animation/DocumentTimeline.cpp:
1458         (WebCore::compareDeclarativeAnimationOwningElementPositionsInDocumentTreeOrder): Adding a new utility used when sorting both
1459         CSS Transitions and CSS Animations by tree order when their owning element differ, with special logic for pseudo-elements.
1460         (WebCore::DocumentTimeline::getAnimations const): Filter and sort animations according to their composite order.
1461         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Compile a list of transitions that move to a finished state to
1462         the list of completed transitions so that they may be canceled correctly in AnimationTimeline::updateCSSTransitionsForElement().
1463         (WebCore::DocumentTimeline::transitionDidComplete):
1464         * animation/DocumentTimeline.h:
1465
1466 2018-11-02  Zan Dobersek  <zdobersek@igalia.com>
1467
1468         PNGImageDecoder: report no repetition for non-animated images
1469         https://bugs.webkit.org/show_bug.cgi?id=191068
1470
1471         Reviewed by Michael Catanzaro.
1472
1473         When building with APNG support enabled, the
1474         PNGImageDecoder::repetitionCount() method until now reported  infinite
1475         repetition count for all PNG images, even the ones that were not
1476         animated. This is now changed so that no repetition is reported for
1477         non-animated images.
1478
1479         * platform/image-decoders/png/PNGImageDecoder.cpp:
1480         (WebCore::PNGImageDecoder::repetitionCount const):
1481
1482 2018-11-02  Justin Fan  <justin_fan@apple.com>
1483
1484         [WebGPU] Experimental prototype for MSL shaders
1485         https://bugs.webkit.org/show_bug.cgi?id=191084
1486
1487         Reviewed by Dean Jackson.
1488
1489         Begin implementation for WebGPUDevice and WebGPUShaderModule and associated descriptor objects.
1490
1491         Test: webgpu/webgpu-basics.html
1492         Test: webgpu/shader-modules.html
1493
1494         * CMakeLists.txt:
1495         * DerivedSources.make:
1496         * Modules/webgpu/GPUDevice.cpp: 
1497         (WebCore::GPUDevice::createShaderModule const):
1498         * Modules/webgpu/GPUDevice.h: 
1499         (WebCore::GPUDevice::platformDevice const):
1500         * Modules/webgpu/GPUShaderModule.h:
1501         (WebCore::GPUShaderModule::platformShaderModule const):
1502         * Modules/webgpu/GPUShaderModuleDescriptor.h:
1503         * Modules/webgpu/WebGPU.cpp:
1504         (WebCore::WebGPU::requestAdapter const):
1505         * Modules/webgpu/WebGPUAdapter.cpp:
1506         (WebCore::WebGPUAdapter::create):
1507         (WebCore::WebGPUAdapter::createDevice):
1508         * Modules/webgpu/WebGPUAdapter.h:
1509         * Modules/webgpu/WebGPUAdapter.idl:
1510         * Modules/webgpu/WebGPUDevice.cpp:
1511         (WebCore::WebGPUDevice::create):
1512         (WebCore::WebGPUDevice::WebGPUDevice):
1513         (WebCore::WebGPUDevice::createShaderModule const):
1514         * Modules/webgpu/WebGPUDevice.h:
1515         * Modules/webgpu/WebGPUDevice.idl:
1516         * Modules/webgpu/WebGPUShaderModule.cpp:
1517         (WebCore::WebGPUShaderModule::create):
1518         (WebCore::WebGPUShaderModule::WebGPUShaderModule):
1519         * Modules/webgpu/WebGPUShaderModule.h:
1520         * Modules/webgpu/WebGPUShaderModule.idl:
1521         * Modules/webgpu/WebGPUShaderModuleDescriptor.h:
1522         * Modules/webgpu/WebGPUShaderModuleDescriptor.idl:
1523         * Modules/webgpu/WebGPUSwapChain.cpp:
1524         (WebCore::WebGPUSwapChain::configure):
1525         * Modules/webgpu/WebGPUSwapChain.h:
1526         * Modules/webgpu/WebGPUSwapChain.idl:
1527         * Modules/webgpu/cocoa/GPUDeviceMetal.mm:
1528         (WebCore::GPUDevice::create):
1529         (WebCore::GPUDevice::GPUDevice):
1530         * Modules/webgpu/cocoa/GPUShaderModuleMetal.mm:
1531         (WebCore::GPUShaderModule::create):
1532         (WebCore::GPUShaderModule::GPUShaderModule):
1533         * Sources.txt:
1534         * SourcesCocoa.txt:
1535         * WebCore.xcodeproj/project.pbxproj:
1536         * bindings/js/WebCoreBuiltinNames.h:
1537         * platform/Logging.h:
1538
1539 2018-11-01  Jiewen Tan  <jiewen_tan@apple.com>
1540
1541         Replace CommonRandom SPI with API
1542         https://bugs.webkit.org/show_bug.cgi?id=191178
1543         <rdar://problem/45722391>
1544
1545         Reviewed by Brent Fulgham.
1546
1547         The API is available since macOS 10.10 and iOS 10, and therefore it is safe to replace
1548         all SPI usages with API.
1549
1550         No change of behaviors.
1551
1552         * crypto/CommonCryptoUtilities.h:
1553         * crypto/mac/CryptoKeyMac.cpp:
1554         (WebCore::CryptoKey::randomData):
1555         * crypto/mac/SerializedCryptoKeyWrapMac.mm:
1556         (WebCore::createAndStoreMasterKey):
1557         (WebCore::wrapSerializedCryptoKey):
1558         * page/Crypto.cpp:
1559         (WebCore::Crypto::getRandomValues):
1560
1561 2018-11-01  Chris Dumez  <cdumez@apple.com>
1562
1563         [WebIDL] Rename CallWith=ScriptState to CallWith=ExecState
1564         https://bugs.webkit.org/show_bug.cgi?id=191162
1565
1566         Reviewed by Alex Christensen.
1567
1568         Rename CallWith=ScriptState to CallWith=ExecState in our Web IDL as ScriptState is no longer a thing
1569         in modern WebKit. The implementation is actually passed an ExecState nowadays.
1570
1571         * Modules/applepay/ApplePaySession.idl:
1572         * Modules/encryptedmedia/MediaKeyStatusMap.idl:
1573         * Modules/fetch/FetchBody.idl:
1574         * Modules/indexeddb/IDBCursor.idl:
1575         * Modules/indexeddb/IDBFactory.idl:
1576         * Modules/indexeddb/IDBIndex.idl:
1577         * Modules/indexeddb/IDBKeyRange.idl:
1578         * Modules/indexeddb/IDBObjectStore.idl:
1579         * Modules/mediastream/RTCPeerConnection.idl:
1580         * animation/Animatable.idl:
1581         * animation/KeyframeEffect.idl:
1582         * animation/KeyframeEffectReadOnly.idl:
1583         * bindings/scripts/CodeGeneratorJS.pm:
1584         (GenerateCallWith):
1585         (GenerateConstructorDefinition):
1586         * bindings/scripts/IDLAttributes.json:
1587         * bindings/scripts/test/JS/JSTestObj.cpp:
1588         (WebCore::jsTestObjWithExecStateAttributeGetter):
1589         (WebCore::jsTestObjWithExecStateAttribute):
1590         (WebCore::setJSTestObjWithExecStateAttributeSetter):
1591         (WebCore::setJSTestObjWithExecStateAttribute):
1592         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttributeGetter):
1593         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttribute):
1594         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttributeSetter):
1595         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttribute):
1596         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeGetter):
1597         (WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttribute):
1598         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeSetter):
1599         (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttribute):
1600         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidBody):
1601         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoid):
1602         (WebCore::jsTestObjPrototypeFunctionWithExecStateObjBody):
1603         (WebCore::jsTestObjPrototypeFunctionWithExecStateObj):
1604         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidExceptionBody):
1605         (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidException):
1606         (WebCore::jsTestObjPrototypeFunctionWithExecStateObjExceptionBody):
1607         (WebCore::jsTestObjPrototypeFunctionWithExecStateObjException):
1608         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateBody):
1609         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecState):
1610         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjExceptionBody):
1611         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjException):
1612         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpacesBody):
1613         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpaces):
1614         (WebCore::jsTestObjWithScriptStateAttributeGetter): Deleted.
1615         (WebCore::jsTestObjWithScriptStateAttribute): Deleted.
1616         (WebCore::setJSTestObjWithScriptStateAttributeSetter): Deleted.
1617         (WebCore::setJSTestObjWithScriptStateAttribute): Deleted.
1618         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeGetter): Deleted.
1619         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute): Deleted.
1620         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeSetter): Deleted.
1621         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute): Deleted.
1622         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeGetter): Deleted.
1623         (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): Deleted.
1624         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeSetter): Deleted.
1625         (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): Deleted.
1626         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidBody): Deleted.
1627         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoid): Deleted.
1628         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjBody): Deleted.
1629         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObj): Deleted.
1630         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidExceptionBody): Deleted.
1631         (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidException): Deleted.
1632         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjExceptionBody): Deleted.
1633         (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException): Deleted.
1634         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateBody): Deleted.
1635         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState): Deleted.
1636         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjExceptionBody): Deleted.
1637         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException): Deleted.
1638         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpacesBody): Deleted.
1639         (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces): Deleted.
1640         * bindings/scripts/test/TestObj.idl:
1641         * bindings/scripts/test/TestPromiseRejectionEvent.idl:
1642         * crypto/SubtleCrypto.idl:
1643         * dom/Element.idl:
1644         * dom/ErrorEvent.idl:
1645         * dom/MessagePort.idl:
1646         * dom/MouseEvent.idl:
1647         * html/HTMLCanvasElement.idl:
1648         * html/HTMLFrameElement.idl:
1649         * html/OffscreenCanvas.idl:
1650         * html/track/DataCue.idl:
1651         * inspector/CommandLineAPIHost.idl:
1652         * page/DOMWindow.idl:
1653         * page/RemoteDOMWindow.idl:
1654         * page/WindowOrWorkerGlobalScope.idl:
1655         * testing/Internals.idl:
1656         * workers/DedicatedWorkerGlobalScope.idl:
1657         * workers/Worker.idl:
1658
1659 2018-11-01  Fujii Hironori  <Hironori.Fujii@sony.com>
1660
1661         Rename <wtf/unicode/UTF8.h> to <wtf/unicode/UTF8Conversion.h> in order to avoid conflicting with ICU's unicode/utf8.h
1662         https://bugs.webkit.org/show_bug.cgi?id=189693
1663
1664         Reviewed by Yusuke Suzuki.
1665
1666         No new tests because there's no behaviro changes.
1667
1668         * platform/SharedBuffer.cpp: Replaced <wtf/unicode/UTF8.h> with <wtf/unicode/UTF8Conversion.h>.
1669         * xml/XSLTProcessorLibxslt.cpp: Ditto.
1670         * xml/parser/XMLDocumentParserLibxml2.cpp: Ditto.
1671
1672 2018-11-01  John Wilander  <wilander@apple.com>
1673
1674         In WebCore::ResourceLoadObserver, use document.sessionID().isEphemeral() when possible and check for page existence when not
1675         https://bugs.webkit.org/show_bug.cgi?id=191119
1676         <rdar://problem/44176965>
1677
1678         Reviewed by Chris Dumez.
1679
1680         New API test added.
1681
1682         * loader/ResourceLoadObserver.cpp:
1683         (WebCore::ResourceLoadObserver::logSubresourceLoading):
1684         (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
1685
1686 2018-11-01  Devin Rousso  <drousso@apple.com>
1687
1688         Web Inspector: Network: remove unnecessary media event tracking
1689         https://bugs.webkit.org/show_bug.cgi?id=191174
1690
1691         Reviewed by Joseph Pecoraro.
1692
1693         No new tests, as this simply removes some event listeners for the WebInspector frontend.
1694
1695         * inspector/agents/InspectorDOMAgent.cpp:
1696         (WebCore::InspectorDOMAgent::addEventListenersToNode):
1697
1698 2018-11-01  Chris Dumez  <cdumez@apple.com>
1699
1700         Location object sans browsing context
1701         https://bugs.webkit.org/show_bug.cgi?id=191060
1702
1703         Reviewed by Geoffrey Garen.
1704
1705         As per https://github.com/whatwg/html/pull/4076, a Location object's URL should be "about:blank" when
1706         it does not have a browsing context (Frame), not "".
1707
1708         No new tests, rebaselined existing tests.
1709
1710         * page/Location.cpp:
1711         (WebCore::Location::url const):
1712         (WebCore::Location::href const):
1713         (WebCore::Location::protocol const):
1714         (WebCore::Location::host const):
1715         (WebCore::Location::hostname const):
1716         (WebCore::Location::port const):
1717         (WebCore::Location::pathname const):
1718         (WebCore::Location::search const):
1719         (WebCore::Location::origin const):
1720         (WebCore::Location::hash const):
1721
1722 2018-11-01  Sihui Liu  <sihui_liu@apple.com>
1723
1724         Add a storage limit for IndexedDB
1725         https://bugs.webkit.org/show_bug.cgi?id=190598
1726         <rdar://problem/44654715>
1727
1728         Reviewed by Chris Dumez.
1729
1730         Set a storage limit in IndexedDB for each pair of mainFrameOrigin and openingOrigin. 
1731         IndexedDB will return a QuotaExceededError if limit is reached.
1732
1733         If the size of free disk space is over 1 GB, the default limit is 500 MB; otherwise it is 
1734         half the free disk space.
1735
1736         Test: storage/indexeddb/storage-limit.html
1737
1738         * Modules/indexeddb/server/IDBBackingStore.h:
1739         * Modules/indexeddb/server/IDBServer.cpp:
1740         (WebCore::IDBServer::IDBServer::createBackingStore):
1741         (WebCore::IDBServer::IDBServer::setPerOriginQuota):
1742         * Modules/indexeddb/server/IDBServer.h:
1743         (WebCore::IDBServer::IDBServer::perOriginQuota const):
1744         * Modules/indexeddb/server/MemoryIDBBackingStore.h:
1745         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1746         (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
1747         (WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const):
1748         (WebCore::IDBServer::SQLiteIDBBackingStore::maximumSize const):
1749         (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
1750         (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
1751         (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
1752         (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
1753         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
1754         (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
1755         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
1756         (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
1757         * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1758         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1759         (WebCore::IDBServer::UniqueIDBDatabase::setQuota):
1760         * Modules/indexeddb/server/UniqueIDBDatabase.h:
1761
1762 2018-11-01  Justin Michaud  <justin_michaud@apple.com>
1763
1764         CSS Custom Properties API Should Support syntax="*" and "<length>", and handle cycles properly
1765         https://bugs.webkit.org/show_bug.cgi?id=191042
1766
1767         Reviewed by Antti Koivisto.
1768
1769         Refactor code so that:
1770         - All properties applied in StyleResolver::applyMatchedProperties are only applied once. 
1771         - Custom properties are only resolved once, in StyleResolver, when they are applied to the RenderStyle. They were previously resolved
1772           every time they were referenced, and again in RenderStyle.
1773         - The font-size property is applied after its variable references, but before custom properties that depend on it.
1774         - Cycles are detected at the same time as resolution.
1775         - MutableStyleProperties' custom properties cannot be set from Javascript or WebKitLegacy if they do not parse for the property's type.
1776           If they contain var(--...) references, however, then they can be set because we cannot check if the references are valid from setProperty.
1777           This behaviour matches chrome, but is not documented in the spec. 
1778         - Custom property values have more explicit resolved/unresolved state.
1779         - RenderStyle only ever holds resolved custom properties, and StyleResolver::CascadedProperties only holds unresolved properties.
1780
1781         Tests: css-custom-properties-api/crash.html
1782                css-custom-properties-api/cycles.html
1783                css-custom-properties-api/inline.html
1784
1785         * css/CSSComputedStyleDeclaration.cpp:
1786         (WebCore::ComputedStyleExtractor::customPropertyValue):
1787         * css/CSSCustomPropertyValue.cpp:
1788         (WebCore::CSSCustomPropertyValue::equals const):
1789         (WebCore::CSSCustomPropertyValue::customCSSText const):
1790         (WebCore::CSSCustomPropertyValue::tokens const):
1791         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): Deleted.
1792         (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): Deleted.
1793         (WebCore::CSSCustomPropertyValue::setResolvedTypedValue): Deleted.
1794         * css/CSSCustomPropertyValue.h:
1795         * css/CSSRegisteredCustomProperty.cpp:
1796         (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
1797         * css/CSSRegisteredCustomProperty.h:
1798         * css/CSSVariableData.cpp:
1799         (WebCore::CSSVariableData::CSSVariableData):
1800         (WebCore::CSSVariableData::consumeAndUpdateTokens): Deleted.
1801         (WebCore::CSSVariableData::checkVariablesForCycles const): Deleted.
1802         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): Deleted.
1803         (WebCore::CSSVariableData::resolveVariableFallback const): Deleted.
1804         (WebCore::CSSVariableData::resolveVariableReference const): Deleted.
1805         (WebCore::CSSVariableData::resolveVariableReferences const): Deleted.
1806         (WebCore::CSSVariableData::resolveTokenRange const): Deleted.
1807         * css/CSSVariableData.h:
1808         (WebCore::CSSVariableData::create):
1809         (WebCore::CSSVariableData::createResolved): Deleted.
1810         (WebCore::CSSVariableData::needsVariableResolution const): Deleted.
1811         (WebCore::CSSVariableData::CSSVariableData): Deleted.
1812         * css/CSSVariableReferenceValue.cpp:
1813         (WebCore::resolveVariableFallback):
1814         (WebCore::resolveVariableReference):
1815         (WebCore::resolveTokenRange):
1816         (WebCore::CSSVariableReferenceValue::resolveVariableReferences const):
1817         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): Deleted.
1818         * css/CSSVariableReferenceValue.h:
1819         (WebCore::CSSVariableReferenceValue::create):
1820         (WebCore::CSSVariableReferenceValue::equals const):
1821         (WebCore::CSSVariableReferenceValue::variableDataValue const): Deleted.
1822         * css/DOMCSSRegisterCustomProperty.cpp:
1823         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
1824         * css/PropertySetCSSStyleDeclaration.cpp:
1825         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
1826         * css/StyleBuilderCustom.h:
1827         (WebCore::StyleBuilderCustom::applyInitialCustomProperty):
1828         (WebCore::StyleBuilderCustom::applyValueCustomProperty):
1829         * css/StyleProperties.cpp:
1830         (WebCore::MutableStyleProperties::setCustomProperty):
1831         * css/StyleProperties.h:
1832         * css/StyleResolver.cpp:
1833         (WebCore::StyleResolver::State::setStyle):
1834         (WebCore::StyleResolver::styleForKeyframe):
1835         (WebCore::StyleResolver::styleForPage):
1836         (WebCore::StyleResolver::applyMatchedProperties):
1837         (WebCore::StyleResolver::applyPropertyToCurrentStyle):
1838         (WebCore::StyleResolver::applyProperty):
1839         (WebCore::StyleResolver::resolvedVariableValue const):
1840         (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
1841         (WebCore::StyleResolver::CascadedProperties::Property::apply):
1842         (WebCore::StyleResolver::applyCascadedCustomProperty):
1843         (WebCore::StyleResolver::applyCascadedProperties):
1844         * css/StyleResolver.h:
1845         * css/parser/CSSParser.cpp:
1846         (WebCore::CSSParser::parseValueWithVariableReferences):
1847         * css/parser/CSSParser.h:
1848         * css/parser/CSSPropertyParser.cpp:
1849         (WebCore::CSSPropertyParser::CSSPropertyParser):
1850         (WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue):
1851         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue):
1852         (WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies):
1853         (WebCore::CSSPropertyParser::parseValueStart):
1854         (WebCore::CSSPropertyParser::parseSingleValue):
1855         * css/parser/CSSPropertyParser.h:
1856         * css/parser/CSSVariableParser.cpp:
1857         (WebCore::CSSVariableParser::parseDeclarationValue):
1858         * dom/ConstantPropertyMap.cpp:
1859         (WebCore::ConstantPropertyMap::setValueForProperty):
1860         (WebCore::variableDataForPositivePixelLength):
1861         (WebCore::variableDataForPositiveDuration):
1862         * rendering/style/RenderStyle.cpp:
1863         (WebCore::RenderStyle::checkVariablesInCustomProperties): Deleted.
1864         * rendering/style/RenderStyle.h:
1865         (WebCore::RenderStyle::setInheritedCustomPropertyValue):
1866         (WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
1867         * rendering/style/StyleCustomPropertyData.h:
1868         (WebCore::StyleCustomPropertyData::operator== const):
1869         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
1870         (WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
1871         (): Deleted.
1872
1873 2018-11-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
1874
1875         [CG] Adopt CG SPI for non-even cornered rounded rects
1876         https://bugs.webkit.org/show_bug.cgi?id=190155
1877
1878         Reviewed by Simon Fraser.
1879
1880         Instead of creating bezier curves for the non-even corners of the rounded
1881         rects, we should use the optimized SPI provided by CG.
1882
1883         * platform/graphics/cg/PathCG.cpp:
1884         (WebCore::Path::platformAddPathForRoundedRect):
1885
1886 2018-11-01  Youenn Fablet  <youenn@apple.com>
1887
1888         RTCTrackEvent.streams should be SameObject
1889         https://bugs.webkit.org/show_bug.cgi?id=191130
1890
1891         Reviewed by Eric Carlson.
1892
1893         Mimick SameObject using CachedAttribute.
1894         Covered by rebased test.
1895
1896         * Modules/mediastream/RTCTrackEvent.idl:
1897
1898 2018-10-31  Zalan Bujtas  <zalan@apple.com>
1899
1900         [LFC][IFC] Add support for inline-block elements.
1901         https://bugs.webkit.org/show_bug.cgi?id=191143
1902
1903         Reviewed by Antti Koivisto.
1904
1905         This patch add support for laying out non-shrink-to-width inline-block elements.
1906
1907         Test: fast/inline/simple-inline-block.html
1908
1909         * layout/FormattingContext.h:
1910         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
1911         * layout/FormattingContextGeometry.cpp:
1912         (WebCore::Layout::contentHeightForFormattingContextRoot):
1913         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
1914         * layout/inlineformatting/InlineFormattingContext.cpp:
1915         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
1916         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
1917         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
1918         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
1919         * layout/layouttree/LayoutInlineContainer.cpp:
1920         (WebCore::Layout::InlineContainer::establishesInlineFormattingContext const):
1921         * layout/layouttree/LayoutInlineContainer.h:
1922         * layout/layouttree/LayoutTreeBuilder.cpp:
1923         (WebCore::Layout::TreeBuilder::createSubTree):
1924
1925 2018-11-01  Claudio Saavedra  <csaavedra@igalia.com>
1926
1927         Fix build with VIDEO and WEB_AUDIO disabled
1928         https://bugs.webkit.org/show_bug.cgi?id=191147
1929
1930         Reviewed by Philippe Normand.
1931
1932         Supported or not, there were a few build fixes needed
1933         to be able to build WebKit with media disabled. Mostly
1934         low-hanging fruits.
1935
1936         * Modules/mediasource/VideoPlaybackQuality.cpp:
1937         * Modules/mediasource/VideoPlaybackQuality.h:
1938         * Modules/mediasource/VideoPlaybackQuality.idl:
1939         * dom/Document.cpp:
1940         (WebCore::Document::dispatchFullScreenChangeOrErrorEvent):
1941         * inspector/agents/InspectorDOMAgent.cpp:
1942         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
1943         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
1944         * inspector/agents/InspectorDOMAgent.h:
1945         * rendering/RenderThemeGtk.cpp:
1946
1947 2018-10-31  Devin Rousso  <drousso@apple.com>
1948
1949         Web Inspector: Canvas: create a setting for auto-recording newly created contexts
1950         https://bugs.webkit.org/show_bug.cgi?id=190856
1951
1952         Reviewed by Brian Burg.
1953
1954         Test: inspector/canvas/setRecordingAutoCaptureFrameCount.html
1955
1956         * inspector/agents/InspectorCanvasAgent.h:
1957         (WebCore::InspectorCanvasAgent::RecordingOptions): Added.
1958         * inspector/agents/InspectorCanvasAgent.cpp:
1959         (WebCore::InspectorCanvasAgent::enable):
1960         (WebCore::InspectorCanvasAgent::disable):
1961         (WebCore::InspectorCanvasAgent::setRecordingAutoCaptureFrameCount): Added.
1962         (WebCore::InspectorCanvasAgent::startRecording):
1963         (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
1964         (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
1965         (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
1966         (WebCore::InspectorCanvasAgent::startRecording): Added.
1967         Unify the different functions that are able to start a recording to use a single path.
1968
1969         * inspector/InspectorCanvas.h:
1970         * inspector/InspectorCanvas.cpp:
1971         (WebCore::InspectorCanvas::resetRecordingData):
1972         (WebCore::InspectorCanvas::recordAction):
1973         (WebCore::InspectorCanvas::setFrameCount): Added.
1974         (WebCore::InspectorCanvas::overFrameCount const): Added.
1975
1976 2018-10-31  Devin Rousso  <drousso@apple.com>
1977
1978         Web Inspector: display low-power enter/exit events in Timelines and Network node waterfalls
1979         https://bugs.webkit.org/show_bug.cgi?id=190641
1980         <rdar://problem/45319049>
1981
1982         Reviewed by Joseph Pecoraro.
1983
1984         No new tests, as low power mode is indeterminate. Should not affect functionality.
1985
1986         * inspector/agents/InspectorDOMAgent.h:
1987         * inspector/agents/InspectorDOMAgent.cpp:
1988         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
1989         (WebCore::InspectorDOMAgent::addEventListenersToNode):
1990         (WebCore::InspectorDOMAgent::mediaMetricsTimerFired): Added.
1991
1992 2018-10-31  Alicia Boya García  <aboya@igalia.com>
1993
1994         [MSE] Use tolerance when growing the coded frame group
1995         https://bugs.webkit.org/show_bug.cgi?id=190085
1996
1997         Reviewed by Jer Noble.
1998
1999         Test: media/media-source/media-source-append-acb-tolerance.html
2000
2001         This patch introduces a millisecond tolerance in the range of
2002         potential frames that should be erased frame from the track buffer
2003         when the coded frame group is growing.
2004
2005         This is necessary because some files have imprecise overlapping
2006         timestamps (especially WebM files).
2007
2008         This fixes a stall when seeking back and forth in YouTube with WebM
2009         video.
2010
2011         A test case simulating the problem with video/mock using timestamps
2012         similar to those of a typical 30 fps WebM video is also added.
2013
2014         * Modules/mediasource/SourceBuffer.cpp:
2015         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2016
2017 2018-10-31  Jer Noble  <jer.noble@apple.com>
2018
2019         MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L60.B0') is inproperly rejected
2020         https://bugs.webkit.org/show_bug.cgi?id=191129
2021
2022         Reviewed by Eric Carlson.
2023
2024         Test: media/media-source/media-source-istypesupported-case-sensitive.html
2025
2026         According to RFC 2045: "All media type values, subtype values, and parameter names as
2027         defined are case-insensitive. However, parameter values are case-sensitive unless otherwise
2028         specified for the specific parameter." So rather than fold the entire ContentType into lower-
2029         case, leave the original string intact and require clients to enforce case-insensitivity.
2030
2031         * Modules/mediasource/MediaSource.cpp:
2032         (WebCore::MediaSource::isTypeSupported):
2033
2034 2018-10-31  Jer Noble  <jer.noble@apple.com>
2035
2036         Unreivewed build fix; fix the non-HAVE_AVCONTENTKEYSESSION builds by adding guards around
2037         access of m_cdmInstance.
2038
2039         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2040         (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
2041
2042 2018-10-31  YUHAN WU  <yuhan_wu@apple.com>
2043
2044         MediaRecorder should fire dataavailable event when all tracks are ended and stop() is called
2045         https://bugs.webkit.org/show_bug.cgi?id=190778
2046         <rdar://problem/45703574>
2047
2048         Reviewed by Youenn Fablet.
2049
2050         Add a include to fix the unified build error.
2051
2052         No tests since no new functionality.
2053
2054         * Modules/webgpu/WebGPUDevice.cpp:
2055
2056 2018-10-26  Jer Noble  <jer.noble@apple.com>
2057
2058         [EME][Cocoa] Cannot play unmuxed video and audio fMP4 streams encrypted with different keys via MSE
2059         https://bugs.webkit.org/show_bug.cgi?id=190946
2060
2061         Reviewed by Eric Carlson.
2062
2063         Use separate AVContentKeySessions per CDMInstanceSession (rather than one AVContentKeySession per
2064         CDMInstance).
2065
2066         - Add a mechanism for sending a message out from platform/CDMInstance to MediaKeySession without
2067           requiring MediaKeySession to send a callback first.
2068
2069         - Move all the AVContentKeySession delegate methods from CDMInstanceFairPlayStreamingAVFObjC to
2070           CDMInstanceSessionFairPlayStreamingAVFObjC.
2071
2072         - Add a mechanism for requesting the correct CDMInstanceSession for a given KeyID.
2073
2074         - Support key renewal through a "renew" message.
2075
2076         - Remember the keyID in SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID()
2077           and ask for the correct CDMInstanceSession for that keyID in attemptToDecrypt().
2078
2079         - Pass the CDMInstance down from MediaPlayerPrivateMediaSourceAVFObjC -> SourceBufferPrivateAVFObjC.
2080
2081         * Modules/encryptedmedia/MediaKeySession.cpp:
2082         (WebCore::MediaKeySession::sendMessage):
2083         * Modules/encryptedmedia/MediaKeySession.h:
2084         * platform/encryptedmedia/CDMInstanceSession.h:
2085         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
2086         * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2087         (-[WebCoreFPSContentKeySessionDelegate initWithParent:]):
2088         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration):
2089         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::createSession):
2090         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2091         (WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionForKeyIDs const):
2092         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::CDMInstanceSessionFairPlayStreamingAVFObjC):
2093         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::~CDMInstanceSessionFairPlayStreamingAVFObjC):
2094         (WebCore::keyIDsForRequest):
2095         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyIDs):
2096         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense):
2097         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense):
2098         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession):
2099         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData):
2100         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
2101         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
2102         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
2103         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed):
2104         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest):
2105         (WebCore::requestStatusToCDMStatus):
2106         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses const):
2107         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2108         (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession):
2109         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2110         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2111         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
2112         (WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceAttached):
2113         (WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceDetached):
2114         (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance):
2115         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2116         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2117         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2118         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached):
2119         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached):
2120         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance):
2121         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKey const):
2122         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
2123         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
2124         (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
2125         (WebCore::MediaSourcePrivateAVFObjC::cdmInstanceAttached):
2126         (WebCore::MediaSourcePrivateAVFObjC::cdmInstanceDetached):
2127         (WebCore::MediaSourcePrivateAVFObjC::attemptToDecryptWithInstance):
2128         (WebCore::MediaSourcePrivateAVFObjC::waitingForKey const):
2129         (WebCore::MediaSourcePrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2130         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
2131         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
2132         (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
2133         (WebCore::SourceBufferPrivateAVFObjC::destroyParser):
2134         (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
2135         (WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt):
2136         (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged):
2137
2138 2018-10-31  Zach Li  <zacharyli323@gmail.com>
2139
2140         Add credit card autofill button
2141         https://bugs.webkit.org/show_bug.cgi?id=191051
2142         <rdar://problem/45657011>
2143
2144         Reviewed by Wenson Hsieh.
2145
2146         Test: fast/forms/auto-fill-button/input-credit-card-auto-fill-button.html
2147
2148         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2149         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2150         * css/html.css:
2151         (input::-webkit-credit-card-auto-fill-button):
2152         Add credit card autofill button.
2153         (input::-webkit-credit-card-auto-fill-button:hover):
2154         (input::-webkit-credit-card-auto-fill-button:active):
2155         * html/HTMLTextFormControlElement.h:
2156         * html/TextFieldInputType.cpp:
2157         (WebCore::autoFillButtonTypeToAccessibilityLabel):
2158         (WebCore::autoFillButtonTypeToAutoFillButtonText):
2159         (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
2160         (WebCore::isAutoFillButtonTypeChanged):
2161         * platform/LocalizedStrings.cpp:
2162         (WebCore::AXAutoFillCreditCardLabel):
2163         * platform/LocalizedStrings.h:
2164         * testing/Internals.cpp:
2165         (WebCore::toAutoFillButtonType):
2166         (WebCore::toInternalsAutoFillButtonType):
2167         * testing/Internals.h:
2168         * testing/Internals.idl:
2169
2170 2018-10-31  Eric Carlson  <eric.carlson@apple.com>
2171
2172         [MediaStream] Don't reveal device IDs until the user has granted permission to capture
2173         https://bugs.webkit.org/show_bug.cgi?id=191112
2174         <rdar://problem/45699932>
2175
2176         Reviewed by Youenn Fablet.
2177
2178         No new tests, existing tests updated.
2179
2180         * Modules/mediastream/MediaDevicesRequest.cpp:
2181         (WebCore::MediaDevicesRequest::start): Don't reveal device ID or group ID until the user 
2182         has granted permssion to capture.
2183
2184 2018-10-31  YUHAN WU  <yuhan_wu@apple.com>
2185
2186         MediaRecorder should fire dataavailable event when all tracks are ended and stop() is called
2187         https://bugs.webkit.org/show_bug.cgi?id=190778
2188
2189         Reviewed by Youenn Fablet.
2190
2191         Implement JavaScript dispatch event dataavailable and JavaScript exposed method stop().
2192         Implement a mock string as the output buffer of MediaRecorder.
2193         Remove the declaration of timecode in BlobEvent since it has not been implemented in MediaRecorder and MediaRecorderPrivate. 
2194
2195         Tests: http/wpt/mediarecorder/MediaRecorder-dataavailable.html
2196                http/wpt/mediarecorder/MediaRecorder-mock-dataavailable.html
2197                imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-destroy-script-execution.html
2198                imported/w3c/web-platform-tests/mediacapture-record/support/MediaRecorder-iframe.html
2199
2200         * CMakeLists.txt:
2201         * Modules/mediarecorder/BlobEvent.cpp: Added.
2202         (WebCore::BlobEvent::create):
2203         (WebCore::BlobEvent::BlobEvent):
2204         (WebCore::BlobEvent::eventInterface const):
2205         * Modules/mediarecorder/BlobEvent.h:
2206         * Modules/mediarecorder/BlobEvent.idl:
2207         * Modules/mediarecorder/MediaRecorder.cpp:
2208         (WebCore::MediaRecorder::MediaRecorder):
2209         (WebCore::MediaRecorder::~MediaRecorder):
2210         (WebCore::MediaRecorder::stop):
2211         (WebCore::MediaRecorder::startRecording):
2212         (WebCore::MediaRecorder::stopRecording):
2213         (WebCore::MediaRecorder::stopRecordingInternal):
2214         (WebCore::MediaRecorder::didAddOrRemoveTrack):
2215         (WebCore::MediaRecorder::trackEnded):
2216         (WebCore::MediaRecorder::sampleBufferUpdated):
2217         (WebCore::MediaRecorder::audioSamplesAvailable):
2218         (WebCore::MediaRecorder::scheduleDeferredTask):
2219         * Modules/mediarecorder/MediaRecorder.h:
2220         * Modules/mediarecorder/MediaRecorder.idl:
2221         * Sources.txt:
2222         * WebCore.xcodeproj/project.pbxproj:
2223         * dom/EventNames.h:
2224         * dom/EventNames.in:
2225         * platform/mediarecorder/MediaRecorderPrivate.h: Added.
2226         * platform/mediarecorder/MediaRecorderPrivateMock.cpp: Added.
2227         (WebCore::MediaRecorderPrivateMock::sampleBufferUpdated):
2228         (WebCore::MediaRecorderPrivateMock::audioSamplesAvailable):
2229         (WebCore::MediaRecorderPrivateMock::generateMockString):
2230         (WebCore::MediaRecorderPrivateMock::fetchData):
2231         * platform/mediarecorder/MediaRecorderPrivateMock.h: Added.
2232
2233 2018-10-31  Claudio Saavedra  <csaavedra@igalia.com>
2234
2235         [GTK][WPE] Remaining topPrivatelyControlledDomain() fixes
2236         https://bugs.webkit.org/show_bug.cgi?id=191110
2237
2238         Reviewed by Michael Catanzaro.
2239
2240         Covered by existing tests.
2241
2242         Turns out that this method is expected to reject domains that
2243         are not registrable. Also sync with the Mac implementation in
2244         that given domains that are not all ASCII should be returned
2245         back as is. This fixes the remaining Public Suffix API tests.
2246
2247         * platform/soup/PublicSuffixSoup.cpp:
2248         (WebCore::topPrivatelyControlledDomain):
2249
2250 2018-10-31  Antti Koivisto  <antti@apple.com>
2251
2252         Remove LayerFlushScheduler
2253         https://bugs.webkit.org/show_bug.cgi?id=191103
2254
2255         Reviewed by Anders Carlsson.
2256
2257         It is only used in WK1.
2258
2259         * SourcesCocoa.txt:
2260         * WebCore.xcodeproj/project.pbxproj:
2261         * platform/graphics/ca/LayerFlushScheduler.cpp: Removed.
2262         * platform/graphics/ca/LayerFlushScheduler.h: Removed.
2263         * platform/graphics/ca/LayerFlushSchedulerClient.h: Removed.
2264         * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Removed.
2265
2266 2018-10-31  Zalan Bujtas  <zalan@apple.com>
2267
2268         Missing from r237634
2269
2270         * layout/inlineformatting/InlineFormattingState.cpp:
2271         (WebCore::Layout::InlineFormattingState::formattingContext):
2272
2273 2018-10-31  Zalan Bujtas  <zalan@apple.com>
2274
2275         [LFC] Do not pass LayoutState& to compute* and layout* functions
2276         https://bugs.webkit.org/show_bug.cgi?id=191100
2277
2278         Reviewed by Antti Koivisto.
2279
2280         Reduce noise by removing LayoutState& parameter where possible.
2281
2282         * layout/FormattingContext.cpp:
2283         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
2284         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
2285         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
2286         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
2287         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
2288         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
2289         * layout/FormattingContext.h:
2290         * layout/FormattingContextGeometry.cpp:
2291         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
2292         * layout/LayoutFormattingState.cpp:
2293         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
2294         * layout/blockformatting/BlockFormattingContext.cpp:
2295         (WebCore::Layout::BlockFormattingContext::layout const):
2296         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2297         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
2298         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
2299         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
2300         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
2301         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
2302         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
2303         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
2304         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
2305         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
2306         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2307         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
2308         * layout/blockformatting/BlockFormattingContext.h:
2309         * layout/inlineformatting/InlineFormattingContext.cpp:
2310         (WebCore::Layout::InlineFormattingContext::layout const):
2311         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
2312         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2313         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
2314         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
2315         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
2316         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
2317         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
2318         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
2319         * layout/inlineformatting/InlineFormattingContext.h:
2320
2321 2018-10-31  Zalan Bujtas  <zalan@apple.com>
2322
2323         [LFC] FormattingContext class should take FormattingState&
2324         https://bugs.webkit.org/show_bug.cgi?id=191099
2325
2326         Reviewed by Antti Koivisto.
2327
2328         This is in preparation for not passing LayoutState& into every layout functions.
2329         FormattingContext has FormattingState now and LayoutState can be acquired through FormattingState.
2330         LayoutState <- FormattingState <- FormattingContext
2331
2332         * layout/FormattingContext.cpp:
2333         (WebCore::Layout::FormattingContext::FormattingContext):
2334         (WebCore::Layout::FormattingContext::formattingState const):
2335         (WebCore::Layout::FormattingContext::layoutState const):
2336         * layout/FormattingContext.h:
2337         * layout/FormattingState.cpp:
2338         (WebCore::Layout::FormattingState::FormattingState):
2339         * layout/FormattingState.h:
2340         (WebCore::Layout::FormattingState::layoutState const):
2341         * layout/LayoutFormattingState.h:
2342         * layout/blockformatting/BlockFormattingContext.cpp:
2343         (WebCore::Layout::BlockFormattingContext::BlockFormattingContext):
2344         * layout/blockformatting/BlockFormattingContext.h:
2345         * layout/blockformatting/BlockFormattingState.cpp:
2346         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
2347         (WebCore::Layout::BlockFormattingState::formattingContext):
2348         (WebCore::Layout::BlockFormattingState::formattingContext const): Deleted.
2349         * layout/blockformatting/BlockFormattingState.h:
2350         * layout/inlineformatting/InlineFormattingContext.cpp:
2351         (WebCore::Layout::InlineFormattingContext::InlineFormattingContext):
2352         * layout/inlineformatting/InlineFormattingContext.h:
2353         * layout/inlineformatting/InlineFormattingState.cpp:
2354         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
2355         (WebCore::Layout::InlineFormattingState::formattingContext):
2356         (WebCore::Layout::InlineFormattingState::formattingContext const): Deleted.
2357         * layout/inlineformatting/InlineFormattingState.h:
2358
2359 2018-10-31  Zalan Bujtas  <zalan@apple.com>
2360
2361         [LFC] The *FormattingState class should provide the *FormattingContext.
2362         https://bugs.webkit.org/show_bug.cgi?id=191089
2363
2364         Reviewed by Antti Koivisto.
2365
2366         BlockFormattingState provides the BlockFormattingContext object, while InlineFormattingState provides the InlineFormattingContext.
2367
2368         * layout/FormattingContext.cpp:
2369         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
2370         * layout/FormattingState.h:
2371         * layout/LayoutFormattingState.cpp:
2372         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
2373         (WebCore::Layout::LayoutState::formattingContext const): Deleted.
2374         * layout/LayoutFormattingState.h:
2375         * layout/blockformatting/BlockFormattingContext.cpp:
2376         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2377         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
2378         * layout/blockformatting/BlockFormattingState.cpp:
2379         (WebCore::Layout::BlockFormattingState::formattingContext const):
2380         * layout/blockformatting/BlockFormattingState.h:
2381         * layout/inlineformatting/InlineFormattingContext.cpp:
2382         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
2383         * layout/inlineformatting/InlineFormattingState.cpp:
2384         (WebCore::Layout::InlineFormattingState::formattingContext const):
2385         * layout/inlineformatting/InlineFormattingState.h:
2386
2387 2018-10-31  Zalan Bujtas  <zalan@apple.com>
2388
2389         [LFC] Rename LayoutContext to LayoutState
2390         https://bugs.webkit.org/show_bug.cgi?id=191080
2391
2392         Reviewed by Antti Koivisto.
2393
2394         LayoutContext naming was a bit misleading since none of the other *FormattingContext classes (BlockFormattingContext etc) hold states.
2395         (LayoutContext.cpp -> LayoutFormattingState.cpp because LayoutState.cpp name is already taken.)
2396
2397         Now the current state is as follows:
2398
2399         LayoutState has
2400         1. Layout tree
2401         2. State content for each formatting subtrees
2402         3. Display tree
2403
2404         * Sources.txt:
2405         * WebCore.xcodeproj/project.pbxproj:
2406         * layout/FormattingContext.cpp:
2407         (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
2408         (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
2409         (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
2410         (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
2411         (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
2412         (WebCore::Layout::FormattingContext::mapBoxToAncestor):
2413         (WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
2414         (WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
2415         (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
2416         * layout/FormattingContext.h:
2417         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
2418         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
2419         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
2420         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
2421         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
2422         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2423         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
2424         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2425         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2426         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2427         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2428         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
2429         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
2430         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2431         * layout/FormattingContextGeometry.cpp:
2432         (WebCore::Layout::contentHeightForFormattingContextRoot):
2433         (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight):
2434         (WebCore::Layout::FormattingContext::Geometry::computedMinHeight):
2435         (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
2436         (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
2437         (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
2438         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
2439         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
2440         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
2441         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
2442         (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
2443         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
2444         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
2445         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
2446         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
2447         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
2448         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
2449         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
2450         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
2451         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
2452         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
2453         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
2454         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
2455         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
2456         * layout/FormattingState.cpp:
2457         (WebCore::Layout::FormattingState::FormattingState):
2458         * layout/FormattingState.h:
2459         (WebCore::Layout::FormattingState::setInstrinsicWidthConstraints):
2460         (WebCore::Layout::FormattingState::instrinsicWidthConstraints const):
2461         * layout/LayoutFormattingState.cpp: Renamed from Source/WebCore/layout/LayoutContext.cpp.
2462         (WebCore::Layout::LayoutState::LayoutState):
2463         (WebCore::Layout::LayoutState::initializeRoot):
2464         (WebCore::Layout::LayoutState::updateLayout):
2465         (WebCore::Layout::LayoutState::layoutFormattingContextSubtree):
2466         (WebCore::Layout::LayoutState::displayBoxForLayoutBox const):
2467         (WebCore::Layout::LayoutState::styleChanged):
2468         (WebCore::Layout::LayoutState::markNeedsUpdate):
2469         (WebCore::Layout::LayoutState::formattingStateForBox const):
2470         (WebCore::Layout::LayoutState::establishedFormattingState const):
2471         (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded):
2472         (WebCore::Layout::LayoutState::formattingContext const):
2473         * layout/LayoutFormattingState.h: Renamed from Source/WebCore/layout/LayoutContext.h.
2474         (WebCore::Layout::LayoutState::setInQuirksMode):
2475         (WebCore::Layout::LayoutState::hasDisplayBox const):
2476         (WebCore::Layout::LayoutState::inQuirksMode const):
2477         * layout/Verification.cpp:
2478         (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
2479         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
2480         (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
2481         (WebCore::Layout::verifyAndOutputSubtree):
2482         (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const):
2483         (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const): Deleted.
2484         * layout/blockformatting/BlockFormattingContext.cpp:
2485         (WebCore::Layout::BlockFormattingContext::layout const):
2486         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
2487         (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
2488         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
2489         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
2490         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
2491         (WebCore::Layout::hasPrecomputedMarginTop):
2492         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
2493         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
2494         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
2495         (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
2496         (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
2497         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
2498         (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
2499         * layout/blockformatting/BlockFormattingContext.h:
2500         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2501         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
2502         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2503         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2504         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
2505         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
2506         (WebCore::Layout::isStretchedToInitialContainingBlock):
2507         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
2508         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
2509         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
2510         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
2511         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
2512         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
2513         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
2514         (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
2515         (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop):
2516         * layout/blockformatting/BlockFormattingState.cpp:
2517         (WebCore::Layout::BlockFormattingState::BlockFormattingState):
2518         * layout/blockformatting/BlockFormattingState.h:
2519         * layout/blockformatting/BlockInvalidation.cpp:
2520         (WebCore::Layout::computeUpdateType):
2521         (WebCore::Layout::computeUpdateTypeForAncestor):
2522         (WebCore::Layout::BlockInvalidation::invalidate):
2523         * layout/blockformatting/BlockInvalidation.h:
2524         * layout/blockformatting/BlockMarginCollapse.cpp:
2525         (WebCore::Layout::isMarginTopCollapsedWithParent):
2526         (WebCore::Layout::isMarginBottomCollapsedThrough):
2527         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild):
2528         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop):
2529         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop):
2530         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom):
2531         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
2532         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom):
2533         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
2534         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild):
2535         (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom):
2536         * layout/displaytree/DisplayBox.h:
2537         * layout/floats/FloatAvoider.cpp:
2538         (WebCore::Layout::FloatAvoider::FloatAvoider):
2539         * layout/floats/FloatAvoider.h:
2540         * layout/floats/FloatBox.cpp:
2541         (WebCore::Layout::FloatBox::FloatBox):
2542         * layout/floats/FloatBox.h:
2543         * layout/floats/FloatingContext.cpp:
2544         (WebCore::Layout::FloatingContext::positionForFloat const):
2545         (WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
2546         (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
2547         * layout/floats/FloatingContext.h:
2548         (WebCore::Layout::FloatingContext::layoutState const):
2549         (WebCore::Layout::FloatingContext::layoutContext const): Deleted.
2550         * layout/floats/FloatingState.cpp:
2551         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
2552         (WebCore::Layout::FloatingState::FloatingState):
2553         (WebCore::Layout::FloatingState::constraints const):
2554         * layout/floats/FloatingState.h:
2555         (WebCore::Layout::FloatingState::create):
2556         (WebCore::Layout::FloatingState::layoutState const):
2557         (WebCore::Layout::FloatingState::layoutContext const): Deleted.
2558         * layout/inlineformatting/InlineFormattingContext.cpp:
2559         (WebCore::Layout::InlineFormattingContext::layout const):
2560         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
2561         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
2562         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
2563         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
2564         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
2565         (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
2566         (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
2567         (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const):
2568         * layout/inlineformatting/InlineFormattingContext.h:
2569         * layout/inlineformatting/InlineFormattingContextGeometry.cpp:
2570         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2571         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
2572         * layout/inlineformatting/InlineFormattingState.cpp:
2573         (WebCore::Layout::InlineFormattingState::InlineFormattingState):
2574         * layout/inlineformatting/InlineFormattingState.h:
2575         * layout/inlineformatting/InlineInvalidation.cpp:
2576         (WebCore::Layout::InlineInvalidation::invalidate):
2577         * layout/inlineformatting/InlineInvalidation.h:
2578         * layout/inlineformatting/InlineLineBreaker.cpp:
2579         (WebCore::Layout::InlineLineBreaker::InlineLineBreaker):
2580         (WebCore::Layout::InlineLineBreaker::runWidth const):
2581         * layout/inlineformatting/InlineLineBreaker.h:
2582         * layout/layouttree/LayoutTreeBuilder.cpp:
2583         (WebCore::Layout::outputInlineRuns):
2584         (WebCore::Layout::outputLayoutTree):
2585         (WebCore::Layout::showLayoutTree):
2586         * layout/layouttree/LayoutTreeBuilder.h:
2587         * page/FrameViewLayoutContext.cpp:
2588         (WebCore::layoutUsingFormattingContext):
2589
2590 2018-10-30  Wenson Hsieh  <wenson_hsieh@apple.com>
2591
2592         [Cocoa] Attachment dropped from one web view to another is missing its file wrapper
2593         https://bugs.webkit.org/show_bug.cgi?id=190530
2594         <rdar://problem/45232149>
2595
2596         Reviewed by Tim Horton.
2597
2598         Add support for copying and pasting attachment elements across web views by encoding and adding file wrapper
2599         data as subresources in the web archive when writing selected web content to the pasteboard, and then decoding
2600         and creating NSFileWrappers upon reading web content.
2601
2602         Test: WKAttachmentTests.CopyAndPasteBetweenWebViews
2603
2604         * WebCore.xcodeproj/project.pbxproj:
2605         * editing/Editor.cpp:
2606         (WebCore::Editor::registerAttachments):
2607         * editing/Editor.h:
2608
2609         Add registerAttachments(), which registers _WKAttachments in the UI process given a list of
2610         SerializedAttachmentData. This behaves similarly to registerAttachmentIdentifiers(), but differs in that (1) it
2611         sends serialized file wrapper data, and (2) it sends a list of serialized attachments, rather than information
2612         about just a single attachment.
2613
2614         * editing/SerializedAttachmentData.h:
2615
2616         Introduce SerializedAttachmentData, a struct containing information needed to serialize and deserialize an
2617         attachment. These are used both when writing attachment data to the pasteboard, and when consuming attachment
2618         data upon paste.
2619
2620         * editing/cocoa/WebContentReaderCocoa.mm:
2621         (WebCore::replaceRichContentWithAttachments):
2622
2623         Add a step when pasting rich content with attachments, to collect and send serialized attachments to the client.
2624         Also, drive-by fix: don't WTFMove() the Ref here if it's still going to be used below.
2625
2626         * html/HTMLAttachmentElement.cpp:
2627         (WebCore::HTMLAttachmentElement::archiveResourceURL):
2628         * html/HTMLAttachmentElement.h:
2629
2630         Add a static helper function to compute a URL that represents the data for the given attachment identifier, for
2631         use in a web archive resource.
2632
2633         * loader/archive/cf/LegacyWebArchive.cpp:
2634         (WebCore::addSubresourcesForAttachmentElementsIfNecessary):
2635
2636         Add a helper function to create and append ArchiveResources representing attachment element data when writing
2637         attachments to the pasteboard via web archive data.
2638
2639         (WebCore::LegacyWebArchive::create):
2640         * page/EditorClient.h:
2641         (WebCore::EditorClient::registerAttachments):
2642         (WebCore::EditorClient::serializedAttachmentDataForIdentifiers):
2643
2644 2018-10-30  David Kilzer  <ddkilzer@apple.com>
2645
2646         XSLTProcessor should limit max transform depth
2647         <https://webkit.org/b/191075>
2648         <rdar://problem/45531453>
2649
2650         Reviewed by Alex Christensen.
2651
2652         Test: fast/xsl/xslt-max-depth.html
2653
2654         * xml/SoftLinkLibxslt.cpp: Add macro for `xsltMaxDepth` global.
2655         * xml/SoftLinkLibxslt.h: Ditto.
2656         * xml/XSLTProcessorLibxslt.cpp:
2657         (WebCore::XSLTProcessor::transformToString): Set `xsltMaxDepth`
2658         to 1000.  Default in libxslt.dylib is 3000.
2659
2660 2018-10-30  Jim Mason  <jmason@ibinx.com>
2661
2662         [GTK] Scrollbars not following gtk-primary-button-warps-slider setting
2663         https://bugs.webkit.org/show_bug.cgi?id=191067
2664
2665         Reviewed by Michael Catanzaro.
2666
2667         * platform/gtk/ScrollbarThemeGtk.cpp:
2668         (WebCore::ScrollbarThemeGtk::handleMousePressEvent):
2669
2670 2018-10-30  Alexey Proskuryakov  <ap@apple.com>
2671
2672         Clean up some obsolete MAX_ALLOWED macros
2673         https://bugs.webkit.org/show_bug.cgi?id=190916
2674
2675         Reviewed by Tim Horton.
2676
2677         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2678         (WebCore::exernalDeviceDisplayNameForPlayer):
2679         * platform/mac/PlatformEventFactoryMac.mm:
2680         (WebCore::globalPointForEvent):
2681         (WebCore::pointForEvent):
2682         (WebCore::mouseButtonForEvent):
2683         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
2684
2685 2018-10-30  Ali Juma  <ajuma@chromium.org>
2686
2687         Calling window.open("", "_self") allows working around restrictions on window.close()
2688         https://bugs.webkit.org/show_bug.cgi?id=191073
2689
2690         Reviewed by Chris Dumez.
2691
2692         Do not treat a re-used frame in DOMWindow::createWindow as having been opened by DOM.
2693
2694         Test: fast/dom/Window/window-open-self-disallow-close.html
2695
2696         * page/DOMWindow.cpp:
2697         (WebCore::DOMWindow::createWindow):
2698
2699 2018-10-30  Andy Estes  <aestes@apple.com>
2700
2701         [Payment Request] Implement PaymentResponse.retry()
2702         https://bugs.webkit.org/show_bug.cgi?id=190985
2703
2704         Reviewed by Daniel Bates.
2705
2706         Implemented the retry() method on PaymentResponse as specified in the Payment Request API
2707         W3C Editor's Draft of 24 October 2018.
2708
2709         See https://w3c.github.io/payment-request/#retry-method for details.
2710
2711         Tests: http/tests/paymentrequest/payment-response-rejects-if-not-active.https.html
2712                http/tests/paymentrequest/payment-response-retry-method.https.html
2713
2714         * Modules/applepay/PaymentCoordinator.h:
2715         (WebCore::PaymentCoordinator::client): Added. Returns m_client.
2716         * Modules/applepay/PaymentCoordinatorClient.h:
2717         (WebCore::PaymentCoordinatorClient::isMockPaymentCoordinator const): Added. Used to downcast
2718         a PaymentCoordinatorClient to a MockPaymentCoordinator.
2719         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2720         (WebCore::ApplePayPaymentHandler::computeTotalAndLineItems const): Made const.
2721         (WebCore::ApplePayPaymentHandler::computeErrors const): Broke this function into
2722         computeAddressErrors, computePayerErrors, and computePaymentMethodErrors, then modified this
2723         function to call those functions. Exceptions thrown by computePaymentMethodErrors are ignored.
2724         (WebCore::ApplePayPaymentHandler::computeAddressErrors const): Added.
2725         (WebCore::ApplePayPaymentHandler::computePayerErrors const): Added.
2726         (WebCore::ApplePayPaymentHandler::computePaymentMethodErrors const): Added.
2727         (WebCore::ApplePayPaymentHandler::complete): Added ASSERTs to verify whether result is a
2728         final result.
2729         (WebCore::ApplePayPaymentHandler::retry): Computed PaymentErrors from PaymentValidationErrors,
2730         ensured the PaymentAuthorizationResult was non-final by adding an unknown error if necessary,
2731         and called PaymentCoordinator::completePaymentSession.
2732         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
2733         * Modules/paymentrequest/PaymentHandler.h:
2734         * Modules/paymentrequest/PaymentRequest.cpp:
2735         (WebCore::PaymentRequest::show): Changed to call settleShowPromise.
2736         (WebCore::PaymentRequest::abortWithException): Changed to abort PaymentResponse's retry
2737         promise, if present, instead of PaymentResponse's show promise.
2738         (WebCore::PaymentRequest::settleShowPromise): Added. Settles m_showPromise then sets it to
2739         std::nullopt.
2740         (WebCore::PaymentRequest::closeActivePaymentHandler): Added. Hides the active payment
2741         handler then sets it to std::nullopt.
2742         (WebCore::PaymentRequest::stop): Stopped calling abortWithException, since that function
2743         might settle PaymentResponse's retry promise. PaymentResponse is now an ActiveDOMObject and
2744         will settle its own promise in its implementation of stop.
2745         (WebCore::PaymentRequest::abort): Changed to throw an InvalidStateError if there is a
2746         pending retry promise and to call abortWithException instead of stop.
2747         (WebCore::PaymentRequest::completeMerchantValidation): Changed to call abortWithException
2748         instead of stop.
2749         (WebCore::PaymentRequest::settleDetailsPromise): Ditto.
2750         (WebCore::PaymentRequest::accept): Updated the existing PaymentResponse, if present, rather
2751         than creating a new one. Settled the existing PaymentResponse's retry promise, if present,
2752         rather than the show promise.
2753         (WebCore::PaymentRequest::complete): Changed to throw an AbortError if there is no longer an
2754         active payment handler.
2755         (WebCore::PaymentRequest::retry): Changed to throw an AbortError if there is no longer an
2756         active payment handler, and to call PaymentHandler::retry if there is.
2757         (WebCore::PaymentRequest::cancel): Changed to call abortWithException instead of stop.
2758         * Modules/paymentrequest/PaymentRequest.h:
2759         * Modules/paymentrequest/PaymentRequest.idl:
2760         * Modules/paymentrequest/PaymentResponse.cpp:
2761         (WebCore::PaymentResponse::PaymentResponse):
2762         (WebCore::PaymentResponse::finishConstruction): Pending activities create strong references
2763         to |this|, so they cannot be created in constructors without relaxing adoption requirements.
2764         Added this function so that the pending activity can be created after the PaymentResponse is
2765         created and adopted.
2766         (WebCore::PaymentResponse::~PaymentResponse):
2767         (WebCore::PaymentResponse::complete): Updated to throw an AbortError or InvalidStateError
2768         when necessary.
2769         (WebCore::PaymentResponse::retry): Implemented. Throws an AbortError or InvalidStateError
2770         when necessary, otherwise calls PaymentRequest::retry and stores the retry promise in
2771         m_retryPromise.
2772         (WebCore::PaymentResponse::abortWithException): Added. Rejects the retry promise with
2773         |exception|, clears the pending activity, and sets m_state to Completed.
2774         (WebCore::PaymentResponse::settleRetryPromise): Added. Settles the retry promise and sets it
2775         to std::nullopt.
2776         (WebCore::PaymentResponse::canSuspendForDocumentSuspension const): Added. Returns true if
2777         there is no pending activity.
2778         (WebCore::PaymentResponse::stop): Added. Rejects the retry promise with AbortError, clears
2779         the pending activity, and sets m_state to Stopped.
2780         * Modules/paymentrequest/PaymentResponse.h: Changed create to call finishConstruction and
2781         made PaymentResponse an ActiveDOMObject instead of a ContextDestructionObserver.
2782         * testing/Internals.cpp:
2783         (WebCore::Internals::Internals): Changed to only create a MockPaymentCoordinator for main frames.
2784         (WebCore::Internals::mockPaymentCoordinator): Changed to get the MockPaymentCoordinator by
2785         downcasting the page's payment coordinator client.
2786         * testing/Internals.h:
2787         * testing/Internals.idl:
2788         * testing/MockPaymentCoordinator.cpp:
2789         (WebCore::MockPaymentCoordinator::completePaymentSession): Changed to only increment
2790         hideCount for final results.
2791         * testing/MockPaymentCoordinator.h:
2792         (isType): Added so that PaymentCoordinatorClients can be downcasted to MockPaymentCoordinators.
2793
2794 2018-10-30  Zalan Bujtas  <zalan@apple.com>
2795
2796         [iOS] Use the mainframe view size to compute window.outerWidth/height.
2797         https://bugs.webkit.org/show_bug.cgi?id=191070
2798         <rdar://problem/42368377>
2799
2800         Reviewed by Tim Horton.
2801
2802         Use a more reasonable value for window.outerWidth and height.
2803         (WKWebView's frame rect -> drawing area sizing -> WebPage's view size -> FrameView size)
2804
2805         * page/DOMWindow.cpp:
2806         (WebCore::DOMWindow::outerHeight const):
2807         (WebCore::DOMWindow::outerWidth const):
2808
2809 2018-10-30  Andy Estes  <aestes@apple.com>
2810
2811         [Apple Pay] PaymentRequest.canMakePayment() should resolve to true whenever Apple Pay is available
2812         https://bugs.webkit.org/show_bug.cgi?id=191039
2813
2814         Reviewed by Megan Gardner.
2815
2816         During a recent Web Payments WG F2F, we decided that canMakePayment() should return true
2817         whenever the user agent supports one or more of the specified payment methods, even if those
2818         payment methods do not have active instruments.
2819
2820         Change WebKit's implementation of canMakePayment() for Apple Pay to resolve with the value
2821         of ApplePaySession.canMakePayments() rather than ApplePaySession.canMakePaymentsWithActiveCard().
2822
2823         Added a test case to http/tests/paymentrequest/payment-request-canmakepayment-method.https.html.
2824
2825         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
2826         (WebCore::ApplePayPaymentHandler::canMakePayment):
2827         (WebCore::shouldDiscloseApplePayCapability): Deleted.
2828         * testing/MockPaymentCoordinator.cpp:
2829         (WebCore::MockPaymentCoordinator::canMakePayments):
2830         (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard):
2831         * testing/MockPaymentCoordinator.h:
2832         * testing/MockPaymentCoordinator.idl:
2833
2834 2018-10-30  Sihui Liu  <sihui_liu@apple.com>
2835
2836         Add a deprecation warning to console for Web SQL
2837         https://bugs.webkit.org/show_bug.cgi?id=190936
2838
2839         Reviewed by Ryosuke Niwa.
2840
2841         No new tests. Just adding a console message.
2842
2843         * Modules/webdatabase/DOMWindowWebDatabase.cpp:
2844         (WebCore::DOMWindowWebDatabase::openDatabase):
2845
2846 2018-10-30  Sihui Liu  <sihui_liu@apple.com>
2847
2848         IndexedDB: iteration of cursors skip records if updated or deleted
2849         https://bugs.webkit.org/show_bug.cgi?id=190917
2850         <rdar://problem/35250410>
2851
2852         Reviewed by Chris Dumez.
2853
2854         When object store has changes, we cleared cached records and reset the SQLite statement, 
2855         updating the boundary to the next key in cursor's direction. Therefore, the cursor could 
2856         jump to the next key after update or deletion.
2857         We should cache those records before changing the statement.
2858
2859         Test: storage/indexeddb/cursor-update-while-iterating.html
2860
2861         * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
2862         (WebCore::IDBServer::SQLiteIDBCursor::objectStoreRecordsChanged):
2863         (WebCore::IDBServer::SQLiteIDBCursor::fetch):
2864         * Modules/indexeddb/server/SQLiteIDBCursor.h:
2865
2866 2018-10-29  Zalan Bujtas  <zalan@apple.com>
2867
2868         [LFC][IFC] Introduce InlineFormattingContextGeometry class
2869         https://bugs.webkit.org/show_bug.cgi?id=191054
2870
2871         Reviewed by Antti Koivisto.
2872
2873         This is in preparation for inline-block support.
2874
2875         Move float and inline-block elements layout to layoutFormattingContextRoot().
2876         computeWidthAndHeightForInlineBox takes care of replaced elements.
2877
2878         * Sources.txt:
2879         * WebCore.xcodeproj/project.pbxproj:
2880         * layout/inlineformatting/InlineFormattingContext.cpp:
2881         (WebCore::Layout::InlineFormattingContext::layout const):
2882         (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const):
2883         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const):
2884         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const): Deleted.
2885         * layout/inlineformatting/InlineFormattingContext.h:
2886         * layout/inlineformatting/InlineFormattingContextGeometry.cpp: Added.
2887         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin):
2888         (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin):
2889
2890 2018-10-28  Antoine Quint  <graouts@apple.com>
2891
2892         [Web Animations] Implement the update animations and send events procedure
2893         https://bugs.webkit.org/show_bug.cgi?id=191013
2894         <rdar://problem/45620495>
2895
2896         Reviewed by Dean Jackson.
2897
2898         While we implemented the various parts of what the Web Animations specification refers to as the "update animations and send events"
2899         procedure, we did not implement it as one function and in the correct order, specifically updating animations and sending events in
2900         two separate tasks. We now have a single method on DocumentTimeline which runs as the DisplayRefreshMonitor fires to update each
2901         "relevant" animation with the current time, perform a microtask checkpoint and dispatch events.
2902
2903         Implementing this procedure allowed us to make several enhancements:
2904
2905         1. We introduce the concept of a "relevant" animation, which is essentially an animation that is either pending or playing. All animations
2906         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.
2907         Maintaining such a list guarantees that we're only updating animations that would have changed state since the last time the "update animations
2908         and send events" procedure was run. Note that DeclarativeAnimation instances are also considered to be relevant if they have queued DOM events
2909         to dispatch as they could otherwise be destroyed before they can fully dispatch them.
2910
2911         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
2912         we had a registered animation, invalidate their style and finally forcing a style update on the document. We had a separate data structure where
2913         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
2914         them as expected. We now let the "update animations and send events" procedure update the timing of all relevant animations and let individual
2915         animation effects invalidate their style as needed, the document style invalidation happening naturally without DocumentTimeline forcing it. 
2916
2917         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"
2918         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
2919         timing model, which would then create a timer to the earliest moment any listed animation would require an update, finally registering a display
2920         refresh monitor update, which used at least GenericTaskQueue<Timer> and potentially two, whereas we use none right now.
2921
2922         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.
2923
2924         To facilitate all of this, we have changed the m_animations ListHashSet to contain only the "relevant" animations, and no longer every animation created
2925         that has this DocumentTimeline set as their "timeline" property. To keep this list current, every single change that changes a given animation's timing
2926         ends up calling AnimationTimeline::animationTimingDidChange() passing the animation as the sole parameter and adding this animation to m_animations. We
2927         immediately schedule a display refresh monitor update if one wasn't already scheduled. Then, when running the "update animations and send events"
2928         procedure, we call a new WebAnimation::tick() method on each of those animations, which updates this animation's effect and relevance, using the newly
2929         computed relevance to identify whether this animation should be kept in the m_animations ListHashSet.
2930
2931         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
2932         Animations and CSS Transitions are committed through CSS have dedicated data structures that are not updated in this particular patch, but this will be
2933         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
2934         refresh monitor udpates when only accelerated animations are running.
2935
2936         * animation/AnimationTimeline.cpp:
2937         (WebCore::AnimationTimeline::animationTimingDidChange): Called by animations when any aspect of their timing model changes. The provided animation is then
2938         added to the m_animations list unless its timeline is no longer this timeline.
2939         (WebCore::AnimationTimeline::removeAnimation): Remove the provided animation from m_animations and remove any animation registered on the element-specific
2940         animation lists if this animation has an effect with a target.
2941         (WebCore::AnimationTimeline::animationWasAddedToElement): We no longer need to worry about the m_animationsWithoutTarget data structure since we removed it.
2942         (WebCore::removeCSSTransitionFromMap): Fix a bug where we would remove any CSSTransition in the provided map that had a matching transition-property instead
2943         of checking the CSSTransition registered for this transition-property was indeed the provided CSSTransition. The other code changes in this patch made this
2944         code now cause regressions in the Web Platform Tests.
2945         (WebCore::AnimationTimeline::animationWasRemovedFromElement): Stop updating m_animationsWithoutTarget since it no longer exists.
2946         (WebCore::AnimationTimeline::elementWasRemoved):
2947         (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Fix a small error that caused a regression in the Web Platform Tests where we could attempt to
2948         call setBackingAnimation() on a nullptr instead of a valid CSSAnimation.
2949         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
2950         (WebCore::AnimationTimeline::addAnimation): Deleted.
2951         * animation/AnimationTimeline.h:
2952         (WebCore::AnimationTimeline::hasElementAnimations const): Deleted.
2953         (WebCore::AnimationTimeline:: const): Deleted.
2954         (WebCore::AnimationTimeline::elementToAnimationsMap): Deleted.
2955         (WebCore::AnimationTimeline::elementToCSSAnimationsMap): Deleted.
2956         (WebCore::AnimationTimeline::elementToCSSTransitionsMap): Deleted.
2957         * animation/CSSTransition.cpp:
2958         (WebCore::CSSTransition::canBeListed const): Deleted.
2959         * animation/CSSTransition.h:
2960         * animation/DeclarativeAnimation.cpp:
2961         (WebCore::DeclarativeAnimation::tick): Call the superclass's method and queue any necessary DOM events reflecting the timing model changes.
2962         (WebCore::DeclarativeAnimation::needsTick const): Call the superclass's method and return true also if we have pending events since otherwise this animation
2963         could be removed from m_animations on its AnimationTimeline and potentially destroyed before the GenericEventQueue had a chance to dispatch all events.
2964         (WebCore::DeclarativeAnimation::startTime const): We removed the custom binding for this IDL property and renamed the method from bindingsStartTime to startTime.
2965         (WebCore::DeclarativeAnimation::setStartTime): We removed the custom binding for this IDL property and renamed the method from setBindingsStartTime to setStartTime.
2966         (WebCore::DeclarativeAnimation::bindingsStartTime const): Deleted.
2967         (WebCore::DeclarativeAnimation::setBindingsStartTime): Deleted.
2968         * animation/DeclarativeAnimation.h:
2969         * animation/DocumentAnimationScheduler.cpp:
2970         (WebCore::DocumentAnimationScheduler::unscheduleWebAnimationsResolution): Add a method to mark that we no longer need a display refresh monitor update for this
2971         document's animation timeline. This is called when m_animations becomes empty.
2972         * animation/DocumentAnimationScheduler.h:
2973         * animation/DocumentTimeline.cpp:
2974         (WebCore::DocumentTimeline::DocumentTimeline):
2975         (WebCore::DocumentTimeline::detachFromDocument): Stop clearing two task queues and a timer that no longer exist and instead only clear the task queue to clear
2976         the cached current time, which we queue any time we generate a new one (see DocumentTimeline::currentTime).
2977         (WebCore::DocumentTimeline::getAnimations const): Use isRelevant() instead of canBeListed().
2978         (WebCore::DocumentTimeline::updateThrottlingState):
2979         (WebCore::DocumentTimeline::suspendAnimations):
2980         (WebCore::DocumentTimeline::resumeAnimations):
2981         (WebCore::DocumentTimeline::numberOfActiveAnimationsForTesting const):
2982         (WebCore::DocumentTimeline::currentTime): Queue a task in the new m_currentTimeClearingTaskQueue task queue to clear the current time that we've generated and cached
2983         in the next run loop (provided all pending JS execution has also completed). 
2984         (WebCore::DocumentTimeline::maybeClearCachedCurrentTime):
2985         (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Schedule a display refresh monitor update if we are not suspended and have "relevant" animations.
2986         (WebCore::DocumentTimeline::animationTimingDidChange): Call scheduleAnimationResolutionIfNeeded() after calling the superclass's implementation.
2987         (WebCore::DocumentTimeline::removeAnimation): Call unscheduleAnimationResolution() if the list of "relevant" animations is now empty.
2988         (WebCore::DocumentTimeline::unscheduleAnimationResolution): Unschedule a pending display refresh monitor update.
2989         (WebCore::DocumentTimeline::animationResolutionTimerFired):
2990         (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Implement the "update animations and send events" procedure as specified by the Web Animations spec.
2991         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
2992         longer relevant following the call to tick().
2993         (WebCore::DocumentTimeline::enqueueAnimationPlaybackEvent):
2994         (WebCore::DocumentTimeline::timingModelDidChange): Deleted.
2995         (WebCore::DocumentTimeline::scheduleInvalidationTaskIfNeeded): Deleted.
2996         (WebCore::DocumentTimeline::performInvalidationTask): Deleted.
2997         (WebCore::DocumentTimeline::updateAnimationSchedule): Deleted.
2998         (WebCore::DocumentTimeline::animationScheduleTimerFired): Deleted.
2999         (WebCore::DocumentTimeline::updateAnimations): Deleted.
3000         (WebCore::compareAnimationPlaybackEvents): Deleted.
3001         (WebCore::DocumentTimeline::performEventDispatchTask): Deleted.
3002         * animation/DocumentTimeline.h:
3003         * 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
3004         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
3005         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
3006         start time and can stop requiring a custom IDL binding for the "startTime" property.
3007         (WebCore::WebAnimation::effectTimingPropertiesDidChange):
3008         (WebCore::WebAnimation::setEffect):
3009         (WebCore::WebAnimation::setEffectInternal):
3010         (WebCore::WebAnimation::setTimeline):
3011         (WebCore::WebAnimation::setTimelineInternal):
3012         (WebCore::WebAnimation::startTime const):
3013         (WebCore::WebAnimation::setStartTime):
3014         (WebCore::WebAnimation::silentlySetCurrentTime):
3015         (WebCore::WebAnimation::setCurrentTime):
3016         (WebCore::WebAnimation::setPlaybackRate):
3017         (WebCore::WebAnimation::cancel):
3018         (WebCore::WebAnimation::resetPendingTasks):
3019         (WebCore::WebAnimation::finish):
3020         (WebCore::WebAnimation::timingDidChange): New method called any time a timing property changed where we run the "update the finished state" procedure and notify the
3021         animation's timeline that its timing changed so that it can be considered the next time the "update animations and send events" procedure runs.
3022         (WebCore::WebAnimation::invalidateEffect):
3023         (WebCore::WebAnimation::updateFinishedState): Update the animation's relevance after running the procedure as specified.
3024         (WebCore::WebAnimation::play):
3025         (WebCore::WebAnimation::runPendingPlayTask):
3026         (WebCore::WebAnimation::pause):
3027         (WebCore::WebAnimation::runPendingPauseTask):
3028         (WebCore::WebAnimation::needsTick const):
3029         (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
3030         the pending play and pause tasks.
3031         (WebCore::WebAnimation::resolve):
3032         (WebCore::WebAnimation::updateRelevance):
3033         (WebCore::WebAnimation::computeRelevance):
3034         (WebCore::WebAnimation::timingModelDidChange): Deleted.
3035         (WebCore::WebAnimation::setHoldTime): Deleted.
3036         (WebCore::WebAnimation::bindingsStartTime const): Deleted.
3037         (WebCore::WebAnimation::setBindingsStartTime): Deleted.
3038         (WebCore::WebAnimation::setTimeToRunPendingPlayTask): Deleted.
3039         (WebCore::WebAnimation::setTimeToRunPendingPauseTask): Deleted.
3040         (WebCore::WebAnimation::updatePendingTasks): Deleted.
3041         (WebCore::WebAnimation::timeToNextRequiredTick const): Deleted.
3042         (WebCore::WebAnimation::runPendingTasks): Deleted.
3043         (WebCore::WebAnimation::canBeListed const): Deleted.
3044         * animation/WebAnimation.h:
3045         (WebCore::WebAnimation::isRelevant const):
3046         (WebCore::WebAnimation::hasPendingPlayTask const):
3047         (WebCore::WebAnimation::isEffectInvalidationSuspended):
3048         * animation/WebAnimation.idl:
3049         * dom/Element.cpp:
3050         (WebCore::Element::getAnimations): Use isRelevant() instead of canBeListed().
3051
3052 2018-10-30  Youenn Fablet  <youenn@apple.com>
3053
3054         LibWebRTCRtpReceiverBackend::getSynchronizationSources should use Vector::append
3055         https://bugs.webkit.org/show_bug.cgi?id=191026
3056
3057         Reviewed by Eric Carlson.
3058
3059         Covered by updated test.
3060
3061         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
3062         (WebCore::LibWebRTCRtpReceiverBackend::getSynchronizationSources const):
3063
3064 2018-10-30  Claudio Saavedra  <csaavedra@igalia.com>
3065
3066         [GTK][WPE] Fixes to the PublicSuffix implementation
3067         https://bugs.webkit.org/show_bug.cgi?id=191031
3068
3069         Reviewed by Michael Catanzaro.
3070
3071         Covered by existing tests.
3072
3073         Downcase hostnames before passing it on to the underlying
3074         libsoup API. Special case localhost and fix a mixed-up
3075         libsoup GError checks. This fixes most of the failures.
3076
3077         * platform/soup/PublicSuffixSoup.cpp:
3078         (WebCore::isPublicSuffix):
3079         (WebCore::topPrivatelyControlledDomain):
3080
3081 2018-10-29  Zalan Bujtas  <zalan@apple.com>
3082
3083         Missing from r237549
3084
3085         * layout/blockformatting/BlockFormattingContext.cpp:
3086         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
3087         (WebCore::Layout::hasPrecomputedMarginTop):
3088
3089 2018-10-29  Ross Kirsling  <ross.kirsling@sony.com>
3090
3091         Unreviewed speculative build fix for AppleWin after r237559.
3092
3093         * PlatformAppleWin.cmake:
3094
3095 2018-10-29  Justin Michaud  <justin_michaud@apple.com>
3096
3097         Revert r237347 registered custom properties... https://bugs.webkit.org/show_bug.cgi?id=190039
3098         https://bugs.webkit.org/show_bug.cgi?id=190919
3099
3100         Reviewed by Michael Saboff.
3101
3102         * css/CSSComputedStyleDeclaration.cpp:
3103         (WebCore::ComputedStyleExtractor::customPropertyValue):
3104         * css/CSSCustomPropertyValue.cpp:
3105         (WebCore::CSSCustomPropertyValue::customCSSText const):
3106         (WebCore::CSSCustomPropertyValue::tokens const):
3107         (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const):
3108         (WebCore::CSSCustomPropertyValue::resolveVariableReferences const):
3109         (WebCore::CSSCustomPropertyValue::setResolvedTypedValue):
3110         (WebCore::CSSCustomPropertyValue::equals const): Deleted.
3111         * css/CSSCustomPropertyValue.h:
3112         * css/CSSRegisteredCustomProperty.cpp:
3113         (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty):
3114         * css/CSSRegisteredCustomProperty.h:
3115         * css/CSSVariableData.cpp:
3116         (WebCore::CSSVariableData::consumeAndUpdateTokens):
3117         (WebCore::CSSVariableData::CSSVariableData):
3118         (WebCore::CSSVariableData::checkVariablesForCycles const):
3119         (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const):
3120         (WebCore::CSSVariableData::resolveVariableFallback const):
3121         (WebCore::CSSVariableData::resolveVariableReference const):
3122         (WebCore::CSSVariableData::resolveVariableReferences const):
3123         (WebCore::CSSVariableData::resolveTokenRange const):
3124         * css/CSSVariableData.h:
3125         (WebCore::CSSVariableData::create):
3126         (WebCore::CSSVariableData::createResolved):
3127         (WebCore::CSSVariableData::needsVariableResolution const):
3128         (WebCore::CSSVariableData::CSSVariableData):
3129         * css/CSSVariableReferenceValue.cpp:
3130         (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const):
3131         (WebCore::resolveVariableFallback): Deleted.
3132         (WebCore::resolveVariableReference): Deleted.
3133         (WebCore::resolveTokenRange): Deleted.
3134         (WebCore::CSSVariableReferenceValue::resolveVariableReferences const): Deleted.
3135         * css/CSSVariableReferenceValue.h:
3136         (WebCore::CSSVariableReferenceValue::create):
3137         (WebCore::CSSVariableReferenceValue::variableDataValue const):
3138         (WebCore::CSSVariableReferenceValue::equals const):
3139         * css/DOMCSSRegisterCustomProperty.cpp:
3140         (WebCore::DOMCSSRegisterCustomProperty::registerProperty):
3141         * css/PropertySetCSSStyleDeclaration.cpp:
3142         (WebCore::PropertySetCSSStyleDeclaration::setProperty):
3143         * css/StyleBuilderCustom.h:
3144         (WebCore::StyleBuilderCustom::applyInitialCustomProperty):
3145         (WebCore::StyleBuilderCustom::applyValueCustomProperty):
3146         * css/StyleProperties.cpp:
3147         (WebCore::MutableStyleProperties::setCustomProperty):
3148         * css/StyleProperties.h:
3149         * css/StyleResolver.cpp:
3150         (WebCore::StyleResolver::State::setStyle):
3151         (WebCore::StyleResolver::styleForKeyframe):
3152         (WebCore::StyleResolver::styleForPage):
3153         (WebCore::StyleResolver::applyMatchedProperties):
3154         (WebCore::StyleResolver::applyPropertyToCurrentStyle):
3155         (WebCore::StyleResolver::applyProperty):
3156         (WebCore::StyleResolver::resolvedVariableValue const):
3157         (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties):
3158         (WebCore::StyleResolver::CascadedProperties::Property::apply):
3159         (WebCore::StyleResolver::applyCascadedProperties):
3160         (WebCore::StyleResolver::applyCascadedCustomProperty): Deleted.
3161         * css/StyleResolver.h:
3162         * css/parser/CSSParser.cpp:
3163         (WebCore::CSSParser::parseValueWithVariableReferences):
3164         * css/parser/CSSParser.h:
3165         * css/parser/CSSPropertyParser.cpp:
3166         (WebCore::CSSPropertyParser::CSSPropertyParser):
3167         (WebCore::CSSPropertyParser::parseValueStart):
3168         (WebCore::CSSPropertyParser::parseSingleValue):
3169         (WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue): Deleted.
3170         (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): Deleted.
3171         (WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies): Deleted.
3172         * css/parser/CSSPropertyParser.h:
3173         * css/parser/CSSVariableParser.cpp:
3174         (WebCore::CSSVariableParser::parseDeclarationValue):
3175         * dom/ConstantPropertyMap.cpp:
3176         (WebCore::ConstantPropertyMap::setValueForProperty):
3177         (WebCore::variableDataForPositivePixelLength):
3178         (WebCore::variableDataForPositiveDuration):
3179         * rendering/style/RenderStyle.cpp:
3180         (WebCore::RenderStyle::checkVariablesInCustomProperties):
3181         * rendering/style/RenderStyle.h:
3182         (WebCore::RenderStyle::setInheritedCustomPropertyValue):
3183         (WebCore::RenderStyle::setNonInheritedCustomPropertyValue):
3184         * rendering/style/StyleCustomPropertyData.h:
3185         (WebCore::StyleCustomPropertyData::operator== const):
3186         (WebCore::StyleCustomPropertyData::setCustomPropertyValue):
3187         (WebCore::StyleCustomPropertyData::StyleCustomPropertyData):
3188
3189 2018-10-29  Youenn Fablet  <youenn@apple.com>
3190
3191         Handle MDNS resolution of candidates through libwebrtc directly
3192         https://bugs.webkit.org/show_bug.cgi?id=190681
3193
3194         Reviewed by Eric Carlson.
3195
3196         Remove the previous MDNS resolution mechanism.
3197         Instead, add support for the AsyncResolver mechanism added to libwebrtc.
3198         Covered by current mdns webrtc test that is unflaked.
3199
3200         * Modules/mediastream/PeerConnectionBackend.cpp:
3201         (WebCore::PeerConnectionBackend::addIceCandidate):
3202         * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
3203         (WebCore::LibWebRTCProvider::createPeerConnection):
3204         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
3205         * testing/MockLibWebRTCPeerConnection.cpp:
3206         (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection):
3207         * testing/MockLibWebRTCPeerConnection.h:
3208
3209 2018-10-29  Devin Rousso  <drousso@apple.com>
3210
3211         Web Inspector: increase size limits for NetworkResourceData
3212         https://bugs.webkit.org/show_bug.cgi?id=191034
3213         <rdar://problem/45529852>
3214
3215         Reviewed by Joseph Pecoraro.
3216
3217         No tests since no new functionality.
3218
3219         * inspector/NetworkResourcesData.cpp:
3220         All resources: 100MB => 200MB
3221         Each resource:  10MB =>  50MB
3222
3223 2018-10-29  Tim Horton  <timothy_horton@apple.com>
3224
3225         Modernize WebKit nibs and lprojs for localization's sake
3226         https://bugs.webkit.org/show_bug.cgi?id=190911
3227         <rdar://problem/45349466>
3228
3229         Reviewed by Dan Bernstein.
3230
3231         * PlatformGTK.cmake:
3232         * PlatformWPE.cmake:
3233         * PlatformWin.cmake:
3234         * WebCore.xcodeproj/project.pbxproj:
3235         * en.lproj/Localizable.strings: Renamed from Source/WebCore/English.lproj/Localizable.strings.
3236         * en.lproj/Localizable.stringsdict: Renamed from Source/WebCore/English.lproj/Localizable.stringsdict.
3237         * en.lproj/mediaControlsLocalizedStrings.js: Renamed from Source/WebCore/English.lproj/mediaControlsLocalizedStrings.js.
3238         * en.lproj/modern-media-controls-localized-strings.js: Renamed from Source/WebCore/English.lproj/modern-media-controls-localized-strings.js.
3239         English->en
3240
3241 2018-10-29  Tim Horton  <timothy_horton@apple.com>
3242
3243         Make FindOptionsShowOverlay work on iOS
3244         https://bugs.webkit.org/show_bug.cgi?id=190551
3245
3246         Reviewed by Andy Estes.
3247
3248         * platform/graphics/GraphicsContext.h:
3249         Export some more GraphicsContext methods.
3250
3251 2018-10-29  Youenn Fablet  <youenn@apple.com>
3252
3253         Invalid ssrc value in the stats of type 'inbound-rtp'
3254         https://bugs.webkit.org/show_bug.cgi?id=190826
3255         <rdar://problem/45487435>
3256
3257         Reviewed by Eric Carlson.
3258
3259         Value was not initialized in WebCore if missing from libwebrtc.
3260         Change value to an optional so that it will not appear if libwebrtc does not expose it.
3261         Move integer/boolean values from being initialized to be optional so
3262         that we do not expose them to JS if not exposed by libwebrtc.
3263
3264         Covered by updated tests.
3265
3266         * Modules/mediastream/RTCStatsReport.h:
3267
3268 2018-10-29  Jer Noble  <jer.noble@apple.com>
3269
3270         CRASH in CoreGraphics: ERROR_CGDataProvider_BufferIsNotBigEnough
3271         https://bugs.webkit.org/show_bug.cgi?id=190954
3272
3273         Reviewed by Simon Fraser.
3274
3275         Crash analyitics show that WebProcess will crash in ERROR_CGDataProvider_BufferIsNotBigEnough,
3276         which attempts to fetch the last byte in the image buffer in order to verify that the entire
3277         buffer is readable. Unfortunately, the stack trace generated by this crash does not identify
3278         what CGDataProvider is responsible for the not-big-enough buffer. In order to identify which
3279         CGDataProvider created by WebKit is responsible (if any), we will add our own version of
3280         ERROR_CGDataProvider_BufferIsNotBigEnough, called at CGDataProvider creation time, which should
3281         generate a crash within the responsible stack frame.
3282
3283         (This assumes that the issue is the wrong sized buffer at CGDataProvider creation time, and not
3284         that the buffer itself is reclaimed between creation time and access.)
3285
3286         * WebCore.xcodeproj/project.pbxproj:
3287         * platform/graphics/cg/GraphicsContext3DCG.cpp:
3288         (WebCore::GraphicsContext3D::paintToCanvas):
3289         * platform/graphics/cg/ImageBufferCG.cpp:
3290         (WebCore::ImageBuffer::ImageBuffer):
3291         (WebCore::ImageBuffer::toCFData const):
3292         (WebCore::cfData):
3293         * platform/graphics/cocoa/WebGLLayer.mm:
3294         (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
3295         * platform/graphics/cv/PixelBufferConformerCV.cpp:
3296         (WebCore::CVPixelBufferGetBytePointerCallback):
3297         (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer):
3298         * platform/graphics/cg/ImageUtilitiesCG.h: Added.
3299         (WebCore::verifyImageBufferIsBigEnough):
3300
3301 2018-10-29  David Kilzer  <ddkilzer@apple.com>
3302
3303         Fix clang static analyzer warning in StyleBuilderConverter.h
3304         <https://webkit.org/b/190907>
3305
3306         Reviewed by Antti Koivisto.
3307
3308         Fix the following clang static warning in StyleBuilderConverter.h:
3309             Value stored to 'autoFlow' during its initialization is never read
3310
3311         * css/StyleBuilderConverter.h:
3312         (WebCore::StyleBuilderConverter::convertGridAutoFlow): Move
3313         assignment of RenderStyle::initialGridAutoFlow() to `default`
3314         case.  Make `CSSValueDense` consistent with other cases by
3315         assigning value to `autoFlow` instead of returning early.
3316
3317 2018-10-29  Youenn Fablet  <youenn@apple.com>
3318
3319         Guard H264 simulcast with a runtime flag
3320         https://bugs.webkit.org/show_bug.cgi?id=191025
3321
3322         Reviewed by Eric Carlson.
3323
3324         Add a runtime flag for H264 simulcast and enable libwebrtc field trial based on it.
3325         Covered by existing test.
3326
3327         * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
3328         (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
3329         * page/RuntimeEnabledFeatures.h:
3330         (WebCore::RuntimeEnabledFeatures::webRTCH264SimulcastEnabled const):
3331         (WebCore::RuntimeEnabledFeatures::setWebRTCH264SimulcastEnabled):
3332
3333 2018-10-29  Zalan Bujtas  <zalan@apple.com>
3334
3335         [LFC][IFC] Compute estimated margin top for inline formatting root's ancestors
3336         https://bugs.webkit.org/show_bug.cgi?id=191018
3337
3338         Reviewed by Antti Koivisto.
3339
3340         <div><img style="float: left"></div>
3341         This inline formatting context (root -> div) inherits the floating context from the parent block formatting context.
3342         Floats are added to the floating context relative to the floating context's root. In order to position this float properly we
3343         need to precompute the ancestor's margin top (stop at the block formatting root boundary).
3344
3345         Test: fast/inline/simple-intruding-floats3.html
3346
3347         * layout/blockformatting/BlockFormattingContext.cpp:
3348         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
3349
3350 2018-10-29  Zalan Bujtas  <zalan@apple.com>
3351
3352         [LFC] Add support for inflow non replaced content height when the box is an inline formatting root.
3353         https://bugs.webkit.org/show_bug.cgi?id=191011
3354
3355         Reviewed by Antti Koivisto.
3356
3357         // 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible'
3358         // Height is the bottom edge of the last line box, if the box establishes a inline formatting context with one or more lines
3359
3360         This is temporary until after inline runs transition to the display tree.
3361
3362         Test: fast/inline/simple-intruding-floats2.html
3363
3364         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3365         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3366         * layout/inlineformatting/InlineRun.h:
3367         (WebCore::Layout::InlineRun::logicalLeft const):
3368         (WebCore::Layout::InlineRun::logicalRight const):
3369         (WebCore::Layout::InlineRun::logicalTop const):
3370         (WebCore::Layout::InlineRun::logicalBottom const):
3371         (WebCore::Layout::InlineRun::width const):
3372         (WebCore::Layout::InlineRun::height const):
3373         (WebCore::Layout::InlineRun::setWidth):
3374         (WebCore::Layout::InlineRun::setLogicalLeft):
3375         (WebCore::Layout::InlineRun::setLogicalRight):
3376         (WebCore::Layout::InlineRun::moveHorizontally):
3377         (WebCore::Layout::InlineRun::InlineRun):
3378         * layout/inlineformatting/Line.cpp:
3379         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
3380
3381 2018-10-29  Zalan Bujtas  <zalan@apple.com>
3382
3383         [LFC][IFC] Add support for simple intruding floats.
3384         https://bugs.webkit.org/show_bug.cgi?id=190998
3385
3386         Reviewed by Antti Koivisto.
3387
3388         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.
3389         This vertical position must be in the same coordinate system as the float's position is. In case of intruding float,
3390         it is the parent block formatting root's coordinate system (that's where the float lives.)
3391
3392         Test: fast/inline/simple-intruding-float1.html
3393
3394         * layout/blockformatting/BlockFormattingContext.cpp:
3395         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
3396         (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
3397         (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const):
3398         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
3399         (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
3400         (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
3401         * layout/blockformatting/BlockFormattingContext.h:
3402         * layout/floats/FloatingState.cpp:
3403         (WebCore::Layout::FloatingState::constraints const):
3404
3405 2018-10-29  Zalan Bujtas  <zalan@apple.com>
3406
3407         [LFC][IFC] Inline layout produces separate runs when float is present.
3408         https://bugs.webkit.org/show_bug.cgi?id=190980
3409
3410         Reviewed by Antti Koivisto.
3411
3412         <div>foo<img src="foobar.jpg" style="float: left">bar</div> produces 2 inline boxes (foo) and (bar) -> current inline code
3413         while it is really just one continuous run (foobar) -> LFC
3414         Adjust verification code to check for such runs.
3415
3416         * layout/Verification.cpp:
3417         (WebCore::Layout::checkForMatchingNonTextRuns):
3418         (WebCore::Layout::checkForMatchingTextRuns):
3419         (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
3420         * layout/inlineformatting/InlineRun.h:
3421         (WebCore::Layout::InlineRun::textContext const):
3422
3423 2018-10-29  Youenn Fablet  <youenn@apple.com>
3424
3425         [WebRTC] Enable VP8 by default
3426         https://bugs.webkit.org/show_bug.cgi?id=190672
3427         <rdar://problem/43663785>
3428
3429         Reviewed by Eric Carlson.
3430
3431         No change of behavior.
3432
3433         * page/RuntimeEnabledFeatures.h: Set default value to true.
3434
3435 2018-10-28  Andy Estes  <aestes@apple.com>
3436
3437         [Payment Request] Implement MerchantValidationEvent.methodName
3438         https://bugs.webkit.org/show_bug.cgi?id=190058
3439
3440         Reviewed by Darin Adler.
3441
3442         Implemented MerchantValidationEvent's methodName attribute and MerchantValidationEventInit's
3443         methodName property as specified in the Payment Request API W3C Editor's Draft of
3444         27 September 2018.
3445
3446         Covered by web-platform-tests/payment-request/MerchantValidationEvent/constructor.https.html.
3447
3448         * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
3449         (WebCore::ApplePayPaymentHandler::validateMerchant): Passed the payment method identifier
3450         (as a string) to MerchantValidationEvent::create()
3451         * Modules/paymentrequest/MerchantValidationEvent.cpp:
3452         (WebCore::MerchantValidationEvent::create): Validated the methodName before constructing the
3453         event, throwing a RangeError on failure.
3454         (WebCore::MerchantValidationEvent::MerchantValidationEvent):
3455         * Modules/paymentrequest/MerchantValidationEvent.h:
3456         * Modules/paymentrequest/MerchantValidationEvent.idl:
3457
3458 2018-10-27  Antoine Quint  <graouts@apple.com>
3459
3460         [Web Animations] Remove WebAnimation::description()
3461         https://bugs.webkit.org/show_bug.cgi?id=190995
3462
3463         Reviewed by Dean Jackson.
3464
3465         This method is never used.
3466
3467         * animation/WebAnimation.cpp:
3468         (WebCore::WebAnimation::description): Deleted.
3469         * animation/WebAnimation.h:
3470
3471 2018-10-27  Antoine Quint  <graouts@apple.com>
3472
3473         [Web Animations] Move the logic of Document::getAnimations() to DocumentTimeline
3474         https://bugs.webkit.org/show_bug.cgi?id=190994
3475
3476         Reviewed by Dean Jackson.
3477
3478         It would be cleaner to have the logic of document.getAnimations() on the DocumentTimeline instead of the Document, keep more
3479         animation-related code compartmentalized in the animation directory. No change in behavior, so no test update.
3480
3481         * animation/DocumentTimeline.cpp:
3482         (WebCore::DocumentTimeline::getAnimations const):
3483         * animation/DocumentTimeline.h:
3484         * dom/Document.cpp:
3485         (WebCore::Document::getAnimations):
3486
3487 2018-10-27  Antoine Quint  <graouts@apple.com>
3488
3489         [Web Animations] Move bindings methods requiring style flush from CSSAnimation to DeclarativeAnimation
3490         https://bugs.webkit.org/show_bug.cgi?id=190996
3491
3492         Reviewed by Dean Jackson.
3493
3494         Moving all of the IDL bindings methods that require flushing style from CSSAnimation to its superclass
3495         DeclarativeAnimation so we follow the same route in CSSTransition. Note that there was code in
3496         CSSAnimation::bindingsCurrentTime() that was not moved as it proved to not be necessary.
3497
3498         * animation/CSSAnimation.cpp:
3499         (WebCore::CSSAnimation::bindingsPlay):
3500         (WebCore::CSSAnimation::bindingsPause):
3501         (WebCore::CSSAnimation::bindingsStartTime const): Deleted.
3502         (WebCore::CSSAnimation::setBindingsStartTime): Deleted.
3503         (WebCore::CSSAnimation::bindingsCurrentTime const): Deleted.
3504         (WebCore::CSSAnimation::setBindingsCurrentTime): Deleted.
3505         (WebCore::CSSAnimation::bindingsPlayState const): Deleted.
3506         (WebCore::CSSAnimation::bindingsPending const): Deleted.
3507         (WebCore::CSSAnimation::bindingsReady): Deleted.
3508         (WebCore::CSSAnimation::bindingsFinished): Deleted.
3509         (WebCore::CSSAnimation::flushPendingStyleChanges const): Deleted.
3510         * animation/CSSAnimation.h:
3511         * animation/DeclarativeAnimation.cpp:
3512         (WebCore::DeclarativeAnimation::bindingsStartTime const):
3513         (WebCore::DeclarativeAnimation::setBindingsStartTime):
3514         (WebCore::DeclarativeAnimation::bindingsCurrentTime const):
3515         (WebCore::DeclarativeAnimation::setBindingsCurrentTime):
3516         (WebCore::DeclarativeAnimation::bindingsPlayState const):
3517         (WebCore::DeclarativeAnimation::bindingsPending const):
3518         (WebCore::DeclarativeAnimation::bindingsReady):
3519         (WebCore::DeclarativeAnimation::bindingsFinished):
3520         (WebCore::DeclarativeAnimation::bindingsPlay):
3521         (WebCore::DeclarativeAnimation::bindingsPause):
3522         (WebCore::DeclarativeAnimation::flushPendingStyleChanges const):
3523         * animation/DeclarativeAnimation.h:
3524
3525 2018-10-27  Charlie Turner  <cturner@igalia.com>
3526
3527         [EME] Add a logging macro
3528         https://bugs.webkit.org/show_bug.cgi?id=190984
3529
3530         Reviewed by Xabier Rodriguez-Calvar.
3531
3532         No tests since no new functionality.
3533
3534         * Modules/encryptedmedia/MediaKeySession.cpp:
3535         (WebCore::MediaKeySession::MediaKeySession):
3536         (WebCore::MediaKeySession::generateRequest):
3537         (WebCore::MediaKeySession::update):
3538         (WebCore::MediaKeySession::close):
3539         (WebCore::MediaKeySession::remove):
3540         (WebCore::MediaKeySession::sessionClosed):
3541         * Modules/encryptedmedia/MediaKeys.cpp:
3542         (WebCore::MediaKeys::createSession):
3543         * Modules/encryptedmedia/NavigatorEME.cpp:
3544         (WebCore::NavigatorEME::requestMediaKeySystemAccess):
3545         * platform/Logging.h:
3546
3547 2018-10-27  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3548
3549         [GStreamer][EME] Post key received to bus should be done before waking up other threads
3550         https://bugs.webkit.org/show_bug.cgi?id=190822
3551
3552         Reviewed by Philippe Normand.
3553
3554         Notify after posting message to bus.
3555
3556         * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
3557         (webkitMediaCommonEncryptionDecryptSinkEventHandler):
3558
3559 2018-10-27  Charlie Turner  <cturner@igalia.com>
3560
3561         Fix release build with -DLOG_DISABLED=0
3562         https://bugs.webkit.org/show_bug.cgi?id=190866
3563
3564         Reviewed by Xabier Rodriguez-Calvar.
3565
3566         No new tests since no functionality changed.
3567
3568         * platform/graphics/Font.cpp:
3569         * platform/graphics/Font.h:
3570         * platform/graphics/FontPlatformData.h:
3571         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
3572         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
3573         * platform/graphics/win/FontPlatformDataWin.cpp:
3574
3575 2018-10-26  Commit Queue  <commit-queue@webkit.org>
3576
3577         Unreviewed, rolling out r237458.
3578         https://bugs.webkit.org/show_bug.cgi?id=190973
3579
3580         broke internal iOS builds (Requested by zalan on #webkit).
3581
3582         Reverted changeset:
3583
3584         "Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI"
3585         https://bugs.webkit.org/show_bug.cgi?id=190951
3586         https://trac.webkit.org/changeset/237458
3587
3588 2018-10-26  Antoine Quint  <graouts@apple.com>
3589
3590         [Web Animations] Remove useless internals methods
3591         https://bugs.webkit.org/show_bug.cgi?id=190968
3592
3593         Reviewed by Dean Jackson.
3594
3595         We had a few internals methods added early on in the Web Animations implementation that are no longer
3596         relevant now that the full API is implemented. We can safely remove them now.
3597
3598         * animation/AnimationTimeline.cpp:
3599         (WebCore::AnimationTimeline::setCurrentTime): Deleted.
3600         (WebCore::AnimationTimeline::description): Deleted.
3601         * animation/AnimationTimeline.h:
3602         (WebCore::AnimationTimeline::currentTime):
3603         (WebCore::AnimationTimeline::pause): Deleted.
3604         * animation/DocumentTimeline.cpp:
3605         (WebCore::DocumentTimeline::currentTime):
3606         (WebCore::DocumentTimeline::pause): Deleted.
3607         * animation/DocumentTimeline.h:
3608         * testing/Internals.cpp:
3609         (WebCore::Internals::timelineDescription): Deleted.
3610         (WebCore::Internals::pauseTimeline): Deleted.
3611         (WebCore::Internals::setTimelineCurrentTime): Deleted.
3612         * testing/Internals.h:
3613         * testing/Internals.idl:
3614
3615 2018-10-26  Antoine Quint  <graouts@apple.com>
3616
3617         Web Inspector: Crash in http/tests/inspector/network/resource-response-source-memory-cache-revalidate-expired-only.html
3618         https://bugs.webkit.org/show_bug.cgi?id=190955
3619
3620         Reviewed by Dean Jackson.
3621
3622         We can get in situations when running tests where runtime flags are not consistent throughout the time a test is run since
3623         showing the Web Inspector can cause flags to be re-set after the initial test was loaded. As such, to avoid crashes due to
3624         the ASSERT(!frame().animation().hasAnimations()) in FrameView::didDestroyRenderTree(), we now cancel animations upon teardown
3625         no matter what the value of the runtime flag for the Web Animations CSS Integration on both the DocumentTimeline (if it exists)
3626         and the CSSAnimationController.
3627
3628         * dom/Element.cpp:
3629         (WebCore::Element::removedFromAncestor):
3630         * dom/PseudoElement.cpp:
3631         (WebCore::PseudoElement::clearHostElement):
3632         * page/FrameView.cpp:
3633         (WebCore::FrameView::didDestroyRenderTree):
3634         * rendering/updating/RenderTreeUpdater.cpp:
3635         (WebCore::RenderTreeUpdater::tearDownRenderers):
3636
3637 2018-10-26  Timothy Hatcher  <timothy@apple.com>
3638
3639         Use dark appearance scrollbar when page background is dark or document supports dark mode.
3640         https://bugs.webkit.org/show_bug.cgi?id=190937
3641         rdar://problem/41225839
3642
3643         Reviewed by Beth Dakin.
3644
3645         * page/FrameView.cpp:
3646         (WebCore::FrameView::useDarkAppearance const): Added. Ask the document.
3647         (WebCore::FrameView::paintScrollCorner): Set LocalDefaultSystemAppearance based
3648         on the scrollbar overlay style too.
3649         * page/FrameView.h:
3650         * platform/ScrollableArea.h:
3651         (WebCore::ScrollableArea::useDarkAppearance const): Added. Default to false.
3652         * platform/mac/ScrollAnimatorMac.mm:
3653         (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Added.
3654         Ask the ScrollableArea if a dark appearance is desired.
3655
3656 2018-10-26  Antti Koivisto  <antti@apple.com>
3657
3658         Use random() instead of begin() to limit cache sizes
3659         https://bugs.webkit.org/show_bug.cgi?id=190957
3660
3661         Reviewed by Chris Dumez.
3662
3663         We currently use cache.remove(cache.begin()) pattern to limit sized of various caches.
3664         This is a bad pattern for tables that never rehash (because they have fixed maximum size) as most of the
3665         keys get permanently stuck in the table.
3666
3667         * css/CSSValuePool.cpp:
3668         (WebCore::CSSValuePool::createColorValue):
3669         (WebCore::CSSValuePool::createFontFamilyValue):
3670         (WebCore::CSSValuePool::createFontFaceValue):
3671         * dom/InlineStyleSheetOwner.cpp:
3672         (WebCore::InlineStyleSheetOwner::createSheet):
3673         * dom/SelectorQuery.cpp:
3674         * platform/graphics/FontCascade.cpp:
3675         (WebCore::retrieveOrAddCachedFonts):
3676         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3677         (WebCore::shouldAutoActivateFontIfNeeded):
3678         * platform/mac/PublicSuffixMac.mm:
3679         (WebCore::topPrivatelyControlledDomain):
3680
3681 2018-10-26  Jer Noble  <jer.noble@apple.com>
3682
3683         Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI
3684         https://bugs.webkit.org/show_bug.cgi?id=190951
3685         <rdar://problem/45213065>
3686
3687         Reviewed by Alex Christensen.
3688
3689         Request the correct route policy and context from the VideoFullscreenModel.
3690
3691         * platform/cocoa/VideoFullscreenModel.h:
3692         (WebCore::VideoFullscreenModel::requestRouteSharingPolicyAndContextUID):
3693         * platform/cocoa/VideoFullscreenModelVideoElement.h:
3694         * platform/cocoa/VideoFullscreenModelVideoElement.mm:
3695         (WebCore::VideoFullscreenModelVideoElement::requestRouteSharingPolicyAndContextUID):
3696         * platform/ios/VideoFullscreenInterfaceAVKit.h:
3697         * platform/ios/VideoFullscreenInterfaceAVKit.mm:
3698         (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]):
3699         (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel):
3700         (VideoFullscreenInterfaceAVKit::doSetup):
3701
3702 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3703
3704         [LFC][IFC] Add more inline information to outputLayoutTree
3705         https://bugs.webkit.org/show_bug.cgi?id=190945
3706
3707         Reviewed by Antti Koivisto.
3708
3709         * layout/layouttree/LayoutTreeBuilder.cpp:
3710         (WebCore::Layout::outputInlineRuns):
3711         (WebCore::Layout::outputLayoutBox):
3712
3713 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3714
3715         [LFC][IFC] Layout floats as part of the inline content
3716         https://bugs.webkit.org/show_bug.cgi?id=190942
3717
3718         Reviewed by Antti Koivisto.
3719
3720         Add float handling to InlineFormattingContext::layoutInlineContent.
3721         Note that floats don't actually generate inline runs.
3722
3723         Test: fast/block/basic/inline-content-with-floating-image.html
3724
3725         * layout/blockformatting/BlockFormattingContext.cpp:
3726         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
3727         * layout/floats/FloatAvoider.cpp:
3728         (WebCore::Layout::FloatAvoider::FloatAvoider): Check if any mapping is needed.
3729         * layout/inlineformatting/InlineFormattingContext.cpp:
3730         (WebCore::Layout::isTrimmableContent):
3731         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
3732         (WebCore::Layout::trimLeadingRun): Deleted.
3733         * layout/inlineformatting/InlineFormattingContext.h:
3734         (WebCore::Layout::InlineFormattingContext::Line::isClosed const):
3735         * layout/inlineformatting/Line.cpp:
3736         (WebCore::Layout::InlineFormattingContext::Line::init):
3737         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
3738         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight):
3739         (WebCore::Layout::InlineFormattingContext::Line::appendContent):
3740         (WebCore::Layout::InlineFormattingContext::Line::close):
3741
3742 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3743
3744         [LFC][IFC] Adjust current line with float constraints.
3745         https://bugs.webkit.org/show_bug.cgi?id=190940
3746
3747         Reviewed by Antti Koivisto.
3748
3749         * layout/inlineformatting/InlineFormattingContext.cpp:
3750         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
3751         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
3752         * layout/inlineformatting/InlineFormattingContext.h:
3753         * layout/inlineformatting/InlineRun.h:
3754         (WebCore::Layout::InlineRun::moveHorizontally):
3755         * layout/inlineformatting/Line.cpp:
3756         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft):
3757         (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight):
3758
3759 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3760
3761         [LFC][IFC] Compute float box size and position
3762         https://bugs.webkit.org/show_bug.cgi?id=190938
3763
3764         Reviewed by Antti Koivisto.
3765
3766         * layout/inlineformatting/InlineFormattingContext.cpp:
3767         (WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const):
3768         (WebCore::Layout::InlineFormattingContext::computeFloatPosition const):
3769         * layout/inlineformatting/InlineFormattingContext.h:
3770
3771 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3772
3773         [LFC][IFC] Add line logical top and bottom
3774         https://bugs.webkit.org/show_bug.cgi?id=190934
3775
3776         Reviewed by Antti Koivisto.
3777
3778         * layout/inlineformatting/InlineFormattingContext.cpp:
3779         (WebCore::Layout::InlineFormattingContext::initializeNewLine const):
3780         (WebCore::Layout::InlineFormattingContext::layoutInlineContent const):
3781         * layout/inlineformatting/InlineFormattingContext.h:
3782         (WebCore::Layout::InlineFormattingContext::Line::isFirstLine const):
3783         (WebCore::Layout::InlineFormattingContext::Line::logicalTop const):
3784         (WebCore::Layout::InlineFormattingContext::Line::logicalBottom const):
3785         * layout/inlineformatting/Line.cpp:
3786         (WebCore::Layout::InlineFormattingContext::Line::init):
3787         (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight):
3788         (WebCore::Layout::InlineFormattingContext::Line::close):
3789
3790 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3791
3792         [LFC][IFC] Find floating constraints for a given vertical position
3793         https://bugs.webkit.org/show_bug.cgi?id=190928
3794
3795         Reviewed by Antti Koivisto.
3796
3797         https://www.w3.org/TR/CSS22/visuren.html#inline-formatting
3798
3799         "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.
3800         However, floating boxes may come between the containing block edge and the line box edge.
3801         Thus, although line boxes in the same inline formatting context generally have the same width
3802         (that of the containing block), they may vary in width if available horizontal space is reduced due to floats."
3803
3804         This patch adds support for retrieving left/right constraints for a given line (vertical position).
3805
3806         * layout/floats/FloatingState.cpp:
3807         (WebCore::Layout::FloatingState::constraints const):
3808         * layout/floats/FloatingState.h:
3809
3810 2018-10-26  Zalan Bujtas  <zalan@apple.com>
3811
3812         [LFC] Inline formatting context has higher priority than block
3813         https://bugs.webkit.org/show_bug.cgi?id=190924
3814
3815         Reviewed by Antti Koivisto.
3816
3817         When an element establishes both inline and block formatting contexts, we need to pick one to
3818         create (and we choose the content driven formatting type (inline)). See example below:
3819
3820         <div style="overflow: hidden">This text should be inside an inlines formatting context.</div>
3821
3822         * layout/LayoutContext.cpp:
3823         (WebCore::Layout::LayoutContext::formattingContext const):
3824
3825 2018-10-26  Ali Juma  <ajuma@chromium.org>
3826
3827         REGRESSION (r237255): Text selection is broken in form fields
3828         https://bugs.webkit.org/show_bug.cgi?id=190899
3829
3830         Reviewed by Ryosuke Niwa.
3831
3832         Fix missing negation when checking for a fully-clipped-out rect. This was causing
3833         RenderObject::computeVisibleRectInContainer to incorrectly early-out.
3834
3835         Test: fast/repaint/text-selection-overflow-hidden.html
3836
3837         * rendering/RenderObject.cpp:
3838         (WebCore::RenderObject::computeVisibleRectInContainer const):
3839
3840 2018-10-25  Chris Dumez  <cdumez@apple.com>
3841
3842         [PSON] Navigating cross-site with locked history but unlocked back/forward list fails to create a new BackForwardListItem
3843         https://bugs.webkit.org/show_bug.cgi?id=190915
3844         <rdar://problem/45059069>
3845
3846         Reviewed by Geoffrey Garen.
3847
3848         * history/PageCache.cpp:
3849         (WebCore::canCacheFrame):
3850         Make sure we do not put into PageCache a page whose main frame is showing the initial empty document.
3851         We usually do not try to put those into PageCache because we do not have a HistoryItem to save the
3852         PageCache entry on. However, when we process-swap on a navigation with the history locked, the new
3853         process has a HistoryItem and is initially showing the initial empty document before continuing
3854         the load from the previous process. Note that saving the initial empty document in PageCache would
3855         lead to crashes later on previous the initial empty document's Window is taken and reused for the
3856         next load.
3857
3858         * loader/FrameLoader.cpp:
3859         (WebCore::FrameLoader::load):
3860         Stop assuming that we're continuing a client-side redirect when lockHistory is Yes. It is
3861         lockBackForwardList that is actually Yes when we're doing a client-side redirect.
3862
3863         * loader/PolicyChecker.cpp:
3864         (WebCore::PolicyChecker::checkNavigationPolicy):
3865         Stop using calling the completion handler with an invalid URL when the policy decision is 'Suspend' and