Web Inspector: InspectorFrontendAPIDispatcher should not ignore all exceptions
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2020-12-04  Brian Burg  <bburg@apple.com>
2
3         Web Inspector: InspectorFrontendAPIDispatcher should not ignore all exceptions
4         https://bugs.webkit.org/show_bug.cgi?id=219378
5
6         Reviewed by Devin Rousso.
7
8         Covered by existing Web Inspector layout tests.
9
10         * bindings/js/ScriptController.h: Make evaluateInWorld public and exported.
11
12         * inspector/InspectorFrontendAPIDispatcher.h:
13         * inspector/InspectorFrontendAPIDispatcher.cpp:
14         (WebCore::InspectorFrontendAPIDispatcher::evaluateOrQueueExpression):
15         (WebCore::InspectorFrontendAPIDispatcher::evaluateExpression):
16         Evaluate and pass along the result whether it's a value or exception.
17
18         * inspector/InspectorFrontendClientLocal.h:
19         * inspector/InspectorFrontendClientLocal.cpp:
20         (WebCore::InspectorFrontendClientLocal::evaluationResultToBoolean):
21         (WebCore::InspectorFrontendClientLocal::isDebuggingEnabled):
22         (WebCore::InspectorFrontendClientLocal::isTimelineProfilingEnabled):
23         (WebCore::InspectorFrontendClientLocal::isProfilingJavaScript):
24         Refactor the common code to take an EvaluationResult and figure out if the value is true or falsy.
25
26         * platform/Logging.h: Add an Inspector logging channel, for logging errors.
27
28 2020-12-04  Zalan Bujtas  <zalan@apple.com>
29
30         [LFC][Floats] FloatAvoider does not need to keep a pointer to Layout::Box around.
31         https://bugs.webkit.org/show_bug.cgi?id=219529
32
33         Reviewed by Antti Koivisto.
34
35         * layout/floats/FloatAvoider.cpp:
36         (WebCore::Layout::FloatAvoider::FloatAvoider):
37         * layout/floats/FloatAvoider.h:
38         (WebCore::Layout::FloatAvoider::isLeftAligned const):
39         (WebCore::Layout::FloatAvoider::isFloatingBox const):
40         (WebCore::Layout::FloatAvoider::layoutBox const): Deleted.
41         * layout/floats/FloatingContext.cpp:
42         (WebCore::Layout::FloatingContext::positionForFloat const):
43         (WebCore::Layout::FloatingContext::positionForNonFloatingFloatAvoider const):
44
45 2020-12-04  Fujii Hironori  <Hironori.Fujii@sony.com>
46
47         GraphicsContextGLOpenGL: m_depthBuffer and m_stencilBuffer are used only if USE(OPENGL_ES)
48         https://bugs.webkit.org/show_bug.cgi?id=219422
49
50         Reviewed by Don Olmstead.
51
52         * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
53         Conditioned out m_depthBuffer and m_stencilBuffer with #if !USE(ANGLE) && USE(OPENGL_ES).
54         * platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp:
55         (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
56         Removed code to generate m_depthBuffer and m_stencilBuffer because
57         this code is only for USE(ANGLE).
58         (WebCore::GraphicsContextGLOpenGL::~GraphicsContextGLOpenGL):
59
60 2020-12-04  David Kilzer  <ddkilzer@apple.com>
61
62         Add safety checks to xsltParamArrayFromParameterMap()
63         <https://webkit.org/b/219407>
64         <rdar://problem/71853069>
65
66         Reviewed by Darin Adler.
67
68         * xml/XSLTProcessorLibxslt.cpp:
69         (WebCore::xsltParamArrayFromParameterMap):
70
71 2020-12-04  Zalan Bujtas  <zalan@apple.com>
72
73         [LFC][IFC] Move float constraint logic from initialConstraintsForLine to a dedicated function
74         https://bugs.webkit.org/show_bug.cgi?id=219526
75
76         Reviewed by Antti Koivisto.
77
78         We are going to call this new function whenever the line stretches vertically and not just once at the very beginning.
79
80         * layout/inlineformatting/InlineLineBuilder.cpp:
81         (WebCore::Layout::LineBuilder::floatConstraints const):
82         (WebCore::Layout::LineBuilder::initialConstraintsForLine const):
83         (WebCore::Layout::LineBuilder::initialConstraintsForLine): Deleted.
84         * layout/inlineformatting/InlineLineBuilder.h:
85         (WebCore::Layout::LineBuilder::floatingState const):
86
87 2020-12-04  Kate Cheney  <katherine_cheney@apple.com>
88
89         Create API to enable/disable text interaction gestures in WKWebView
90         https://bugs.webkit.org/show_bug.cgi?id=217784
91         <rdar://problem/63406241>
92
93         Reviewed by Wenson Hsieh.
94
95         Add API to disable text selection for macOS.
96
97         * page/EventHandler.cpp:
98         (WebCore::EventHandler::selectClosestWordFromMouseEvent):
99         (WebCore::EventHandler::selectClosestContextualWordOrLinkFromMouseEvent):
100         (WebCore::EventHandler::handleMousePressEventDoubleClick):
101         (WebCore::EventHandler::handleMousePressEventTripleClick):
102         (WebCore::EventHandler::handleMousePressEventSingleClick):
103         (WebCore::EventHandler::mouseDownMayStartSelect):
104         Create a new function to return whether a click results in a
105         selection. It will always return false if text interaction is disabled.
106
107         (WebCore::EventHandler::handleMousePressEvent):
108         (WebCore::EventHandler::handleMouseDraggedEvent):
109         (WebCore::EventHandler::updateSelectionForMouseDrag):
110         (WebCore::EventHandler::selectCursor):
111         * page/EventHandler.h:
112         * page/Page.cpp:
113         (WebCore::m_textInteractionEnabled):
114         (WebCore::m_shouldRelaxThirdPartyCookieBlocking): Deleted.
115         * page/Page.h:
116         Store the textInteractionEnabled value in the Page so it is
117         accessible from the EventHandler.
118
119         (WebCore::Page::textInteractionEnabled):
120         (WebCore::Page::setTextInteractionEnabled):
121         * page/PageConfiguration.h:
122
123 2020-12-04  Adam Roben  <aroben@apple.com>
124
125         More FALLBACK_PLATFORM adoption
126         https://bugs.webkit.org/show_bug.cgi?id=219545
127
128         Reviewed by Tim Horton.
129
130         * Configurations/SDKVariant.xcconfig:
131         WK_EMPTY_$(THIS_IS_NOT_EMPTY) evaluates to the empty string, not to
132         NO.
133
134 2020-12-04  Said Abou-Hallawa  <said@apple.com>
135
136         [GPU Process] Share the NativeImage with GPU Process through a ShareableBitmap
137         https://bugs.webkit.org/show_bug.cgi?id=218934
138
139         Reviewed by Tim Horton.
140
141         Delete a NativeImage constructor and a create method which were used by
142         the deleted IPC coders of the NativeImage.
143
144         * Headers.cmake:
145         * WebCore.xcodeproj/project.pbxproj:
146         * platform/graphics/NativeImage.cpp:
147         (WebCore::NativeImage::create):
148         (WebCore::NativeImage::NativeImage):
149         * platform/graphics/NativeImage.h:
150         * platform/graphics/NativeImageReference.h: Removed.
151
152 2020-12-04  Peng Liu  <peng.liu6@apple.com>
153
154         [MSE] Move track buffer management from SourceBuffer to SourceBufferPrivate
155         https://bugs.webkit.org/show_bug.cgi?id=219332
156
157         Reviewed by Daniel Bates.
158
159         Currently, the `SourceBuffer` class deals with both the DOM related tasks (providing
160         Javascript interfaces, firing events, handling object properties, etc.) and track
161         buffer management. This patch moves the track buffer management from `SourceBuffer`
162         to `SourceBufferPrivate`. The purpose of this change is to support running the track
163         buffer management in the GPU process so that the callbacks from a media parser regarding
164         a new sample is parsed does not need to cross the process boundary (`SourceBufferPrivate`
165         will run in the GPU process). We have to update the interface `SourceBufferPrivateClient`
166         accordingly.
167
168         When running the track buffer management in the `SourceBuffer` class, we can get
169         some information related to `MediaSource` directly, such as `isSeeking`, `duration`,
170         and `currentMediaTime`. However, after moving it to `SourceBufferPrivate`, we have to
171         get the information from the corresponding `MediaSourcePrivate`. This patch includes
172         some changes for that.
173
174         No new tests because this patch does not want to introduce any behavior change.
175
176         * Modules/mediasource/MediaSource.cpp:
177         (WebCore::MediaSource::seekToTime):
178         (WebCore::MediaSource::completeSeek):
179         * Modules/mediasource/SourceBuffer.cpp:
180         (WebCore::SourceBuffer::SourceBuffer):
181         (WebCore::SourceBuffer::~SourceBuffer):
182         (WebCore::SourceBuffer::buffered const):
183         (WebCore::SourceBuffer::timestampOffset const):
184         (WebCore::SourceBuffer::setTimestampOffset):
185         (WebCore::SourceBuffer::setAppendWindowStart):
186         (WebCore::SourceBuffer::setAppendWindowEnd):
187         (WebCore::SourceBuffer::resetParserState):
188         (WebCore::SourceBuffer::abort):
189         (WebCore::SourceBuffer::changeType):
190         (WebCore::SourceBuffer::highestPresentationTimestamp const):
191         (WebCore::SourceBuffer::readyStateChanged):
192         (WebCore::SourceBuffer::removedFromMediaSource):
193         (WebCore::SourceBuffer::seekToTime):
194         (WebCore::SourceBuffer::appendBufferInternal):
195         (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
196         (WebCore::SourceBuffer::removeTimerFired):
197         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
198         (WebCore::SourceBuffer::validateInitializationSegment):
199         (WebCore::SourceBuffer::sourceBufferPrivateAppendError):
200         (WebCore::SourceBuffer::appendError):
201         (WebCore::SourceBuffer::trySignalAllSamplesEnqueued):
202         (WebCore::SourceBuffer::sourceBufferPrivateDidParseSample):
203         (WebCore::SourceBuffer::sourceBufferPrivateDurationChanged):
204         (WebCore::SourceBuffer::sourceBufferPrivateDidDropSample):
205         (WebCore::SourceBuffer::sourceBufferPrivateStreamEndedWithDecodeError):
206         (WebCore::SourceBuffer::extraMemoryCost const):
207         (WebCore::SourceBuffer::bufferedSamplesForTrackID):
208         (WebCore::SourceBuffer::setMode):
209         (WebCore::SourceBuffer::setShouldGenerateTimestamps):
210         (WebCore::SourceBuffer::isBufferedDirty const):
211         (WebCore::SourceBuffer::setBufferedDirty):
212         (): Deleted.
213         (WebCore::SourceBuffer::TrackBuffer::TrackBuffer): Deleted.
214         (WebCore::SourceBuffer::TrackBuffer::enqueueDiscontinuityBoundary): Deleted.
215         (WebCore::SourceBuffer::sourceBufferPrivateFastSeekTimeForMediaTime): Deleted.
216         (WebCore::decodeTimeComparator): Deleted.
217         (WebCore::removeSamplesFromTrackBuffer): Deleted.
218         (WebCore::SourceBuffer::removeCodedFrames): Deleted.
219         (WebCore::SourceBuffer::evictCodedFrames): Deleted.
220         (WebCore::SampleLessThanComparator::operator()): Deleted.
221         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): Deleted.
222         (WebCore::SourceBuffer::sourceBufferPrivateReenqueSamples): Deleted.
223         (WebCore::SourceBuffer::sourceBufferPrivateDidBecomeReadyForMoreSamples): Deleted.
224         (WebCore::SourceBuffer::provideMediaData): Deleted.
225         (WebCore::SourceBuffer::updateMinimumUpcomingPresentationTime): Deleted.
226         (WebCore::SourceBuffer::resetMinimumUpcomingPresentationTime): Deleted.
227         (WebCore::SourceBuffer::trySignalAllSamplesInTrackEnqueued): Deleted.
228         (WebCore::SourceBuffer::reenqueueMediaForTime): Deleted.
229         (WebCore::SourceBuffer::didDropSample): Deleted.
230         (WebCore::SourceBuffer::updateBufferedFromTrackBuffers): Deleted.
231         * Modules/mediasource/SourceBuffer.h:
232         * Sources.txt:
233         * WebCore.xcodeproj/project.pbxproj:
234         * platform/graphics/MediaSourcePrivate.h:
235         (WebCore::MediaSourcePrivate::setIsSeeking):
236         (WebCore::MediaSourcePrivate::isSeeking const):
237         * platform/graphics/SourceBufferPrivate.cpp: Added.
238         (WebCore::SourceBufferPrivate::TrackBuffer::TrackBuffer):
239         (WebCore::enqueueDiscontinuityBoundary):
240         (WebCore::SourceBufferPrivate::SourceBufferPrivate):
241         (WebCore::SourceBufferPrivate::resetTimestampOffsetInTrackBuffers):
242         (WebCore::SourceBufferPrivate::resetTrackBuffers):
243         (WebCore::SourceBufferPrivate::highestPresentationTimestamp const):
244         (WebCore::SourceBufferPrivate::updateBufferedFromTrackBuffers):
245         (WebCore::SourceBufferPrivate::reenqueSamples):
246         (WebCore::SourceBufferPrivate::seekToTime):
247         (WebCore::SourceBufferPrivate::clearTrackBuffers):
248         (WebCore::SourceBufferPrivate::bufferedSamplesForTrackID):
249         (WebCore::SourceBufferPrivate::fastSeekTimeForMediaTime):
250         (WebCore::SourceBufferPrivate::updateMinimumUpcomingPresentationTime):
251         (WebCore::SourceBufferPrivate::trySignalAllSamplesInTrackEnqueued):
252         (WebCore::SourceBufferPrivate::provideMediaData):
253         (WebCore::SourceBufferPrivate::reenqueueMediaForTime):
254         (WebCore::SourceBufferPrivate::reenqueueMediaIfNeeded):
255         (WebCore::decodeTimeComparator):
256         (WebCore::removeSamplesFromTrackBuffer):
257         (WebCore::SourceBufferPrivate::removeCodedFrames):
258         (WebCore::SourceBufferPrivate::evictCodedFrames):
259         (WebCore::SourceBufferPrivate::totalTrackBufferSizeInBytes const):
260         (WebCore::SourceBufferPrivate::addTrackBuffer):
261         (WebCore::SourceBufferPrivate::updateTrackIds):
262         (WebCore::SourceBufferPrivate::setAllTrackBuffersNeedRandomAccess):
263         (WebCore::SourceBufferPrivate::didReceiveInitializationSegment):
264         (WebCore::SourceBufferPrivate::validateInitializationSegment):
265         (WebCore::SourceBufferPrivate::didReceiveSample):
266         * platform/graphics/SourceBufferPrivate.h:
267         (WebCore::SourceBufferPrivate::setActive):
268         (WebCore::SourceBufferPrivate::setClient):
269         (WebCore::SourceBufferPrivate::setIsAttached):
270         (WebCore::SourceBufferPrivate::setCurrentTimeFudgeFactor):
271         (WebCore::SourceBufferPrivate::setAppendWindowStart):
272         (WebCore::SourceBufferPrivate::setAppendWindowEnd):
273         (WebCore::SourceBufferPrivate::bufferFull const):
274         (WebCore::SourceBufferPrivate::buffered const):
275         (WebCore::SourceBufferPrivate::isBufferedDirty const):
276         (WebCore::SourceBufferPrivate::setBufferedDirty):
277         (WebCore::SourceBufferPrivate::timestampOffset const):
278         (WebCore::SourceBufferPrivate::setTimestampOffset):
279         (WebCore::SourceBufferPrivate::startChangingType):
280         (WebCore::SourceBufferPrivate::setShouldGenerateTimestamps):
281         (WebCore::SourceBufferPrivate::setMode):
282         (WebCore::SourceBufferPrivate::setGroupStartTimestamp):
283         (WebCore::SourceBufferPrivate::setGroupStartTimestampToEndTimestamp):
284         (WebCore::SourceBufferPrivate::isActive const):
285         (WebCore::SourceBufferPrivate::isSeeking const):
286         (WebCore::SourceBufferPrivate::currentMediaTime const):
287         (WebCore::SourceBufferPrivate::duration const):
288         (WebCore::SourceBufferPrivate::flush):
289         (WebCore::SourceBufferPrivate::enqueueSample):
290         (WebCore::SourceBufferPrivate::allSamplesInTrackEnqueued):
291         (WebCore::SourceBufferPrivate::isReadyForMoreSamples):
292         (WebCore::SourceBufferPrivate::notifyClientWhenReadyForMoreSamples):
293         (WebCore::SourceBufferPrivate::canSetMinimumUpcomingPresentationTime const):
294         (WebCore::SourceBufferPrivate::setMinimumUpcomingPresentationTime):
295         (WebCore::SourceBufferPrivate::clearMinimumUpcomingPresentationTime):
296         * platform/graphics/SourceBufferPrivateClient.h:
297         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h:
298         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
299         (WebCore::MediaSourcePrivateAVFObjC::duration const):
300         (WebCore::MediaSourcePrivateAVFObjC::currentMediaTime const):
301         (WebCore::MediaSourcePrivateAVFObjC::duration): Deleted.
302         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
303         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
304         (WebCore::SourceBufferPrivateAVFObjC::didParseInitializationData):
305         (WebCore::SourceBufferPrivateAVFObjC::didProvideMediaDataForTrackID):
306         (WebCore::SourceBufferPrivateAVFObjC::removedFromMediaSource):
307         (WebCore::SourceBufferPrivateAVFObjC::setActive):
308         (WebCore::SourceBufferPrivateAVFObjC::isActive const):
309         (WebCore::SourceBufferPrivateAVFObjC::didBecomeReadyForMoreSamples):
310         (WebCore::SourceBufferPrivateAVFObjC::isSeeking const):
311         (WebCore::SourceBufferPrivateAVFObjC::currentMediaTime const):
312         (WebCore::SourceBufferPrivateAVFObjC::duration const):
313         (WebCore::SourceBufferPrivateAVFObjC::setVideoLayer):
314         (WebCore::SourceBufferPrivateAVFObjC::setDecompressionSession):
315         (WebCore::SourceBufferPrivateAVFObjC::setClient): Deleted.
316         (WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime): Deleted.
317         * platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.cpp:
318         (WebCore::MediaSourcePrivateGStreamer::duration const):
319         (WebCore::MediaSourcePrivateGStreamer::currentMediaTime const):
320         * platform/graphics/gstreamer/mse/MediaSourcePrivateGStreamer.h:
321         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
322         (WebCore::SourceBufferPrivateGStreamer::append):
323         (WebCore::SourceBufferPrivateGStreamer::removedFromMediaSource):
324         (WebCore::SourceBufferPrivateGStreamer::notifyReadyForMoreSamples):
325         (WebCore::SourceBufferPrivateGStreamer::setActive):
326         (WebCore::SourceBufferPrivateGStreamer::isActive const):
327         (WebCore::SourceBufferPrivateGStreamer::didReceiveInitializationSegment):
328         (WebCore::SourceBufferPrivateGStreamer::didReceiveSample):
329         (WebCore::SourceBufferPrivateGStreamer::didReceiveAllPendingSamples):
330         (WebCore::SourceBufferPrivateGStreamer::appendParsingFailed):
331         (WebCore::SourceBufferPrivateGStreamer::isSeeking const):
332         (WebCore::SourceBufferPrivateGStreamer::currentMediaTime const):
333         (WebCore::SourceBufferPrivateGStreamer::duration const):
334         (WebCore::SourceBufferPrivateGStreamer::setClient): Deleted.
335         * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:
336         * platform/mock/mediasource/MockMediaPlayerMediaSource.h:
337         * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
338         (WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate):
339         (WebCore::MockMediaSourcePrivate::currentMediaTime const):
340         (WebCore::MockMediaSourcePrivate::logChannel const):
341         (WebCore::MockMediaSourcePrivate::mediaSourceLogger const): Deleted.
342         (WebCore::MockMediaSourcePrivate::mediaSourceLogIdentifier): Deleted.
343         * platform/mock/mediasource/MockMediaSourcePrivate.h:
344         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
345         (WebCore::MockSourceBufferPrivate::MockSourceBufferPrivate):
346         (WebCore::MockSourceBufferPrivate::didReceiveInitializationSegment):
347         (WebCore::MockSourceBufferPrivate::didReceiveSample):
348         (WebCore::MockSourceBufferPrivate::setActive):
349         (WebCore::MockSourceBufferPrivate::isActive const):
350         (WebCore::MockSourceBufferPrivate::isSeeking const):
351         (WebCore::MockSourceBufferPrivate::currentMediaTime const):
352         (WebCore::MockSourceBufferPrivate::duration const):
353         (WebCore::MockSourceBufferPrivate::logChannel const):
354         (WebCore::MockSourceBufferPrivate::setClient): Deleted.
355         (WebCore::MockSourceBufferPrivate::fastSeekTimeForMediaTime): Deleted.
356         (WebCore::MockSourceBufferPrivate::sourceBufferLogger const): Deleted.
357         (WebCore::MockSourceBufferPrivate::sourceBufferLogIdentifier): Deleted.
358         * platform/mock/mediasource/MockSourceBufferPrivate.h:
359
360 2020-12-04  Zalan Bujtas  <zalan@apple.com>
361
362         [LFC][IFC] Only shrink the line with the float when it is intrusive
363         https://bugs.webkit.org/show_bug.cgi?id=219525
364
365         Reviewed by Antti Koivisto.
366
367         In this patch we check if the positioned float box actually intersects the line and shrink the available width accordingly. 
368
369         * layout/inlineformatting/InlineLineBuilder.cpp:
370         (WebCore::Layout::LineBuilder::layoutInlineContent):
371         (WebCore::Layout::LineBuilder::computedIntrinsicWidth):
372         (WebCore::Layout::LineBuilder::initialize):
373         (WebCore::Layout::LineBuilder::placeInlineContent):
374         (WebCore::Layout::LineBuilder::close):
375         (WebCore::Layout::LineBuilder::initialConstraintsForLine):
376         (WebCore::Layout::LineBuilder::handleFloatContent):
377         (WebCore::Layout::LineBuilder::handleInlineContent):
378         (WebCore::Layout::LineBuilder::rebuildLineForTrailingSoftHyphen):
379         (WebCore::Layout::LineBuilder::constraintsForLine): Deleted.
380         * layout/inlineformatting/InlineLineBuilder.h:
381
382 2020-12-04  Zalan Bujtas  <zalan@apple.com>
383
384         [LFC][IFC] Float positioning needs to happen while building the line
385         https://bugs.webkit.org/show_bug.cgi?id=219523
386
387         Reviewed by Antti Koivisto.
388
389         This patch is in preparation for cases when the float may fit the line and we assume it's intrusive but due to e.g. "clear"
390         it is not intersecting the line at all.
391         In order to figure out whether the float boxes intersect the current line, we need to compute their position as we find them.
392         In this patch the float positioning logic is moved over to LineBuilder (from the line post-processing) and floats are added
393         to the FloatingState as we encounter them while building the line.
394
395         * layout/inlineformatting/InlineFormattingContext.cpp:
396         (WebCore::Layout::InlineFormattingContext::lineLayout):
397         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
398         (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
399         * layout/inlineformatting/InlineFormattingContext.h:
400         * layout/inlineformatting/InlineLineBuilder.cpp:
401         (WebCore::Layout::LineBuilder::LineBuilder):
402         (WebCore::Layout::LineBuilder::layoutInlineContent):
403         (WebCore::Layout::LineBuilder::computedIntrinsicWidth):
404         (WebCore::Layout::LineBuilder::initialize):
405         (WebCore::Layout::LineBuilder::constraintsForLine):
406         (WebCore::Layout::LineBuilder::handleFloatContent):
407         * layout/inlineformatting/InlineLineBuilder.h:
408         (WebCore::Layout::LineBuilder::formattingState):
409         (WebCore::Layout::LineBuilder::floatingState):
410
411 2020-12-04  Zalan Bujtas  <zalan@apple.com>
412
413         Web process assert when loading slack
414         https://bugs.webkit.org/show_bug.cgi?id=219079
415         <rdar://problem/71814675>
416
417         Reviewed by Antti Koivisto.
418
419         While some display types do not make too much sense on replaced elements, Box::isInlineLevelBox should
420         return true for all of them.
421
422         Test: fast/inline/inline-flex-on-replaced-crash.html
423
424         * layout/layouttree/LayoutBox.cpp:
425         (WebCore::Layout::Box::isInlineLevelBox const):
426
427 2020-12-04  Zalan Bujtas  <zalan@apple.com>
428
429         [LFC][IFC] Decouple inline content and float handling in LineBuilder
430         https://bugs.webkit.org/show_bug.cgi?id=219522
431
432         Reviewed by Antti Koivisto.
433
434         The line candidate content is either a list of inline runs or an individual float box. Let's process them separately.
435
436         This is in preparation for adding support for "vertically stretchy" lines vs. intrusive floats where the line height
437         may change as we add new inline level boxes and we need to probe against existing floats.
438
439         * layout/inlineformatting/InlineLineBuilder.cpp:
440         (WebCore::Layout::LineCandidate::InlineContent::continuousContent const):
441         (WebCore::Layout::LineCandidate::InlineContent::isEmpty const):
442         (WebCore::Layout::LineBuilder::placeInlineContent):
443         (WebCore::Layout::LineBuilder::handleFloatContent):
444         (WebCore::Layout::LineBuilder::handleInlineContent):
445         (WebCore::Layout::LineCandidate::InlineContent::operator() const): Deleted.
446         (WebCore::Layout::LineBuilder::handleFloatOrInlineContent): Deleted.
447         * layout/inlineformatting/InlineLineBuilder.h:
448
449 2020-12-03  Simon Fraser  <simon.fraser@apple.com>
450
451         Only the first wheel event in a gesture should be cancelable
452         https://bugs.webkit.org/show_bug.cgi?id=218764
453         <rdar://problem/71248946>
454
455         Reviewed by Tim Horton.
456
457         Implement the WebKit2 version of r270312, where only the first wheel event in a gesture is
458         cancelable.
459
460         When scrolling over an element with handlers, we do event handling on the main thread,
461         so we can take the compute value of EventHandler's Optional<WheelScrollGestureState>
462         from the first event and send it back to the scrolling thread.
463
464         However, the scrolling thread needs to block until this first event comes back from
465         the main thread. To achieve this, EventDispatcher::wheelEvent() now dispaches
466         main thread scrolls from the scrolling thread (not the dispatcher thread), and
467         waits on m_waitingForBeganEventCondition with a 50ms timeout for that first event to
468         come back.
469
470         In the normal case, main thread handling dispatches the event back to the scrolling
471         thread for scrolling via handleWheelEventAfterMainThread(), and then calls
472         wheelEventWasProcessedByMainThread() to signal the condition. If for some reason
473         handleWheelEventAfterMainThread() doesn't get called (e.g. nothing was scrollable),
474         then wheelEventWasProcessedByMainThread() still gets called to signal.
475
476         If m_waitingForBeganEventCondition times out, then the scrolling thread falls back
477         to non-blocking behaviour (as if the first event was not canceled).
478
479         Finally, when we know the gesture will become non-blocking, we transition to running
480         the scroll from the scrolling thread, which requires that we set up latching, hence
481         the changes in ScrollingTreeLatchingController.
482
483         Tested by existing tests in fast/events/wheel.
484
485         * page/EventHandler.cpp:
486         (WebCore::EventHandler::wheelEventWasProcessedByMainThread):
487         (WebCore::EventHandler::handleWheelEventInScrollableArea):
488         * page/WheelEventTestMonitor.cpp:
489         (WebCore::operator<<):
490         * page/WheelEventTestMonitor.h:
491         * page/mac/EventHandlerMac.mm:
492         (WebCore::EventHandler::processWheelEventForScrolling):
493         * page/scrolling/ScrollingTree.cpp:
494         (WebCore::ScrollingTree::determineWheelEventProcessing):
495         (WebCore::ScrollingTree::setGestureState):
496         (WebCore::ScrollingTree::gestureState):
497         * page/scrolling/ScrollingTree.h:
498         (WebCore::ScrollingTree::willSendEventToMainThread):
499         (WebCore::ScrollingTree::waitForEventToBeProcessedByMainThread):
500         * page/scrolling/ScrollingTreeLatchingController.cpp:
501         (WebCore::ScrollingTreeLatchingController::receivedWheelEvent):
502         (WebCore::ScrollingTreeLatchingController::nodeDidHandleEvent):
503         * page/scrolling/ScrollingTreeLatchingController.h:
504         * page/scrolling/ThreadedScrollingTree.cpp:
505         (WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread):
506         (WebCore::ThreadedScrollingTree::wheelEventWasProcessedByMainThread):
507         (WebCore::ThreadedScrollingTree::willSendEventToMainThread):
508         (WebCore::ThreadedScrollingTree::waitForEventToBeProcessedByMainThread):
509         * page/scrolling/ThreadedScrollingTree.h:
510         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
511         (WebCore::ScrollingCoordinatorMac::handleWheelEventForScrolling): Need to track deferral
512         for WheelEventTestMonitor.
513         (WebCore::ScrollingCoordinatorMac::wheelEventWasProcessedByMainThread): This is now synchronous
514         to the scrolling thread so no need for the deferrer.
515         (WebCore::nextDeferIdentifier): Deleted.
516         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
517         (WebCore::ScrollingCoordinatorNicosia::wheelEventWasProcessedByMainThread):
518         * platform/cocoa/ScrollController.mm:
519         (WebCore::ScrollController::handleWheelEvent):
520
521 2020-12-03  Kate Cheney  <katherine_cheney@apple.com>
522
523         Issue logging in to Microsoft Teams if logged into other Microsoft accounts and navigating directly to teams.microsoft.com
524         https://bugs.webkit.org/show_bug.cgi?id=219505
525         <rdar://problem/71391657>
526
527         Reviewed by Alex Christensen.
528
529         This is a temporary quirk to assist a high-traffic website while they
530         complete the large task of migrating away from login flows that
531         require third party cookies. This quirk will be removed when the site
532         is updated.
533
534         No new tests, site specific quirk.
535
536         In https://bugs.webkit.org/show_bug.cgi?id=218778 we added a quirk to
537         call the Storage Access API on behalf of microsoft.com when logging
538         into Microsoft Teams. This patch covers a final edge case where a user
539         was logged into other Microsoft accounts prior to the fix. In this
540         case, if the user tries to go straight to teams.microsoft.com, an endless
541         redirect loop will occur because the site has login credentials from a previous
542         Microsoft login but does not have 3rd party cookie access to authenticate the
543         login on teams.microsoft.com. The solution is to redirect the user to
544         the login page for Teams on microsoft.com where the previous fix added
545         a Storage Access prompt.
546
547         * loader/DocumentLoader.cpp:
548         (WebCore::microsoftTeamsRedirectURL):
549         (WebCore::DocumentLoader::responseReceived):
550         * page/Quirks.cpp:
551         (WebCore::Quirks::isMicrosoftTeamsRedirectURL):
552         * page/Quirks.h:
553
554 2020-12-03  Adam Roben  <aroben@apple.com>
555
556         Adopt FALLBACK_PLATFORM
557         https://bugs.webkit.org/show_bug.cgi?id=219504
558
559         Reviewed by Tim Horton.
560
561         * Configurations/SDKVariant.xcconfig:
562         * Scripts/check-xcfilelists.sh:
563         Use FALLBACK_PLATFORM it if it's defined, otherwise use PLATFORM_NAME
564         as before.
565
566 2020-12-03  Said Abou-Hallawa  <said@apple.com>
567
568         [GPU Process] Disconnect NativeImages from RemoteResourceCacheProxy when RemoteRenderingBackendProxy is destroyed
569         https://bugs.webkit.org/show_bug.cgi?id=219417
570
571         Reviewed by Tim Horton.
572
573         Allow multiple observers for a single NativeImage. The NativeImage is 
574         usually a frame of a CachedImage. The CachedImage can be referenced by
575         multiple pages and every page has its RemoteRenderingBackendProxy which
576         is a superclass of NativeImage::Observer.s
577
578         * platform/graphics/NativeImage.cpp:
579         (WebCore::NativeImage::~NativeImage):
580         * platform/graphics/NativeImage.h:
581         (WebCore::NativeImage::addObserver):
582         (WebCore::NativeImage::removeObserver):
583         (WebCore::NativeImage::setObserver): Deleted.
584         (): Deleted.
585
586 2020-12-03  Simon Fraser  <simon.fraser@apple.com>
587
588         Use red color for sync wheel event handler debug overlay text
589         https://bugs.webkit.org/show_bug.cgi?id=219514
590
591         Reviewed by Tim Horton.
592
593         Use red for the "sync" wheel event handler debug overlay text.
594
595         * rendering/RenderLayerBacking.cpp:
596         (WebCore::patternForEventListenerRegionType):
597
598 2020-12-03  Alex Christensen  <achristensen@webkit.org>
599
600         Serialize NFA to disk before converting it to a DFA when compiling a WKContentRuleList
601         https://bugs.webkit.org/show_bug.cgi?id=219452
602
603         Reviewed by Geoffrey Garen.
604
605         This decreases maximum memory use by about 50% because the NFA and DFA never need to be in memory at the same time.
606         I'll have to do some tuning and on-device measurement, but this may allow us to increase maxRuleCount.
607
608         * Headers.cmake:
609         * Sources.txt:
610         * WebCore.xcodeproj/project.pbxproj:
611         * contentextensions/CombinedURLFilters.cpp:
612         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
613         * contentextensions/CombinedURLFilters.h:
614         * contentextensions/ContentExtensionCompiler.cpp:
615         (WebCore::ContentExtensions::compileToBytecode):
616         (WebCore::ContentExtensions::compileRuleList):
617         * contentextensions/ContentExtensionError.cpp:
618         (WebCore::ContentExtensions::contentExtensionErrorCategory):
619         * contentextensions/ContentExtensionError.h:
620         * contentextensions/ContentExtensionsDebugging.h:
621         * contentextensions/DFA.cpp:
622         (WebCore::ContentExtensions::DFA::shrinkToFit): Deleted.
623         * contentextensions/DFA.h:
624         * contentextensions/ImmutableNFA.h:
625         (WebCore::ContentExtensions::ImmutableNFA::clear):
626         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator* const): Deleted.
627         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator-> const): Deleted.
628         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator== const): Deleted.
629         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator!= const): Deleted.
630         (WebCore::ContentExtensions::ImmutableNFA::ConstTargetIterator::operator++): Deleted.
631         (WebCore::ContentExtensions::ImmutableNFA::IterableConstTargets::begin const): Deleted.
632         (WebCore::ContentExtensions::ImmutableNFA::IterableConstTargets::end const): Deleted.
633         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator== const): Deleted.
634         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator!= const): Deleted.
635         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::operator++): Deleted.
636         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::first const): Deleted.
637         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::last const): Deleted.
638         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::data const): Deleted.
639         (WebCore::ContentExtensions::ImmutableNFA::ConstRangeIterator::range const): Deleted.
640         (WebCore::ContentExtensions::ImmutableNFA::IterableConstRange::begin const): Deleted.
641         (WebCore::ContentExtensions::ImmutableNFA::IterableConstRange::end const): Deleted.
642         (WebCore::ContentExtensions::ImmutableNFA::IterableConstRange::debugPrint const): Deleted.
643         (WebCore::ContentExtensions::ImmutableNFA::transitionsForNode const): Deleted.
644         (WebCore::ContentExtensions::ImmutableNFA::root const): Deleted.
645         (WebCore::ContentExtensions::ImmutableNFA::finalize): Deleted.
646         * contentextensions/ImmutableNFANodeBuilder.h:
647         * contentextensions/NFAToDFA.cpp:
648         (WebCore::ContentExtensions::epsilonClosureExcludingSelf):
649         (WebCore::ContentExtensions::resolveEpsilonClosures):
650         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetSource::NodeIdSetToUniqueNodeIdSetSource):
651         (WebCore::ContentExtensions::NodeIdSetToUniqueNodeIdSetTranslator::translate):
652         (WebCore::ContentExtensions::createCombinedTransition):
653         (WebCore::ContentExtensions::getOrCreateDFANode):
654         (WebCore::ContentExtensions::NFAToDFA::convert):
655         * contentextensions/NFAToDFA.h:
656         * contentextensions/SerializedNFA.cpp: Added.
657         (WebCore::ContentExtensions::writeAllToFile):
658         (WebCore::ContentExtensions::SerializedNFA::serialize):
659         (WebCore::ContentExtensions::SerializedNFA::SerializedNFA):
660         (WebCore::ContentExtensions::SerializedNFA::pointerAtOffsetInFile const):
661         (WebCore::ContentExtensions::SerializedNFA::nodes const const):
662         (WebCore::ContentExtensions::SerializedNFA::transitions const const):
663         (WebCore::ContentExtensions::SerializedNFA::targets const const):
664         (WebCore::ContentExtensions::SerializedNFA::epsilonTransitionsTargets const const):
665         (WebCore::ContentExtensions::SerializedNFA::actions const const):
666         * contentextensions/SerializedNFA.h: Copied from Source/WebCore/contentextensions/ImmutableNFA.h.
667         (WebCore::ContentExtensions::SerializedNFA::Range::Range):
668         (WebCore::ContentExtensions::SerializedNFA::Range::begin const):
669         (WebCore::ContentExtensions::SerializedNFA::Range::end const):
670         (WebCore::ContentExtensions::SerializedNFA::Range::size const):
671         (WebCore::ContentExtensions::SerializedNFA::Range::operator[] const):
672         (WebCore::ContentExtensions::SerializedNFA::root const):
673         (WebCore::ContentExtensions::SerializedNFA::ConstTargetIterator::operator* const):
674         (WebCore::ContentExtensions::SerializedNFA::ConstTargetIterator::operator-> const):
675         (WebCore::ContentExtensions::SerializedNFA::ConstTargetIterator::operator== const):
676         (WebCore::ContentExtensions::SerializedNFA::ConstTargetIterator::operator!= const):
677         (WebCore::ContentExtensions::SerializedNFA::ConstTargetIterator::operator++):
678         (WebCore::ContentExtensions::SerializedNFA::IterableConstTargets::begin const):
679         (WebCore::ContentExtensions::SerializedNFA::IterableConstTargets::end const):
680         (WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::operator== const):
681         (WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::operator!= const):
682         (WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::operator++):
683         (WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::first const):
684         (WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::last const):
685         (WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::data const):
686         (WebCore::ContentExtensions::SerializedNFA::ConstRangeIterator::range const):
687         (WebCore::ContentExtensions::SerializedNFA::IterableConstRange::begin const):
688         (WebCore::ContentExtensions::SerializedNFA::IterableConstRange::end const):
689         (WebCore::ContentExtensions::SerializedNFA::IterableConstRange::debugPrint const):
690         (WebCore::ContentExtensions::SerializedNFA::transitionsForNode const):
691
692 2020-12-03  Tim Horton  <timothy_horton@apple.com>
693
694         ASSERTION FAILED: isMainThread() in WTF::Optional<IntSize> &WebCore::surfaceMaximumSize()
695         https://bugs.webkit.org/show_bug.cgi?id=219492
696
697         Reviewed by Ryosuke Niwa.
698
699         No new tests; fixes a failing test.
700
701         * platform/graphics/cocoa/IOSurface.mm:
702         (WebCore::surfaceMaximumSize):
703         (WebCore::IOSurface::setMaximumSize):
704         (WebCore::IOSurface::maximumSize):
705         maximumSize() is used off the main thread, so wrap it in a WTF::Atomic.
706
707 2020-12-03  Chris Dumez  <cdumez@apple.com>
708
709         Crash when trying to suspend an OfflineAudioContext with a bad buffer
710         https://bugs.webkit.org/show_bug.cgi?id=219496
711
712         Reviewed by Geoffrey Garen.
713
714         Test: webaudio/OfflineAudioContext-bad-buffer-suspend-crash.html
715
716         * Modules/webaudio/OfflineAudioContext.cpp:
717         (WebCore::OfflineAudioContext::startOfflineRendering):
718         Throw a NotSupportedError for consistency with Blink.
719
720         (WebCore::OfflineAudioContext::suspendOfflineRendering):
721         Use length() instead of dereferencing the potentially null renderTarget to get
722         the length.
723
724 2020-12-03  Chris Dumez  <cdumez@apple.com>
725
726         Refactor macros for low power mode code
727         https://bugs.webkit.org/show_bug.cgi?id=219497
728
729         Reviewed by Geoffrey Garen.
730
731         Use HAVE(APPLE_LOW_POWER_MODE_SUPPORT) instead of PLATFORM(IOS_FAMILY), which is equivalent.
732
733         * SourcesCocoa.txt:
734         * WebCore.xcodeproj/project.pbxproj:
735         * platform/LowPowerModeNotifier.h:
736         * platform/cocoa/LowPowerModeNotifier.mm: Renamed from Source/WebCore/platform/ios/LowPowerModeNotifierIOS.mm.
737         (-[WebLowPowerModeObserver initWithNotifier:]):
738         (-[WebLowPowerModeObserver dealloc]):
739         (-[WebLowPowerModeObserver _didReceiveLowPowerModeChange]):
740         (WebCore::LowPowerModeNotifier::LowPowerModeNotifier):
741         (WebCore::LowPowerModeNotifier::~LowPowerModeNotifier):
742         (WebCore::LowPowerModeNotifier::isLowPowerModeEnabled const):
743         (WebCore::LowPowerModeNotifier::notifyLowPowerModeChanged):
744         (WebCore::notifyLowPowerModeChanged):
745
746 2020-12-03  Alicia Boya García  <aboya@igalia.com>
747
748         [GStreamer] Fix video losing size at the end of the stream
749         https://bugs.webkit.org/show_bug.cgi?id=219493
750
751         Reviewed by Xabier Rodriguez-Calvar.
752
753         Our port for long had an issue where at the end of the video the
754         tracks would be erased, causing the video to lose its size and by
755         extension its aspect ratio.
756
757         In absence of a size, WebKit uses the default video size defined by
758         the spec of 300x150 (2:1 aspect ratio). This causes a video element
759         that doesn't have a size set through CSS to shrink to that size at the
760         end of playback, and also for black bars to appear on wider content
761         (e.g. 16:9 video) when watched in full screen mode.
762
763         This patch fixes the problem by not removing the tracks after an end
764         of stream, and instead reusing them with different pads the next time
765         the video is played.
766
767         Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-video-element/video_size_preserved_after_ended.html
768
769         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
770         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
771         (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
772         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
773         (WebCore::TrackPrivateBaseGStreamer::setPad):
774         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
775
776 2020-12-03  Aditya Keerthi  <akeerthi@apple.com>
777
778         [iOS][FCR] Add new look for buttons in their default state
779         https://bugs.webkit.org/show_bug.cgi?id=219446
780         <rdar://problem/71904353>
781
782         Reviewed by Wenson Hsieh.
783
784         Controls with a button-like appearance include <button> and <input>
785         elements with the following type attributes: “button”, “submit”,
786         “reset”, and “file”. All of these have the same default appearance,
787         with the exception of "submit", which has a darker background and
788         lighter text color than the others.
789
790         Note that styles for additional states (pressed, disabled) will be
791         added once final specifications are obtained.
792
793         * css/formControlsIOS.css:
794         (input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::-webkit-file-upload-button, button):
795         (input:matches([type="button"], [type="reset"]), input[type="file"]::-webkit-file-upload-button, button):
796         (input[type="submit"]):
797         * rendering/RenderThemeIOS.mm:
798         (WebCore::RenderThemeIOS::paintPushButtonDecorations):
799
800         The old button appearance painted a gradient over the button background.
801         This gradient is no longer necessary under the new design.
802
803 2020-12-03  Fujii Hironori  <Hironori.Fujii@sony.com>
804
805         GraphicsContextGLOpenGL: Rename IOSurfaceTextureTarget to drawingBufferTextureTarget
806         https://bugs.webkit.org/show_bug.cgi?id=219475
807
808         Reviewed by Don Olmstead.
809
810         Cocoa port has IOSurfaceTextureTarget method to switch a buffer
811         target type. Non-Cocoa ports also need a similar method.
812
813         Rename IOSurfaceTextureTarget, IOSurfaceTextureTargetQuery and
814         EGLIOSurfaceTextureTarget to drawingBufferTextureTarget,
815         drawingBufferTextureTargetQuery and EGLDrawingBufferTextureTarget.
816
817         * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
818         (WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
819         * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
820         (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
821         (WebCore::GraphicsContextGLOpenGL::drawingBufferTextureTarget):
822         (WebCore::GraphicsContextGLOpenGL::drawingBufferTextureTargetQuery):
823         (WebCore::GraphicsContextGLOpenGL::EGLDrawingBufferTextureTarget):
824         (WebCore::GraphicsContextGLOpenGL::reshapeDisplayBufferBacking):
825         (WebCore::GraphicsContextGLOpenGL::bindDisplayBufferBacking):
826         (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTarget): Deleted.
827         (WebCore::GraphicsContextGLOpenGL::IOSurfaceTextureTargetQuery): Deleted.
828         (WebCore::GraphicsContextGLOpenGL::EGLIOSurfaceTextureTarget): Deleted.
829         * platform/graphics/cv/GraphicsContextGLCVANGLE.cpp:
830         (WebCore::GraphicsContextGLCVANGLE::initializeUVContextObjects):
831         (WebCore::GraphicsContextGLCVANGLE::attachIOSurfaceToTexture):
832         (WebCore::GraphicsContextGLCVANGLE::copyPixelBufferToTexture):
833         * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
834
835 2020-12-03  Kimmo Kinnunen  <kkinnunen@apple.com>
836
837         GraphicsContextGL has a couple non-robust getters and other small API problems preventing GPU process implementation
838         https://bugs.webkit.org/show_bug.cgi?id=219486
839
840         Reviewed by Dean Jackson.
841
842         Changes GraphicsContextGL and ExtensionsGL to not have duplicate names
843         and have the correct function signatures.
844
845         Changes few remaining GraphicsContextGL getters to use robust GCGLSpan
846         form.
847
848         Changes few robust getters to GCGLSpan form and moves them from
849         ExtensionsGL to GraphicsContextGL.
850
851         Changes GraphicsContextGLOpenGL::getActiveUniforms to return the result
852         vector instead of taking it as non-const reference. This way the out
853         vector does not need to be transferred to the GPU process, when the
854         code is implemented. The call site is also more natural.
855
856         Requests GL_EXT_occlusion_query_boolean so that WebGL 2.0 occlusion
857         queries work when called with gl::GetQueryObjectuivRobustANGLE.
858
859         Removes use of mapBufferRange and related functions, changes them to a single
860         getBufferSubData. If the mapping ever is useful, the more complex
861         form of API can be added back.
862
863         Changes the getInternalformativ call site to check erros similar to other
864         generic error checking: first clear the errors and then after the call
865         check if there are new errors. This is slightly less efficient than
866         using the domain knowledge that the function never returns -1 in the slot.
867         Current single-value-as-return-value pattern cannot express this. In the
868         future, GPU process context cannot / will not support passing non-default
869         in-arrays. In the future, the generic error checking pattern will possibly
870         be improved, circumventing the need for the -1 domain knowledge case.
871
872         Removes getVertexAttrib*v, they are not used.
873
874         Removes getAttachedShaders, it is not used.
875
876         Removes the vendor-based workarounds from ANGLE ExtensionsGL, it was not
877         used.
878
879         No new tests, a refactor.
880
881         * html/canvas/WebGL2RenderingContext.cpp:
882         (WebCore::WebGL2RenderingContext::getBufferSubData):
883         (WebCore::WebGL2RenderingContext::getInternalformatParameter):
884         (WebCore::WebGL2RenderingContext::vertexAttribI4uiv):
885         (WebCore::WebGL2RenderingContext::getQueryParameter):
886         (WebCore::WebGL2RenderingContext::bindSampler):
887         (WebCore::WebGL2RenderingContext::getSamplerParameter):
888         (WebCore::WebGL2RenderingContext::clientWaitSync):
889         (WebCore::WebGL2RenderingContext::deleteTransformFeedback):
890         (WebCore::WebGL2RenderingContext::beginTransformFeedback):
891         (WebCore::WebGL2RenderingContext::endTransformFeedback):
892         (WebCore::WebGL2RenderingContext::transformFeedbackVaryings):
893         (WebCore::WebGL2RenderingContext::getActiveUniforms):
894         (WebCore::WebGL2RenderingContext::readPixels):
895         * html/canvas/WebGLRenderingContextBase.cpp:
896         (WebCore::WebGLRenderingContextBase::readPixels):
897         * html/canvas/WebGLSync.cpp:
898         (WebCore::WebGLSync::updateCache):
899         * platform/graphics/ExtensionsGL.h:
900         * platform/graphics/GraphicsContextGL.h:
901         (WebCore::GraphicsContextGL::getInternalformati):
902         * platform/graphics/GraphicsTypesGL.h:
903         * platform/graphics/angle/ExtensionsGLANGLE.cpp:
904         (WebCore::ExtensionsGLANGLE::ExtensionsGLANGLE):
905         (WebCore::ExtensionsGLANGLE::getGraphicsResetStatusARB):
906         (WebCore::ExtensionsGLANGLE::getTranslatedShaderSourceANGLE):
907         (WebCore::ExtensionsGLANGLE::blitFramebufferANGLE):
908         (WebCore::ExtensionsGLANGLE::renderbufferStorageMultisampleANGLE):
909         (WebCore::ExtensionsGLANGLE::drawArraysInstancedANGLE):
910         (WebCore::ExtensionsGLANGLE::drawElementsInstancedANGLE):
911         (WebCore::ExtensionsGLANGLE::vertexAttribDivisorANGLE):
912         (WebCore::ExtensionsGLANGLE::getUniformuivRobustANGLE):
913         (WebCore::ExtensionsGLANGLE::getTexLevelParameterivRobustANGLE):
914         (WebCore::ExtensionsGLANGLE::getTexLevelParameterfvRobustANGLE):
915         (WebCore::ExtensionsGLANGLE::getnUniformfvRobustANGLE):
916         (WebCore::ExtensionsGLANGLE::getnUniformivRobustANGLE):
917         (WebCore::ExtensionsGLANGLE::getnUniformuivRobustANGLE):
918         * platform/graphics/angle/ExtensionsGLANGLE.h:
919         * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
920         (WebCore::GraphicsContextGLOpenGL::readnPixels):
921         (WebCore::GraphicsContextGLOpenGL::readnPixelsImpl):
922         (WebCore::GraphicsContextGLOpenGL::getBufferSubData):
923         (WebCore::GraphicsContextGLOpenGL::getInternalformativ):
924         (WebCore::GraphicsContextGLOpenGL::getActiveUniforms):
925         (WebCore::GraphicsContextGLOpenGL::getQueryObjectui):
926         (WebCore::GraphicsContextGLOpenGL::getSamplerParameterf):
927         (WebCore::GraphicsContextGLOpenGL::getSamplerParameteri):
928         (WebCore::GraphicsContextGLOpenGL::getSynci):
929         * platform/graphics/cocoa/GraphicsContextGLOpenGLCocoa.mm:
930         (WebCore::GraphicsContextGLOpenGL::GraphicsContextGLOpenGL):
931         * platform/graphics/opengl/ExtensionsGLOpenGL.cpp:
932         (WebCore::ExtensionsGLOpenGL::blitFramebufferANGLE):
933         (WebCore::ExtensionsGLOpenGL::renderbufferStorageMultisampleANGLE):
934         (WebCore::ExtensionsGLOpenGL::drawArraysInstancedANGLE):
935         (WebCore::ExtensionsGLOpenGL::drawElementsInstancedANGLE):
936         (WebCore::ExtensionsGLOpenGL::vertexAttribDivisorANGLE):
937         * platform/graphics/opengl/ExtensionsGLOpenGL.h:
938         * platform/graphics/opengl/ExtensionsGLOpenGLCommon.cpp:
939         * platform/graphics/opengl/ExtensionsGLOpenGLCommon.h:
940         * platform/graphics/opengl/ExtensionsGLOpenGLES.cpp:
941         (WebCore::ExtensionsGLOpenGLES::blitFramebufferANGLE):
942         (WebCore::ExtensionsGLOpenGLES::renderbufferStorageMultisampleANGLE):
943         (WebCore::ExtensionsGLOpenGLES::drawArraysInstancedANGLE):
944         (WebCore::ExtensionsGLOpenGLES::drawElementsInstancedANGLE):
945         (WebCore::ExtensionsGLOpenGLES::vertexAttribDivisorANGLE):
946         * platform/graphics/opengl/ExtensionsGLOpenGLES.h:
947         * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
948         * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp:
949         (WebCore::GraphicsContextGLOpenGL::readnPixels):
950         * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
951         (WebCore::GraphicsContextGLOpenGL::reshape):
952         (WebCore::GraphicsContextGLOpenGL::blendFunc):
953         (WebCore::GraphicsContextGLOpenGL::compileShader):
954         (WebCore::GraphicsContextGLOpenGL::getActiveAttribImpl):
955         (WebCore::GraphicsContextGLOpenGL::getActiveAttrib):
956         (WebCore::GraphicsContextGLOpenGL::getActiveUniformImpl):
957         (WebCore::GraphicsContextGLOpenGL::getActiveUniform):
958         (WebCore::GraphicsContextGLOpenGL::originalSymbolName):
959         (WebCore::GraphicsContextGLOpenGL::mappedSymbolName):
960         (WebCore::GraphicsContextGLOpenGL::deleteVertexArray):
961         (WebCore::GraphicsContextGLOpenGL::isVertexArray):
962         (WebCore::GraphicsContextGLOpenGL::getNonBuiltInActiveSymbolCount):
963         (WebCore::GraphicsContextGLOpenGL::getUnmangledInfoLog):
964         (WebCore::GraphicsContextGLOpenGL::getProgramInfoLog):
965         (WebCore::GraphicsContextGLOpenGL::getShaderi):
966         (WebCore::GraphicsContextGLOpenGL::getShaderInfoLog):
967         (WebCore::GraphicsContextGLOpenGL::getShaderSource):
968         (WebCore::GraphicsContextGLOpenGL::drawArraysInstanced):
969         (WebCore::GraphicsContextGLOpenGL::drawElementsInstanced):
970         (WebCore::GraphicsContextGLOpenGL::vertexAttribDivisor):
971         (WebCore::GraphicsContextGLOpenGL::getBufferSubData):
972         (WebCore::GraphicsContextGLOpenGL::getInternalformativ):
973         (WebCore::GraphicsContextGLOpenGL::getQueryObjectui):
974         (WebCore::GraphicsContextGLOpenGL::getSamplerParameterf):
975         (WebCore::GraphicsContextGLOpenGL::getSamplerParameteri):
976         (WebCore::GraphicsContextGLOpenGL::getSynci):
977         (WebCore::GraphicsContextGLOpenGL::getActiveUniforms):
978         (WebCore::GraphicsContextGLOpenGL::getUniformBlockIndex):
979         (WebCore::GraphicsContextGLOpenGL::getActiveUniformBlockName):
980         (WebCore::GraphicsContextGLOpenGL::uniformBlockBinding):
981         (WebCore::GraphicsContextGLOpenGL::readnPixels):
982         * platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp:
983         (WebCore::GraphicsContextGLOpenGL::readnPixels):
984         (WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
985
986 2020-12-03  Aditya Keerthi  <akeerthi@apple.com>
987
988         [iOS][FCR] Add new look for search fields
989         https://bugs.webkit.org/show_bug.cgi?id=219443
990         <rdar://problem/71902666>
991
992         Reviewed by Wenson Hsieh.
993
994         Tests: fast/forms/ios/form-control-refresh/search/background-color.html
995                fast/forms/ios/form-control-refresh/search/border.html
996                fast/forms/ios/form-control-refresh/search/font-size.html
997                fast/forms/ios/form-control-refresh/search/results-attribute.html
998                fast/forms/ios/form-control-refresh/search/width-height.html
999
1000         * css/formControlsIOS.css:
1001         (input[type="search"]):
1002
1003         Unlike traditional text fields, the new appearance has no border and a
1004         filled background.
1005
1006         (input[type="search"]::-webkit-search-decoration,):
1007
1008         The new appearance has a magnifying glass glyph in the search field.
1009         On macOS, the glyph changes depending on the value of the "results"
1010         attribute. However, on iOS, the glyph should always be shown.
1011         Consequently, "-webkit-search-decoration", "-webkit-search-results-decoration",
1012         and "-webkit-search-results-button" all specify the same glyph.
1013
1014         * rendering/RenderThemeIOS.mm:
1015         (WebCore::canAdjustBorderRadiusForAppearance):
1016
1017         The old search field forced a pill-like appearance. This is no longer
1018         required under the new appearance.
1019
1020         (WebCore::RenderThemeIOS::adjustRoundBorderRadius):
1021
1022 2020-12-03  Aditya Keerthi  <akeerthi@apple.com>
1023
1024         [iOS][FCR] Add new look for controls with text entry
1025         https://bugs.webkit.org/show_bug.cgi?id=219362
1026         rdar://problem/71813850
1027
1028         Reviewed by Wenson Hsieh.
1029
1030         Controls with text entry include <textarea> and the following <input>
1031         types: "email", "password", "search", "tel", "text", and "url".
1032         Additionally, <input> without a specified type is also a control with
1033         text entry, since the default behavior matches <input type="text">.
1034
1035         * css/formControlsIOS.css:
1036         (textarea, input): Updated border and font to match new look.
1037         * css/html.css:
1038
1039         Removed input[type="range"] and input:matches([type="password"], [type="search"])
1040         from the rule-set containing the selector "input", since "input" encompasses
1041         "range", "password", and "search".
1042
1043         This change aligns with the user-agent stylesheets in Chrome and Firefox.
1044
1045         * rendering/RenderThemeIOS.mm:
1046         (WebCore::RenderThemeIOS::paintTextFieldDecorations):
1047
1048         The previous appearance painted a gradient inside the control. However,
1049         the new appearance does not have any decorations.
1050
1051 2020-12-03  Fujii Hironori  <Hironori.Fujii@sony.com>
1052
1053         Remove GraphicsContextGLOpenGL::setRenderbufferStorageFromDrawable declaration
1054         https://bugs.webkit.org/show_bug.cgi?id=219463
1055
1056         Reviewed by Alex Christensen.
1057
1058         r268198 removed the definition.
1059
1060         * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
1061         * platform/graphics/opengl/GraphicsContextGLOpenGLBase.cpp:
1062         (WebCore::GraphicsContextGLOpenGL::reshapeFBOs):
1063         Removed a dead code of USE(OPENGL_ES) in PLATFORM(COCOA).
1064
1065 2020-12-03  Jer Noble  <jer.noble@apple.com>
1066
1067         MediaSessionHelper::setSharedHelper() hangs when "media in the GPU process" is enabled
1068         https://bugs.webkit.org/show_bug.cgi?id=219466
1069         <rdar://problem/71566601>
1070
1071         Reviewed by Chris Dumez.
1072
1073         The WebProcess will attempt to set a RemoteMediaSessionHelper as the sharedHelper, but calling
1074         MediaSessionHelper::setSharedHelper() will cause a MediaSessionHelperIOS to be created, which in
1075         turn tries to talk to AVSystemController.sharedAVSystemController, which fails due to sandbox
1076         restrictions.
1077
1078         Refactor sharedHelperInstance() to not create a MediaSessionHelperIOS by default, which allows
1079         setSharedHelper to assign a new helper without creating one by default.
1080
1081         * platform/audio/ios/MediaSessionHelperIOS.mm:
1082         (sharedHelperInstance):
1083         (MediaSessionHelper::sharedHelper):
1084         (MediaSessionHelper::resetSharedHelper):
1085         (MediaSessionHelper::setSharedHelper):
1086
1087 2020-12-03  Andres Gonzalez  <andresg_22@apple.com>
1088
1089         Fix for crash handling NSAccessibilityInsertionPointLineNumberAttribute for text fields in isolated tree mode.
1090         https://bugs.webkit.org/show_bug.cgi?id=219477
1091
1092         Reviewed by Chris Fleizach.
1093
1094         Tests:
1095         accessibility/content-editable-as-textarea.html
1096         accessibility/mac/content-editable-range-properties.html
1097
1098         - Implemented AXIsolatedObject::selectionStart/End, selectedText, visiblePositionForIndex.
1099         - Handler of the NSAccessibilityInsertionPointLineNumberAttribute
1100         request now dispatches to the main thread the calls that involve
1101         VisiblePositions.
1102         - This change fixes the above mentioned layout tests in isolated tree mode.
1103
1104         * accessibility/AccessibilityObjectInterface.h:
1105         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1106         (WebCore::AXIsolatedObject::selectionStart const):
1107         (WebCore::AXIsolatedObject::selectionEnd const):
1108         (WebCore::AXIsolatedObject::selectedText const):
1109         (WebCore::AXIsolatedObject::visiblePositionForIndex const):
1110         * accessibility/isolatedtree/AXIsolatedObject.h:
1111         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1112         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1113
1114 2020-12-03  Tim Horton  <timothy_horton@apple.com>
1115
1116         GPU Process: Sandbox violations under IOSurface::maximumSize in the Web Content process
1117         https://bugs.webkit.org/show_bug.cgi?id=219484
1118         <rdar://problem/71603808>
1119
1120         Reviewed by Ryosuke Niwa.
1121
1122         * platform/graphics/cocoa/IOSurface.h:
1123         * platform/graphics/cocoa/IOSurface.mm:
1124         (WebCore::computeMaximumSurfaceSize):
1125         (WebCore::surfaceMaximumSize):
1126         (WebCore::IOSurface::setMaximumSize):
1127         (WebCore::IOSurface::maximumSize):
1128         Make it possible to externally override IOSurface::maximumSize.
1129
1130 2020-12-03  Lauro Moura  <lmoura@igalia.com>
1131
1132         [WTF] Avoid JSONValue::create with raw string falling to bool overload
1133         https://bugs.webkit.org/show_bug.cgi?id=219483
1134
1135         Reviewed by Adrian Perez de Castro.
1136
1137         Covered by existing tests.
1138
1139         * inspector/InspectorFrontendClientLocal.cpp:
1140         (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Convert to WTF::String when creating the value.
1141
1142 2020-12-03  Martin Robinson  <mrobinson@igalia.com>
1143
1144         Move code from AxisScrollSnapOffsets to ScrollSnapOffsetsInfo
1145         https://bugs.webkit.org/show_bug.cgi?id=219345
1146
1147         Reviewed by Daniel Bates.
1148
1149         No new tests. This should not modify behavior.
1150
1151         * Headers.cmake: Remove AxisScrollSnapOffsets.h from header list.
1152         * Sources.txt: Update source list.
1153         * WebCore.xcodeproj/project.pbxproj: Ditto.
1154         * page/FrameView.cpp: Update includes.
1155         * page/scrolling/AxisScrollSnapOffsets.h: Removed.
1156         * page/scrolling/ScrollSnapOffsetsInfo.cpp: Renamed from Source/WebCore/page/scrolling/AxisScrollSnapOffsets.cpp.
1157         (WebCore::indicesOfNearestSnapOffsetRanges): Added from AxisScrollSnapOffsets.
1158         (WebCore::indicesOfNearestSnapOffsets): Ditto.
1159         (WebCore::closestSnapOffset): Ditto.
1160         (WebCore::computeScrollSnapPortOrAreaRect): Ditto.
1161         (WebCore::computeScrollSnapAlignOffset): Ditto.
1162         (WebCore::operator<<): Ditto.
1163         (WebCore::computeAxisProximitySnapOffsetRanges): Ditto.
1164         (WebCore::updateSnapOffsetsForScrollableArea): Ditto.
1165         * page/scrolling/ScrollSnapOffsetsInfo.h: Added functions from AxisScrollSnapOffsets.h and surrounded
1166         this header in conditional compilation so it can be included unconditionally.
1167         * page/scrolling/ScrollingCoordinator.h: Updated includes.
1168         * page/scrolling/ScrollingMomentumCalculator.h: Ditto.
1169         * platform/cocoa/ScrollSnapAnimatorState.h: Ditto.
1170         * rendering/RenderLayer.cpp: Ditto.
1171
1172 2020-12-02  Simon Fraser  <simon.fraser@apple.com>
1173
1174         Determine the WheelScrollGestureState on the main thread before passing it to ScrollingCoordinator
1175         https://bugs.webkit.org/show_bug.cgi?id=219481
1176
1177         Reviewed by Tim Horton.
1178
1179         Fixing webkit.org/b/218764 requires that we store state for a given series of wheel events
1180         related to whether the "begin" event had preventDefault() called on it (i.e. was canceled).
1181         Previously code was designed to propagate OptionSet<EventHandling> around, and use it to compute
1182         WheelScrollGestureState in both EventHandler and ScrollingTree code. However, we can
1183         compute WheelScrollGestureState just once in EventHandler, and pass it to ScrollingCoordinator.
1184
1185         To achieve this, add a bottleneck in the form of EventHandler::handleWheelEventInScrollableArea()
1186         and before calling the ScrollableArea function (implementation of which can call ScrollingCoordinator),
1187         compute WheelScrollGestureState from OptionSet<EventHandling>. This required making
1188         handleWheelEventInAppropriateEnclosingBox() a member function.
1189
1190         * page/EventHandler.cpp:
1191         (WebCore::EventHandler::processWheelEventForScrolling):
1192         (WebCore::EventHandler::handleWheelEvent):
1193         (WebCore::handleWheelEventPhaseInScrollableArea):
1194         (WebCore::didScrollInScrollableArea):
1195         (WebCore::EventHandler::handleWheelEventInAppropriateEnclosingBox):
1196         (WebCore::EventHandler::handleWheelEventInScrollableArea):
1197         (WebCore::EventHandler::updateWheelGestureState):
1198         (WebCore::EventHandler::defaultWheelEventHandler):
1199         (WebCore::handleWheelEventInAppropriateEnclosingBox): Deleted.
1200         * page/EventHandler.h:
1201         * page/FrameView.cpp:
1202         (WebCore::FrameView::handleWheelEventForScrolling):
1203         * page/FrameView.h:
1204         * page/mac/EventHandlerMac.mm:
1205         (WebCore::EventHandler::wheelEvent):
1206         (WebCore::EventHandler::processWheelEventForScrolling):
1207         (WebCore::EventHandler::wheelEventWasProcessedByMainThread):
1208         * page/scrolling/ScrollingCoordinator.h:
1209         (WebCore::ScrollingCoordinator::handleWheelEventForScrolling):
1210         (WebCore::ScrollingCoordinator::wheelEventWasProcessedByMainThread):
1211         * page/scrolling/ThreadedScrollingTree.cpp:
1212         (WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread):
1213         (WebCore::ThreadedScrollingTree::wheelEventWasProcessedByMainThread):
1214         * page/scrolling/ThreadedScrollingTree.h:
1215         * page/scrolling/mac/ScrollingCoordinatorMac.h:
1216         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
1217         (WebCore::ScrollingCoordinatorMac::handleWheelEventForScrolling):
1218         (WebCore::ScrollingCoordinatorMac::wheelEventWasProcessedByMainThread):
1219         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
1220         (WebCore::ScrollingCoordinatorNicosia::handleWheelEventForScrolling):
1221         (WebCore::ScrollingCoordinatorNicosia::wheelEventWasProcessedByMainThread):
1222         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.h:
1223         * platform/ScrollableArea.cpp:
1224         (WebCore::ScrollableArea::handleWheelEventForScrolling):
1225         * platform/ScrollableArea.h:
1226         * rendering/RenderLayer.cpp:
1227         (WebCore::RenderLayer::handleWheelEventForScrolling):
1228         * rendering/RenderLayer.h:
1229
1230 2020-12-02  Rob Buis  <rbuis@igalia.com>
1231
1232         Remove m_reversedOrderIteratorForHitTesting
1233         https://bugs.webkit.org/show_bug.cgi?id=218554
1234
1235         Reviewed by Zalan Bujtas.
1236
1237         Remove m_reversedOrderIteratorForHitTesting as
1238         determining it at hit test time should not be very expensive.
1239
1240         * rendering/RenderFlexibleBox.cpp:
1241         (WebCore::RenderFlexibleBox::hitTestChildren):
1242         (WebCore::RenderFlexibleBox::layoutFlexItems):
1243         * rendering/RenderFlexibleBox.h:
1244
1245 2020-12-02  Fujii Hironori  <Hironori.Fujii@sony.com>
1246
1247         GraphicsContextGL: Remove unused platformTexture and platformGraphicsContextGL interface
1248         https://bugs.webkit.org/show_bug.cgi?id=219461
1249
1250         Reviewed by Daniel Bates.
1251
1252         * platform/graphics/GraphicsContextGL.h:
1253         * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
1254         * platform/graphics/opengl/GraphicsContextGLOpenGLES.cpp:
1255         (WebCore::GraphicsContextGLOpenGL::platformGraphicsContextGL): Deleted.
1256         (WebCore::GraphicsContextGLOpenGL::platformTexture const): Deleted.
1257         * platform/graphics/texmap/GraphicsContextGLTextureMapper.cpp:
1258         (WebCore::GraphicsContextGLOpenGL::platformGraphicsContextGL const): Deleted.
1259         (WebCore::GraphicsContextGLOpenGL::platformTexture const): Deleted.
1260
1261 2020-12-02  Chris Dumez  <cdumez@apple.com>
1262
1263         iframe with `sandbox=allow-top-navigation-by-user-activation` can navigate top frame when the user interacts with an iframe from another origin
1264         https://bugs.webkit.org/show_bug.cgi?id=219413
1265         <rdar://problem/64887657>
1266
1267         Reviewed by Geoffrey Garen.
1268
1269         An iframe with `sandbox=allow-top-navigation-by-user-activation` can navigate the top frame when the user
1270         interacts with an frame from another origin. This is not strict enough and does not match the behavior of
1271         Chrome.
1272
1273         In Chrome, the user activation is only valid for the purpose of navigation if the user interacted with either:
1274         - The iframe triggering the navigation
1275         - A descendant iframe of the iframe triggering the navigation
1276         - A frame from the same origin as the iframe triggering the navigation
1277
1278         This patch aligns our behavior with Chrome's.
1279
1280         Test: http/tests/security/block-top-level-navigations-by-sandboxed-iframe-with-propagated-user-gesture.html
1281
1282         * dom/Document.cpp:
1283         (WebCore::Document::canNavigateInternal):
1284         * dom/UserGestureIndicator.cpp:
1285         (WebCore::UserGestureToken::UserGestureToken):
1286         (WebCore::UserGestureToken::isValidForDocument const):
1287         (WebCore::UserGestureIndicator::processingUserGesture):
1288         * dom/UserGestureIndicator.h:
1289         (WebCore::UserGestureToken::create):
1290
1291 2020-12-02  Chris Dumez  <cdumez@apple.com>
1292
1293         Block suspicious top level navigations by iframes even if sandbox=allow-top-navigation is specified
1294         https://bugs.webkit.org/show_bug.cgi?id=219408
1295         <rdar://problem/71049726>
1296
1297         Reviewed by Geoffrey Garen.
1298
1299         Block suspicious top level navigations by iframes even if sandbox=allow-top-navigation is specified,
1300         when the parent of the sandboxed iframe is not first-party.
1301
1302         Test: http/tests/security/block-top-level-navigations-by-third-party-sandboxed-iframe.html
1303
1304         * dom/Document.cpp:
1305         (WebCore::Document::isNavigationBlockedByThirdPartyIFrameRedirectBlocking):
1306
1307 2020-12-02  Truitt Savell  <tsavell@apple.com>
1308
1309         Unreviewed, reverting r270339.
1310
1311         introduced a constantly failing test.
1312
1313         Reverted changeset:
1314
1315         "Toggling pointer-events on body does not re-enable scrolling
1316         on child"
1317         https://bugs.webkit.org/show_bug.cgi?id=218533
1318         https://trac.webkit.org/changeset/270339
1319
1320 2020-12-02  Megan Gardner  <megan_gardner@apple.com>
1321
1322         Create and draw app highlights
1323         https://bugs.webkit.org/show_bug.cgi?id=219365
1324
1325         Reviewed by Wenson Hsieh.
1326
1327         Create a separate highlight register for app highlights so that there is a clear separation
1328         with no risk of web content accessing the wrong highlights. Extend rendering to include the 
1329         app highlights with the current default settings. 
1330
1331         * Modules/highlight/Highlight.h:
1332         * Modules/highlight/HighlightRegister.cpp:
1333         (WebCore::HighlightRegister::appHighlightKey):
1334         (WebCore::HighlightRegister::addAppHighlight):
1335         * Modules/highlight/HighlightRegister.h:
1336         * WebCore.xcodeproj/project.pbxproj:
1337         * css/CSSValueKeywords.in:
1338         * dom/Document.cpp:
1339         (WebCore::Document::appHighlightRegister):
1340         (WebCore::Document::collectRageDataFromRegister):
1341         (WebCore::Document::updateHighlightPositions):
1342         * dom/Document.h:
1343         * dom/StaticRange.h:
1344         * page/ContextMenuController.cpp:
1345         (WebCore::ContextMenuController::contextMenuItemSelected):
1346         * rendering/HighlightData.cpp:
1347         (WebCore::rendererAfterOffset):
1348         * rendering/InlineTextBox.cpp:
1349         (WebCore::InlineTextBox::resolveStyleForMarkedText):
1350         (WebCore::InlineTextBox::collectMarkedTextsForHighlights const):
1351         * rendering/MarkedText.h:
1352         * rendering/RenderTheme.cpp:
1353         (WebCore::RenderTheme::platformAppHighlightColor const):
1354         * rendering/RenderTheme.h:
1355         * rendering/RenderThemeIOS.mm:
1356         (WebCore::cssValueIDSelectorList):
1357         * rendering/RenderThemeMac.h:
1358         * rendering/RenderThemeMac.mm:
1359         (WebCore::RenderThemeMac::platformAppHighlightColor const):
1360         (WebCore::RenderThemeMac::systemColor const):
1361
1362 2020-12-02  Julian Gonzalez  <julian_a_gonzalez@apple.com>
1363
1364         Fix crash with performance.measure() with negative duration
1365         https://bugs.webkit.org/show_bug.cgi?id=219418
1366
1367         Reviewed by Alex Christensen.
1368
1369         In PerformanceUserTiming::measure(), the wrong variable is used
1370         to look up the exception to return if an invalid duration
1371         value is provided.
1372
1373         Updated user-timing-apis test to catch this crash.
1374
1375         * page/PerformanceUserTiming.cpp:
1376         (WebCore::PerformanceUserTiming::measure):
1377
1378 2020-12-02  Andres Gonzalez  <andresg_22@apple.com>
1379
1380         Fix for accessibility layout tests involving ranges in isolated tree mode.
1381         https://bugs.webkit.org/show_bug.cgi?id=219436
1382
1383         Reviewed by Chris Fleizach.
1384
1385         Tests:
1386         accessibility/mac/bounds-for-range.html
1387         accessibility/misspelling-range.html
1388
1389         - Implementation of AXIsolatedObject::boundsForRange and misspellingRange.
1390         - Fix for bug in stringForRange that wasn't isolatedCopying the returned
1391         string. Also this method should not dispatch the call to the main thread
1392         since the caller needs to do so because it is passing a SimpleRange as a
1393         parameter.
1394         - Implementation of AXIsolatedObject::lineForPosition. Other methods
1395         that take or return VisiblePositions and VisiblePositionRanges need also
1396         to be implemented.
1397
1398         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1399         (WebCore::AXIsolatedObject::stringForRange const):
1400         (WebCore::AXIsolatedObject::boundsForRange const):
1401         (WebCore::AXIsolatedObject::misspellingRange const):
1402         (WebCore::AXIsolatedObject::lineForPosition const):
1403         * accessibility/isolatedtree/AXIsolatedObject.h:
1404
1405 2020-12-02  Simon Fraser  <simon.fraser@apple.com>
1406
1407         Optimize padding in EventHandler and platform event classes
1408         https://bugs.webkit.org/show_bug.cgi?id=219420
1409
1410         Reviewed by Ryosuke Niwa.
1411
1412         Organize the member variables in EventHandler a bit better, to minimize padding
1413         and avoid redundant #ifdefs. This shrinks it from 632 bytes to 576 bytes.
1414
1415         Minimize padding in the Platform*Event classes.
1416
1417         * page/EventHandler.h:
1418         * platform/PlatformEvent.h:
1419         (WebCore::PlatformEvent::PlatformEvent):
1420         * platform/PlatformKeyboardEvent.h:
1421         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1422         * platform/PlatformMouseEvent.h:
1423         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1424         * platform/PlatformWheelEvent.h:
1425         (WebCore::PlatformWheelEvent::m_wheelTicksY):
1426         (WebCore::PlatformWheelEvent::m_granularity): Deleted.
1427
1428 2020-12-02  Aditya Keerthi  <akeerthi@apple.com>
1429
1430         REGRESSION: [iOS] imported/w3c/web-platform-tests/css/css-ui/appearance-revert-001.tentative.html is a flaky image failure
1431         https://bugs.webkit.org/show_bug.cgi?id=219410
1432         <rdar://problem/71868276>
1433
1434         Reviewed by Wenson Hsieh.
1435
1436         The flaky failure started appearing after r270065, which introduced a
1437         new look for progress bars when the iOSFormControlRefresh setting is
1438         enabled. Animated indeterminate progress bars were added as part of the
1439         new appearance.
1440
1441         However, since the setting is disabled by default, there should have
1442         been no effect on existing tests. r270065 omitted an early return in
1443         RenderThemeIOS::animationRepeatIntervalForProgressBar, which would
1444         lead to the existing progress bar being repainted 30 times per second.
1445         This repainting is the likely cause of the flaky image failure.
1446
1447         Furthermore, this test uses a determinate progress bar, so repainting
1448         due to animation should never occur, regardless of whether or not the
1449         iOSFormControlRefresh setting is enabled. To fix the incorrect behavior,
1450         a change was made to RenderProgress::updateAnimationState.
1451
1452         * rendering/RenderProgress.cpp:
1453         (WebCore::RenderProgress::updateAnimationState):
1454
1455         Only indeterminate progress bars have an animation.
1456
1457         * rendering/RenderThemeIOS.mm:
1458         (WebCore::RenderThemeIOS::animationRepeatIntervalForProgressBar const):
1459
1460         Use the original value if the iOSFormControlRefresh setting is disabled.
1461
1462 2020-12-01  Tim Horton  <timothy_horton@apple.com>
1463
1464         GPU Process: IOSurfaces should not be mapped into the Web Content Process
1465         https://bugs.webkit.org/show_bug.cgi?id=219368
1466
1467         Reviewed by Said Abou-Hallawa.
1468
1469         * platform/graphics/ConcreteImageBuffer.h:
1470         * platform/graphics/ImageBuffer.h:
1471         * platform/graphics/ImageBufferBackend.h:
1472         * platform/graphics/cg/ImageBufferIOSurfaceBackend.h:
1473         Make it possible to determine if an image buffer's backend is capable of mapping the backing store in-process or not.
1474
1475 2020-12-01  Andres Gonzalez  <andresg_22@apple.com>
1476
1477         Fix for accessibility attributed string tests in isolated mode.
1478         https://bugs.webkit.org/show_bug.cgi?id=219419
1479
1480         Reviewed by Chris Fleizach.
1481
1482         Tests:
1483         accessibility/mac/attributed-string-includes-misspelled-with-selection.html
1484         accessibility/mac/attributed-string/attributed-string-does-not-includes-misspelled-for-non-editable.html
1485         accessibility/mac/misspelled-attributed-string.html
1486
1487         Implemented AXIsolatedObject::rangeForPlainTextRange which is needed to
1488         build the attributed string for a given range.
1489         Also Implemented AXIsolatedObject::doAXBoundsForRangeUsingCharacterOffset
1490         and makeRangeVisible as a follow up to the previous patch to support
1491         PlaintTextRanges in isolated tree mode.
1492
1493         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1494         (WebCore::AXIsolatedObject::rangeForPlainTextRange const):
1495         (WebCore::AXIsolatedObject::makeRangeVisible):
1496         (WebCore::AXIsolatedObject::doAXBoundsForRangeUsingCharacterOffset const):
1497         * accessibility/isolatedtree/AXIsolatedObject.h:
1498
1499 2020-12-01  Devin Rousso  <drousso@apple.com>
1500
1501         Toggling pointer-events on body does not re-enable scrolling on child
1502         https://bugs.webkit.org/show_bug.cgi?id=218533
1503         <rdar://problem/71009746>
1504
1505         Reviewed by Simon Fraser.
1506
1507         * rendering/style/RenderStyle.cpp:
1508         (WebCore::RenderStyle::changeRequiresRecompositeLayer const):
1509         Changes to the CSS `pointer-events` property should also also indicate that a recomposite is
1510         required (`StyleDifference::RecompositeLayer`), resulting in `RenderElement::styleWillChange`
1511         being called, which invalidates the event region since the value of the CSS `pointer-events`
1512         property has changed.
1513
1514         * rendering/RenderLayerCompositor.cpp:
1515         (WebCore::RenderLayerCompositor::layerStyleChanged):
1516         Don't limit `StyleDifference::RecompositeLayer` changes to only affect `RenderWidget`.
1517
1518 2020-12-01  Simon Fraser  <simon.fraser@apple.com>
1519
1520         Simplify some callsites of WheelEventTestMonitor
1521         https://bugs.webkit.org/show_bug.cgi?id=219416
1522
1523         Reviewed by Daniel Bates.
1524
1525         Migrate towards more usage of WheelEventTestMonitorCompletionDeferrer, using a pattern
1526         where we WTFMove() one into a completion handler to pair the defer/undefer pairs,
1527         rather than having manual deferral/undeferral.
1528
1529         To make this work, WheelEventTestMonitorCompletionDeferrer gains a move constructor,
1530         that nullifies the m_monitor in the source to prevent double firing.
1531         
1532         Remove the WheelEventTestMonitor::RequestedScrollPosition deferral, since that code path
1533         is now synchronous.
1534
1535         * page/EventHandler.cpp:
1536         (WebCore::EventHandler::handleWheelEventInternal):
1537         * page/FrameView.cpp:
1538         (WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl):
1539         * page/WheelEventTestMonitor.cpp:
1540         (WebCore::WheelEventTestMonitor::removeDeferralForReason):
1541         * page/WheelEventTestMonitor.h:
1542         (WebCore::WheelEventTestMonitorCompletionDeferrer::WheelEventTestMonitorCompletionDeferrer):
1543         * page/scrolling/AsyncScrollingCoordinator.cpp:
1544         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
1545         (WebCore::AsyncScrollingCoordinator::synchronizeStateFromScrollingTree):
1546         (WebCore::AsyncScrollingCoordinator::applyPendingScrollUpdates):
1547         (WebCore::AsyncScrollingCoordinator::applyScrollUpdate):
1548         (WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll):
1549         (WebCore::AsyncScrollingCoordinator::noteScrollingThreadSyncCompleteForNode): Deleted.
1550         * page/scrolling/AsyncScrollingCoordinator.h:
1551         * page/scrolling/ScrollingTree.h:
1552         (WebCore::ScrollingTree::wheelEventTestMonitor):
1553         * page/scrolling/ThreadedScrollingTree.cpp:
1554         (WebCore::ThreadedScrollingTree::scrollingTreeNodeDidScroll):
1555         (WebCore::ThreadedScrollingTree::setActiveScrollSnapIndices):
1556         (WebCore::ThreadedScrollingTree::scrollingTreeNodeRequestsScroll): Deleted.
1557         * page/scrolling/ThreadedScrollingTree.h:
1558         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
1559         (WebCore::ScrollingCoordinatorMac::wheelEventWasProcessedByMainThread):
1560         * page/scrolling/mac/ScrollingTreeMac.h:
1561         * page/scrolling/mac/ScrollingTreeScrollingNodeDelegateMac.mm:
1562         (WebCore::ScrollingTreeScrollingNodeDelegateMac::handleWheelEvent):
1563
1564 2020-12-01  Peng Liu  <peng.liu6@apple.com>
1565
1566         [Media In GPU Process][MSE] Add the support to forward initialization segment from the GPU Process to Web processes
1567         https://bugs.webkit.org/show_bug.cgi?id=219227
1568
1569         Reviewed by Eric Carlson.
1570
1571         * Headers.cmake:
1572
1573 2020-12-01  Chris Fleizach  <cfleizach@apple.com>
1574
1575         AX: VoiceOver does not announce the  aria-checked state for ARIA treeitem
1576         https://bugs.webkit.org/show_bug.cgi?id=218316
1577         <rdar://problem/70787809>
1578
1579         Reviewed by Zalan Bujtas.
1580
1581         Tree items need to be able to support their aria-checked status according to WAI-ARIA.
1582         In addition, when the value changes they need to be able to post an appropriate notification.
1583         While working on this, I realized that if an attribute changes, the notification is not fired until the next layout change
1584         which is problematic. Those need to fire immediately.
1585
1586         Test: accessibility/mac/checked-status-tree-items.html
1587               accessibility/ios-simulator/checked-status-tree-items.html
1588
1589         * accessibility/AXObjectCache.cpp:
1590         (WebCore::AXObjectCache::deferAttributeChangeIfNeeded):
1591         * accessibility/AccessibilityNodeObject.cpp:
1592         (WebCore::AccessibilityNodeObject::isChecked const):
1593         * accessibility/AccessibilityObject.cpp:
1594         (WebCore::AccessibilityObject::supportsCheckedState const):
1595         * accessibility/AccessibilityObject.h:
1596         * accessibility/AccessibilityObjectInterface.h:
1597         * accessibility/AccessibilityTreeItem.cpp:
1598         (WebCore::AccessibilityTreeItem::supportsCheckedState const):
1599         * accessibility/AccessibilityTreeItem.h:
1600         * accessibility/ios/AXObjectCacheIOS.mm:
1601         (WebCore::AXObjectCache::postPlatformNotification):
1602         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1603         (-[WebAccessibilityObjectWrapper accessibilityTraits]):
1604         (-[WebAccessibilityObjectWrapper accessibilityValue]):
1605         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1606         (WebCore::AXIsolatedObject::initializeAttributeData):
1607         * accessibility/isolatedtree/AXIsolatedObject.h:
1608         * accessibility/isolatedtree/AXIsolatedTree.h:
1609         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1610         (AXAttributedStringAppendText):
1611         (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]):
1612         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1613
1614 2020-12-01  Andres Gonzalez  <andresg_22@apple.com>
1615
1616         Fix for multiple LayoutTests/accessibility tests in isolated tree mode that rely on PlainTextRange.
1617         https://bugs.webkit.org/show_bug.cgi?id=219411
1618
1619         Reviewed by Chris Fleizach.
1620
1621         Tests:
1622         accessibility/insert-newline.html
1623         accessibility/mac/input-string-for-range-crash.html
1624         accessibility/mac/range-for-contenteditable-newline.html
1625         accessibility/mac/range-for-line-textarea.html
1626         accessibility/set-selected-text-range-after-newline.html
1627         accessibility/textarea-line-for-index.html
1628         accessibility/mac/select-element-selection-with-optgroups.html
1629
1630         Implementation of AXIsolatedObject methods that take or return PlainTextRanges.
1631
1632         * accessibility/isolatedtree/AXIsolatedObject.cpp:
1633         (WebCore::AXIsolatedObject::selectedTextRange const):
1634         (WebCore::AXIsolatedObject::doAXRangeForLine const):
1635         (WebCore::AXIsolatedObject::doAXStringForRange const):
1636         (WebCore::AXIsolatedObject::doAXRangeForPosition const):
1637         (WebCore::AXIsolatedObject::doAXRangeForIndex const):
1638         (WebCore::AXIsolatedObject::doAXStyleRangeForIndex const):
1639         (WebCore::AXIsolatedObject::doAXBoundsForRange const):
1640         (WebCore::AXIsolatedObject::doAXLineForIndex):
1641         * accessibility/isolatedtree/AXIsolatedObject.h:
1642
1643 2020-12-01  Aditya Keerthi  <akeerthi@apple.com>
1644
1645         [iOS] <button> with multi-line content does not render properly
1646         https://bugs.webkit.org/show_bug.cgi?id=219372
1647         <rdar://problem/6061602>
1648
1649         Reviewed by Darin Adler.
1650
1651         Currently, on iOS, a <button> that has multiple lines of content clips
1652         the content to a single line. This behavior is incorrect, since <button>
1653         can contain arbitrary HTML and should resize based on its content.
1654
1655         The incorrect behavior occurs due to the forcing of a single line height
1656         for the button in RenderThemeIOS::adjustButtonStyle. To fix, replace
1657         setHeight with setMinHeight when styling the button. This ensures the
1658         button retains its appearance for single-line content, but does not clip
1659         multi-line content.
1660
1661         Test: fast/forms/button-multiline-height.html
1662
1663         * rendering/RenderTheme.cpp:
1664         (WebCore::RenderTheme::adjustButtonStyle const):
1665         * rendering/RenderTheme.h:
1666         (WebCore::RenderTheme::setButtonSize): Removed.
1667
1668         This virtual method is unnecessary, as it is only used by a single
1669         derived class, RenderThemeIOS.
1670
1671         * rendering/RenderThemeIOS.h:
1672         * rendering/RenderThemeIOS.mm:
1673         (WebCore::RenderThemeIOS::adjustButtonStyle const):
1674
1675         No longer round down the height calculation, to ensure the min height
1676         better matches the font size.
1677
1678 2020-12-01  Youenn Fablet  <youenn@apple.com>
1679
1680         Update SFrame transformation implementation according post-commit review
1681         https://bugs.webkit.org/show_bug.cgi?id=218981
1682
1683         Reviewed by Geoffrey Garen.
1684
1685         Add an ASSERT that salt key size is 16 or above so that IV computation is safe.
1686         Move HMAC SHA 256 Cocoa implementation to CryptoUtilitiesCocoa.cpp.
1687         A follow-up patch should move CryptoUtilitiesCocoa.cpp to platform or PAL.
1688
1689         No change of behavior.
1690
1691         * Modules/mediastream/RTCRtpSFrameTransformer.cpp:
1692         (WebCore::RTCRtpSFrameTransformer::setEncryptionKey):
1693         * Modules/mediastream/RTCRtpSFrameTransformerCocoa.cpp:
1694         (WebCore::RTCRtpSFrameTransformer::computeEncryptedDataSignature):
1695         * crypto/mac/CryptoAlgorithmHMACMac.cpp:
1696         (WebCore::CryptoAlgorithmHMAC::platformSign):
1697         (WebCore::CryptoAlgorithmHMAC::platformVerify):
1698         (WebCore::calculateSignature): Deleted.
1699         * crypto/mac/CryptoUtilitiesCocoa.cpp:
1700         (WebCore::calculateHMACSignature):
1701         (WebCore::calculateSHA256Signature):
1702         * crypto/mac/CryptoUtilitiesCocoa.h:
1703
1704 2020-12-01  Lauro Moura  <lmoura@igalia.com>
1705
1706         Unreviewed. Fix the reaches end of non-void function warning since r270294.
1707
1708         No new tests. No new behaviors.
1709
1710         * Modules/mediastream/RTCRtpScriptTransformerContext.h:
1711         (WebCore::RTCRtpScriptTransformerContext::requestKeyFrame): Add default clause returning void.
1712
1713 2020-11-30  Simon Fraser  <simon.fraser@apple.com>
1714
1715         [WK1] Only the first wheel event in a gesture should be cancelable
1716         https://bugs.webkit.org/show_bug.cgi?id=219384
1717
1718         Reviewed by Chris Dumez.
1719
1720         Implement the logic described at <https://w3c.github.io/uievents/#cancelability-of-wheel-events>,
1721         where only the first wheel event in a sequence is cancelable, and, if not canceled, then the
1722         rest of the events in the sequence become non-cancelable.
1723
1724         This is done for the non-async scrolling code path (i.e. WebKitLegacy) by storing
1725         a Optional<WheelScrollGestureState> on EventHandler, which is cleared when we receive
1726         the "begin" event, set when we finish processing that event, then consulted for subsequent
1727         move events.
1728
1729         Tests: fast/events/wheel/first-wheel-event-cancelable.html
1730                fast/events/wheel/wheel-events-become-non-cancelable.html
1731
1732         * page/EventHandler.h:
1733         * page/ios/EventHandlerIOS.mm:
1734         (WebCore::EventHandler::wheelEvent):
1735         * page/mac/EventHandlerMac.mm:
1736         (WebCore::EventHandler::wheelEvent):
1737         (WebCore::EventHandler::wheelEventWasProcessedByMainThread):
1738         * platform/PlatformWheelEvent.cpp:
1739         (WebCore::operator<<):
1740         * platform/PlatformWheelEvent.h:
1741
1742 2020-12-01  Youenn Fablet  <youenn@apple.com>
1743
1744         REGRESSION(STP116): wpt.live/webrtc/RTCRtpTransceiver.https.html crashes on load
1745         https://bugs.webkit.org/show_bug.cgi?id=219259
1746
1747         Reviewed by Eric Carlson.
1748
1749         Make use of StopStandard instead of the old StopInternal method.
1750         Covered by rebased tests.
1751
1752         * Modules/mediastream/RTCPeerConnection.cpp:
1753         (WebCore::RTCPeerConnection::addInternalTransceiver):
1754         * Modules/mediastream/RTCPeerConnection.h:
1755         * Modules/mediastream/RTCRtpTransceiver.cpp:
1756         (WebCore::RTCRtpTransceiver::setConnection):
1757         (WebCore::RTCRtpTransceiver::stop):
1758         * Modules/mediastream/RTCRtpTransceiver.h:
1759         * Modules/mediastream/RTCRtpTransceiver.idl:
1760         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp:
1761         (WebCore::LibWebRTCRtpTransceiverBackend::stop):
1762
1763 2020-12-01  Youenn Fablet  <youenn@apple.com>
1764
1765         DedicatedWorkerGlobalScope should clear m_rtcRtpTransformerConstructorMap before destructor
1766         https://bugs.webkit.org/show_bug.cgi?id=219389
1767
1768         Reviewed by Eric Carlson.
1769
1770         Clear the constructor map before the destructor in prepareForDestruction like done for audio worklet.
1771         Covered by http/wpt/webrtc/webrtc-transform.html no longer crashing with guard malloc.
1772
1773         * workers/DedicatedWorkerGlobalScope.cpp:
1774         (WebCore::DedicatedWorkerGlobalScope::prepareForDestruction):
1775         * workers/DedicatedWorkerGlobalScope.h:
1776         * workers/WorkerGlobalScope.h:
1777
1778 2020-12-01  Philippe Normand  <pnormand@igalia.com>
1779
1780         [GStreamer] Common module should use a dedicated logging category
1781         https://bugs.webkit.org/show_bug.cgi?id=219348
1782
1783         Reviewed by Xabier Rodriguez-Calvar.
1784
1785         Because this module can be used outside of the MediaPlayer scope, we cannot assume the
1786         MediaPlayer debug category will be initialized in time when GST_DEBUG logs need to be
1787         emitted from GStreamerCommon. So it is safer to introduce a new, standalone, logging
1788         category for this module.
1789
1790         * platform/graphics/gstreamer/GStreamerCommon.cpp:
1791         (WebCore::initializeGStreamer):
1792
1793 2020-12-01  Rob Buis  <rbuis@igalia.com>
1794
1795         Lazy loaded iframe should not lazy load when scripting is disabled
1796         https://bugs.webkit.org/show_bug.cgi?id=217315
1797
1798         Reviewed by Darin Adler.
1799
1800         Lazy loaded iframe should not lazy load when scripting is disabled [1].
1801
1802         Test: imported/w3c/web-platform-tests/html/semantics/embedded-content/the-iframe-element/iframe-loading-lazy-in-script-disabled-iframe.html
1803
1804         [1] https://html.spec.whatwg.org/#will-lazy-load-element-steps
1805
1806         This matches Chrome and Firefox.
1807
1808         * html/HTMLIFrameElement.cpp:
1809         (WebCore::isFrameLazyLoadable):
1810         (WebCore::HTMLIFrameElement::shouldLoadFrameLazily):
1811         * html/HTMLImageElement.cpp:
1812         (WebCore::HTMLImageElement::isLazyLoadable const):
1813
1814 2020-12-01  Tetsuharu Ohzeki  <tetsuharu.ohzeki@gmail.com>
1815
1816         [WebIDL] Move ShadowRootInit to dedicated idl file from Element.idl
1817         https://bugs.webkit.org/show_bug.cgi?id=219261
1818
1819         Reviewed by Don Olmstead.
1820
1821         * CMakeLists.txt:
1822         * DerivedSources-input.xcfilelist:
1823         * DerivedSources-output.xcfilelist:
1824         * DerivedSources.make:
1825         * Headers.cmake:
1826         * Sources.txt:
1827         * WebCore.xcodeproj/project.pbxproj:
1828         * dom/Element.cpp:
1829         * dom/Element.h:
1830         * dom/Element.idl:
1831         * dom/ShadowRootInit.h: Added.
1832         * dom/ShadowRootInit.idl: Added.
1833           This patch use the same license header used in bug 216336
1834           because this patch does not change the code essentially at here.
1835
1836 2020-12-01  Youenn Fablet  <youenn@apple.com>
1837
1838         CSSStyleSheet.cssRules and rules should throw in case of opaque stylesheets
1839         https://bugs.webkit.org/show_bug.cgi?id=219203
1840
1841         Reviewed by Alex Christensen.
1842
1843         In case of opaque stylesheet, throw a SecurityError as done by Chrome and Firefox.
1844         Covered by updated and rebased tests.
1845
1846         * css/CSSStyleSheet.cpp:
1847         (WebCore::CSSStyleSheet::cssRulesFromJS):
1848         (WebCore::CSSStyleSheet::rulesFromJS):
1849         * css/CSSStyleSheet.idl:
1850
1851 2020-12-01  Youenn Fablet  <youenn@apple.com>
1852
1853         Allow RTCRtpScriptTransformer to request key frames
1854         https://bugs.webkit.org/show_bug.cgi?id=219199
1855         <rdar://problem/71763010>
1856
1857         Reviewed by Eric Carlson.
1858
1859         Expose RTCRtpScriptTransformerContext to RTCRtpScriptTransformer as part of third parameter of the 'start' callback.
1860         This context exposes some states (sender or receiver transform, audio or video transform).
1861         It also exposes the ability to request key frames for video transforms.
1862
1863         Make RTCRtpTransformableFrame ref counted so that we can keep it even though the frame was piped to the writable stream.
1864         Make LibWebRTCRtpTransformableFrame able to cope with a nullptr internal rtc frame.
1865
1866         Add support for RTCEncodedVideoFrame.type.
1867
1868         Tests: http/wpt/webrtc/audio-script-transform.html
1869                http/wpt/webrtc/video-script-transform.html
1870
1871         * CMakeLists.txt:
1872         * DerivedSources-input.xcfilelist:
1873         * DerivedSources-output.xcfilelist:
1874         * DerivedSources.make:
1875         * Modules/mediastream/RTCEncodedVideoFrame.cpp:
1876         (WebCore::RTCEncodedVideoFrame::RTCEncodedVideoFrame):
1877         * Modules/mediastream/RTCEncodedVideoFrame.h:
1878         (WebCore::RTCEncodedVideoFrame::type const):
1879         * Modules/mediastream/RTCEncodedVideoFrame.idl:
1880         * Modules/mediastream/RTCRtpScriptTransformerContext.h: Added.
1881         (WebCore::RTCRtpScriptTransformerContext::side const):
1882         (WebCore::RTCRtpScriptTransformerContext::mediaType const):
1883         (WebCore::RTCRtpScriptTransformerContext::create):
1884         (WebCore::RTCRtpScriptTransformerContext::RTCRtpScriptTransformerContext):
1885         (WebCore::RTCRtpScriptTransformerContext::requestKeyFrame):
1886         * Modules/mediastream/RTCRtpScriptTransformerContext.idl: Added.
1887         * Modules/mediastream/RTCRtpTransformBackend.h:
1888         * Modules/mediastream/RTCRtpTransformableFrame.h:
1889         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverTransformBackend.cpp:
1890         (WebCore::LibWebRTCRtpReceiverTransformBackend::requestKeyFrame):
1891         * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverTransformBackend.h:
1892         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderTransformBackend.cpp:
1893         (WebCore::LibWebRTCRtpSenderTransformBackend::requestKeyFrame):
1894         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderTransformBackend.h:
1895         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformableFrame.cpp:
1896         (WebCore::LibWebRTCRtpTransformableFrame::isKeyFrame const):
1897         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformableFrame.h:
1898         * Sources.txt:
1899         * WebCore.xcodeproj/project.pbxproj:
1900
1901 2020-12-01  Rob Buis  <rbuis@igalia.com>
1902
1903         Remove m_gridItemsIndexesMap
1904         https://bugs.webkit.org/show_bug.cgi?id=219392
1905
1906         Reviewed by Manuel Rego Casasnovas.
1907
1908         Remove m_gridItemsIndexesMap since it is not used.
1909
1910         * rendering/Grid.h:
1911
1912 2020-12-01  Alejandro G. Castro  <alex@igalia.com>
1913
1914         [GTK][WPE] Async scrolling udpates are blocked in the main thread
1915         https://bugs.webkit.org/show_bug.cgi?id=219308
1916
1917         Reviewed by Simon Fraser.
1918
1919         We need to avoid this performance improvement of avoiding the
1920         refresh for the scrolling thread when no wheel events were
1921         recently sent because GTK and WPE kinetic scrolling does not use
1922         wheel events to control the animation. We are discussing to change
1923         this for the future and make the code more similar for every port.
1924
1925         No new tests, not sure if we can add tests for this situation. We
1926         detected it manually.
1927
1928         * page/scrolling/ThreadedScrollingTree.cpp:
1929         (WebCore::ThreadedScrollingTree::displayDidRefresh): This function
1930         is also called by the threaded compositor thread in case of GTK
1931         and WPE. We can not use that condition for GTK and WPE, kinetic
1932         animation does not use the wheel events.
1933
1934 2020-12-01  Youenn Fablet  <youenn@apple.com>
1935
1936         Add support for readable/writable to RTCRtpSFrameTransform
1937         https://bugs.webkit.org/show_bug.cgi?id=219298
1938
1939         Reviewed by Eric Carlson.
1940
1941         Add support for locking WritableStream and checking locked state.
1942         Add readable/writable getters so that RTCRtpSFrameTransform can be used as a TransformStream.
1943         Make a refactoring to allow reuse of SimpleReadableStreamSource and SimpleWritableStreamSink.
1944
1945         In case of encryption/decryption error, we do not error the transform as this is final.
1946         Instead, we output empty buffers.
1947         In case of trying to encrypt unexpected objects, we error the transform.
1948
1949         Move RTCRtpTransformableFrame to be ref counted.
1950         This allows to keep a RTCRtpTransformableFrame for each RTCEncodedFrame even though the underlying
1951         webrtc frame (which is a unique ptr) is given back to the webrtc backend after processing.
1952
1953         Covered by updated test.
1954
1955         * Modules/mediastream/RTCEncodedAudioFrame.cpp:
1956         (WebCore::RTCEncodedAudioFrame::RTCEncodedAudioFrame):
1957         * Modules/mediastream/RTCEncodedAudioFrame.h:
1958         (WebCore::RTCEncodedAudioFrame::create):
1959         * Modules/mediastream/RTCEncodedFrame.cpp:
1960         (WebCore::RTCEncodedFrame::RTCEncodedFrame):
1961         * Modules/mediastream/RTCEncodedFrame.h:
1962         (WebCore::RTCEncodedFrame::rtcFrame):
1963         * Modules/mediastream/RTCEncodedVideoFrame.cpp:
1964         (WebCore::RTCEncodedVideoFrame::RTCEncodedVideoFrame):
1965         * Modules/mediastream/RTCEncodedVideoFrame.h:
1966         (WebCore::RTCEncodedVideoFrame::create):
1967         * Modules/mediastream/RTCRtpSFrameTransform.cpp:
1968         (WebCore::RTCRtpSFrameTransform::RTCRtpSFrameTransform):
1969         (WebCore::RTCRtpSFrameTransform::isAttached const):
1970         (WebCore::RTCRtpSFrameTransform::initializeTransformer):
1971         (WebCore::RTCRtpSFrameTransform::willClearBackend):
1972         (WebCore::transformFrame):
1973         (WebCore::RTCRtpSFrameTransform::createStreams):
1974         (WebCore::RTCRtpSFrameTransform::readable):
1975         (WebCore::RTCRtpSFrameTransform::writable):
1976         * Modules/mediastream/RTCRtpSFrameTransform.h:
1977         (WebCore::RTCRtpSFrameTransform::create):
1978         * Modules/mediastream/RTCRtpSFrameTransform.idl:
1979         * Modules/mediastream/RTCRtpSFrameTransformer.cpp:
1980         (WebCore::RTCRtpSFrameTransformer::setEncryptionKey):
1981         (WebCore::RTCRtpSFrameTransformer::decryptFrame):
1982         (WebCore::RTCRtpSFrameTransformer::encryptFrame):
1983         (WebCore::RTCRtpSFrameTransformer::transform):
1984         (WebCore::RTCRtpSFrameTransformer::updateAuthenticationSize):
1985         * Modules/mediastream/RTCRtpSFrameTransformer.h:
1986         (WebCore::RTCRtpSFrameTransformer::setIsEncrypting):
1987         (WebCore::RTCRtpSFrameTransformer::setAuthenticationSize):
1988         * Modules/mediastream/RTCRtpSFrameTransformerCocoa.cpp:
1989         (WebCore::RTCRtpSFrameTransformer::updateAuthenticationSize):
1990         * Modules/mediastream/RTCRtpScriptTransformer.cpp:
1991         (WebCore::RTCRtpScriptTransformer::startStreams):
1992         * Modules/mediastream/RTCRtpScriptTransformer.h:
1993         * Modules/mediastream/RTCRtpTransformBackend.h:
1994         * Modules/mediastream/RTCRtpTransformableFrame.h:
1995         * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderTransformBackend.cpp:
1996         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformBackend.cpp:
1997         (WebCore::LibWebRTCRtpTransformBackend::processTransformedFrame):
1998         (WebCore::LibWebRTCRtpTransformBackend::Transform):
1999         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformBackend.h:
2000         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformableFrame.cpp: Added.
2001         * Modules/mediastream/libwebrtc/LibWebRTCRtpTransformableFrame.h:
2002         * Modules/streams/ReadableStreamSource.h:
2003         (WebCore::SimpleReadableStreamSource::create):
2004         (WebCore::SimpleReadableStreamSource::close):
2005         (WebCore::SimpleReadableStreamSource::enqueue):
2006         * Modules/streams/WritableStreamSink.h:
2007         (WebCore::SimpleWritableStreamSink::create):
2008         (WebCore::SimpleWritableStreamSink::SimpleWritableStreamSink):
2009         (WebCore::SimpleWritableStreamSink::write):
2010         * bindings/js/WritableStream.cpp:
2011         (WebCore::WritableStreamInternal::callFunction):
2012         (WebCore::checkWritableStream):
2013         (WebCore::WritableStream::lock):
2014         (WebCore::WritableStream::isLocked const):
2015         * bindings/js/WritableStream.h:
2016         * bindings/scripts/CodeGeneratorJS.pm:
2017         (AddToIncludesForIDLType):
2018
2019 2020-12-01  Sergio Villar Senin  <svillar@igalia.com>
2020
2021         [css-flexbox] WebKit doesn't preserve aspect ratio when computing cross size of flexed images in auto-height flex container
2022         https://bugs.webkit.org/show_bug.cgi?id=209983
2023         <rdar://problem/61288094>
2024
2025         Reviewed by Darin Adler.
2026
2027         Aspect ratio was not preserved in the cross axis because WebKit was stretching the items (as they're auto sized) without considering
2028         the aspect ratio. Instead of letting flexbox code deal with that we basically don't stretch them and let RenderReplaced compute the
2029         cross size based on the aspect ratio as it does with other elements that are not flex items.
2030
2031         This allows us to pass 3 tests from the WPT test suite.
2032
2033         * rendering/RenderFlexibleBox.cpp:
2034         (WebCore::RenderFlexibleBox::needToStretchChildLogicalHeight const): Return false for replaced elements with aspect ratio.
2035
2036 2020-11-30  Andres Gonzalez  <andresg_22@apple.com>
2037
2038         [WebAccessibilityObjectWrapper doAXAttributedStringForRange] needs to run on the main thread.
2039         https://bugs.webkit.org/show_bug.cgi?id=219360
2040
2041         Reviewed by Chris Fleizach.
2042
2043         Dispatch this call to the main thread in isolated tree mode.
2044         In addition, moved several TextMarker static functions and ObjectiveC
2045         wrappers out of the WebAccessibilityObjectWrapper implementation in an
2046         ongoing effort to move core code out of the accessibility platform
2047         wrapper.
2048
2049         * accessibility/mac/AXObjectCacheMac.mm:
2050         (WebCore::textMarkerRangeFromMarkers):
2051         (WebCore::startOrEndTextMarkerForRange):
2052         (WebCore::textMarkerRangeFromRange):
2053         * accessibility/mac/WebAccessibilityObjectWrapperMac.h:
2054         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2055         (-[WebAccessibilityObjectWrapper doAXAttributedStringForRange:]):
2056         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
2057         (-[WebAccessibilityObjectWrapper textMarkerRangeFromRange:]): Deleted,
2058         not needed, instead call the C function directly.
2059         (textMarkerRangeFromRange): Deleted, moved to AXObjectCacheMac.mm.
2060         (-[WebAccessibilityObjectWrapper startOrEndTextMarkerForRange:isStart:]):
2061         Deleted, not needed, instead call the C function directly.
2062         (startOrEndTextmarkerForRange): Deleted, Moved to AXObjectCacheMac.mm.
2063
2064 2020-11-30  Simon Fraser  <simon.fraser@apple.com>
2065
2066         Pass OptionSet<EventHandling> to various wheel event handler functions
2067         https://bugs.webkit.org/show_bug.cgi?id=219373
2068
2069         Reviewed by Tim Horton.
2070
2071         Fixing webkit.org/b/218764 will require that code that dispatches wheel events
2072         can tell later whether script called preventDefault() on the event, since this
2073         will affect whether the rest of the wheel events in a gesture are cancelable.
2074
2075         To prepare for this, pass OptionSet<EventHandling> around in event handling
2076         code.
2077
2078         No behavior change.
2079
2080         * dom/Element.cpp:
2081         (WebCore::Element::dispatchWheelEvent):
2082         * page/EventHandler.cpp:
2083         (WebCore::handleWheelEventInAppropriateEnclosingBox):
2084         (WebCore::EventHandler::processWheelEventForScrolling):
2085         (WebCore::EventHandler::handleWheelEvent):
2086         (WebCore::EventHandler::handleWheelEventInternal):
2087         (WebCore::EventHandler::defaultWheelEventHandler):
2088         * page/EventHandler.h:
2089         * page/FrameView.cpp:
2090         (WebCore::FrameView::handleWheelEventForScrolling):
2091         * page/FrameView.h:
2092         * page/mac/EventHandlerMac.mm:
2093         (WebCore::EventHandler::wheelEvent):
2094         (WebCore::EventHandler::processWheelEventForScrolling):
2095         * page/scrolling/ScrollingCoordinator.h:
2096         (WebCore::ScrollingCoordinator::handleWheelEventForScrolling):
2097         * page/scrolling/ThreadedScrollingTree.cpp:
2098         (WebCore::ThreadedScrollingTree::handleWheelEventAfterMainThread):
2099         * page/scrolling/ThreadedScrollingTree.h:
2100         * page/scrolling/mac/ScrollingCoordinatorMac.h:
2101         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
2102         (WebCore::ScrollingCoordinatorMac::handleWheelEventForScrolling):
2103         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp:
2104         (WebCore::ScrollingCoordinatorNicosia::handleWheelEventForScrolling):
2105         (WebCore::ScrollingCoordinatorNicosia::wheelEventWasProcessedByMainThread):
2106         * page/scrolling/nicosia/ScrollingCoordinatorNicosia.h:
2107         * platform/ScrollableArea.cpp:
2108         (WebCore::ScrollableArea::handleWheelEventForScrolling):
2109         * platform/ScrollableArea.h:
2110         * rendering/RenderLayer.cpp:
2111         (WebCore::RenderLayer::handleWheelEventForScrolling):
2112         * rendering/RenderLayer.h:
2113
2114 2020-11-30  Chris Dumez  <cdumez@apple.com>
2115
2116         sessionStorage should not be cloned when a window is opened with rel=noopener
2117         https://bugs.webkit.org/show_bug.cgi?id=218804
2118         <rdar://problem/71286606>
2119
2120         Reviewed by Alex Christensen.
2121
2122         sessionStorage should not be cloned when a window is opened with rel=noopener, as per:
2123         - https://html.spec.whatwg.org/multipage/browsers.html#copy-session-storage
2124
2125         Both Firefox and Chrome have already implemented this behavior.
2126
2127         * loader/EmptyFrameLoaderClient.h:
2128         * loader/FrameLoader.cpp:
2129         (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
2130         * loader/FrameLoaderClient.h:
2131         * page/Chrome.cpp:
2132         (WebCore::Chrome::createWindow const):
2133
2134 2020-11-30  Alex Christensen  <achristensen@webkit.org>
2135
2136         Allow blob URLs with fragments
2137         https://bugs.webkit.org/show_bug.cgi?id=219361
2138
2139         Reviewed by Darin Adler.
2140
2141         When fetching blob content, we use the whole blob URL.
2142         In order to match Chrome and Firefox, we need to remove the fragment if there is one.
2143
2144         * platform/network/BlobRegistryImpl.cpp:
2145         (WebCore::BlobRegistryImpl::getBlobDataFromURL const):
2146
2147 2020-11-30  James Darpinian  <jdarpinian@chromium.org>
2148
2149         Support KHR_parallel_shader_compile
2150         https://bugs.webkit.org/show_bug.cgi?id=219266
2151
2152         Reviewed by Kenneth Russell.
2153
2154         Tested by webgl/conformance/extensions/khr-parallel-shader-compile.html
2155
2156         * CMakeLists.txt:
2157         * DerivedSources-input.xcfilelist:
2158         * DerivedSources-output.xcfilelist:
2159         * DerivedSources.make:
2160         * Sources.txt:
2161         * WebCore.xcodeproj/project.pbxproj:
2162         * bindings/js/JSDOMConvertWebGL.cpp:
2163         (WebCore::convertToJSValue):
2164         * html/canvas/KHRParallelShaderCompile.cpp: Added.
2165         (WebCore::KHRParallelShaderCompile::KHRParallelShaderCompile):
2166         (WebCore::KHRParallelShaderCompile::getName const):
2167         (WebCore::KHRParallelShaderCompile::supported):
2168         * html/canvas/KHRParallelShaderCompile.h: Added.
2169         * html/canvas/KHRParallelShaderCompile.idl: Added.
2170         * html/canvas/WebGL2RenderingContext.cpp:
2171         (WebCore::WebGL2RenderingContext::getExtension):
2172         (WebCore::WebGL2RenderingContext::getSupportedExtensions):
2173         * html/canvas/WebGLExtension.h:
2174         * html/canvas/WebGLRenderingContext.cpp:
2175         (WebCore::WebGLRenderingContext::getExtension):
2176         (WebCore::WebGLRenderingContext::getSupportedExtensions):
2177         * html/canvas/WebGLRenderingContextBase.cpp:
2178         (WebCore::WebGLRenderingContextBase::getProgramParameter):
2179         (WebCore::WebGLRenderingContextBase::getShaderParameter):
2180         (WebCore::WebGLRenderingContextBase::extensionIsEnabled):
2181         (WebCore::WebGLRenderingContextBase::loseExtensions):
2182         * html/canvas/WebGLRenderingContextBase.h:
2183         * platform/graphics/ExtensionsGL.h:
2184
2185 2020-11-30  Youenn Fablet  <youenn@apple.com>
2186
2187         Introduce an experimental flag specific to VP9 profile 2
2188         https://bugs.webkit.org/show_bug.cgi?id=219350
2189
2190         Reviewed by Eric Carlson.
2191
2192         Introduce an experimental flag for VP9 profile 2.
2193         Pass it to libwebrtc backend when creating codec factories.
2194         Profile 2 support is only enabled if profile 0 support is also enabled.
2195         Covered by updated test.
2196
2197         * page/Page.cpp:
2198         (WebCore::m_shouldRelaxThirdPartyCookieBlocking):
2199         * page/RuntimeEnabledFeatures.h:
2200         (WebCore::RuntimeEnabledFeatures::webRTCVP9Profile0CodecEnabled const):
2201         (WebCore::RuntimeEnabledFeatures::setWebRTCVP9Profile0CodecEnabled):
2202         (WebCore::RuntimeEnabledFeatures::webRTCVP9Profile2CodecEnabled const):
2203         (WebCore::RuntimeEnabledFeatures::setWebRTCVP9Profile2CodecEnabled):
2204         (WebCore::RuntimeEnabledFeatures::webRTCVP9CodecEnabled const): Deleted.
2205         (WebCore::RuntimeEnabledFeatures::setWebRTCVP9CodecEnabled): Deleted.
2206         * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
2207         (WebCore::LibWebRTCProvider::setVP9Support):
2208         * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
2209         (WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
2210         (WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
2211         * testing/Internals.cpp:
2212         (WebCore::Internals::setWebRTCVP9Support):
2213         * testing/Internals.h:
2214         * testing/Internals.idl:
2215
2216 2020-11-30  Youenn Fablet  <youenn@apple.com>
2217
2218         Missing WebRTC Metrics in iOS 14 Beta 5
2219         https://bugs.webkit.org/show_bug.cgi?id=215678
2220         <rdar://problem/67625414>
2221
2222         Reviewed by Eric Carlson.
2223
2224         Expose more stats and fix a bug in stat exposure code for kind.
2225         Covered by updated test.
2226
2227         * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp:
2228         (WebCore::fillInboundRtpStreamStats):
2229         (WebCore::fillRemoteInboundRtpStreamStats):
2230         (WebCore::fillOutboundRtpStreamStats):
2231
2232 2020-11-30  Kenneth Russell  <kbr@chromium.org>
2233
2234         [WebGL2] Rasterizer discard interferes with implicit clears
2235         https://bugs.webkit.org/show_bug.cgi?id=219061
2236
2237         Reviewed by Dean Jackson.
2238
2239         When rasterizer discard is enabled, user-level draw calls and
2240         clears skip the implicit clear since they have no effect.
2241         Readbacks and copies still perform the implicit clear.
2242
2243         A new WebGL conformance test has been added for this in
2244         https://github.com/KhronosGroup/WebGL/pull/3183 which passes with
2245         this fix. WebKit's TestRunner doesn't run the composite phase as
2246         the browser or MiniBrowser do, so wouldn't pass this test as
2247         integrated as a layout test. Per discussion with dino and
2248         kkinnunen on Slack, will address this in follow-on work.
2249
2250         * html/canvas/WebGL2RenderingContext.cpp:
2251         (WebCore::WebGL2RenderingContext::copyTexSubImage3D):
2252         (WebCore::WebGL2RenderingContext::readPixels):
2253         * html/canvas/WebGLRenderingContextBase.cpp:
2254         (WebCore::ScopedDisableRasterizerDiscard::ScopedDisableRasterizerDiscard):
2255         (WebCore::ScopedDisableRasterizerDiscard::~ScopedDisableRasterizerDiscard):
2256         (WebCore::WebGLRenderingContextBase::initializeNewContext):
2257         (WebCore::WebGLRenderingContextBase::clearIfComposited):
2258         (WebCore::WebGLRenderingContextBase::paintRenderingResultsToCanvas):
2259         (WebCore::WebGLRenderingContextBase::paintRenderingResultsToImageData):
2260         (WebCore::WebGLRenderingContextBase::clear):
2261         (WebCore::WebGLRenderingContextBase::copyTexSubImage2D):
2262         (WebCore::WebGLRenderingContextBase::disable):
2263         (WebCore::WebGLRenderingContextBase::drawArrays):
2264         (WebCore::WebGLRenderingContextBase::drawElements):
2265         (WebCore::WebGLRenderingContextBase::enable):
2266         (WebCore::WebGLRenderingContextBase::readPixels):
2267         (WebCore::WebGLRenderingContextBase::copyTexImage2D):
2268         (WebCore::WebGLRenderingContextBase::drawArraysInstanced):
2269         (WebCore::WebGLRenderingContextBase::drawElementsInstanced):
2270         * html/canvas/WebGLRenderingContextBase.h:
2271
2272 2020-11-30  Simon Fraser  <simon.fraser@apple.com>
2273
2274         Unreviewed build fix.
2275
2276         Fix non-unified builds after r270224.
2277
2278         * display/DisplayTreeBuilder.cpp:
2279         * display/DisplayTreeBuilder.h:
2280
2281 2020-11-30  Aditya Keerthi  <akeerthi@apple.com>
2282
2283         RenderTheme::paintDecorations should return void
2284         https://bugs.webkit.org/show_bug.cgi?id=219357
2285
2286         Reviewed by Simon Fraser.
2287
2288         RenderTheme::paintDecorations currently returns a boolean value.
2289         However, the returned value is unused. For clarity, the method is
2290         updated to return void. The various "paint*Decorations" methods
2291         called in RenderTheme:paintDecorations are also updated to return void.
2292
2293         * rendering/RenderTheme.cpp:
2294         (WebCore::RenderTheme::paintDecorations):
2295         * rendering/RenderTheme.h:
2296         (WebCore::RenderTheme::paintFileUploadIconDecorations):
2297         (WebCore::RenderTheme::paintCheckboxDecorations):
2298         (WebCore::RenderTheme::paintRadioDecorations):
2299         (WebCore::RenderTheme::paintButtonDecorations):
2300         (WebCore::RenderTheme::paintTextFieldDecorations):
2301         (WebCore::RenderTheme::paintTextAreaDecorations):
2302         (WebCore::RenderTheme::paintMenuListDecorations):
2303         (WebCore::RenderTheme::paintMenuListButtonDecorations):
2304         (WebCore::RenderTheme::paintPushButtonDecorations):
2305         (WebCore::RenderTheme::paintSquareButtonDecorations):
2306         (WebCore::RenderTheme::paintSliderThumbDecorations):
2307         (WebCore::RenderTheme::paintSearchFieldDecorations):
2308         * rendering/RenderThemeAdwaita.cpp:
2309         (WebCore::RenderThemeAdwaita::paintMenuListButtonDecorations):
2310         * rendering/RenderThemeAdwaita.h:
2311         * rendering/RenderThemeIOS.h:
2312         * rendering/RenderThemeIOS.mm:
2313         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
2314         (WebCore::RenderThemeIOS::paintRadioDecorations):
2315         (WebCore::RenderThemeIOS::paintTextFieldDecorations):
2316         (WebCore::RenderThemeIOS::paintTextAreaDecorations):
2317         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
2318         (WebCore::RenderThemeIOS::paintSliderThumbDecorations):
2319         (WebCore::RenderThemeIOS::paintSearchFieldDecorations):
2320         (WebCore::RenderThemeIOS::paintButtonDecorations):
2321         (WebCore::RenderThemeIOS::paintPushButtonDecorations):
2322         (WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
2323         * rendering/RenderThemeMac.h:
2324         * rendering/RenderThemeMac.mm:
2325         (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
2326         * rendering/RenderThemeWin.cpp:
2327         (WebCore::RenderThemeWin::paintMenuList):
2328         (WebCore::RenderThemeWin::paintMenuListButtonDecorations):
2329         * rendering/RenderThemeWin.h:
2330
2331 2020-11-30  Tyler Wilcock  <twilco.o@protonmail.com>
2332
2333         getComputedStyle rounds lineHeight to nearest pixel
2334         https://bugs.webkit.org/show_bug.cgi?id=216601
2335
2336         Reviewed by Simon Fraser.
2337
2338         When serializing `line-height` for `getComputedStyle`, ensure the
2339         value can be represented fractionally (when appropriate). Prior to this
2340         patch, `line-height` serialization was always an integer value.  Per
2341         spec, the used value of `line-height` can be a `<number>` value, which
2342         is fractional.  Gecko and Chromium allow fractional `line-height`s to be
2343         returned from `getComputedStyle`, further confirming this.
2344
2345         https://drafts.csswg.org/css2/#propdef-line-height
2346
2347         Test: fast/css/line-height-get-computed-style.html
2348
2349         * css/CSSComputedStyleDeclaration.cpp:
2350         (WebCore::lineHeightFromStyle): Cast result to `double` instead of
2351         `int` since `line-height` can be represented fractionally.
2352
2353 2020-11-30  Aditya Keerthi  <akeerthi@apple.com>
2354
2355         Use real dates and times as placeholders for date/time inputs with editable components
2356         https://bugs.webkit.org/show_bug.cgi?id=219216
2357         <rdar://problem/71636615>
2358
2359         Reviewed by Devin Rousso.
2360
2361         Currently, date/time inputs with editable components have "--" as a
2362         placeholder when the input is empty. This is undesirable for two reasons:
2363
2364         1. "--" does not fill the width of the component, leading to an unpleasant appearance.
2365         2. The order of the date/time components is unclear.
2366
2367         To resolve these issues, this patch introduces real dates and times as
2368         placeholders. For dates, the current date is used as a placeholder.
2369         For times, a fixed time (such as "12:30 PM") is used, to avoid being
2370         overly specific. Note that the second and millisecond fields for times
2371         will always have "00" and "000" as a placeholder respectively.
2372
2373         When the placeholder is visible, the text color is changed to dark gray,
2374         matching the placeholder in regular text inputs. Note that date/time
2375         placeholders are not customizable in any way, as it is an unspecified aspect
2376         of the element. Separators are left in the existing text color, to avoid
2377         making the input look disabled.
2378
2379         * html/shadow/DateTimeEditElement.cpp:
2380         (WebCore::DateTimeEditElement::DateTimeEditElement):
2381         (WebCore::DateTimeEditElement::placeholderDate const):
2382         * html/shadow/DateTimeEditElement.h:
2383
2384         Introduced m_placeholderDate, which is set to the current date.
2385
2386         * html/shadow/DateTimeFieldElement.cpp:
2387         (WebCore::DateTimeFieldElement::setEmptyValue):
2388         (WebCore::DateTimeFieldElement::setValueAsInteger):
2389         (WebCore::DateTimeFieldElement::visibleValue const):
2390         (WebCore::DateTimeFieldElement::updateVisibleValue):
2391
2392         Removed early return when the previous visible value is equal to the
2393         updated visible value. This can occur when the placeholder value is equal
2394         to the value entered by the user. In these instances, we should still
2395         dispatch input and change events.
2396
2397         * html/shadow/DateTimeFieldElement.h:
2398
2399         Added base class implementations of setEmptyValue and setValueAsInteger
2400         so that the logic to change the text color when a placeholder is visible
2401         can be shared.
2402
2403         Changed visibleValue to no longer be a pure virtual method, as the
2404         implementations in derived classes were very similar, and can be
2405         abstracted. For this reason, the new placeholderValue pure virtual method
2406         was added.
2407
2408         * html/shadow/DateTimeFieldElements.cpp:
2409         (WebCore::DateTimeDayFieldElement::DateTimeDayFieldElement):
2410         (WebCore::DateTimeHourFieldElement::DateTimeHourFieldElement):
2411         (WebCore::DateTimeMeridiemFieldElement::DateTimeMeridiemFieldElement):
2412         (WebCore::DateTimeMillisecondFieldElement::DateTimeMillisecondFieldElement):
2413         (WebCore::DateTimeMinuteFieldElement::DateTimeMinuteFieldElement):
2414         (WebCore::DateTimeMonthFieldElement::DateTimeMonthFieldElement):
2415
2416         Months are 0-indexed, so we add 1 to the value returned by month().
2417
2418         (WebCore::DateTimeSecondFieldElement::DateTimeSecondFieldElement):
2419         (WebCore::DateTimeSymbolicMonthFieldElement::DateTimeSymbolicMonthFieldElement):
2420         (WebCore::DateTimeYearFieldElement::DateTimeYearFieldElement):
2421         * html/shadow/DateTimeNumericFieldElement.cpp:
2422         (WebCore::DateTimeNumericFieldElement::DateTimeNumericFieldElement):
2423         (WebCore::DateTimeNumericFieldElement::setEmptyValue):
2424         (WebCore::DateTimeNumericFieldElement::setValueAsInteger):
2425         (WebCore::DateTimeNumericFieldElement::placeholderValue const):
2426         (WebCore::DateTimeNumericFieldElement::valueAsInteger const):
2427         * html/shadow/DateTimeNumericFieldElement.h:
2428         * html/shadow/DateTimeSymbolicFieldElement.cpp:
2429         (WebCore::DateTimeSymbolicFieldElement::DateTimeSymbolicFieldElement):
2430         (WebCore::DateTimeSymbolicFieldElement::setEmptyValue):
2431         (WebCore::DateTimeSymbolicFieldElement::setValueAsInteger):
2432         (WebCore::DateTimeSymbolicFieldElement::placeholderValue const):
2433         (WebCore::DateTimeSymbolicFieldElement::valueAsInteger const):
2434         * html/shadow/DateTimeSymbolicFieldElement.h:
2435
2436 2020-11-30  Zalan Bujtas  <zalan@apple.com>
2437
2438         [LFC][IFC] Remove redundant const ContainerBox& formattingContextRoot from LineBuilder c'tor
2439         https://bugs.webkit.org/show_bug.cgi?id=219339
2440
2441         Reviewed by Antti Koivisto.
2442
2443         * layout/inlineformatting/InlineFormattingContext.cpp:
2444         (WebCore::Layout::InlineFormattingContext::lineLayout):
2445         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
2446         * layout/inlineformatting/InlineLineBuilder.cpp:
2447         (WebCore::Layout::LineBuilder::LineBuilder):
2448         (WebCore::Layout::LineBuilder::root const):
2449         * layout/inlineformatting/InlineLineBuilder.h:
2450         (WebCore::Layout::LineBuilder::root const): Deleted.
2451
2452 2020-11-30  Zalan Bujtas  <zalan@apple.com>
2453
2454         [LFC][IFC] Preferred width computation is not constrained by existing floats
2455         https://bugs.webkit.org/show_bug.cgi?id=219338
2456
2457         Reviewed by Antti Koivisto.
2458
2459         Let's create a fake(empty) floating state/context for the line as existing floats should not constrain the min/max content widths.
2460
2461         * layout/inlineformatting/InlineFormattingContext.cpp:
2462         (WebCore::Layout::InlineFormattingContext::computedIntrinsicWidthForConstraint const):
2463
2464 2020-11-30  Zalan Bujtas  <zalan@apple.com>
2465
2466         [LFC][TFC] Add missing TableGrid::Row::m_baseline initialization
2467         https://bugs.webkit.org/show_bug.cgi?id=219336
2468
2469         Reviewed by Antti Koivisto.
2470
2471         * layout/tableformatting/TableGrid.h:
2472
2473 2020-11-30  Andres Gonzalez  <andresg_22@apple.com>
2474
2475         AXIsolatedTree::m_axObjectCache should not be accessed on the secondary AX thread.
2476         https://bugs.webkit.org/show_bug.cgi?id=219223
2477
2478         Reviewed by Chris Fleizach.
2479
2480         AXIsolatedTree::m_axObjectCache was being set on the main thread and
2481         also accessed on the AX thread in the nodeForID and applyPendingChanges
2482         methods. This problem is fixed with this change by adding the member
2483         variable m_usedOnAXThread that is initialized on the main thread and only
2484         used on the AX thread. This means also a performance optimization since
2485         nodeForID and applyPendingChanges are called very frequently.
2486         In addition, the change to AXIsolatedTree::create fixes a possible race
2487         condition between the time the newly created tree was added to the map
2488         of trees on the main thread, and the time that the tree is ready to be
2489         used on the AX thread. Now the newly created tree is not added to the
2490         trees map until it is fully functional.
2491
2492         * accessibility/AXObjectCache.cpp:
2493         (WebCore::AXObjectCache::getOrCreateIsolatedTree const):
2494         (WebCore::AXObjectCache::generateIsolatedTree): Deleted, the creation
2495         and initialization of the isolated tree is now done in
2496         AXIsolatedTree::create.
2497
2498         * accessibility/AXObjectCache.h:
2499         (WebCore::AXObjectCache::pageID const): Getter for the m_pageID member
2500         variable.
2501
2502         * accessibility/isolatedtree/AXIsolatedObject.cpp:
2503         (WebCore::AXIsolatedObject::AXIsolatedObject): Now takes a pointer t the
2504         tree instead of a tree ID.
2505         (WebCore::AXIsolatedObject::create): Same as above.
2506         (WebCore::AXIsolatedObject::associatedAXObject const):
2507         (WebCore::AXIsolatedObject::setSelectedChildren): Check for nullity of
2508         the AXObjectCache.
2509         * accessibility/isolatedtree/AXIsolatedObject.h:
2510         * accessibility/isolatedtree/AXIsolatedTree.cpp:
2511         (WebCore::AXIsolatedTree::AXIsolatedTree): Takes an AXObjectCache.
2512         (WebCore::AXIsolatedTree::clear):
2513         (WebCore::AXIsolatedTree::create): Takes an AXObjectCache.
2514         (WebCore::AXIsolatedTree::nodeForID const):
2515         (WebCore::AXIsolatedTree::createSubtree):
2516         (WebCore::AXIsolatedTree::updateNode):
2517         (WebCore::AXIsolatedTree::applyPendingChanges):
2518         (WebCore::AXIsolatedTree::createTreeForPageID): Deleted, became
2519         AXIsolatedTree::create.
2520         * accessibility/isolatedtree/AXIsolatedTree.h:
2521         (WebCore::AXIsolatedTree::axObjectCache const):
2522         (WebCore::AXIsolatedTree::setAXObjectCache): Deleted, can be set only at
2523         construction time.
2524
2525 2020-11-30  Xabier Rodriguez Calvar  <calvaris@igalia.com>
2526
2527         [GStreamer] Media player does not properly inhibit, uninhibit sleep
2528         https://bugs.webkit.org/show_bug.cgi?id=186971
2529
2530         Reviewed by Philippe Normand.
2531
2532         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
2533         (WebCore::MediaPlayerPrivateGStreamerMSE::updateStates): Call the
2534         player to update the playback state as it is done in the regular
2535         player.
2536
2537 2020-11-29  Zalan Bujtas  <zalan@apple.com>
2538
2539         [LFC][BFC] Do not assume float avoiders have pre-computed vertical positions
2540         https://bugs.webkit.org/show_bug.cgi?id=219326
2541
2542         Reviewed by Antti Koivisto.
2543
2544         Move the final vertical position computation from computeHeightAndMargin() (it does not really belong in there) to
2545         layoutInFlowContent(). This patch also ensures that we only adjust the vertical position when needed.
2546
2547         Test: fast/layoutformattingcontext/block-only/child-containing-block-margin-collapse-when-float-avoiders.html
2548
2549         * layout/blockformatting/BlockFormattingContext.cpp:
2550         (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin):
2551
2552 2020-11-29  Zalan Bujtas  <zalan@apple.com>
2553
2554         [LFC][IFC] Create runs for inline boxes
2555         https://bugs.webkit.org/show_bug.cgi?id=219329
2556
2557         Reviewed by Antti Koivisto.
2558
2559         With this patch we start constructing runs for inline boxes (these are spec "inline boxes" and not legacy line layout "inline boxes").
2560
2561         * layout/inlineformatting/InlineFormattingContext.cpp:
2562         (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
2563         * layout/inlineformatting/InlineLineBox.cpp:
2564         (WebCore::Layout::LineBox::logicalMarginRectForInlineLevelBox const):
2565         * layout/inlineformatting/InlineLineBox.h:
2566         * layout/integration/LayoutIntegrationInlineContentBuilder.cpp:
2567         (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayLines const):
2568         (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayInlineBoxes const):
2569         * layout/layouttree/LayoutTreeBuilder.cpp:
2570         (WebCore::Layout::showInlineTreeAndRuns):
2571
2572 2020-11-29  Zalan Bujtas  <zalan@apple.com>
2573
2574         [LFC][IFC] Remove LineBuilder::availableWidth
2575         https://bugs.webkit.org/show_bug.cgi?id=219330
2576
2577         Reviewed by Antti Koivisto.
2578
2579         There is no "global" available width while building the line. It may very well change as
2580         inline level boxes stretch the line and additional floats turn to intrusive.
2581
2582         * layout/inlineformatting/InlineLineBuilder.cpp:
2583         (WebCore::Layout::LineBuilder::close):
2584         (WebCore::Layout::LineBuilder::handleFloatOrInlineContent):
2585         (WebCore::Layout::LineBuilder::rebuildLineForTrailingSoftHyphen):
2586         * layout/inlineformatting/InlineLineBuilder.h:
2587         (WebCore::Layout::LineBuilder::availableWidth const): Deleted.
2588
2589 2020-11-29  Zalan Bujtas  <zalan@apple.com>
2590
2591         [LFC][IFC] FloatingContext should take const FloatingState&
2592         https://bugs.webkit.org/show_bug.cgi?id=219331
2593
2594         Reviewed by Antti Koivisto.
2595
2596         Let's not use FloatContext as a proxy for adding float items to the FloatingState.
2597         It enables us to use FloatingContext when we don't have mutable FloatingState e.g. while
2598         computing preferred width.
2599
2600         * layout/blockformatting/BlockFormattingContext.cpp:
2601         (WebCore::Layout::BlockFormattingContext::layoutInFlowContent):
2602         * layout/floats/FloatingContext.cpp:
2603         (WebCore::Layout::FloatingContext::FloatingContext):
2604         (WebCore::Layout::FloatingContext::toFloatItem const):
2605         (WebCore::Layout::FloatingContext::append): Deleted.
2606         * layout/floats/FloatingContext.h:
2607         (WebCore::Layout::FloatingContext::floatingState const):
2608         (WebCore::Layout::FloatingContext::layoutState const):
2609         * layout/inlineformatting/InlineFormattingContext.cpp:
2610         (WebCore::Layout::InlineFormattingContext::computeGeometryForLineContent):
2611
2612 2020-11-28  Don Olmstead  <don.olmstead@sony.com>
2613
2614         Non-unified build fixes, late November 2020 edition, take three
2615         https://bugs.webkit.org/show_bug.cgi?id=219333
2616
2617         Unreviewed non-unified build fixes.
2618
2619         * display/css/DisplayBoxFactory.cpp:
2620         * display/css/DisplayCSSPainter.cpp:
2621         * display/css/DisplayContainerBox.cpp:
2622
2623 2020-11-28  Simon Fraser  <simon.fraser@apple.com>
2624
2625         [LFC Display] Use a vector to maintain state during display tree building
2626         https://bugs.webkit.org/show_bug.cgi?id=219314
2627
2628         Reviewed by Zalan Bujtas.
2629
2630         Over time more state will be required during tree building. Rather than using the stack
2631         and passing lots of arguments to tree building functions, use a Vector<> to push state
2632         when processing a ContainerBox's children, and pop afterwards.
2633
2634         The vector is declared as a std::unique_ptr<> to hide the state types from the header.
2635
2636         * display/DisplayTreeBuilder.cpp:
2637         (WebCore::Display::TreeBuilder::TreeBuilder):
2638         (WebCore::Display::TreeBuilder::build):
2639         (WebCore::Display::TreeBuilder::pushStateForBoxDescendants):
2640         (WebCore::Display::TreeBuilder::popState):
2641         (WebCore::Display::TreeBuilder::currentState const):
2642         (WebCore::Display::TreeBuilder::positioningContext const):
2643         (WebCore::Display::TreeBuilder::buildInlineDisplayTree):
2644         (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree):
2645         (WebCore::Display::TreeBuilder::buildInlineDisplayTree const): Deleted.
2646         (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree const): Deleted.
2647         * display/DisplayTreeBuilder.h:
2648
2649 2020-11-28  Simon Fraser  <simon.fraser@apple.com>
2650
2651         [LFC Display] Add basic transforms support.
2652         https://bugs.webkit.org/show_bug.cgi?id=219313
2653
2654         Reviewed by Zalan Bujtas.
2655
2656         Add Display::BoxRareGeometry which will hold uncommon per-box geometry like
2657         border-radius and transformation matrix.
2658
2659         At tree building time, compute a TransformationMatrix for the transforms on a box,
2660         using a pixel-snapped transform origin. Also store a bit on Display::Style to indicate
2661         that a transform applies (when set, we assume that BoxRareGeometry is non-null).
2662
2663         At paint time, use the computed matrix to adjust the CTM when painting a stacking
2664         context, post-clipping and pre-effects. We adjust the box's matrix to move the
2665         applied origin to the origin of the border box, and to account for the fact that
2666         descendants will continue to paint in absolute coordinates.
2667
2668         * Sources.txt:
2669         * WebCore.xcodeproj/project.pbxproj:
2670         * display/css/DisplayBoxFactory.cpp:
2671         (WebCore::Display::BoxFactory::computeTransformOrigin const):
2672         (WebCore::Display::BoxFactory::computeTransformationMatrix const):
2673         (WebCore::Display::BoxFactory::constructBoxRareGeometry const):
2674         (WebCore::Display::BoxFactory::setupBoxModelBox const):
2675         * display/css/DisplayBoxFactory.h:
2676         * display/css/DisplayBoxModelBox.cpp:
2677         (WebCore::Display::BoxModelBox::setBoxRareGeometry):
2678         (WebCore::Display::BoxModelBox::hasAncestorClip const):
2679         * display/css/DisplayBoxModelBox.h:
2680         (WebCore::Display::BoxModelBox::rareGeometry const):
2681         * display/css/DisplayBoxRareGeometry.cpp: Added.
2682         * display/css/DisplayBoxRareGeometry.h: Copied from Source/WebCore/display/css/DisplayBoxModelBox.h.
2683         (WebCore::Display::BoxRareGeometry::transform const):
2684         (WebCore::Display::BoxRareGeometry::setTransform):
2685         * display/css/DisplayCSSPainter.cpp:
2686         (WebCore::Display::applyAncestorClip):
2687         (WebCore::Display::applyEffects):
2688         (WebCore::Display::CSSPainter::paintAtomicallyPaintedBox):
2689         * display/css/DisplayStyle.cpp:
2690         (WebCore::Display::Style::Style):
2691         * display/css/DisplayStyle.h:
2692         (WebCore::Display::Style::hasTransform const):
2693         (WebCore::Display::Style::setHasTransform):
2694
2695 2020-11-28  Simon Fraser  <simon.fraser@apple.com>
2696
2697         [LFC Display] Add basic opacity support.
2698         https://bugs.webkit.org/show_bug.cgi?id=219312
2699
2700         Reviewed by Zalan Bujtas.
2701
2702         Add a TransparencyLayerScope helper that can lazily begin, and end a transparency layer.
2703
2704         Add display tree support for opacity via applyEffects(), which begins a transparency
2705         layer at the start of stacking context painting when alpha is < 1.
2706
2707         * display/css/DisplayBoxDecorationPainter.cpp:
2708         (WebCore::Display::BorderPainter::paintTranslucentBorderSides const):
2709         * display/css/DisplayCSSPainter.cpp:
2710         (WebCore::Display::applyEffects):
2711         (WebCore::Display::CSSPainter::paintAtomicallyPaintedBox):
2712         * display/css/DisplayStyle.cpp:
2713         (WebCore::Display::Style::Style):
2714         * display/css/DisplayStyle.h:
2715         (WebCore::Display::Style::opacity const):
2716         * platform/graphics/GraphicsContext.h:
2717         (WebCore::TransparencyLayerScope::TransparencyLayerScope):
2718         (WebCore::TransparencyLayerScope::beginLayer):
2719         (WebCore::TransparencyLayerScope::~TransparencyLayerScope):
2720
2721 2020-11-28  Antti Koivisto  <antti@apple.com>
2722
2723         Move caret rect computation out of render tree
2724         https://bugs.webkit.org/show_bug.cgi?id=219304
2725
2726         Reviewed by Zalan Bujtas.
2727
2728         Reduce code randomly sprinkled on renderers by moving it into standalone functions.
2729
2730         * Sources.txt:
2731         * WebCore.xcodeproj/project.pbxproj:
2732         * accessibility/AXObjectCache.cpp:
2733         (WebCore::AXObjectCache::localCaretRectForCharacterOffset):
2734         * editing/RenderedPosition.cpp:
2735         (WebCore::RenderedPosition::absoluteRect const):
2736         * editing/RenderedPosition.h:
2737         * editing/VisiblePosition.cpp:
2738         (WebCore::VisiblePosition::localCaretRect const):
2739         * rendering/CaretRectComputation.cpp: Added.
2740         (WebCore::computeCaretRectForEmptyElement):
2741         (WebCore::computeCaretRectForLinePosition):
2742         (WebCore::computeCaretRectForText):
2743         (WebCore::computeCaretRectForLineBreak):
2744         (WebCore::computeCaretRectForSVGInlineText):
2745         (WebCore::computeCaretRectForBox):
2746         (WebCore::computeCaretRectForBlock):
2747         (WebCore::computeCaretRectForInline):
2748         (WebCore::computeLocalCaretRect):
2749         * rendering/CaretRectComputation.h: Added.
2750         * rendering/RenderBlock.cpp:
2751         (WebCore::RenderBlock::localCaretRect const): Deleted.
2752         * rendering/RenderBlock.h:
2753         * rendering/RenderBlockFlow.cpp:
2754         (WebCore::RenderBlockFlow::computeCaretRect const): Deleted.
2755         * rendering/RenderBlockFlow.h:
2756         * rendering/RenderBox.cpp:
2757         (WebCore::RenderBox::localCaretRect const): Deleted.
2758         * rendering/RenderBox.h:
2759         * rendering/RenderBoxModelObject.cpp:
2760         (WebCore::RenderBoxModelObject::localCaretRectForEmptyElement const): Deleted.
2761         * rendering/RenderBoxModelObject.h:
2762         * rendering/RenderInline.cpp:
2763         (WebCore::RenderInline::localCaretRect const): Deleted.
2764         * rendering/RenderInline.h:
2765         * rendering/RenderLineBreak.cpp:
2766         (WebCore::RenderLineBreak::localCaretRect const): Deleted.
2767         * rendering/RenderLineBreak.h:
2768         * rendering/RenderObject.cpp:
2769         (WebCore::RenderObject::localCaretRect const): Deleted.
2770         * rendering/RenderObject.h:
2771         * rendering/RenderObjectEnums.h:
2772         * rendering/RenderText.cpp:
2773         (WebCore::RenderText::localCaretRect const): Deleted.
2774         * rendering/RenderText.h:
2775         * rendering/svg/RenderSVGInlineText.cpp:
2776         (WebCore::RenderSVGInlineText::localCaretRect const): Deleted.
2777         * rendering/svg/RenderSVGInlineText.h:
2778
2779 2020-11-28  Don Olmstead  <don.olmstead@sony.com>
2780
2781         Remove enums for GCGLenum constants in GraphicsContextGL and ExtensionsGL
2782         https://bugs.webkit.org/show_bug.cgi?id=219319
2783
2784         Reviewed by Darin Adler.
2785
2786         Both GraphicsContextGL and ExtensionsGL were using C style enums to scope GCGLenum
2787         values. Rather than using the enum static constexpr values of GCGLenum are used
2788         instead.
2789
2790         This removes the need in WebGLDrawBuffers to static_cast the enums to GCGLenum
2791         which works around a narrowing error.
2792
2793         No new tests. No change in behavior.
2794
2795         * html/canvas/WebGLDrawBuffers.cpp:
2796         (WebCore::WebGLDrawBuffers::drawBuffersWEBGL):
2797         * platform/graphics/ExtensionsGL.h:
2798         * platform/graphics/GraphicsContextGL.h:
2799
2800 2020-11-28  Philippe Normand  <pnormand@igalia.com>
2801
2802         Unreviewed, GTK LTS build fix after r270195
2803
2804         * rendering/RenderInline.cpp:
2805         (WebCore::RenderInline::linesBoundingBox const):
2806
2807 2020-11-27  Simon Fraser  <simon.fraser@apple.com>
2808
2809         [LFC Display] Implement basic overflow:hidden clipping
2810         https://bugs.webkit.org/show_bug.cgi?id=219311
2811
2812         Reviewed by Zalan Bujtas.
2813
2814         Add BoxClip which represents the clip generated by walking the containing block ancestor chain
2815         of a box. Display::BoxModelBox optionally has a BoxClip if it's a box that paints out of order
2816         (i.e. participates in z-order sorting, so positioned or stacking context). That BoxClip
2817         represents the clip contributed by ancestors, and it's applied before painting this box.
2818         If a Box has overflow clip, then that is also additionally applied before painting the
2819         in-flow descendants of the box.
2820         
2821         To compute BoxClip, ask the display box for the relevant containing block for its clip,
2822         which takes the clip from ancestors and appends the clip for that box (if any).
2823         
2824         Also move accessors for borderRoundedRect() and innerBorderRoundedRect() onto Display::BoxModelBox
2825         since they are needed for clipping as well as painting.
2826
2827         * Sources.txt:
2828         * WebCore.xcodeproj/project.pbxproj:
2829         * display/css/DisplayBoxClip.cpp: Copied from Source/WebCore/display/css/DisplayBoxModelBox.cpp.
2830         (WebCore::Display::BoxClip::BoxClip):
2831         (WebCore::Display::BoxClip::copy const):
2832         (WebCore::Display::BoxClip::pushClip):
2833         (WebCore::Display::BoxClip::pushRoundedClip):
2834         * display/css/DisplayBoxClip.h: Copied from Source/WebCore/display/css/DisplayBoxModelBox.cpp.
2835         (WebCore::Display::BoxClip::create):
2836         (WebCore::Display::BoxClip::clipRect const):
2837         (WebCore::Display::BoxClip::affectedByBorderRadius const):
2838         (WebCore::Display::BoxClip::clipStack const):
2839         * display/css/DisplayBoxDecorationData.cpp:
2840         (WebCore::Display::roundedRectWithIncludedRadii):
2841         (WebCore::Display::roundedInsetBorderForRect):
2842         * display/css/DisplayBoxDecorationData.h:
2843         * display/css/DisplayBoxDecorationPainter.cpp:
2844         (WebCore::Display::BoxDecorationPainter::innerBorderRoundedRect const):
2845         (WebCore::Display::roundedRectWithIncludedRadii): Deleted.
2846         (WebCore::Display::roundedInsetBorderForRect): Deleted.
2847         * display/css/DisplayBoxFactory.cpp:
2848         (WebCore::Display::BoxFactory::setupBoxModelBox const):
2849         * display/css/DisplayBoxModelBox.cpp:
2850         (WebCore::Display::BoxModelBox::borderRoundedRect const):
2851         (WebCore::Display::BoxModelBox::innerBorderRoundedRect const):
2852         (WebCore::Display::BoxModelBox::setAncestorClip):
2853         (WebCore::Display::BoxModelBox::clipForDescendants const):
2854         (WebCore::Display::BoxModelBox::debugDescription const):
2855         * display/css/DisplayBoxModelBox.h:
2856         (WebCore::Display::BoxModelBox::ancestorClip const):
2857         * display/css/DisplayCSSPainter.cpp:
2858         (WebCore::Display::applyClipIfNecessary):
2859         (WebCore::Display::applyAncestorClip):
2860         (WebCore::Display::CSSPainter::recursivePaintDescendantsForPhase):
2861         (WebCore::Display::CSSPainter::paintAtomicallyPaintedBox):
2862         * display/css/DisplayContainerBox.cpp:
2863         (WebCore::Display::ContainerBox::debugDescription const):
2864         * display/css/DisplayStyle.cpp:
2865         (WebCore::Display::Style::Style):
2866         * display/css/DisplayStyle.h:
2867         (WebCore::Display::Style::hasClippedOverflow const):
2868
2869 2020-11-27  Simon Fraser  <simon.fraser@apple.com>
2870
2871         [LFC Display] Fix box locations for positioned elements
2872         https://bugs.webkit.org/show_bug.cgi?id=219310
2873
2874         Reviewed by Zalan Bujtas.
2875
2876         The code assumed that layout boxes were always positioned relative to their parents,
2877         but border box geometry is actually relative to containing block. To keep track
2878         of this when building the display tree, add PositioningContext which tracks
2879         containing blocks for three types of positioning (fixed, absolute and in-flow),
2880         and root-relative offsets for each.
2881
2882         The code then passes the appropriate containing block box + offset into the Display::BoxFactory
2883         code, which uses the offset to compute absolute box rects.
2884
2885         * display/DisplayTreeBuilder.cpp:
2886         (WebCore::Display::PositioningContext::PositioningContext):
2887         (WebCore::Display::PositioningContext::m_absolutePositionContainer):
2888         (WebCore::Display::PositioningContext::m_inFlowContainer):
2889         (WebCore::Display::PositioningContext::contextForDescendants const):
2890         (WebCore::Display::PositioningContext::containingBlockContextForLayoutBox const):
2891         (WebCore::Display::PositioningContext::inFlowContainingBlockContext const):
2892         (WebCore::Display::TreeBuilder::build):
2893         (WebCore::Display::TreeBuilder::buildInlineDisplayTree const):
2894         (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree const):
2895         * display/DisplayTreeBuilder.h:
2896         * display/css/DisplayBoxFactory.cpp:
2897         (WebCore::Display::BoxFactory::displayBoxForRootBox const):
2898         (WebCore::Display::BoxFactory::displayBoxForBodyBox const):
2899         (WebCore::Display::BoxFactory::displayBoxForLayoutBox const):
2900         (WebCore::Display::BoxFactory::displayBoxForTextRun const):
2901         (WebCore::Display::BoxFactory::setupBoxGeometry const):
2902         (WebCore::Display::BoxFactory::constructBoxDecorationData const):
2903         (WebCore::Display::BoxFactory::setupBoxModelBox const):
2904         * display/css/DisplayBoxFactory.h:
2905         * layout/layouttree/LayoutBox.cpp:
2906         (WebCore::Layout::Box::containingBlock const):
2907         * layout/layouttree/LayoutBox.h:
2908         (WebCore::Layout::Box::isContainingBlockForInFlow const):
2909         (WebCore::Layout::Box::isContainingBlockForFixedPosition const):
2910         (WebCore::Layout::Box::isContainingBlockForOutOfFlowPosition const):
2911
2912 2020-11-27  Aditya Keerthi  <akeerthi@apple.com>
2913
2914         [iOS][FCR] Add new look for meter element
2915         https://bugs.webkit.org/show_bug.cgi?id=219103
2916         <rdar://problem/71549155>
2917
2918         Reviewed by Wenson Hsieh.
2919
2920         Tests: fast/forms/ios/form-control-refresh/meter/border.html
2921                fast/forms/ios/form-control-refresh/meter/even-less-good-appearance.html
2922                fast/forms/ios/form-control-refresh/meter/optimal-appearance.html
2923                fast/forms/ios/form-control-refresh/meter/suboptimal-appearance.html
2924                fast/forms/ios/form-control-refresh/meter/width-height.html
2925
2926         * html/HTMLMeterElement.cpp:
2927         (WebCore::HTMLMeterElement::createElementRenderer):
2928         * rendering/RenderTheme.cpp:
2929         (WebCore::RenderTheme::supportsMeter const):
2930         * rendering/RenderTheme.h:
2931
2932         Added additional parameter to supportsMeter to control support at runtime.
2933
2934         * rendering/RenderThemeIOS.h:
2935         * rendering/RenderThemeIOS.mm:
2936         (WebCore::RenderThemeIOS::supportsMeter const):
2937
2938         Implement this method so that a native meter is painted on iOS. Note that
2939         a native appearance for meter is currently supported on macOS, but is
2940         unsupported on iOS.
2941
2942         (WebCore::RenderThemeIOS::paintMeter):
2943
2944         Paint a meter element using the new appearance. The color of the filled
2945         portion matches the element's gauge region, and can be one of three
2946         colors. If the style has an RTL direction, flip the filled portion to
2947         start from the right side of the element. This matches the RTL behavior
2948         for progress bars.
2949
2950         * rendering/RenderThemeMac.h:
2951         * rendering/RenderThemeMac.mm:
2952         (WebCore::RenderThemeMac::supportsMeter const):
2953         * rendering/RenderThemeWin.cpp:
2954         (WebCore::RenderThemeWin::supportsMeter const):
2955         * rendering/RenderThemeWin.h:
2956
2957 2020-11-27  Don Olmstead  <don.olmstead@sony.com>
2958
2959         Non-unified build fixes, late November 2020 edition, take two
2960         https://bugs.webkit.org/show_bug.cgi?id=219317
2961
2962         Unreviewed non-unified build fixes.
2963
2964         * display/css/DisplayBox.cpp:
2965         * layout/integration/LayoutIntegrationLineLayout.cpp:
2966         * rendering/RenderBlockFlow.cpp:
2967
2968 2020-11-27  Fujii Hironori  <Hironori.Fujii@sony.com>
2969
2970         [WinCairo][Clang] html/canvas/WebGLDrawBuffers.cpp(77,29): error: non-constant-expression cannot be narrowed from type 'WebCore::GraphicsContextGL::(anonymous enum at GraphicsContextGL.h:64:5)' to 'GCGLenum' (aka 'unsigned int') in initializer list
2971         https://bugs.webkit.org/show_bug.cgi?id=219320
2972
2973         Unreviewed build fix for WinCairo clang-cl build.
2974
2975         * html/canvas/WebGLDrawBuffers.cpp:
2976         (WebCore::WebGLDrawBuffers::drawBuffersWEBGL): Added static_cast<GCGLenum> for the initializer list.
2977
2978 2020-11-27  Wenson Hsieh  <wenson_hsieh@apple.com>
2979
2980         Introduce new display list meta commands in preparation for webkit.org/b/219091
2981         https://bugs.webkit.org/show_bug.cgi?id=219262
2982
2983         Reviewed by Ryosuke Niwa.
2984
2985         Introduces two new display list items: `MetaCommandChangeDestinationImageBuffer` and `MetaCommandEnd`. These
2986         meta commands will be used in a future patch to synchronize display list drawing commands between multiple
2987         destination image buffers when using the GPU process by allowing `RemoteRenderingBackend` to process display
2988         data that contains commands targeting more than one destination image buffer.
2989
2990         `MetaCommandChangeDestinationImageBuffer` is used to inform the replayer that the destination image buffer (in
2991         which commands are replayed) should be changed to the new image buffer indicated by the rendering resource
2992         identifier in the item. When replaying, we'll bail with `StopReplayReason::ChangeDestinationImageBuffer` and set
2993         `nextDestinationImageBuffer` to the identifier of this next buffer.
2994
2995         `MetaCommandEnd` is used to inform the replayer that it should expect no more display list items; in a future
2996         patch, `RemoteRenderingBackend` will take this as a cue to immediately stop waiting for more display list data
2997         and go to sleep.
2998
2999         A stream of display list data will eventually consist of data targeting one or more destination image buffers,
3000         separated by `MetaCommandChangeDestinationImageBuffer` items, and may span one or more item buffers, separated
3001         by `MetaCommandChangeItemBuffer` items; finally, it will conclude with a `MetaCommandEnd` item.
3002         The below diagram depicts one such stream of display list data, where we have two destination image buffers
3003         (denoted by A and B), and display list item data spanning two item buffers (denoted by 1 and 2).
3004
3005         Wakeup message initiates display list processing with Image Buffer A and Item Buffer 1
3006             |
3007             |                                           MetaCommandChangeItemBuffer(2)
3008             |                                                        |
3009             |     MetaCommandChangeDestinationImageBuffer(B)         |
3010             |                       |                                |
3011             |                       |                                |
3012             v                       v                                v
3013             +-----------------------+--------------------------------++
3014             | +--------------------+ +------------------------------+ |
3015             | | Destination        | | Destination                  | | Item Buffer 1
3016             | | Image Buffer A     | | Image Buffer B               | |
3017             | +--------------------+ +------------------------------+ |
3018             +---------------------------------------------------------+
3019
3020             +---------------------------------------------------------+
3021             | +--------------+ +-----------------------+              |
3022             | | Dst. Image   | | Destination Image     |  Unused      | Item Buffer 2
3023             | | Buffer B     | | Buffer A              |  Capacity    |
3024             | +--------------+ +-----------------------+              |
3025             +-----------------+-------------------------+-------------+
3026                               ^                         ^
3027                               |                         |
3028                               |                         |
3029                               |                     MetaCommandEnd
3030                               |
3031             MetaCommandChangeDestinationImageBuffer(A)
3032
3033         Additionally, rename `MetaCommandSwitchToItemBuffer` to `MetaCommandChangeItemBuffer`, such that it is
3034         consistent with the new `MetaCommandChangeDestinationImageBuffer` item.
3035
3036         * platform/graphics/displaylists/DisplayList.cpp:
3037         (WebCore::DisplayList::DisplayList::append):
3038         * platform/graphics/displaylists/DisplayListItemBuffer.cpp:
3039         (WebCore::DisplayList::ItemHandle::apply):
3040         (WebCore::DisplayList::ItemHandle::destroy):
3041         (WebCore::DisplayList::ItemHandle::copyTo const):
3042         (WebCore::DisplayList::ItemBuffer::swapWritableBufferIfNeeded):
3043         * platform/graphics/displaylists/DisplayListItemType.cpp:
3044         (WebCore::DisplayList::sizeOfItemInBytes):
3045         (WebCore::DisplayList::isDrawingItem):
3046         (WebCore::DisplayList::isInlineItem):
3047         * platform/graphics/displaylists/DisplayListItemType.h:
3048         * platform/graphics/displaylists/DisplayListItems.cpp:
3049         (WebCore::DisplayList::operator<<):
3050         * platform/graphics/displaylists/DisplayListItems.h:
3051         (WebCore::DisplayList::MetaCommandChangeItemBuffer::MetaCommandChangeItemBuffer):
3052         (WebCore::DisplayList::MetaCommandChangeDestinationImageBuffer::MetaCommandChangeDestinationImageBuffer):
3053         (WebCore::DisplayList::MetaCommandChangeDestinationImageBuffer::identifier const):
3054         (WebCore::DisplayList::MetaCommandSwitchToItemBuffer::MetaCommandSwitchToItemBuffer): Deleted.
3055         (WebCore::DisplayList::MetaCommandSwitchToItemBuffer::identifier const): Deleted.
3056         * platform/graphics/displaylists/DisplayListReplayer.cpp:
3057         (WebCore::DisplayList::Replayer::replay):
3058         * platform/graphics/displaylists/DisplayListReplayer.h:
3059
3060 2020-11-27  Simon Fraser  <simon.fraser@apple.com>
3061
3062         [LFC Display] Clean up CSS stacking context painting code
3063         https://bugs.webkit.org/show_bug.cgi?id=219307
3064
3065         Reviewed by Antti Koivisto.
3066
3067         Clarify the code in Display::CSSPainter that paints stacking contexts and positioned
3068         elements. Non-stacking positioned elements paint atomically, but don't paint descendant
3069         stacking contexts (sometimes these are called "pseudo-stacking contexts" but that term
3070         is avoided here to reduce confusion). Share code between painting these and stacking
3071         contexts via paintAtomicallyPaintedBox().
3072
3073         Also make sure we paint the contents of non-container child boxes, so that things like
3074         positioned images paint.
3075
3076         Remove some incorrect image painting code in BoxPainter::paintBox().
3077
3078         * display/DisplayTreeBuilder.cpp:
3079         (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree const):
3080         * display/css/DisplayBoxPainter.cpp:
3081         (WebCore::Display::BoxPainter::paintBox):
3082         * display/css/DisplayCSSPainter.cpp:
3083         (WebCore::Display::CSSPainter::recursivePaintDescendantsForPhase):
3084         (WebCore::Display::CSSPainter::recursivePaintDescendants):
3085         (WebCore::Display::CSSPainter::paintAtomicallyPaintedBox):
3086         (WebCore::Display::CSSPainter::paintStackingContext):
3087         (WebCore::Display::CSSPainter::participatesInZOrderSorting):
3088         (WebCore::Display::CSSPainter::collectStackingContextDescendants):
3089         (WebCore::Display::CSSPainter::recursiveCollectLayers):
3090         * display/css/DisplayCSSPainter.h:
3091
3092 2020-11-27  Simon Fraser  <simon.fraser@apple.com>
3093
3094         [LFC Display] A ContainerBox can establish an inline formatting context and have box children
3095         https://bugs.webkit.org/show_bug.cgi?id=218736
3096
3097         Reviewed by Zalan Bujtas.
3098
3099         If a layout box establishes an inline formatting context, then the only descendant container
3100         boxes that we should make display boxes for while traversing non-inline descendants
3101         are those which are out of flow.
3102
3103         * display/DisplayTreeBuilder.cpp:
3104         (WebCore::Display::TreeBuilder::recursiveBuildDisplayTree const):
3105
3106 2020-11-27  Adrian Perez de Castro  <aperez@igalia.com>
3107
3108         Non-unified build fixes, late November 2020 edition
3109         https://bugs.webkit.org/show_bug.cgi?id=219306
3110
3111         Unreviewed non-unified build fixes.
3112
3113         * dom/SimpleRange.cpp: Add missing Frame.h header.
3114         * html/canvas/CanvasRenderingContext2D.cpp: Removed fontStyleIsWithinRange() from here, as
3115         it is not used in this source file.
3116         * html/canvas/CanvasRenderingContext2DBase.cpp:
3117         (WebCore::isSpaceThatNeedsReplacing): Moved here from CanvasRenderingContext2D.cpp
3118         * inspector/InspectorNodeFinder.cpp: Add missing Frame.h header.
3119         * page/FrameTree.h: Added missing wtf/Forward.h header
3120         * style/StyleResolveForFontRaw.cpp: Add missing CSSToLengthConversionData.h,
3121         FontCascade.h, and Settings.h headers.
3122         * style/StyleResolveForFontRaw.h: Add forward declaration for FontCascadeDescription.
3123
3124 2020-11-27  Simon Fraser  <simon.fraser@apple.com>
3125
3126         [LFC Display] Add support for painting box shadows
3127         https://bugs.webkit.org/show_bug.cgi?id=219265
3128
3129         Reviewed by Zalan Bujtas.
3130
3131         Clone the ShadowData linked list into Display::Style, fixing up the color,
3132         and add code to BoxDecorationPainter to paint outset and inset shadows.
3133
3134         The pixel snapping isn't quite right yet; we really need to pixel-snap the
3135         rect that results from the border/padding box with shadow offset and spread applied,
3136         but that would require storing more shadow-related data at tree building time.
3137
3138         The boxShadowShouldBeAppliedToBackground() code path isn't supported yet.
3139
3140         * display/css/DisplayBoxDecorationPainter.cpp:
3141         (WebCore::Display::BoxDecorationPainter::BoxDecorationPainter):
3142         (WebCore::Display::BoxDecorationPainter::paintBoxShadow const):
3143         (WebCore::Display::BoxDecorationPainter::innerBorderRoundedRect const):
3144         (WebCore::Display::BoxDecorationPainter::backgroundRoundedRectAdjustedForBleedAvoidance const):
3145         (WebCore::Display::BoxDecorationPainter::paintBackgroundAndBorders const):
3146         * display/css/DisplayBoxDecorationPainter.h:
3147         * display/css/DisplayStyle.cpp:
3148         (WebCore::Display::deepCopy):
3149         (WebCore::Display::Style::Style):
3150         * display/css/DisplayStyle.h:
3151         (WebCore::Display::Style::boxShadow const):
3152         * platform/graphics/LayoutSize.h:
3153         (WebCore::roundSizeToDevicePixels):
3154         * rendering/style/ShadowData.h:
3155         (WebCore::ShadowData::setColor):
3156         (WebCore::ShadowData::setNext):
3157
3158 2020-11-27  Antti Koivisto  <antti@apple.com>
3159
3160         [LFC][Integration] Initial display:inline support
3161         https://bugs.webkit.org/show_bug.cgi?id=219301
3162
3163         Reviewed by Zalan Bujtas.
3164
3165         <span> etc.
3166
3167         Not enabled yet.
3168
3169         * layout/integration/LayoutIntegrationBoxTree.cpp:
3170         (WebCore::LayoutIntegration::BoxTree::buildTree):
3171         (WebCore::LayoutIntegration::BoxTree::updateStyle):
3172         (WebCore::LayoutIntegration::BoxTree::layoutBoxForRenderer):
3173         (WebCore::LayoutIntegration::BoxTree::rendererForLayoutBox):
3174         * layout/integration/LayoutIntegrationCoverage.cpp:
3175         (WebCore::LayoutIntegration::canUseForChild):
3176         (WebCore::LayoutIntegration::canUseForLineLayoutWithReason):
3177         * layout/integration/LayoutIntegrationInlineContent.h:
3178         (WebCore::LayoutIntegration::InlineContent::InlineBox::InlineBox):
3179         (WebCore::LayoutIntegration::InlineContent::InlineBox::layoutBox const):
3180         (WebCore::LayoutIntegration::InlineContent::InlineBox::lineIndex const):
3181         (WebCore::LayoutIntegration::InlineContent::InlineBox::rect const):
3182         (WebCore::LayoutIntegration::InlineContent::shrinkToFit):
3183         * layout/integration/LayoutIntegrationInlineContentBuilder.cpp:
3184         (WebCore::LayoutIntegration::InlineContentBuilder::build const):
3185         (WebCore::LayoutIntegration::InlineContentBuilder::createDisplayInlineBoxes const):
3186         * layout/integration/LayoutIntegrationInlineContentBuilder.h:
3187         * layout/integration/LayoutIntegrationLineLayout.cpp:
3188         (WebCore::LayoutIntegration::LineLayout::containing):
3189         (WebCore::LayoutIntegration::LineLayout::enclosingBorderBoxRectFor const):
3190         (WebCore::LayoutIntegration::LineLayout::paint):
3191         * layout/integration/LayoutIntegrationLineLayout.h:
3192         * rendering/RenderBlockFlow.cpp:
3193         (WebCore::RenderBlockFlow::layoutModernLines):
3194         * rendering/RenderInline.cpp:
3195         (WebCore::RenderInline::styleDidChange):
3196         (WebCore::RenderInline::linesBoundingBox const):
3197
3198 2020-11-27  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
3199
3200         REGRESSION(r269642) [GStreamer][WebRTC] Unexpected results after update to M87
3201         https://bugs.webkit.org/show_bug.cgi?id=218787
3202
3203         Reviewed by Philippe Normand.
3204
3205         Describe more specifically the H264 SDP. It uses a hardcoded list with the minimun
3206         requirement: ConstrainedBaseline and Baseline profiles which are supported by the video
3207         decoders used in GStreamer.
3208
3209         No new tests required.
3210
3211         * platform/GStreamer.cmake:
3212         * platform/mediastream/libwebrtc/GStreamerVideoCommon.cpp: Added.
3213         (WebCore::createH264Format):
3214         (WebCore::gstreamerSupportedH264Codecs):
3215         * platform/mediastream/libwebrtc/GStreamerVideoCommon.h: Added.
3216         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: Removed unused headers.
3217         (WebCore::GStreamerVideoDecoder::AddDecoderIfSupported): Pass argument by reference.
3218         (WebCore::GStreamerVideoDecoder::ConfigureSupportedDecoder): Instead of a single SDP returns
3219         a vector of them.
3220         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: Removed unused headers.
3221         (WebCore::GStreamerVideoEncoder::AddCodecIfSupported): Pass argument by reference.
3222         (WebCore::GStreamerVideoEncoder::ConfigureSupportedCodec): Instead of a single SDP returns
3223         a vector of them and remove the unused argument.
3224         (WebCore::GStreamerVideoEncoderFactory::GetSupportedFormats const):
3225         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h: Fixed a typo.
3226
3227 2020-11-27  Philippe Normand  <pnormand@igalia.com>
3228
3229         Unreviewed, clang build fix after r270185
3230
3231         * platform/graphics/GraphicsTypesGL.h: Fixup nullptr_t namespace.
3232         (GCGLSpan::GCGLSpan):
3233         (std::numeric_limits<size_t>::max):
3234
3235 2020-11-27  Víctor Manuel Jáquez Leal  <vjaquez@igalia.com>
3236
3237         [GStreamer] refactor video encoder with WebKit style
3238         https://bugs.webkit.org/show_bug.cgi?id=218748
3239
3240         Reviewed by Philippe Normand.
3241
3242         Apply WebKit code style to GStreamerVideoEncoder
3243
3244         No new tests required since it's a refactor.
3245
3246         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
3247         (Encoders::singleton): Instead of an array with the available encoders, a singleton map is
3248         used, with better memory handling.
3249         (Encoders::registerEncoder): static method to register a possible encoder to handle
3250         (Encoders::definition): getter
3251         (webrtcVideoEncoderGetProperty): renamed
3252         (webrtcVideoEncoderSetBitrate): renamed
3253         (webrtcVideoEncoderSetFormat): Use getter for static pads; GRefPtr for memory handling;
3254         don't call gst_ghost_pad_set_target() inside a g_assert since it can be disabled.
3255         (webrtcVideoEncoderSetProperty): renamed
3256         (setupX264enc): renamed
3257         (setupOpenh264enc): renamed
3258         (setupOmxh264enc): renamed
3259         (setBitrateKbitPerSec): renamed
3260         (setBitrateBitPerSec): renamed
3261         (webrtc_video_encoder_class_init): renamed
3262         (webrtc_video_encoder_init): renamed
3263         * platform/mediastream/libwebrtc/GStreamerVideoEncoder.h: use G_DECLARE_FINAL_TYPE macro and
3264         change the name of the glib type to WEBRTC_TYPE_VIDEO_ENCODER
3265         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: remove unused macro
3266         (WebCore::GStreamerVideoEncoderFactory::GStreamerVideoEncoderFactory): Don't register the
3267         element as primary, but none.
3268
3269 2020-11-27  Kimmo Kinnunen  <kkinnunen@apple.com>
3270
3271         GraphicsContextGL should have robust multivalue setters
3272         https://bugs.webkit.org/show_bug.cgi?id=219256
3273
3274         Reviewed by Dean Jackson.
3275
3276         Replace bufSize, pointer pairs and plain pointers in GraphicsContextGL
3277         with GCGLSpan. This makes it easier to understand how many values there
3278         are pointed by the pointer. This is needed for simpler implementation of GPU
3279         process IPC, where the IPC layer does not need to interpret the OpenGL
3280         properties.
3281
3282         In WebGL implementation, changes the validation functions to return
3283         the memory reference that will be touched by the valid function call.
3284         On validation failure, nullopt will be returned.
3285
3286         Makes the existing GraphicsContextGL texture image manipulation functions
3287         to support robust invocation. Removes the robust APIs from ExtensionsGL.
3288         Adds the missing texture image manipulation functions from ExtensionGL
3289         to GraphicsContextGL. Implementations for the moved methods
3290         exist only for ANGLE implementation of GraphicsContextGLOpenGL.
3291
3292         Changes the ANGLE variant of GraphicsContextGL::texImage2D to be
3293         implemented as ExtensionsGLANGLE::texImage2DRobustANGLE. Before, for
3294         ANGLE the GraphicsContextGL::texImage2D was unused.
3295
3296         No new tests, a refactor.
3297
3298         * html/canvas/WebGL2RenderingContext.cpp:
3299         (WebCore::WebGL2RenderingContext::invalidateFramebuffer):
3300         (WebCore::WebGL2RenderingContext::invalidateSubFramebuffer):
3301         (WebCore::WebGL2RenderingContext::uniform1uiv):
3302         (WebCore::WebGL2RenderingContext::uniform2uiv):
3303         (WebCore::WebGL2RenderingContext::uniform3uiv):
3304         (WebCore::WebGL2RenderingContext::uniform4uiv):
3305         (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv):
3306         (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv):
3307         (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv):
3308         (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv):
3309         (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv):
3310         (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv):
3311         (WebCore::WebGL2RenderingContext::vertexAttribI4iv):
3312         (WebCore::WebGL2RenderingContext::vertexAttribI4uiv):
3313         (WebCore::WebGL2RenderingContext::drawBuffers):
3314         (WebCore::WebGL2RenderingContext::clearBufferiv):
3315         (WebCore::WebGL2RenderingContext::clearBufferuiv):
3316         (WebCore::WebGL2RenderingContext::clearBufferfv):
3317         (WebCore::WebGL2RenderingContext::validateClearBuffer):
3318         (WebCore::WebGL2RenderingContext::uniform1fv):
3319         (WebCore::WebGL2RenderingContext::uniform2fv):
3320         (WebCore::WebGL2RenderingContext::uniform3fv):
3321         (WebCore::WebGL2RenderingContext::uniform4fv):
3322         (WebCore::WebGL2RenderingContext::uniform1iv):
3323         (WebCore::WebGL2RenderingContext::uniform2iv):
3324         (WebCore::WebGL2RenderingContext::uniform3iv):
3325         (WebCore::WebGL2RenderingContext::uniform4iv):
3326         (WebCore::WebGL2RenderingContext::uniformMatrix2fv):
3327         (WebCore::WebGL2RenderingContext::uniformMatrix3fv):
3328         (WebCore::WebGL2RenderingContext::uniformMatrix4fv):
3329         * html/canvas/WebGL2RenderingContext.h:
3330         * html/canvas/WebGLDrawBuffers.cpp:
3331         (WebCore::WebGLDrawBuffers::drawBuffersWEBGL):
3332         * html/canvas/WebGLFramebuffer.cpp:
3333         (WebCore::WebGLFramebuffer::drawBuffersIfNecessary):
3334         * html/canvas/WebGLRenderingContextBase.cpp:
3335         (WebCore::WebGLRenderingContextBase::bufferData):
3336         (WebCore::WebGLRenderingContextBase::bufferSubData):
3337         (WebCore::WebGLRenderingContextBase::uniform1fv):
3338         (WebCore::WebGLRenderingContextBase::uniform2fv):
3339         (WebCore::WebGLRenderingContextBase::uniform3fv):
3340         (WebCore::WebGLRenderingContextBase::uniform4fv):
3341         (WebCore::WebGLRenderingContextBase::uniform1iv):
3342         (WebCore::WebGLRenderingContextBase::uniform2iv):
3343         (WebCore::WebGLRenderingContextBase::uniform3iv):
3344         (WebCore::WebGLRenderingContextBase::uniform4iv):
3345         (WebCore::WebGLRenderingContextBase::uniformMatrix2fv):
3346         (WebCore::WebGLRenderingContextBase::uniformMatrix3fv):
3347         (WebCore::WebGLRenderingContextBase::uniformMatrix4fv):
3348         (WebCore::WebGLRenderingContextBase::validateUniformMatrixParameters):
3349         (WebCore::WebGLRenderingContextBase::vertexAttribfvImpl):
3350         * html/canvas/WebGLRenderingContextBase.h:
3351         (WebCore::WebGLRenderingContextBase::validateUniformParameters):
3352         * platform/graphics/ExtensionsGL.h:
3353         * platform/graphics/GraphicsContextGL.h:
3354         * platform/graphics/GraphicsTypesGL.h:
3355         (GCGLSpan::GCGLSpan):
3356         (std::numeric_limits<size_t>::max):
3357         (makeGCGLSpan):
3358         * platform/graphics/angle/ExtensionsGLANGLE.cpp:
3359         (WebCore::ExtensionsGLANGLE::drawBuffersEXT):
3360         * platform/graphics/angle/ExtensionsGLANGLE.h:
3361         * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
3362         (WebCore::GraphicsContextGLOpenGL::bufferData):
3363         (WebCore::GraphicsContextGLOpenGL::bufferSubData):
3364         (WebCore::GraphicsContextGLOpenGL::uniform1fv):
3365         (WebCore::GraphicsContextGLOpenGL::uniform2fv):
3366         (WebCore::GraphicsContextGLOpenGL::uniform3fv):
3367         (WebCore::GraphicsContextGLOpenGL::uniform4fv):
3368         (WebCore::GraphicsContextGLOpenGL::uniform1iv):
3369         (WebCore::GraphicsContextGLOpenGL::uniform2iv):
3370         (WebCore::GraphicsContextGLOpenGL::uniform3iv):
3371         (WebCore::GraphicsContextGLOpenGL::uniform4iv):
3372         (WebCore::GraphicsContextGLOpenGL::uniformMatrix2fv):
3373         (WebCore::GraphicsContextGLOpenGL::uniformMatrix3fv):
3374         (WebCore::GraphicsContextGLOpenGL::uniformMatrix4fv):
3375         (WebCore::GraphicsContextGLOpenGL::vertexAttrib1fv):