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